/* ===== ULTRA design tokens ===== */
:root {
  --brand: #80ef80; --on-brand: #0f2e14; --brand-dark: #1a6b2e; --brand-deep: #14532d; --brand-soft: #e9fbe9; --brand-line: #5fd35f;
  --bg: #f4f5fa; --surface: #ffffff; --text: #111c2b; --label: #475569; --muted: #64748b; --border: #e5e9ef; --border-strong: #cfd6df;
  --success: #15803d; --success-bg: #e7f6ec; --warn: #b45309; --warn-bg: #fdf3dc; --danger: #b91c1c; --danger-bg: #fdecec; --info: #0369a1; --info-bg: #e3f1fa; --orange: #c2410c; --orange-bg: #fdeee4;
  --shadow: 0 2px 6px rgba(67, 89, 113, 0.12); --radius: 12px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-dark); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: #8a96a6; }
:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 4px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.right { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ===== Shell ===== */
.shell { display: flex; min-height: 100vh; }
.side { width: 272px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 30; }
.side-head { padding: 14px 16px 10px; display: flex; align-items: center; gap: 8px; }
.side-head img { height: 44px; max-width: 100%; object-fit: contain; object-position: left center; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.side-sec { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark); padding: 14px 12px 6px; border-top: 1px solid var(--border); margin-top: 8px; }
.side-sec.first { border-top: none; margin-top: 0; color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 12px; }
.nav-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: none; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; color: var(--label); font-weight: 500; font-size: 14.5px; }
.nav-btn:hover { background: #f4f7f5; color: var(--text); }
.nav-btn.on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.nav-btn .chev { margin-left: auto; transition: transform .15s; }
.nav-btn .chev.open { transform: rotate(90deg); }
.nav-sub { padding: 2px 0 6px 22px; }
.nav-sub .nav-btn { font-size: 13.5px; padding: 8px 12px; gap: 10px; }
.nav-sub .dot { width: 6px; height: 6px; border-radius: 6px; background: #b6c2cf; flex-shrink: 0; }
.nav-sub .nav-btn.on .dot { background: var(--brand-dark); width: 8px; height: 8px; }
.nav-head { font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 12px 2px; }
.nav-stage { margin-left: auto; font-size: 10px; font-weight: 700; color: #94a3b8; background: #f1f5f9; border-radius: 99px; padding: 1px 7px; }
.side-foot { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; padding: 14px 28px 0; background: var(--bg); }
.topbar-in { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px; }
.content { padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1440px; width: 100%; }
.burger { display: none; }
@media (max-width: 960px) {
  .side { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .burger { display: inline-flex; }
  .topbar, .content { padding-left: 14px; padding-right: 14px; }
}
.avatar { width: 38px; height: 38px; border-radius: 38px; background: var(--brand-deep); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }

/* ===== Komponen ===== */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 24px; }
.card-title { font-weight: 700; font-size: 16px; margin: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 760px; }
.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { height: 40px; padding: 0 16px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 2px 4px rgba(26,107,46,.18); }
.btn-primary:hover:not(:disabled) { filter: brightness(.96); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--brand-dark); }
.btn-danger { background: var(--surface); border-color: #f1b4b4; color: var(--danger); }
.btn-ghost { background: transparent; color: var(--label); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--label); }
.icon-btn:hover { background: #f1f5f9; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--label); }
.field .hint { font-size: 12px; color: var(--muted); }
.input { height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 12px; background: var(--surface); width: 100%; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand-dark); outline: none; box-shadow: 0 0 0 3px rgba(26,107,46,.12); }
.input.bad { border-color: var(--danger); }
.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-success { background: var(--success-bg); color: var(--success); } .b-warn { background: var(--warn-bg); color: var(--warn); } .b-danger { background: var(--danger-bg); color: var(--danger); }
.b-info { background: var(--info-bg); color: var(--info); } .b-neutral { background: #eef1f4; color: var(--label); } .b-orange { background: var(--orange-bg); color: var(--orange); }
.alert { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert-danger { background: var(--danger-bg); color: var(--danger); } .alert-info { background: var(--info-bg); color: var(--info); } .alert-warn { background: var(--warn-bg); color: var(--warn); } .alert-success { background: var(--success-bg); color: var(--success); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 38px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer; color: var(--label); font-weight: 500; }
.chip.on { border-color: var(--brand-dark); background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }

/* KPI */
.kpi { padding: 18px 20px; border-bottom: 3px solid var(--brand-line); display: flex; flex-direction: column; gap: 10px; }
.kpi .ico { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.kpi .val { font-size: 24px; font-weight: 800; }
.kpi .lbl { font-weight: 700; color: var(--label); }
.kpi.clickable { cursor: pointer; text-align: left; border-left: none; border-right: none; border-top: none; font: inherit; }

/* Tabel */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 640px; }
.tbl th { background: #f6f8fa; color: var(--label); font-size: 12px; font-weight: 700; padding: 11px 14px; text-align: center; border-bottom: 1px solid var(--border-strong); white-space: nowrap; letter-spacing: .02em; }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafcfa; }
.tbl td.c { text-align: center; } .tbl td.r { text-align: right; }
.tbl-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search input { padding-left: 36px; height: 40px; }
.search svg { position: absolute; left: 12px; top: 12px; color: var(--muted); }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(17,28,43,.45); z-index: 100; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: 40px 16px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; box-shadow: 0 20px 60px rgba(17,28,43,.3); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); }

/* Toast */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; background: var(--text); color: #fff; border-radius: 12px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 420px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(160deg, var(--brand) 0%, #4fc46a 55%, var(--brand-dark) 100%); color: var(--on-brand); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 34px; line-height: 1.2; margin: 0; font-weight: 800; }
.login-box { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 420px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* Matriks hak akses */
.perm-cell { display: inline-flex; gap: 4px; }
.perm-key { width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 11px; font-weight: 800; color: var(--muted); cursor: pointer; }
.perm-key.on { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.perm-key:disabled { cursor: default; }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

/* ===== Tahap 2: Inventory Umum ===== */
.chip .cnt { margin-left: 6px; display: inline-flex; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: #eef1f4; color: var(--label); font-size: 12px; font-weight: 700; align-items: center; justify-content: center; }
.chip.on .cnt { background: var(--brand-dark); color: #fff; }
.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; flex-shrink: 0; }
.bar-track { height: 8px; border-radius: 6px; background: #eef1f4; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding: 8px 4px 0; border-bottom: 1px solid var(--border); }
.vbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 18px; max-width: 64px; margin: 0 auto; border-radius: 6px 6px 0 0; overflow: hidden; }
.vbar-lbls { display: flex; gap: 10px; padding: 6px 4px 0; }
.vbar-lbls span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.cat-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; text-align: left; cursor: pointer; border: none; font: inherit; color: var(--text); }
.drawer-bg { position: fixed; inset: 0; background: rgba(17,28,43,.35); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 91; box-shadow: -10px 0 40px rgba(17,28,43,.2); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.pick-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.pick-card.on { border-color: var(--brand-dark); box-shadow: 0 0 0 3px var(--brand-soft); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--brand-dark); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qty input { text-align: center; font-weight: 700; height: 38px; padding: 0; }
.item-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1.5px solid transparent; }
.item-card.on { border-color: var(--brand-dark); }
.sticky-side { position: sticky; top: 88px; }
.paper { border: 1px solid var(--border); border-radius: 12px; padding: 22px clamp(14px, 3vw, 32px); display: flex; flex-direction: column; gap: 14px; background: #fff; }
.paper-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--text); flex-wrap: wrap; }
.paper-head img { height: 34px; max-width: 220px; object-fit: contain; }
.doc-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-tbl th, .doc-tbl td { border: 1px solid #94a3b8; padding: 6px 8px; }
.doc-tbl th { background: #f1f4f2; text-align: center; font-weight: 700; }
.doc-tbl td.c { text-align: center; } .doc-tbl td.r { text-align: right; } .doc-tbl tr.sub td { background: #f6f8fa; font-weight: 700; }
.signs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; font-size: 13px; gap: 12px; }
.signs .sp { height: 52px; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; font-size: 13px; }
.meta-grid > div { display: grid; grid-template-columns: 150px 10px minmax(0, 1fr); }
@media (max-width: 700px) { .meta-grid { grid-template-columns: 1fr; } .signs { grid-template-columns: 1fr; } }
.bell-pop { position: absolute; right: 0; top: 46px; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border-radius: 14px; box-shadow: 0 12px 40px rgba(17,28,43,.18); border: 1px solid var(--border); z-index: 40; }
.bell-dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.notif-row { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; width: 100%; background: transparent; border-left: none; border-right: none; border-top: none; font: inherit; color: var(--text); }
.notif-row.unread { background: #f3fbf3; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline > div { display: flex; gap: 10px; font-size: 13px; }
.timeline .d { width: 8px; height: 8px; border-radius: 99px; background: var(--brand-dark); margin-top: 6px; flex-shrink: 0; }
.tbl td.left, .tbl td .left { text-align: left; }
.inline-input { height: 36px; width: 84px; text-align: right; }
.login-center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: var(--bg); }
.login-logo { align-self: center; background: #fff; border-radius: 14px; padding: 8px 14px; box-shadow: 0 2px 6px rgba(67,89,113,.12); }
.login-logo img { height: 44px; max-width: 280px; object-fit: contain; display: block; }
.divider-txt { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.divider-txt::before, .divider-txt::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.svc-head { height: 68px; padding: 0 clamp(16px, 4vw, 48px); background: var(--brand); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--brand-line); }
.svc-head .logo { background: #fff; border-radius: 12px; padding: 6px 12px; display: inline-flex; }
.svc-head .logo img { height: 36px; max-width: 220px; object-fit: contain; }
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 64px; }
.hide-sm { } @media (max-width: 700px) { .hide-sm { display: none !important; } }
.split-main { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.split-list { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); }
@media (max-width: 1000px) { .split-main, .split-list { grid-template-columns: minmax(0, 1fr); } .sticky-side { position: static; } }
