/* XELL Web Studio — tema profesional terang.
   Aksen: gradasi ungu -> biru hanya untuk tombol utama/CTA.
   Font: sistem / Inter — netral, profesional. BUKAN gaya display Met Motion. */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-muted: #eef0f6;
  --text: #1a2233;
  --muted: #5b6478;
  --border: #e3e6ef;
  --grad: linear-gradient(135deg, #7c3aed 0%, #4f46e5 55%, #2563eb 100%);
  --grad-hover: linear-gradient(135deg, #6d28d9 0%, #4338ca 55%, #1d4ed8 100%);
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 64, .08), 0 4px 16px rgba(16, 24, 64, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { height: 36px; width: auto; display: block; }
.brand-name {
  font-size: 22px; font-weight: 800; letter-spacing: .14em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; margin-top: -4px; }
.nav { display: flex; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); font-weight: 600; font-size: 14px;
  padding: 8px 12px; border-radius: 9px;
}
.nav a:hover { color: var(--text); background: var(--surface-muted); text-decoration: none; }
.nav a.active { color: #4f46e5; background: #eef2ff; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.saldo-chip {
  background: var(--surface-muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 700;
}
.saldo-chip small { color: var(--muted); font-weight: 600; }

/* ---------- Layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }
.container-narrow { max-width: 560px; }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 24px 0 10px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 18px;
}
.card h2 { margin-top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: 11px; border: none; cursor: pointer;
  transition: filter .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(99, 60, 220, .35); }
.btn-primary:hover { background: var(--grad-hover); filter: brightness(1.05); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--surface-muted); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #e6e9f2; }
.btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 9px; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
input[type=text], input[type=number], input[type=file], select, textarea {
  width: 100%; font: inherit; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 11px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #a5b4fc; border-color: #6366f1; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.field { margin-bottom: 16px; }
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.otp-inputs input {
  width: 52px; height: 60px; text-align: center; font-size: 26px; font-weight: 800;
  padding: 0; border-radius: 12px;
}

/* ---------- Alerts ---------- */
.alert { border-radius: 11px; padding: 13px 16px; margin-bottom: 18px; font-size: 15px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ---------- Model / price lists ---------- */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.model-card {
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px;
  cursor: pointer; background: #fff;
}
.model-card:hover { border-color: #a5b4fc; }
.model-card.selected { border-color: #6366f1; box-shadow: 0 0 0 3px #e0e7ff; }
.model-card.disabled { opacity: .55; cursor: not-allowed; }
.model-card .name { font-weight: 700; font-size: 15px; }
.model-card .price { font-size: 20px; font-weight: 800; margin-top: 4px; }
.model-card .stock { font-size: 13px; color: var(--muted); }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px;
  border-radius: 999px; background: #eef2ff; color: #4f46e5;
}
.badge-off { background: #fef2f2; color: var(--danger); }

/* ---------- History ---------- */
.job-row {
  display: flex; gap: 14px; align-items: center; padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.job-row:last-child { border-bottom: none; }
.job-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--surface-muted); flex-shrink: 0; }
.job-meta { flex: 1; min-width: 0; }
.job-meta .title { font-weight: 700; }
.job-meta .sub { font-size: 13px; color: var(--muted); }
.progress { height: 8px; background: var(--surface-muted); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: var(--grad); }

/* ---------- Login hero ---------- */
.login-hero {
  background: #0f1226; border-radius: 18px; padding: 28px 24px 22px;
  text-align: center; margin-bottom: 18px;
}
.login-hero img { max-width: 100%; height: auto; }
.login-hero p { color: #c7cdea; margin: 14px 0 0; font-size: 15px; }

/* ---------- Footer ---------- */
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav { display: none; }
  .nav-mobile { display: flex; }
  h1 { font-size: 22px; }
  .card { padding: 18px; }
  .otp-inputs input { width: 44px; height: 52px; font-size: 22px; }
}
.nav-mobile {
  display: none; gap: 4px; overflow-x: auto; padding: 8px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 57px; z-index: 19;
}
.nav-mobile a {
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
  padding: 7px 12px; border-radius: 9px;
}
.nav-mobile a.active { color: #4f46e5; background: #eef2ff; }

/* ---------- Sidebar (CONTRACT §6) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column; padding: 18px 14px;
  overflow-y: auto;
}
.main { margin-left: 240px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 20px; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 15px;
  border-left: 3px solid transparent;
}
.side-item:hover { background: var(--surface-muted); color: var(--text); text-decoration: none; }
.side-item.active { background: #eef2ff; color: #4f46e5; border-left-color: #6366f1; }
.sidebar-user { margin-top: auto; border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-saldo { font-size: 14px; color: var(--muted); }
.sidebar-name { font-size: 14px; font-weight: 700; }
.sidebar-backdrop { display: none; }

/* Topbar hanya untuk mobile (hamburger + judul). */
.topbar { display: none; }
.hamburger {
  font: inherit; font-size: 22px; line-height: 1;
  background: none; border: none; cursor: pointer; color: var(--text);
  padding: 8px 10px; border-radius: 9px;
}
.hamburger:hover { background: var(--surface-muted); }
.topbar-title { font-weight: 700; font-size: 16px; flex: 1; }
.topbar-brand img { height: 28px; width: auto; display: block; }

/* Dashboard: kartu saldo + jalan pintas. */
.saldo-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.saldo-big { font-size: 34px; font-weight: 800; margin: 2px 0; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.shortcut-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text);
}
.shortcut-card:hover { border-color: #a5b4fc; text-decoration: none; }
.shortcut-icon { font-size: 26px; }
.shortcut-name { font-weight: 700; font-size: 16px; }
.shortcut-desc { font-size: 13px; color: var(--muted); }

/* Docs: blok kode + tabel harga. */
.code {
  background: #0f1226; color: #dbe4ff; border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.5;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th, .price-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.price-table th { color: var(--muted); font-size: 13px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-muted); padding: 1px 6px; border-radius: 6px; }
pre code { background: none; padding: 0; }

@media (max-width: 899px) {
  .sidebar {
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(16, 24, 64, .25); }
  .sidebar-backdrop.show {
    display: block; position: fixed; inset: 0; z-index: 25;
    background: rgba(16, 24, 64, .35);
  }
  .main { margin-left: 0; }
  .topbar {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 8px 12px; position: sticky; top: 0; z-index: 20;
  }
}
