/* ==================================================================
   JK ADISTORE AI — Design System Premium (Kelas ChatGPT)
   Tema gelap elegan (default) + terang. Font Inter. Responsive.
   ================================================================== */

/* ---------- Font Inter (lokal via Google Fonts dengan fallback) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ============================ TOKENS ============================ */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-w: 264px;
  --header-h: 60px;

  --speed: .18s cubic-bezier(.4, 0, .2, 1);
}

/* ---- TEMA GELAP (default elegan) ---- */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e1a;
  --bg-soft: #0f1322;
  --bg-panel: #141930;
  --bg-elev: #1a2038;
  --bg-hover: #202745;
  --bg-input: #151b31;

  --border: #232a48;
  --border-soft: #1c2340;

  --text: #eef1fb;
  --text-soft: #a7b0cd;
  --text-dim: #6b7595;

  --brand: #4f6ef7;
  --brand-2: #7b5cf0;
  --brand-3: #22d3ee;
  --brand-grad: linear-gradient(135deg, #4f6ef7 0%, #7b5cf0 55%, #22d3ee 130%);
  --brand-soft: rgba(79, 110, 247, .13);
  --on-brand: #ffffff;

  --user-bubble: linear-gradient(135deg, #4f6ef7, #6d5dfb);
  --ai-bubble: #1a2038;
  --ai-bubble-border: #232a48;

  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow: 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.55);
  --glow: 0 0 0 1px rgba(79,110,247,.35), 0 4px 20px rgba(79,110,247,.22);
}

/* ---- TEMA TERANG ---- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --bg-panel: #ffffff;
  --bg-elev: #ffffff;
  --bg-hover: #eef1fa;
  --bg-input: #f2f4fa;

  --border: #e2e7f3;
  --border-soft: #edf0f8;

  --text: #10142b;
  --text-soft: #4c5578;
  --text-dim: #8a92b0;

  --brand: #4358ea;
  --brand-2: #7443e8;
  --brand-3: #0ea5e9;
  --brand-grad: linear-gradient(135deg, #4358ea 0%, #7443e8 55%, #0ea5e9 130%);
  --brand-soft: rgba(67, 88, 234, .09);
  --on-brand: #ffffff;

  --user-bubble: linear-gradient(135deg, #4358ea, #6d5dfb);
  --ai-bubble: #ffffff;
  --ai-bubble-border: #e2e7f3;

  --shadow-sm: 0 1px 2px rgba(16,20,43,.06);
  --shadow: 0 8px 24px rgba(16,20,43,.10);
  --shadow-lg: 0 16px 48px rgba(16,20,43,.14);
  --glow: 0 0 0 1px rgba(67,88,234,.25), 0 4px 20px rgba(67,88,234,.15);
}

/* ============================ BASE ============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background var(--speed), color var(--speed);
}
a { color: var(--brand); text-decoration: none; transition: color var(--speed); }
a:hover { text-decoration: underline; color: var(--brand-2); }
button { font-family: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
::selection { background: rgba(79,110,247,.35); }

/* scrollbar halus */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ============================ HEADER ============================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 50;
}
.header-in {
  width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 14px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16.5px; color: var(--text);
  letter-spacing: -.01em; text-decoration: none !important;
}
.brand:hover { text-decoration: none !important; }
.brand img { width: 34px; height: 34px; border-radius: 9px; display: block; box-shadow: var(--shadow-sm); }
.brand span b {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800;
}
.header-spacer { flex: 1; }

/* nav desktop */
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-btn {
  padding: 8px 14px; border-radius: 10px; color: var(--text-soft);
  font-weight: 500; font-size: 14px; text-decoration: none;
  transition: all var(--speed); position: relative;
}
.nav-btn:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-btn.aktif { color: var(--brand); font-weight: 600; }
.nav-btn.aktif::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--brand-grad);
}

/* tombol header umum */
.hbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all var(--speed);
  white-space: nowrap;
}
.hbtn-primary {
  background: var(--brand-grad); color: var(--on-brand);
  box-shadow: 0 4px 14px rgba(79,110,247,.35);
}
.hbtn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,110,247,.45); }
.hbtn-ghost {
  background: transparent; color: var(--text-soft); border-color: var(--border);
}
.hbtn-ghost:hover { background: var(--bg-hover); color: var(--text); }

