/* =====================================================================
   tema.css — tema dashboard cokelat–krem + aksen merah (rombak 14 Nov 2026)
   Dipakai halaman dashboard toko yang SUDAH dipindah ke tema baru (+ login).
   Halaman lama tetap memakai gaya inline-nya sampai dipindah satu per satu.
   Sidebar dirender oleh /dashboard/sidebar.js (#141).
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Cokelat (sidebar, teks kuat) */
  --coklat-950: #24110c;
  --coklat-900: #331a13;
  --coklat-800: #46241a;
  --coklat-700: #5c3124;
  --coklat-500: #8a5a48;
  /* Krem (latar & garis) */
  --krem-50: #fdf8f3;
  --krem-100: #f8efe6;
  --krem-200: #efe0d2;
  --krem-300: #e3cdb9;
  /* Aksen merah */
  --merah-700: #8f1d16;
  --merah-600: #b3261e;
  --merah-500: #cc3b2f;
  --merah-100: #fbe3df;
  --merah-50: #fdf1ee;
  /* Status */
  --hijau-700: #23633f; --hijau-50: #e8f4ec;
  --kuning-700: #8a5a0b; --kuning-50: #fdf3dc;
  --biru-700: #2b4f86;  --biru-50: #e8eef8;
  --abu-600: #6f625c;   --abu-50: #f1ece8;

  /* Peran */
  --bg: var(--krem-50);
  --surface: #ffffff;
  --surface-2: var(--krem-100);
  --border: var(--krem-200);
  --text: #2a1812;
  --muted: #7d6359;
  --muted-2: #a8918a;
  --accent: var(--merah-600);
  --accent-hover: var(--merah-700);
  --danger: #b3261e;
  --success: var(--hijau-700);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow: 0 1px 2px rgba(51, 26, 19, .05), 0 2px 10px rgba(51, 26, 19, .05);
  --shadow-lg: 0 24px 60px rgba(51, 26, 19, .22);
  --ring: 0 0 0 3px rgba(179, 38, 30, .16);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Kompatibilitas halaman lama (14 Nov) =====
   CSS khusus halaman yang dipindah masih memakai nama variabel lama (--navy, --blue, …).
   Dipetakan ke palet baru agar tak perlu menulis ulang tiap aturan. */
:root {
  --navy: var(--coklat-800); --navy-2: var(--coklat-700); --navy-dark: var(--coklat-900);
  --blue: var(--merah-600); --teal: var(--coklat-500); --amber: #c98a1b; --warn: #c98a1b;
  --violet: #7a3b2e; --green: var(--hijau-700); --shadow-md: var(--shadow);
}

/* ===== Shell ===== */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ===== Sidebar (dirender sidebar.js) ===== */
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--coklat-900), var(--coklat-950));
  color: #fff; display: flex; flex-direction: column; overflow-y: auto;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; text-decoration: none; color: #fff; }
