/* =====================================================================
   Toko Energi Cetak — Design System
   Print-shop inspired: ink navy + CMYK accents. UI only.
   ===================================================================== */

:root {
  --ink:        #0e1a2b;
  --ink-soft:   #162338;
  --ink-muted:  #24344d;
  --paper:      #eef2f6;
  --paper-2:    #e4ebf2;
  --white:      #ffffff;
  --line:       #d5dee8;
  --line-soft:  #e8eef4;
  --text:       #152033;
  --muted:      #5a6b80;
  --cyan:       #0a8fa8;
  --cyan-deep:  #077a90;
  --cyan-soft:  #e6f6f9;
  --magenta:    #c2185b;
  --magenta-soft:#fce8f0;
  --amber:      #c9850a;
  --amber-soft: #fff4de;
  --green:      #1a7a4c;
  --green-soft: #e5f6ed;
  --radius:     14px;
  --radius-sm:  10px;
  --shadow:     0 1px 2px rgba(14,26,43,.04), 0 8px 24px rgba(14,26,43,.06);
  --shadow-lg:  0 4px 12px rgba(14,26,43,.06), 0 20px 40px rgba(14,26,43,.08);
  --sidebar-w:  280px;
  --ease:       cubic-bezier(.22,.61,.36,1);
  --bs-primary: #0a8fa8;
  --bs-primary-rgb: 10,143,168;
  --bs-body-font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(10,143,168,.08), transparent 55%),
    radial-gradient(900px 500px at -10% 40%, rgba(194,24,91,.05), transparent 50%),
    linear-gradient(180deg, #f5f8fb 0%, var(--paper) 100%);
  background-attachment: fixed;
  font-family: var(--bs-body-font-family);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.samping {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background:
    linear-gradient(165deg, var(--ink) 0%, #13233a 55%, #0c1726 100%);
  color: #b8c5d8;
  padding: 22px 14px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
  border-right: 1px solid rgba(255,255,255,.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.samping::-webkit-scrollbar { width: 5px; }
.samping::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.merek {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 8px 20px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 10px;
  overflow: visible;
}
.merek-mark {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 16px;
  background: linear-gradient(160deg, #21405c 0%, #122538 100%);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 6px 16px rgba(0,0,0,.28);
  display: grid;
  place-items: center;
  overflow: visible;
}
.merek-mark svg {
  width: 36px;
  height: 36px;
  display: block;
  position: relative;
  z-index: 1;
}
.merek-teks {
  width: 100%;
  line-height: 1.15;
  overflow: visible;
}
.merek-teks .nama {
  display: block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: #fff;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
}
.merek-teks .nama .aksen { color: #7ee0f0; }
.merek-teks small {
  display: block;
  color: #8fa0b6;
  font-size: .68rem;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.topbar .merek {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: 0;
  width: auto;
}
.topbar .merek-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
.topbar .merek-mark svg { width: 26px; height: 26px; }
.topbar .merek-teks { width: auto; }
.topbar .merek-teks .nama {
  font-size: .98rem;
  white-space: nowrap;
}
.topbar .merek-teks small { display: none; }

.grup {
  margin: 18px 0 6px;
  padding: 0 14px;
  font-size: .68rem;
  font-weight: 700;
  color: #6e7f96;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.samping a.tautan {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: 10px;
  color: #c5d0e0;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.samping a.tautan .ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.05);
  color: #8fa3bc;
  flex-shrink: 0;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.samping a.tautan .ico svg { width: 15px; height: 15px; }
.samping a.tautan:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.samping a.tautan:hover .ico { background: rgba(255,255,255,.1); color: #fff; }
.samping a.tautan.aktif {
  background: linear-gradient(90deg, rgba(10,143,168,.28), rgba(10,143,168,.12));
  color: #fff;
  border-color: rgba(53,194,220,.25);
}
.samping a.tautan.aktif .ico {
  background: rgba(10,143,168,.35);
  color: #7ee0f0;
}

.samping a:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 3px solid #35c2dc;
  outline-offset: 2px;
}

.sidebar-foot {
  margin-top: 28px;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  font-size: .78rem;
  color: #8494ab;
  line-height: 1.45;
}
.sidebar-foot strong { color: #d5e0ee; font-weight: 600; }

/* ---------- Top bar (mobile) ---------- */
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .merek { padding: 0; margin: 0; border: 0; }
.topbar .merek b { font-size: 1rem; }
.burger {
  width: 40px; height: 40px;
  border: 0; border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
.burger svg { width: 20px; height: 20px; }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,18,30,.45);
  backdrop-filter: blur(2px);
  z-index: 35;
}
.sidebar-overlay.show { display: block; }

/* ---------- Main content ---------- */
.isi {
  flex: 1;
  min-width: 0;
  padding: 36px 42px 72px;
  max-width: 1240px;
  animation: masuk .45s var(--ease) both;
}

@keyframes masuk {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 28px;
}
.page-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: clamp(1.55rem, 2.4vw, 1.9rem);
  color: var(--ink);
  margin: 0;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.page-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .95rem;
  max-width: 52ch;
  line-height: 1.5;
}

h5, .bagian-judul {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  color: var(--ink);
}
h5 { font-size: 1.05rem; margin-bottom: 14px; }
.bagian { margin-top: 36px; }
.bagian-judul {
  font-size: 1.05rem;
  margin: 0 0 14px;
  letter-spacing: -.01em;
}
.text-muted { color: var(--muted) !important; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-pad { padding: 22px 24px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fbfcfd, #f7fafc);
}
.card-head h5 { margin: 0; }
.card-body-pad { padding: 0; }

/* ---------- Forms ---------- */
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-control, .form-select {
  border: 1px solid #c4d0de;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: .93rem;
  background: #fafcfd;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control:hover, .form-select:hover { border-color: #a8b8ca; }
.form-control:focus, .form-select:focus {
  border-color: var(--cyan);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10,143,168,.16);
}
.form-hint {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 5px;
}

.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 10px 18px;
  font-size: .9rem;
  transition: transform .15s var(--ease), box-shadow .15s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #0ea3be 0%, var(--cyan) 100%);
  border-color: var(--cyan-deep);
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 4px 12px rgba(10,143,168,.28);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-deep) 100%);
  border-color: var(--cyan-deep);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px rgba(10,143,168,.35);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--paper); border-color: #b8c6d6; color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  font-size: .92rem;
}
.table thead th {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
  padding: 12px 16px;
  white-space: nowrap;
}
.table td, .table th { padding: 13px 16px; vertical-align: middle; border-color: var(--line-soft); }
.table-hover > tbody > tr { transition: background .12s; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f2f8fa; }
.table-danger { --bs-table-bg: #fdf0f5; --bs-table-color: var(--text); }
.table-danger td:first-child { box-shadow: inset 4px 0 0 var(--magenta); }

.badge-stok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
}
.badge-stok.kritis {
  background: var(--magenta-soft);
  color: var(--magenta);
}
.badge-stok.rendah {
  background: var(--amber-soft);
  color: var(--amber);
}
.kode-pill {
  display: inline-block;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: .8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-muted);
  border: 1px solid var(--line);
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 14px 16px;
  font-size: .92rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: var(--green-soft); border-color: #b5e0c8; color: #14573a; }
.alert-danger  { background: var(--magenta-soft); border-color: #f0bfd3; color: #7d0f3a; }
.alert-warning { background: var(--amber-soft); border-color: #f0d89a; color: #6b5200; }

/* ---------- Dashboard ---------- */
.angka-utama {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 280px at 90% 10%, rgba(10,143,168,.35), transparent 55%),
    radial-gradient(400px 240px at 10% 90%, rgba(194,24,91,.18), transparent 50%),
    linear-gradient(135deg, #0e1a2b 0%, #16304a 100%);
  color: #fff;
  border-radius: 18px;
  padding: 28px 32px 30px;
  box-shadow: var(--shadow-lg);
}
.angka-utama::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 28px solid rgba(255,255,255,.04);
  pointer-events: none;
}
.angka-utama .label {
  color: #9fb1cb;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.angka-utama .nilai {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.08;
  margin-top: 6px;
  letter-spacing: -.03em;
}
.angka-utama .sub {
  color: #9fb1cb;
  margin-top: 10px;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.angka-utama .sub .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3ddeb0;
  box-shadow: 0 0 0 3px rgba(61,222,176,.25);
}

.stat {
  padding: 20px 22px;
  height: 100%;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat .nilai {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
  letter-spacing: -.02em;
}
.stat.peringatan { border-color: #e8b4c8; background: linear-gradient(180deg, #fff, #fdf5f8); }
.stat.peringatan .nilai { color: var(--magenta); }

.aksi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
  height: 100%;
  box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.aksi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cyan);
  opacity: 0;
  transition: opacity .2s;
}
.aksi:hover {
  border-color: #9ed5e2;
  color: var(--ink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.aksi:hover::before { opacity: 1; }
.aksi .aksi-ico {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--cyan-soft);
  color: var(--cyan);
  margin-bottom: 8px;
}
.aksi .aksi-ico svg { width: 18px; height: 18px; }
.aksi b { display: block; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.aksi span { color: var(--muted); font-size: .86rem; line-height: 1.4; }

.panel-form { max-width: 560px; }
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; }

.link-soft {
  color: var(--cyan);
  font-weight: 600;
  text-decoration: none;
  font-size: .9rem;
}
.link-soft:hover { color: var(--cyan-deep); text-decoration: underline; }

.akun-sidebar {
  margin-bottom: 12px;
}
.akun-sidebar strong {
  display: block;
  color: #d5e0ee;
  font-weight: 600;
}
.akun-sidebar span {
  display: block;
  font-size: .75rem;
  color: #8494ab;
  margin-top: 2px;
}
.samping a.tautan-keluar {
  margin-top: 4px;
  color: #e8b4c8;
}
.samping a.tautan-keluar .ico {
  background: rgba(194,24,91,.18);
  color: #f2c4d6;
}
.samping a.tautan-keluar:hover {
  background: rgba(194,24,91,.16);
  color: #fff;
}

/* ---------- Login ---------- */
body.halaman-login {
  min-height: 100vh;
}
.login-tengah {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-kartu {
  width: 100%;
  max-width: 340px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 18px;
  animation: masuk .45s var(--ease) both;
}
.login-merek {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line-soft);
}
.login-merek .merek-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
.login-merek .merek-mark svg { width: 26px; height: 26px; }
.login-merek .merek-teks { width: auto; }
.login-merek .merek-teks .nama {
  font-size: .98rem;
  color: var(--ink);
  white-space: nowrap;
}
.login-merek .merek-teks .nama .aksen { color: var(--cyan); }
.login-merek .merek-teks small {
  margin-top: 3px;
  color: var(--muted);
  letter-spacing: .08em;
}
.login-kartu h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--ink);
}
.login-sub {
  color: var(--muted);
  margin: 4px 0 14px;
  font-size: .86rem;
}
.login-kartu .alert {
  padding: 10px 12px;
  font-size: .84rem;
  margin-bottom: 14px;
}
.login-kartu .form-control { padding: 8px 12px; font-size: .9rem; }
.login-kartu .btn { padding: 9px 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .topbar { display: flex; }
  .samping {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-105%);
    transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .samping.open { transform: none; }
  .isi { padding: 22px 16px 56px; max-width: none; }
  .angka-utama { padding: 24px 22px; }
  .card-pad { padding: 18px; }
}