/* pill status header */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(52, 211, 153, .10); border: 1px solid rgba(52, 211, 153, .25);
  color: #34d399; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 8px rgba(52,211,153,.9); position: relative;
}
.status-pill .dot::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid rgba(52,211,153,.5);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { transform: scale(.6); opacity: 1; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}

/* tombol ikon (tema, dsb.) */
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-soft); cursor: pointer; font-size: 17px;
  transition: all var(--speed);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-dim); }

/* ============================ LAYOUT APLIKASI ============================ */
.app-layout {
  position: fixed; inset: var(--header-h) 0 0 0;
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  max-width: 1600px; margin: 0 auto; width: 100%;
}

/* ============================ SIDEBAR ============================ */
.sidebar {
  border-right: 1px solid var(--border-soft);
  background: var(--bg-soft);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  transition: background var(--speed);
}
.sidebar-head { padding: 14px 14px 10px; }
.sidebar-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-dim); font-weight: 700; padding: 12px 16px 6px;
}
.btn-chat-baru {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--brand-grad); color: var(--on-brand);
  font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 14px rgba(79,110,247,.30);
  transition: all var(--speed);
}
.btn-chat-baru:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(79,110,247,.42); }
.btn-chat-baru:active { transform: translateY(0); }

/* pencarian riwayat */
.cari-wrap { padding: 0 14px 8px; }
.cari {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 8px 10px; transition: all var(--speed);
}
.cari:focus-within { border-color: var(--brand); box-shadow: var(--glow); }
.cari svg { flex: none; opacity: .55; }
.cari input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 13.5px; font-family: inherit;
}
.cari input::placeholder { color: var(--text-dim); }

/* daftar riwayat */
.conv-list { flex: 1; overflow-y: auto; padding: 4px 10px 10px; min-height: 0; }
.conv-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  color: var(--text-soft); transition: all var(--speed);
  position: relative; margin-bottom: 2px;
}
.conv-item:hover { background: var(--bg-hover); color: var(--text); }
.conv-item.aktif { background: var(--brand-soft); color: var(--text); }
.conv-item.aktif::before {
  content: ''; position: absolute; left: -10px; top: 20%; bottom: 20%;
  width: 3px; border-radius: 3px; background: var(--brand-grad);
}
.conv-item .ikon-chat {
  flex: none; width: 17px; height: 17px; opacity: .6;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.conv-item .judul {
  flex: 1; font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-item .waktu { font-size: 11px; color: var(--text-dim); flex: none; }
.conv-del {
  flex: none; border: none; background: none; cursor: pointer;
  color: var(--text-dim); font-size: 13px; padding: 4px 6px; border-radius: 7px;
  opacity: 0; transition: all var(--speed);
}
.conv-item:hover .conv-del, .conv-item.aktif .conv-del { opacity: 1; }
.conv-del:hover { color: var(--err); background: rgba(248,113,113,.12); }
.conv-kosong {
  padding: 22px 14px; text-align: center; color: var(--text-dim); font-size: 13px;
}

/* footer sidebar */
.sidebar-foot {
  border-top: 1px solid var(--border-soft); padding: 10px 14px;
}
.side-chips { display: flex; flex-direction: column; gap: 8px; padding: 4px 14px 10px; }
.side-chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 10px; font-size: 12.5px; color: var(--text-dim);
  background: none; border: none; cursor: default; text-align: left;
}
.side-chip .em { font-size: 14px; }
#btnLogout {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: none; border: 1px solid var(--border-soft); color: var(--text-soft);
  font-size: 13.5px; font-weight: 500; transition: all var(--speed); font-family: inherit;
}
#btnLogout:hover { background: rgba(248,113,113,.09); color: var(--err); border-color: rgba(248,113,113,.3); }