.sb-mark {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: var(--merah-600); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(179, 38, 30, .35);
}
.sb-mark svg { width: 21px; height: 21px; }
.sb-brand strong { font-size: 15px; font-weight: 700; display: block; line-height: 1.2; letter-spacing: -.01em; }
.sb-brand span { font-size: 11.5px; color: rgba(255, 255, 255, .6); }
.sb-nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.sb-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .72); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.sb-nav a svg { width: 18px; height: 18px; flex: none; }
.sb-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sb-nav a.active { background: var(--merah-600); color: #fff; font-weight: 600; box-shadow: 0 6px 14px rgba(179, 38, 30, .3); }
.sb-paket {
  margin: 18px 14px 6px; padding: 14px; border-radius: 14px; text-decoration: none; display: block;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #fff;
}
.sb-paket strong { display: block; font-size: 13px; font-weight: 700; }
.sb-paket span { display: block; font-size: 12px; color: rgba(255, 255, 255, .62); margin-top: 3px; line-height: 1.45; }
.sb-paket em { display: inline-block; margin-top: 10px; font-style: normal; font-size: 12px; font-weight: 600; color: #ffd6cf; }
.sb-paket:hover { background: rgba(255, 255, 255, .1); }
.sb-foot { margin-top: auto; padding: 14px 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sb-slot:empty { display: none; }
.sb-slot { margin-bottom: 8px; }
.sb-logout {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .85); font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
}
.sb-logout:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sb-logout svg { width: 16px; height: 16px; }

/* ===== Topbar ===== */
.topbar {
  padding: 22px 32px 6px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
}
.topbar h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.topbar .tt-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.topbar > :last-child:not(:first-child) { margin-left: auto; }
.topbar .tt-aksi { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.wrap { padding: 16px 32px 40px; width: 100%; max-width: 1280px; }

/* ===== Kartu ===== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 700; margin: 0; }
.card-head .link { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.card-head .link:hover { text-decoration: underline; }

/* ===== Tombol & isian ===== */
.btn {
  padding: 10px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; transition: background .15s, border-color .15s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--merah-100); }
.btn.danger:hover:not(:disabled) { background: var(--merah-50); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { width: auto; padding: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
select.pilih-kecil { width: auto; padding: 8px 32px 8px 12px; font-size: 13px; font-weight: 600; }

/* ===== Pesan, pil, lencana ===== */
.msg { font-size: 13px; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); line-height: 1.45; }
.msg.ok { color: var(--hijau-700); background: var(--hijau-50); border: 1px solid #cbe6d4; }
.msg.err { color: var(--danger); background: var(--merah-50); border: 1px solid var(--merah-100); }
.msg.info { color: var(--kuning-700); background: var(--kuning-50); border: 1px solid #f3dfae; }
.pil { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pil.hijau { color: var(--hijau-700); background: var(--hijau-50); }
.pil.kuning { color: var(--kuning-700); background: var(--kuning-50); }
.pil.biru { color: var(--biru-700); background: var(--biru-50); }
.pil.merah { color: var(--merah-700); background: var(--merah-50); }
.pil.abu { color: var(--abu-600); background: var(--abu-50); }
.pil.coklat { color: var(--coklat-700); background: var(--krem-100); }
.naik { color: var(--hijau-700); } .turun { color: var(--merah-600); }
.kosong { color: var(--muted); font-size: 13.5px; text-align: center; padding: 28px 12px; line-height: 1.6; }

/* ===== Modal (pola halaman lama) ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(36, 17, 12, .5); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px 22px 22px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===== Bilah atas HP (dirender sidebar.js; tersembunyi di layar lebar) ===== */
.m-bar { display: none; }
.m-latar { display: none; }

/* ===== Layar kecil (HP & tablet potret): sidebar = menu geser ===== */
@media (max-width: 860px) {
  .m-bar {
    display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; z-index: 70;
    height: 56px; padding: 0 12px; background: var(--coklat-900); color: #fff;
    box-shadow: 0 2px 12px rgba(36, 17, 12, .25);
  }
  .m-bar button {
    width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff;
    display: grid; place-items: center; cursor: pointer; flex: none;
  }
  .m-bar button svg { width: 22px; height: 22px; }
  .m-bar .sb-mark { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; }
  .m-bar .sb-mark svg { width: 18px; height: 18px; }
  .m-bar strong { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100%; width: 272px; max-width: 86vw; z-index: 90;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: none;
  }
  body.menu-buka .sidebar { transform: none; box-shadow: 12px 0 40px rgba(36, 17, 12, .35); }
  body.menu-buka .m-latar { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(36, 17, 12, .45); }
  body.menu-buka { overflow: hidden; }
  .shell { display: block; }
  .main { padding-top: 56px; min-width: 0; }
  .topbar { padding: 16px 16px 2px; gap: 10px; }
  .topbar h1 { font-size: 21px; }
  .topbar .tt-sub { font-size: 13px; }
  .wrap { padding: 12px 14px 28px; }
  .card { padding: 16px; }
}
