/* ============================================================
   ORDERKU — Admin Dashboard Stylesheet
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #0f2a27; --ink-2: #476059; --ink-3: #7a938c;
  --teal: #0e6b5c; --teal-2: #0d9488; --teal-soft: #e6f5f1; --teal-line: #c9e5de;
  --bg: #f2f7f5; --card: #ffffff; --line: #e3ede9;
  --red: #dc2626; --red-soft: #fef2f2; --amber: #d97706; --sky: #0284c7; --violet: #7c3aed;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,42,39,.05), 0 8px 24px -16px rgba(15,42,39,.18);
}
html, body { height: 100%; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- layout ---------- */
.ok-layout { display: flex; min-height: 100vh; }
.ok-side {
  width: 232px; background: #0b3f36; color: #cfe7e0; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.ok-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; color: #fff; }
.ok-brand .ok-brand-logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #0d9488, #059669); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.ok-brand b { font-size: 15px; letter-spacing: -.01em; }
.ok-brand small { display: block; font-size: 10px; color: #8fc3b8; font-weight: 500; margin-top: -2px; }
.ok-nav { padding: 6px 10px 12px; flex: 1; }
.ok-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0;
  color: #b9d8d1; border-radius: 9px; font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.ok-nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.ok-nav a.active { background: rgba(13,148,136,.35); color: #fff; }
.ok-nav a svg { width: 17px; height: 17px; opacity: .85; flex-shrink: 0; }
.ok-nav .ok-nav-sep { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #6fa39a; padding: 14px 12px 4px; font-weight: 700; }
.ok-side-foot { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #8fc3b8; }
.ok-side-foot a { color: #cfe7e0; font-weight: 600; }
.ok-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ok-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.ok-top h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.ok-top .ok-crumb { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.ok-content { padding: 24px 28px 48px; max-width: 1200px; width: 100%; margin: 0 auto; }

@media (max-width: 860px) {
  .ok-layout { flex-direction: column; }
  .ok-side { width: 100%; height: auto; position: relative; }
  .ok-nav { display: flex; flex-wrap: wrap; }
  .ok-nav .ok-nav-sep { display: none; }
  .ok-content { padding: 16px 14px 40px; }
  .ok-top { padding: 12px 14px; }
}

/* ---------- komponen umum ---------- */
.ok-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ok-card-pad { padding: 18px 20px; }
.ok-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.ok-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none; transition: all .15s; background: var(--teal); color: #fff;
}
.ok-btn:hover { filter: brightness(1.08); text-decoration: none; }
.ok-btn svg { width: 16px; height: 16px; }
.ok-btn.sec { background: var(--card); color: var(--ink); border-color: var(--line); }
.ok-btn.sec:hover { background: var(--teal-soft); border-color: var(--teal-line); }
.ok-btn.danger { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.ok-btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.ok-btn:disabled { opacity: .55; cursor: not-allowed; }

.ok-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.st-new { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.st-confirmed { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.st-shipped { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.st-completed { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.st-cancelled { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.ok-input, .ok-select, .ok-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cfded8; border-radius: 10px; font-size: 13.5px;
  font-family: inherit; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.ok-input:focus, .ok-select:focus, .ok-textarea:focus { outline: none; border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(13,148,136,.14); }
.ok-textarea { min-height: 84px; resize: vertical; }
label.ok-lbl { display: block; font-size: 12px; font-weight: 700; margin: 12px 0 5px; color: var(--ink-2); }
label.ok-lbl:first-child { margin-top: 0; }
.ok-help { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.ok-grid { display: grid; gap: 14px; }
.ok-grid.c2 { grid-template-columns: 1fr 1fr; }
.ok-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.ok-grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .ok-grid.c2, .ok-grid.c3, .ok-grid.c4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .ok-grid.c2, .ok-grid.c3, .ok-grid.c4 { grid-template-columns: 1fr; } }

/* ---------- tabel ---------- */
.ok-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
table.ok-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.ok-table th { text-align: left; padding: 11px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); border-bottom: 1px solid var(--line); background: #f8fbfa; white-space: nowrap; }
.ok-table td { padding: 12px 14px; border-bottom: 1px solid #eef4f2; vertical-align: top; }
.ok-table tr:last-child td { border-bottom: 0; }
.ok-table tbody tr:hover { background: #f8fbfa; }
.ok-table .num { text-align: right; white-space: nowrap; }
.ok-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--ink-2); }
.ok-pager .ok-pg-btns { display: flex; gap: 6px; }

/* ---------- stat cards ---------- */
.ok-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .ok-stats { grid-template-columns: 1fr 1fr; } }
.ok-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.ok-stat .ok-stat-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.ok-stat .ok-stat-ico svg { width: 19px; height: 19px; }
.ok-stat .ok-stat-val { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.ok-stat .ok-stat-lbl { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.ico-teal { background: var(--teal-soft); color: var(--teal); }
.ico-amber { background: #fffbeb; color: var(--amber); }
.ico-sky { background: #f0f9ff; color: var(--sky); }
.ico-violet { background: #f5f3ff; color: var(--violet); }

/* ---------- tabs ---------- */
.ok-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.ok-tab { padding: 9px 15px; font-size: 13px; font-weight: 600; color: var(--ink-2); border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; border-radius: 8px 8px 0 0; }
.ok-tab:hover { background: var(--teal-soft); color: var(--teal); }
.ok-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.ok-tabpanel { display: none; }
.ok-tabpanel.active { display: block; }

/* ---------- modal ---------- */
.ok-modal { position: fixed; inset: 0; background: rgba(6,29,25,.5); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 32px 14px; overflow-y: auto; }
.ok-modal.open { display: flex; }
.ok-modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 640px; box-shadow: 0 24px 60px -12px rgba(0,0,0,.35); }
.ok-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ok-modal-head h3 { font-size: 15px; font-weight: 700; }
.ok-modal-close { background: none; border: 0; font-size: 20px; color: var(--ink-3); cursor: pointer; padding: 4px 8px; border-radius: 8px; line-height: 1; }
.ok-modal-close:hover { background: var(--bg); color: var(--ink); }
.ok-modal-body { padding: 20px; }
.ok-modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: #f8fbfa; border-radius: 0 0 16px 16px; }

/* ---------- toast ---------- */
#ok-toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.ok-toast { background: #0b3f36; color: #fff; border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px -8px rgba(0,0,0,.4); display: flex; align-items: center; gap: 8px; max-width: 340px; animation: oktoast .25s ease; }
.ok-toast.err { background: #7f1d1d; }
@keyframes oktoast { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- kartu produk/form ---------- */
.ok-entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.ok-entity { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.ok-entity .ok-entity-logo { height: 40px; display: flex; align-items: center; }
.ok-entity .ok-entity-logo img { max-height: 40px; max-width: 130px; object-fit: contain; }
.ok-entity h4 { font-size: 14px; font-weight: 700; line-height: 1.35; }
.ok-entity .ok-entity-meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.ok-entity .ok-entity-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

/* ---------- chart ---------- */
.ok-chart { width: 100%; height: auto; }
.ok-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.ok-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* ---------- builder ---------- */
.ok-builder-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .ok-builder-grid { grid-template-columns: 1fr; } }
.ok-preview-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 14px; background: #fff; position: sticky; top: 76px; }
.ok-sticky { position: sticky; top: 76px; }
.ok-save-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* preset tema */
.ok-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ok-preset { border: 2px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; background: #fff; text-align: left; font-family: inherit; }
.ok-preset:hover { border-color: var(--teal-2); }
.ok-preset.active { border-color: var(--teal); background: var(--teal-soft); }
.ok-preset .ok-swatch { display: flex; gap: 3px; margin-bottom: 6px; }
.ok-preset .ok-swatch i { width: 16px; height: 16px; border-radius: 5px; display: block; border: 1px solid rgba(0,0,0,.08); }
.ok-preset b { font-size: 11px; font-weight: 700; color: var(--ink); display: block; line-height: 1.3; }

/* editor warna */
.ok-colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 520px) { .ok-colors { grid-template-columns: 1fr; } }
.ok-color-row { display: flex; align-items: center; gap: 10px; background: #f8fbfa; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ok-color-row input[type=color] { width: 34px; height: 34px; border: 1px solid #cfded8; border-radius: 8px; background: #fff; padding: 2px; cursor: pointer; flex-shrink: 0; }
.ok-color-row .ok-color-txt { flex: 1; min-width: 0; }
.ok-color-row .ok-color-txt b { display: block; font-size: 12px; }
.ok-color-row .ok-color-txt span { font-size: 11px; color: var(--ink-3); }
.ok-color-row input[type=text] { width: 76px; font-size: 11.5px; font-family: ui-monospace, Menlo, monospace; padding: 5px 7px; border: 1px solid #cfded8; border-radius: 7px; }

/* toggles */
.ok-tgl { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ok-tgl:last-child { border-bottom: 0; }
.ok-tgl .ok-tgl-txt b { display: block; font-size: 13px; }
.ok-tgl .ok-tgl-txt span { font-size: 11.5px; color: var(--ink-3); }
.ok-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.ok-switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 2; margin: 0; }
.ok-switch i { position: absolute; inset: 0; background: #cbd5d1; border-radius: 999px; transition: .18s; }
.ok-switch i::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 999px; background: #fff; top: 3px; left: 3px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.ok-switch input:checked + i { background: var(--teal-2); }
.ok-switch input:checked + i::after { left: 21px; }

/* steps editor */
.ok-step { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 12px; overflow: hidden; }
.ok-step-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f8fbfa; cursor: pointer; user-select: none; }
.ok-step-head b { font-size: 13px; flex: 1; min-width: 0; }
.ok-step-head .ok-step-n { width: 24px; height: 24px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.ok-step-body { padding: 14px; border-top: 1px solid var(--line); display: none; }
.ok-step.open .ok-step-body { display: block; }
.ok-field { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fcfefd; }
.ok-field-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ok-field-head b { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok-field-head .ok-ftype { font-size: 10.5px; background: var(--teal-soft); color: var(--teal); padding: 2px 8px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.ok-ico-btn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; color: var(--ink-2); flex-shrink: 0; padding: 0; }
.ok-ico-btn:hover { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal); }
.ok-ico-btn.danger:hover { background: var(--red-soft); border-color: #fecaca; color: var(--red); }
.ok-ico-btn svg { width: 14px; height: 14px; }
.ok-opts { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ok-opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ok-opt-row input[type=text] { flex: 1; }
.ok-opt-row input[type=number] { width: 76px; }
.ok-bonus-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ok-bonus-row input[type=number] { width: 90px; }

/* tier editor */
.ok-tier { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.ok-tier .ok-tier-pct { width: 84px; flex-shrink: 0; }
.ok-tier .ok-tier-body { flex: 1; min-width: 0; }

/* snippet embed */
.ok-snippet { position: relative; background: #0b3f36; color: #d3ece6; border-radius: 12px; padding: 14px 44px 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.65; overflow-x: auto; white-space: pre; }
.ok-snippet button { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 7px; padding: 4px 9px; font-size: 11px; cursor: pointer; font-family: inherit; font-weight: 600; }
.ok-snippet button:hover { background: rgba(255,255,255,.22); }

/* misc */
.ok-kv { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eef4f2; font-size: 13px; }
.ok-kv:last-child { border-bottom: 0; }
.ok-kv .k { width: 130px; flex-shrink: 0; color: var(--ink-3); font-weight: 600; font-size: 12px; padding-top: 1px; }
.ok-kv .v { flex: 1; min-width: 0; word-break: break-word; }
.ok-empty { text-align: center; padding: 42px 16px; color: var(--ink-3); font-size: 13.5px; }
.ok-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.ok-filters .ok-input, .ok-filters .ok-select { width: auto; }
.ok-code-inline { background: #eef4f2; border-radius: 6px; padding: 1px 7px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.ok-note-box { background: var(--teal-soft); border: 1px solid var(--teal-line); color: #0b5a4d; border-radius: 12px; padding: 12px 16px; font-size: 12.5px; line-height: 1.6; }
.ok-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 999px; animation: okspin 1s linear infinite; display: inline-block; }
@keyframes okspin { to { transform: rotate(360deg); } }