/* kartu user kecil di footer sidebar */
.user-mini {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-top: 1px solid var(--border-soft); cursor: pointer; transition: background var(--speed);
}
.user-mini:hover { background: var(--bg-hover); }
.user-mini .ava {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 14px;
}
.user-mini .nm { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-mini .em { font-size: 11.5px; color: var(--text-dim); line-height: 1.3; }
.user-mini .info { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================ AREA CHAT ============================ */
.chat-area {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  position: relative;
}
.chat-top {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  min-height: 52px;
}
.chat-top h1 {
  font-size: 15.5px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.chip-baris { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 12.5px; font-weight: 600;
  transition: all var(--speed); font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.chip.aktif { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* ==================== AREA PESAN (SCROLL) ==================== */
.chat-box {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 26px 0 10px;
  scroll-behavior: smooth;
}
.chat-inner { max-width: 820px; margin: 0 auto; padding: 0 22px; width: 100%; }

/* baris pesan */
.pesan { display: flex; gap: 12px; margin-bottom: 22px; animation: muncul .25s ease both; }
@keyframes muncul { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pesan.user { flex-direction: row-reverse; }
.pesan.sistem { max-width: 640px; margin: 0 auto 22px; }

/* avatar */
.avtar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-top: 2px;
  box-shadow: var(--shadow-sm);
}
.pesan.ai .avtar, .pesan.sistem .avtar {
  background: var(--brand-grad); border: 1px solid rgba(255,255,255,.14);
}
.pesan.user .avtar {
  background: var(--bg-elev); border: 1px solid var(--border);
}
.avtar img { width: 22px; height: 22px; border-radius: 50%; }

/* kolom bubble */
.kolom { display: flex; flex-direction: column; gap: 5px; max-width: 76%; min-width: 0; }
.pesan.user .kolom { align-items: flex-end; }

/* gelembung */
.gelembung {
  padding: 12px 16px; border-radius: var(--radius-lg);
  font-size: 14.5px; line-height: 1.68; word-wrap: break-word; overflow-wrap: break-word;
  position: relative;
}
.pesan.ai .gelembung {
  background: var(--ai-bubble); border: 1px solid var(--ai-bubble-border);
  border-top-left-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.pesan.user .gelembung {
  background: var(--user-bubble); color: #fff;
  border-top-right-radius: 6px;
  box-shadow: 0 6px 18px rgba(79,110,247,.30);
}
.pesan.sistem .gelembung {
  background: var(--bg-panel); border: 1px solid var(--border);
  text-align: center;
  border-radius: var(--radius-lg);
}

/* teks dalam bubble */
.gelembung p { margin: 0 0 10px; }
.gelembung p:last-child { margin-bottom: 0; }
.gelembung ul, .gelembung ol { margin: 6px 0 10px; padding-left: 22px; }
.gelembung li { margin: 3px 0; }
.gelembung code {
  font-family: var(--mono); font-size: 12.5px;
  background: rgba(123,92,240,.14); border: 1px solid rgba(123,92,240,.22);
  padding: 1.5px 6px; border-radius: 6px;
  word-break: break-word;
}
.pesan.user .gelembung code { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.25); color: #fff; }
.gelembung pre {
  background: #0d1022; color: #dbe4ff;
  border: 1px solid #1f2748; border-radius: var(--radius);
  padding: 13px 15px; margin: 8px 0;
  overflow-x: auto; max-width: 100%;
}
[data-theme="light"] .gelembung pre { background: #171b34; color: #dbe4ff; border-color: #2a3158; }
.gelembung pre code { background: none; border: none; padding: 0; font-size: 12.5px; line-height: 1.6; }
.gelembung b { font-weight: 700; }
.gelembung h3 { font-size: 15.5px; margin: 12px 0 6px; font-weight: 700; }
.gelembung a { font-weight: 500; }

/* label model/hub (meta bawah bubble) */
.meta {
  font-size: 11.5px; color: var(--text-dim); font-weight: 500;
  display: flex; align-items: center; gap: 5px;
}
.pesan.user .meta { flex-direction: row-reverse; }
.meta .mgel {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-panel); border: 1px solid var(--border-soft);
  padding: 2px 8px; border-radius: 999px;
}
.pesan.user .meta .mgel { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.85); }

/* nama berkas kode */
.nama-berkas {
  font-family: var(--mono); font-size: 11.5px; color: var(--brand-3);
  margin: 10px 0 4px; font-weight: 600; display: flex; align-items: center; gap: 6px;
}

/* aksi kode */
.aksi-kode {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed var(--border);
}
.btn-aksi {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 9px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  border: 1px solid var(--border); background: var(--bg-panel); color: var(--text-soft);
  transition: all var(--speed);
}
.btn-aksi:hover { color: var(--text); border-color: var(--text-dim); background: var(--bg-hover); }
.btn-aksi.utama { background: var(--brand-grad); color: #fff; border-color: transparent; }
.btn-aksi.utama:hover { filter: brightness(1.08); }

/* ==================== STATUS "SEDANG MENGETIK" ==================== */
.indikator {
  display: flex; gap: 12px; margin: -6px 0 22px;
  animation: muncul .2s ease both;
}
.indikator .avtar { width: 34px; height: 34px; font-size: 17px; background: var(--brand-grad); border: 1px solid rgba(255,255,255,.14); }
.indikator .isi {
  display: flex; flex-direction: column; gap: 6px; justify-content: center;
}
.indikator .tulisan { font-size: 13px; color: var(--text-soft); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.indikator .tulisan .titik { display: inline-flex; gap: 3px; }
.indikator .tulisan .titik span {
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
  animation: lompat 1.1s infinite;
}
.indikator .tulisan .titik span:nth-child(2) { animation-delay: .18s; }
.indikator .tulisan .titik span:nth-child(3) { animation-delay: .36s; }
@keyframes lompat { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ==================== LAYAR SAMBUTAN (hero) ==================== */
.hero-awal { padding-top: 9vh; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--brand-soft); border: 1px solid rgba(79,110,247,.3);
  color: var(--brand); font-size: 12.5px; font-weight: 650;
  margin-bottom: 18px;
}
.hero-awal h2 {
  font-size: clamp(26px, 4.5vw, 40px); font-weight: 800; letter-spacing: -.03em;
  line-height: 1.2; margin-bottom: 10px;
}
.hero-awal h2 .grad {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-awal .sub { color: var(--text-soft); font-size: 15.5px; max-width: 520px; margin: 0 auto 26px; }

/* kartu saran */
.saran-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-top: 8px; text-align: left;
}
.kartu-saran {
  display: flex; flex-direction: column; gap: 6px;
  padding: 15px 16px; border-radius: var(--radius-lg);
  background: var(--bg-panel); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--speed); text-align: left;
  font-family: inherit;
}
.kartu-saran:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); box-shadow: var(--shadow); }
.kartu-saran .em { font-size: 20px; }
.kartu-saran .jd { font-weight: 650; font-size: 13.5px; color: var(--text); }
.kartu-saran .ds { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* ==================== COMPOSER (INPUT BAWAH) ==================== */
.composer-wrap {
  padding: 10px 0 16px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  position: relative;
}
.composer {
  max-width: 820px; margin: 0 auto; padding: 0 22px; width: 100%;
}
.composer-box {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 22px; padding: 10px 10px 10px 18px;
  transition: border-color var(--speed), box-shadow var(--speed);
}
.composer-box:focus-within { border-color: var(--brand); box-shadow: var(--glow); }
#inp {
  flex: 1; resize: none; border: none; outline: none; background: none;
  color: var(--text); font-size: 14.5px; font-family: inherit; line-height: 1.55;
  max-height: 160px; padding: 6px 0;
}
#inp::placeholder { color: var(--text-dim); }
.btn-kirim {
  width: 40px; height: 40px; border-radius: 50%; flex: none; border: none;
  background: var(--brand-grad); color: #fff; font-size: 17px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(79,110,247,.35);
  transition: all var(--speed);
}
.btn-kirim:hover:not(:disabled) { transform: scale(1.06); }
.btn-kirim:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.composer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 30px 0; font-size: 11.5px; color: var(--text-dim); flex-wrap: wrap;
}
.foot-kiri, .foot-kanan { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.foot-kanan .baterai { font-weight: 600; color: var(--text-soft); }
.foot-kanan .baterai.warn { color: var(--warn); }
.foot-kanan .baterai.habis { color: var(--err); }
.pesan-error-bawah { padding: 8px 30px 0; font-size: 12.5px; color: var(--err); text-align: center; }

/* ==================== MODAL UMUM ==================== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 8, 20, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 20px; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-kotak {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
  animation: naik .22s cubic-bezier(.34,1.4,.64,1);
}
@keyframes naik { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-kotak.lebar { max-width: 1080px; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: var(--bg-panel); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 2;
}
.modal-head h3 { font-size: 16px; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.modal-badan { padding: 20px; }
.tutup-x {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--bg-hover); color: var(--text-soft); font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; transition: all var(--speed);
}
.tutup-x:hover { background: var(--bg-hover); color: var(--text); }

/* kartu AI di modal */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ai-kartu {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 15px 14px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1.5px solid var(--border);
  cursor: pointer; transition: all var(--speed); text-align: left; font-family: inherit;
  position: relative;
}
.ai-kartu:hover { transform: translateY(-2px); border-color: var(--text-dim); box-shadow: var(--shadow); }
.ai-kartu.pilih { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--glow); }
.ai-kartu .emoji { font-size: 22px; }
.ai-kartu .nama { font-weight: 700; font-size: 14px; color: var(--text); }
.ai-kartu .ket { font-size: 11.5px; color: var(--text-dim); line-height: 1.45; }
.ai-kartu .status {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
}
.ai-kartu .status.hidup { background: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,.8); }
.ai-kartu .status.sibuk { background: var(--warn); box-shadow: 0 0 8px rgba(251,191,36,.8); }
.ai-kartu .badge-cepat {
  position: absolute; bottom: 10px; right: 10px;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff;
}

/* preview website modal */
.prev-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prev-bar select {
  background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 10px; font-size: 12.5px; font-family: var(--mono);
  outline: none; max-width: 220px;
}
.prev-segmen { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.prev-segmen button {
  border: none; background: none; cursor: pointer; padding: 5px 12px;
  border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-dim); font-family: inherit;
  transition: all var(--speed);
}
.prev-segmen button.aktif { background: var(--brand-grad); color: #fff; }
.preview-frame-shell { margin-top: 14px; }
.preview-bingkai {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: #fff; height: 58vh; position: relative;
  transition: max-width var(--speed); max-width: 100%; margin: 0 auto;
}
.preview-bingkai.hp { max-width: 400px; border-radius: 26px; box-shadow: var(--shadow-lg); }
.preview-bingkai iframe { width: 100%; height: 100%; border: none; display: block; }

/* ==================== TOAST ==================== */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(60px);
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 550;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: all .28s cubic-bezier(.34,1.3,.64,1); z-index: 200;
  max-width: 88vw; text-align: center;
}
#toast.tampil { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.gagal { border-color: rgba(248,113,113,.5); color: var(--err); }

/* ==================== HALAMAN AUTH (login/daftar) ==================== */
.auth-halaman {
  position: fixed; inset: 0; display: grid; grid-template-columns: 1fr 1fr;
  overflow: hidden;
}
.auth-kiri {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  padding: 60px; gap: 18px; overflow: hidden;
}
.auth-kiri::before {
  content: ''; position: absolute; inset: -30%;
  background:
    radial-gradient(38% 40% at 20% 25%, rgba(79,110,247,.32), transparent 70%),
    radial-gradient(35% 40% at 78% 70%, rgba(123,92,240,.28), transparent 70%),
    radial-gradient(28% 30% at 60% 20%, rgba(34,211,238,.15), transparent 70%);
  pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; position: relative; }
.auth-brand img { width: 46px; height: 46px; border-radius: 12px; box-shadow: var(--shadow); }
.auth-brand .nm { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.auth-kiri h1 {
  font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.025em;
  line-height: 1.22; position: relative;
}
.auth-kiri h1 .grad, .hero-awal h2 .grad {
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-kiri .sub { color: var(--text-soft); font-size: 15px; max-width: 430px; position: relative; }
.auth-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; position: relative; }
.auth-feat { display: flex; gap: 11px; align-items: center; font-size: 13.5px; color: var(--text-soft); font-weight: 500; }
.auth-feat .ic {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--brand-soft); border: 1px solid rgba(79,110,247,.25);
}
.auth-kanan {
  display: flex; align-items: center; justify-content: center; padding: 40px 28px;
  background: var(--bg-soft); border-left: 1px solid var(--border-soft);
  overflow-y: auto;
}
.auth-kartu {
  width: 100%; max-width: 400px; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 30px; box-shadow: var(--shadow);
}
.auth-kartu h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.auth-kartu .ket { color: var(--text-dim); font-size: 13.5px; margin-bottom: 22px; }

/* form umum */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 650; color: var(--text-soft);
  margin-bottom: 6px; letter-spacing: .01em;
}
.field input {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  transition: all var(--speed);
}
.field input:focus { border-color: var(--brand); box-shadow: var(--glow); }
.field input::placeholder { color: var(--text-dim); }
.field-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; }

