/* =====================================================================
   TELUR KITA — Desain
   Warna utama mengikuti brief: Hijau Fresh, Kuning Telur, Cream Telur.
   ===================================================================== */
:root {
  --green: #4CAF50;
  --green-600: #3E9B43;
  --dark: #245B3A;
  --yolk: #FFC83D;
  --yolk-600: #E9AE16;
  --cream: #FFF4D6;
  --bg: #FAFCF8;
  --surface: #FFFFFF;
  --surface-2: #F4F8F2;
  --text: #263238;
  --muted: #66766D;
  --faint: #9AA79F;
  --border: #E5ECE2;
  --info: #4A90A4;
  --danger: #E76F51;
  --warn: #E9A23B;

  --green-50: #EAF6EA;
  --yolk-50: #FFF7DE;
  --red-50: #FDEEE9;
  --blue-50: #E7F2F5;
  --cream-50: #FFFAEC;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(36, 91, 58, .06), 0 6px 20px rgba(36, 91, 58, .06);
  --shadow-lg: 0 18px 50px rgba(20, 50, 32, .18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1611; --surface: #16211A; --surface-2: #1B281F; --text: #E5EDE7; --muted: #9DAEA4; --faint: #6F8077;
    --border: #26372C; --green-50: #18301F; --yolk-50: #2E2812; --red-50: #33201B; --blue-50: #172A31; --cream-50: #262213;
    --cream: #2A2513; --dark: #1E4D31; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1611; --surface: #16211A; --surface-2: #1B281F; --text: #E5EDE7; --muted: #9DAEA4; --faint: #6F8077;
  --border: #26372C; --green-50: #18301F; --yolk-50: #2E2812; --red-50: #33201B; --blue-50: #172A31; --cream-50: #262213;
  --cream: #2A2513; --dark: #1E4D31; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-600); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ Splash */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 30%, #FFFBEF 0%, var(--cream) 55%, #FBE6A8 100%); overflow: hidden; transition: opacity .5s ease, visibility .5s; }
#splash.out { opacity: 0; visibility: hidden; }
.sp-stage { position: relative; width: 220px; height: 260px; }
.sp-shadow { position: absolute; left: 50%; bottom: 34px; width: 90px; height: 14px; margin-left: -45px; border-radius: 50%; background: rgba(36,91,58,.18); transform: scaleX(.3); opacity: 0; animation: spShadow 2.6s ease forwards; }
.sp-egg { position: absolute; left: 50%; bottom: 40px; width: 104px; margin-left: -52px; transform-origin: 50% 100%; animation: spDrop 2.6s cubic-bezier(.3,.1,.3,1) forwards; }
.sp-egg svg { width: 104px; height: 132px; display: block; overflow: visible; }
.sp-top { transform-origin: 70% 55%; animation: spLid 2.6s ease forwards; }
.sp-crack { stroke-dasharray: 120; stroke-dashoffset: 120; animation: spCrack 2.6s ease forwards; }
.sp-yolk { position: absolute; left: 50%; bottom: 76px; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE58A, var(--yolk) 60%, var(--yolk-600)); transform: scale(0); animation: spYolk 2.6s ease forwards; box-shadow: 0 0 0 0 rgba(255,200,61,.5); }
.sp-brand { position: absolute; left: 50%; top: calc(50% + 120px); transform: translateX(-50%); text-align: center; white-space: nowrap; }
.sp-brand b { display: block; font-size: 30px; font-weight: 800; color: var(--dark); letter-spacing: -.5px; opacity: 0; transform: translateY(14px); animation: spText .6s ease 1.75s forwards; }
.sp-brand span { display: block; font-size: 13px; color: #6B5A2A; opacity: 0; transform: translateY(10px); animation: spText .6s ease 2s forwards; }
.sp-bar { position: absolute; left: 50%; bottom: 6px; width: 120px; height: 4px; margin-left: -60px; border-radius: 4px; background: rgba(36,91,58,.12); overflow: hidden; }
.sp-bar::after { content: ''; position: absolute; inset: 0; background: var(--green); transform-origin: left; transform: scaleX(0); animation: spBar 2.6s ease forwards; }
.sp-leaf { position: absolute; width: 60px; opacity: 0; }
.sp-leaf.l { left: 8px; bottom: 30px; transform: rotate(-30deg) scale(.4); animation: spLeafL .7s cubic-bezier(.3,1.6,.5,1) 1.55s forwards; }
.sp-leaf.r { right: 8px; bottom: 30px; transform: rotate(30deg) scale(.4) scaleX(-1); animation: spLeafR .7s cubic-bezier(.3,1.6,.5,1) 1.65s forwards; }
.sp-skip { position: absolute; bottom: 18px; right: 20px; border: 0; background: transparent; color: #8A7740; font-size: 12px; cursor: pointer; }
@keyframes spDrop { 0% { transform: translateY(-420px) } 26% { transform: translateY(0) scale(1.06,.9) } 33% { transform: translateY(-36px) scale(.97,1.03) } 40% { transform: translateY(0) scale(1.03,.96) } 45% { transform: translateY(0) rotate(-5deg) } 50% { transform: rotate(5deg) } 54% { transform: rotate(-3deg) } 58%, 100% { transform: rotate(0) } }
@keyframes spShadow { 0% { opacity: 0; transform: scaleX(.3) } 26% { opacity: 1; transform: scaleX(1.1) } 33% { transform: scaleX(.8) } 40%, 100% { opacity: 1; transform: scaleX(1) } }
@keyframes spCrack { 0%, 52% { stroke-dashoffset: 120 } 62%, 100% { stroke-dashoffset: 0 } }
@keyframes spLid { 0%, 62% { transform: none; opacity: 1 } 76% { transform: translate(34px, -70px) rotate(38deg); opacity: 1 } 88%, 100% { transform: translate(60px, -110px) rotate(70deg); opacity: 0 } }
@keyframes spYolk { 0%, 64% { transform: scale(0) } 74% { transform: scale(1.25) } 80% { transform: scale(.95) } 86%, 100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(255,200,61,0) } }
@keyframes spText { to { opacity: 1; transform: none } }
@keyframes spBar { 0% { transform: scaleX(0) } 100% { transform: scaleX(1) } }
@keyframes spLeafL { to { opacity: 1; transform: rotate(-30deg) scale(1) } }
@keyframes spLeafR { to { opacity: 1; transform: rotate(30deg) scale(1) scaleX(-1) } }
@media (prefers-reduced-motion: reduce) { #splash * { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* ------------------------------------------------------------ Login */
#login { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.lg-art { position: relative; background: linear-gradient(160deg, var(--cream) 0%, #FBE8B4 100%); display: grid; place-items: center; padding: 48px; overflow: hidden; }
.lg-art .quote { position: absolute; left: 48px; bottom: 44px; max-width: 360px; font-size: 22px; font-weight: 700; color: var(--dark); }
.lg-art .quote small { display: block; font-size: 14px; font-weight: 500; color: #6B5A2A; margin-top: 8px; }
.lg-art svg.basket { width: min(420px, 80%); height: auto; margin-bottom: 80px; }
.lg-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.lg-card { width: 100%; max-width: 380px; }
.lg-card .brand { margin-bottom: 36px; }
.lg-card h1 { font-size: 26px; margin-bottom: 6px; }
.lg-card p { color: var(--muted); margin: 0 0 24px; }
.btn-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.btn-google:hover { border-color: var(--green); }
.lg-note { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--green-50); color: var(--dark); font-size: 13px; display: flex; gap: 10px; }
.lg-err { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--red-50); color: #B0452A; font-size: 13px; }
:root[data-theme="dark"] .lg-art, :root[data-theme="dark"] #splash { background: linear-gradient(160deg, #2A2513, #1B1A0F); }

/* ------------------------------------------------------------ Brand */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand .logo-mark { width: 44px; height: 44px; }
.brand b { display: block; font-size: 22px; font-weight: 800; color: var(--dark); letter-spacing: -.4px; line-height: 1.1; }
:root[data-theme="dark"] .brand b { color: #CFEBD3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand b { color: #CFEBD3; } }
.brand small { display: block; font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------ Layout */
#app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 22px 16px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.sidebar .brand { padding: 0 8px 18px; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 500; margin: 1px 0; position: relative; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(76,175,80,.3); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--yolk); color: #4A3A00; border-radius: 99px; padding: 1px 7px; }
.side-card { margin-top: auto; padding: 16px; border-radius: var(--radius); background: var(--cream); position: relative; overflow: hidden; }
.side-card svg { width: 100%; height: auto; max-height: 96px; }
.side-card p { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--dark); font-style: italic; }
:root[data-theme="dark"] .side-card p { color: #E8D9A6; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .burger, .topbar .brand-mini { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); outline: none; }
.search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(76,175,80,.15); }
.search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-res { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 360px; overflow: auto; z-index: 40; }
.search-res a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.search-res a:hover { background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; color: var(--text); }
.icon-btn:hover { border-color: var(--green); color: var(--green-600); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; background: transparent; }
.user:hover { border-color: var(--border); background: var(--surface); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--green), var(--dark)); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user b { display: block; font-size: 13.5px; }
.user small { display: block; font-size: 11.5px; color: var(--muted); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 50; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; text-align: left; cursor: pointer; color: var(--text); text-decoration: none; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-2); }
.menu-pop .alert-item { align-items: flex-start; font-size: 13px; }
.menu-pop h4 { margin: 6px 12px 8px; font-size: 13px; }

.content { padding: 26px 28px 60px; max-width: 1320px; width: 100%; }
.demo-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--blue-50); color: var(--info); font-size: 13px; }
.demo-banner button { margin-left: auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head > div:first-child { flex: 1 1 280px; min-width: 0; }
.page-head .tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.page-head .tools .input { width: auto; }
.hero-art { position: absolute; right: 0; top: -10px; width: 210px; pointer-events: none; }

/* ------------------------------------------------------------ Cards & KPI */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card h3 { font-size: 16.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi .k-sub { padding-right: 76px; }
.kpis:not(.six) .kpi .k-sub { padding-right: 0; }
.kpi { position: relative; border-radius: var(--radius); padding: 18px; border: 1px solid var(--border); overflow: hidden; min-height: 150px; display: flex; flex-direction: column; }
.kpi .k-top { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.kpi .k-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.kpi .k-val { font-size: 25px; font-weight: 800; letter-spacing: -.5px; margin: 14px 0 6px; }
.kpi .k-sub { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-top: auto; }
.kpi .k-art { position: absolute; right: 14px; bottom: 14px; width: 58px; height: 58px; opacity: .95; }
.kpi.green { background: var(--green-50); } .kpi.green .k-ic { background: var(--green); }
.kpi.yolk { background: var(--yolk-50); } .kpi.yolk .k-ic { background: var(--yolk); color: #5A4300; }
.kpi.cream { background: var(--cream-50); } .kpi.cream .k-ic { background: #E8A13A; }
.kpi.red { background: var(--red-50); } .kpi.red .k-ic { background: var(--danger); }
.kpi.dark { background: var(--dark); color: #fff; border-color: transparent; } .kpi.dark .k-ic { background: rgba(255,255,255,.15); } .kpi.dark .k-sub { color: rgba(255,255,255,.75); }
.kpi.amplop { background: linear-gradient(135deg, #FFD965, var(--yolk)); color: #3D2F00; border-color: transparent; } .kpi.amplop .k-ic { background: rgba(255,255,255,.55); color: #6B4E00; } .kpi.amplop .k-sub { color: #6B5410; }
.trend-up { color: var(--green-600); font-weight: 700; } .trend-down { color: var(--danger); font-weight: 700; }
.kpi.dark .trend-up { color: #9BE3A0; } .kpi.dark .trend-down { color: #FFB49E; }

.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 230px; }
.legend { display: grid; gap: 10px; }
.legend div { display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 10px; font-size: 13.5px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; }
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
.legend div span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ Buttons & form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent; background: var(--green); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .05s, background .15s; }
.btn:hover { background: var(--green-600); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn.yolk { background: var(--yolk); color: #3D2F00; } .btn.yolk:hover { background: var(--yolk-600); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); } .btn.ghost:hover { border-color: var(--green); color: var(--green-600); }
.btn.danger { background: var(--danger); } .btn.danger:hover { background: #D45C3F; }
.btn.wa { background: #25D366; } .btn.wa:hover { background: #1DB954; }
.btn.sm { padding: 6px 10px; border-radius: 9px; font-size: 13px; }
.btn.icon { padding: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { border: 0; background: none; color: var(--green-600); font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.link-btn:hover { background: var(--green-50); }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; }
.field .help { font-size: 12px; color: var(--muted); }
.input, .field input, .field select, .field textarea, select.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); outline: none; min-height: 42px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(76,175,80,.15); }
.field textarea { min-height: 70px; resize: vertical; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 12px; border: 1px solid var(--border); border-radius: 99px; cursor: pointer; font-size: 13px; background: var(--surface); }
.seg input:checked + span { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.calc-line { grid-column: 1 / -1; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; display: flex; justify-content: space-between; gap: 10px; }

/* ------------------------------------------------------------ Table / list */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 150px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .r { text-align: right; }
.tbl td.num, .tbl td.r, .tbl td:first-child { white-space: nowrap; }
.tbl .acts { white-space: nowrap; text-align: right; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.type { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.type i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.type i .ic { width: 14px; height: 14px; }
.type.green { color: var(--green-600); } .type.green i { background: var(--green); }
.type.red { color: var(--danger); } .type.red i { background: var(--danger); }
.type.yellow { color: #B07E00; } .type.yellow i { background: var(--yolk); }
.type.blue { color: var(--info); } .type.blue i { background: var(--info); }
.type.cream { color: #A0702A; } .type.cream i { background: #E8A13A; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--green-50); color: var(--green-600); }
.badge.warn { background: var(--yolk-50); color: #9A6E00; }
.badge.bad { background: var(--red-50); color: #C2522F; }
.badge.info { background: var(--blue-50); color: var(--info); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 6px; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--dark)); }

.alerts { display: grid; gap: 8px; margin-bottom: 18px; }
.alert { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; border: 1px solid transparent; }
.alert .ic { width: 18px; height: 18px; }
.alert.info { background: var(--blue-50); color: var(--info); }
.alert.warn { background: var(--yolk-50); color: #8A6300; }
.alert.danger { background: var(--red-50); color: #B3482B; }
.alert .link-btn { margin-left: auto; color: inherit; }

.stat-list { display: grid; gap: 0; }
.stat-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.stat-list > div:last-child { border-bottom: 0; }
.stat-list .total { font-weight: 800; border-top: 2px solid var(--border); border-bottom: 0; padding-top: 11px; }
.stat-list .indent { padding-left: 14px; color: var(--muted); }

.po-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 8px; background: var(--surface); }
.po-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.po-card .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.po-card .meta .ic, .badge .ic, .card h3 .ic { width: 16px; height: 16px; vertical-align: -3px; }
.po-card .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.po-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mini-po { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.mini-po:last-child { border-bottom: 0; }
.mini-po .date { width: 48px; text-align: center; border-radius: 10px; background: var(--yolk-50); padding: 6px 0; line-height: 1.1; }
.mini-po .date b { display: block; font-size: 18px; }
.mini-po .date small { font-size: 11px; color: var(--muted); }

.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* ------------------------------------------------------------ Dialog / toast */
dialog { border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(18, 36, 24, .45); backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h3 { font-size: 18px; }
.dlg-body { padding: 20px 22px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
#toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--dark); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: toastIn .25s ease; }
.toast.err { background: #B3482B; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) } }

/* ------------------------------------------------------------ Invoice */
.inv-paper { background: #fff; color: #263238; border-radius: 14px; padding: 34px; border: 1px solid var(--border); max-width: 820px; margin: 0 auto; box-shadow: var(--shadow); }
.inv-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid #245B3A; padding-bottom: 16px; margin-bottom: 18px; }
.inv-head .brand b { color: #245B3A; }
.inv-title { text-align: right; }
.inv-title h2 { font-size: 30px; color: #E9AE16; letter-spacing: 1px; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; font-size: 13.5px; }
.inv-meta dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 0; }
.inv-meta dt { color: #66766D; } .inv-meta dd { margin: 0; font-weight: 600; }
.inv-paper table.tbl th { background: #245B3A; color: #fff; }
.inv-paper .tbl tbody tr:hover { background: transparent; }
.inv-total { margin-left: auto; width: min(320px, 100%); margin-top: 14px; }
.inv-total div { display: flex; justify-content: space-between; padding: 6px 0; }
.inv-total .due { background: #FFF4D6; padding: 10px 12px; border-radius: 10px; font-weight: 800; font-size: 16px; margin-top: 6px; }
.inv-foot { margin-top: 26px; font-size: 13px; color: #66766D; }
.inv-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0 auto 16px; max-width: 820px; }
.stamp { display: inline-block; border: 3px solid #4CAF50; color: #4CAF50; font-weight: 800; padding: 4px 12px; border-radius: 8px; transform: rotate(-8deg); letter-spacing: 2px; }
.stamp.unpaid { border-color: #E76F51; color: #E76F51; }

/* ------------------------------------------------------------ Mobile */
.bottom-nav, .fab-sheet { display: none; }
@media (max-width: 1100px) {
  .g-main, .g-3 { grid-template-columns: 1fr; }
  .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-art { display: none; }
}
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 290px; transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.drawer .sidebar { transform: none; }
  body.drawer::after { content: ''; position: fixed; inset: 0; z-index: 55; background: rgba(18,36,24,.4); }
  .topbar { padding: 10px 16px; gap: 10px; }
  .topbar .burger { display: grid; }
  .topbar .brand-mini { display: flex; } .topbar .brand-mini .logo-mark { width: 32px; height: 32px; } .topbar .brand-mini b { font-size: 17px; }
  .search { display: none; }
  .user .who { display: none; }
  .content { padding: 18px 16px 110px; }
  .page-head h1 { font-size: 22px; }
  .g-2 { grid-template-columns: 1fr; }
  .kpis, .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi .k-sub { padding-right: 0; }
  .kpi { min-height: 128px; padding: 14px; } .kpi .k-val { font-size: 20px; margin: 10px 0 4px; } .kpi .k-art { display: none; } .kpi .k-ic { width: 34px; height: 34px; }
  .donut-wrap { grid-template-columns: 1fr; } .donut-wrap .chart-box { height: 200px; }
  .form { grid-template-columns: 1fr; }
  #login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .lg-art { display: flex; flex-direction: column; align-items: center; padding: 28px 20px 22px; }
  .lg-art svg.basket { width: 190px; margin: 0; }
  .lg-art .quote { position: static; font-size: 17px; text-align: center; margin-top: 10px; max-width: 320px; }
  .lg-form { align-items: start; padding-top: 28px; }
  .alert .link-btn { white-space: nowrap; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; border: 0; background: none; padding: 4px 0; cursor: pointer; }
  .bottom-nav a.active { color: var(--green-600); font-weight: 700; }
  .bottom-nav .fab { width: 54px; height: 54px; margin: -24px auto 0; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(76,175,80,.45); }
  .bottom-nav .fab .ic { width: 26px; height: 26px; }
  /* tabel jadi kartu */
  table.tbl.stack thead { display: none; }
  table.tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 6px 0; }
  .tbl.stack td { border: 0; padding: 5px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl.stack td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; }
  .tbl.stack td.acts { justify-content: flex-end; }
  .tbl.stack td.acts::before { content: none; }
  .tbl.stack tfoot { display: block; }
  .inv-paper { padding: 18px; }
  .inv-paper .xs-hide { display: none; }
  .inv-paper .tbl th, .inv-paper .tbl td { padding: 9px 6px; }
  .inv-paper .tbl td:first-child { white-space: normal; } .inv-meta { grid-template-columns: 1fr; } .inv-head { flex-direction: column; } .inv-title { text-align: left; }
  dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
}
.fab-sheet .opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fab-sheet .opts button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; text-align: left; font-weight: 600; }
.fab-sheet .opts button .ic { color: var(--green-600); width: 24px; height: 24px; }

/* ------------------------------------------------------------ Print */
@media print {
  body * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .inv-paper { box-shadow: none; border: 0; max-width: none; padding: 0; }
  .inv-actions { display: none !important; }
  @page { size: A4; margin: 14mm; }
}