.btn-besar {
  width: 100%; padding: 12px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--brand-grad); color: #fff; font-size: 14.5px; font-weight: 700;
  font-family: inherit; box-shadow: 0 6px 18px rgba(79,110,247,.35);
  transition: all var(--speed); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-besar:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79,110,247,.45); }
.btn-besar:disabled { opacity: .6; cursor: not-allowed; }

.pesan-ok { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.35); color: var(--ok); padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.pesan-err { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.35); color: var(--err); padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }

.auth-alt { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-dim); }
.auth-alt a { font-weight: 600; }

/* ==================== HALAMAN PROFIL ==================== */
.profil-halaman {
  position: fixed; inset: var(--header-h) 0 0 0; overflow-y: auto;
  background: var(--bg);
}
.profil-inner { max-width: 900px; margin: 0 auto; padding: 40px 22px 60px; }
.profil-hero {
  display: flex; align-items: center; gap: 18px; padding: 24px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow);
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.profil-hero::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 84px;
  background: var(--brand-grad); opacity: .85;
}
.profil-hero .ava {
  width: 74px; height: 74px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-panel); border: 3px solid var(--bg-panel);
  font-size: 30px; font-weight: 800; color: var(--brand);
  box-shadow: var(--shadow); margin-top: 44px; position: relative;
}
.profil-hero .info { flex: 1; min-width: 0; margin-top: 44px; }
.profil-hero .nm { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: #fff; position: relative; }
.profil-hero .em { font-size: 13.5px; color: rgba(255,255,255,.85); position: relative; }
.badge-role {
  position: relative; display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); color: #fff;
  backdrop-filter: blur(4px);
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-kartu {
  padding: 18px; border-radius: var(--radius-lg); text-align: center;
  background: var(--bg-panel); border: 1px solid var(--border);
}
.stat-kartu .angka { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.stat-kartu .label { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-top: 2px; }
.kartu- seksi { margin-bottom: 22px; }
.seksi {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 22px; box-shadow: var(--shadow-sm);
}
.seksi h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }
.seksi .ket { font-size: 12.5px; color: var(--text-dim); margin-bottom: 16px; }
.dua-kolom { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-sekunder {
  padding: 10px 18px; border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 650;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-soft);
  transition: all var(--speed); font-family: inherit;
}
.btn-sekunder:hover { color: var(--text); border-color: var(--text-dim); }
.btn-bahaya {
  padding: 10px 18px; border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 650;
  background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.4); color: var(--err);
  transition: all var(--speed); font-family: inherit;
}
.btn-bahaya:hover { background: rgba(248,113,113,.18); }
.btn-sukses {
  padding: 10px 18px; border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 650;
  background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.4); color: var(--ok);
  transition: all var(--speed); font-family: inherit;
}
.btn-sukses:hover { background: rgba(52,211,153,.2); }
.baris-aksi { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.baris-aksi:last-child { border-bottom: none; }
.baris-aksi .ket-kiri { flex: 1; min-width: 220px; }
.baris-aksi .ket-kiri b { display: block; font-size: 13.5px; }
.baris-aksi .ket-kiri span { font-size: 12px; color: var(--text-dim); }

/* ==================== BADGE / LABEL KECIL ==================== */
.badge-ai {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--brand-soft); border: 1px solid rgba(79,110,247,.3); color: var(--brand);
}

/* ==================== HALAMAN 404 ==================== */
.h404 { text-align: center; padding: 14vh 20px; }
.h404 .kode { font-size: 74px; font-weight: 800; letter-spacing: -.04em; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ==================== UTILITAS ==================== */
.text-kecil { font-size: 12px; color: var(--text-dim); }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; }
.spin {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); border-top-color: var(--brand);
  animation: putar .7s linear infinite;
}
@keyframes putar { to { transform: rotate(360deg); } }
