/* Mengikuti gaya Sistem Manajemen Hutama Indah Plastindo: sidebar terang, aksen biru-indigo, kartu membulat */
:root {
  --bg: #f1f5f9; --surface: #fff; --soft: #f8fafc; --border: #e2e8f0; --line: #f1f5f9;
  --text: #0f172a; --body: #334155; --muted: #64748b;
  --primary: #3f51b5; --primary-dark: #303f9f; --primary-soft: #e8eaf6;
  --good: #0f766e; --good-bg: #ccfbf1; --bad: #be123c; --bad-bg: #ffe4e6; --warn: #b45309; --warn-bg: #fef3c7; --info: #0369a1; --info-bg: #e0f2fe;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
}
html.dark {
  --bg: #0b1120; --surface: #111827; --soft: #0f172a; --border: #273449; --line: #1f2937;
  --text: #f1f5f9; --body: #cbd5e1; --muted: #94a3b8; --primary-dark: #9fa8da; --primary-soft: #1e2556;
  --good: #5eead4; --good-bg: #134e4a; --bad: #fda4af; --bad-bg: #4c0519; --warn: #fcd34d; --warn-bg: #451a03; --info: #7dd3fc; --info-bg: #0c4a6e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--bg); color: var(--body); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--text); line-height: 1.3; }
[hidden] { display: none !important; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 284px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); box-shadow: 4px 0 20px rgba(148,163,184,.12); z-index: 50; transition: width .25s, transform .25s; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 80px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.brand-text small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.brand-text strong { font-size: 13px; color: var(--primary-dark); }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 11px 12px 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-radius: 10px; font-weight: 500; font-size: 13.5px; margin-bottom: 1px; transition: background .2s, color .2s, transform .2s; }
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); }
.nav-link:hover { background: var(--bg); color: var(--primary); transform: translateX(2px); }
.nav-link.active { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-weight: 600; box-shadow: 0 4px 15px rgba(59,130,246,.35); }
.nav-link.active svg { color: #fff; }
.collapse-btn { border: 0; border-top: 1px solid var(--line); background: none; color: var(--muted); padding: 14px; cursor: pointer; font: inherit; }
html.collapsed .sidebar { width: 76px; }
html.collapsed .brand-text, html.collapsed .nav-label, html.collapsed .nav-link span, html.collapsed .collapse-btn span { display: none; }
html.collapsed .nav-link { justify-content: center; padding: 11px 0; }
html.collapsed .brand { justify-content: center; padding: 0; }
.overlay { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.crumb { color: var(--muted); } .crumb b { color: var(--text); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--bg); font-weight: 600; }
.user-chip b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, #3f51b5, #3949ab); color: #fff; box-shadow: 0 2px 8px rgba(63,81,181,.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(63,81,181,.4); }
.btn-light { background: var(--surface); border-color: var(--border); color: var(--body); }
.btn-light:hover { background: var(--primary-soft); }
.btn-light:disabled { opacity: .4; cursor: default; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn.big { padding: 12px 20px; font-size: 14px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--bg); color: var(--body); font-size: 17px; cursor: pointer; }
.only-mobile { display: none; }

.content { padding: 24px; max-width: 1560px; width: 100%; margin: 0 auto; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--muted); }
.page-head .meta { font-size: 12px; margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-tools { display: flex; gap: 8px; }
.card-body { padding: 18px 20px; }
.block { margin-bottom: 0; }
section.card.block { margin-bottom: 20px; }
.narrow { max-width: 460px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 14px 16px; margin-bottom: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
input, select { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; outline: none; min-width: 0; }
select { min-width: 130px; max-width: 280px; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(63,81,181,.15); }
.segmented { display: flex; gap: 2px; padding: 3px; background: var(--bg); border-radius: 10px; }
.segmented button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.howto { margin-bottom: 14px; background: var(--primary-soft); border-radius: 12px; padding: 10px 16px; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); }
.howto ul { padding: 8px 0 2px 20px; }
.notice { padding: 11px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; background: var(--info-bg); color: var(--info); }
.notice ul { padding-left: 20px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.good { background: var(--good-bg); color: var(--good); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid > .block { grid-column: 1 / -1; min-width: 0; animation: rise .45s cubic-bezier(.16,1,.3,1) both; }
.grid > .block.half { grid-column: span 1; align-self: stretch; }
.grid > .half > .card { height: 100%; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
@media (min-width: 1001px) { .kpis:has(> :nth-child(5):last-child), .kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); } }
.kpi { padding: 18px 20px; transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.kpi-label { color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.02em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 13px; }
.kpi-hint { font-size: 12px; color: var(--muted); }
.deltas { list-style: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); }
.deltas b { font-weight: 700; margin-right: 2px; }
b.good, .up { color: var(--good); } b.bad, .down { color: var(--bad); } b.flat { color: var(--muted); } b.mid { color: var(--warn); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--bg); color: var(--muted); }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.info { background: var(--info-bg); color: var(--info); }

.chart { position: relative; width: 100%; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.note.pad { padding: 0 20px 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { background: var(--soft); text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover td { background-color: var(--soft); }
td small { display: block; color: var(--muted); font-size: 11.5px; }
td.wrap { white-space: pre-line; min-width: 220px; }
td.strong { font-weight: 700; color: var(--text); }
td.good, td.h4 { background: var(--good-bg); color: var(--good); font-weight: 700; }
td.h3 { background: color-mix(in srgb, var(--good-bg) 50%, transparent); }
td.mid, td.h2 { background: var(--warn-bg); color: var(--warn); }
td.bad, td.h1 { background: var(--bad-bg); color: var(--bad); }
td.up, td.down { font-weight: 600; }
td.higher { background: color-mix(in srgb, var(--bad-bg) 65%, transparent); }
td.lower { background: color-mix(in srgb, var(--info-bg) 75%, transparent); }
td.muted { color: var(--muted); font-style: italic; }
td.group { background: var(--primary-soft); color: var(--primary-dark); font-weight: 800; font-size: 11px; letter-spacing: .08em; }
.empty { color: var(--muted); text-align: center; padding: 20px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 20px; font-size: 12px; color: var(--muted); }

.item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.item .pill { justify-self: start; }
.item a, .item b { font-weight: 700; color: var(--text); } .item a:hover { color: var(--primary); text-decoration: underline; }
.item p { font-size: 12.5px; color: var(--muted); } .item em { font-style: normal; font-weight: 700; }
.progress { margin-bottom: 16px; }
.progress-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.track { height: 9px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
.track i.good { background: #14b8a6; } .track i.mid { background: #f59e0b; } .track i.bad { background: #f43f5e; }
.progress small { color: var(--muted); }

.report .card-body { max-width: 960px; }
.report h3 { font-size: 15px; margin: 8px 0 8px; }
.report section { margin-bottom: 18px; }
.report ul { padding-left: 20px; } .report li { margin-bottom: 8px; }
.report li b { color: var(--text); }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.dow { font-size: 11px; font-weight: 700; color: var(--muted); }
.day { border: 1px solid var(--border); border-radius: 10px; padding: 6px 2px; min-height: 52px; display: flex; flex-direction: column; justify-content: center; }
.day small { font-size: 11px; }
.day.blank { border: 0; } .day.none { color: var(--muted); }
.day.h4 { background: #0d9488; border-color: #0d9488; color: #fff; }
.day.h3 { background: var(--good-bg); color: var(--good); }
.day.h2 { background: var(--warn-bg); color: var(--warn); }
.day.h1 { background: var(--bad-bg); color: var(--bad); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form .btn { align-self: flex-start; }
.row { display: flex; flex-wrap: wrap; gap: 14px; }
.row > label { flex: 1; min-width: 200px; }
.row > label.check { flex: 0 0 auto; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--body); font-weight: 500; font-size: 13px; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
legend { font-weight: 700; padding: 0 6px; font-size: 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.dropzone { align-items: center; gap: 6px; border: 2px dashed var(--border); border-radius: 16px; padding: 34px 16px; text-align: center; cursor: pointer; background: var(--soft); }
.dropzone b { color: var(--text); font-size: 14px; }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone:focus-within { border-color: var(--primary); }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

body.plain { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.plain-card { width: 100%; max-width: 410px; padding: 32px; text-align: center; }
.plain-card h1 { font-size: 20px; margin-bottom: 4px; } .plain-card p { color: var(--muted); margin-bottom: 20px; }
body.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.login-brand { display: flex; flex-direction: column; padding: 48px; color: #fff; background: radial-gradient(circle at 100% 100%, rgba(255,255,255,.12), transparent 45%), radial-gradient(circle at 50% 50%, rgba(255,255,255,.07), transparent 50%), linear-gradient(135deg, #1a237e, #303f9f 55%, #3949ab); }
.login-logo { width: 92px; height: 92px; object-fit: contain; background: #fff; border-radius: 18px; padding: 2px; }
.login-logo.mobile { display: none; }
.login-hero { margin: auto; max-width: 480px; padding: 40px 0; }
.login-hero h1 { color: #fff; font-size: 34px; line-height: 1.25; margin-bottom: 16px; }
.login-hero p { font-size: 17px; color: #c5cae9; margin-bottom: 36px; }
.login-hero ul { list-style: none; display: grid; gap: 16px; }
.login-hero li { display: flex; align-items: center; gap: 16px; font-size: 15px; }
.login-hero li i { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: rgba(255,255,255,.1); }
.login svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-hero li svg { color: #4ade80; }
.login-brand small { font-size: 13px; color: #9fa8da; }
.login-main { display: grid; place-items: center; padding: 32px 24px; }
.login-box { width: 100%; max-width: 440px; }
.login-box h2 { font-size: 28px; text-align: center; margin-bottom: 8px; }
.login-box > p { color: var(--muted); text-align: center; margin-bottom: 28px; }
.login-box .form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.login-box .form label { font-size: 13.5px; font-weight: 500; color: var(--body); margin-top: 10px; }
.login-box .field { position: relative; }
.login-box .field > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.login-box .field input { width: 100%; height: 50px; padding: 0 50px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.login-box .field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(63,81,181,.18); }
.login-box .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.login-box .eye:hover, .login-box .eye[aria-pressed="true"] { color: var(--primary); }
.login-box .form .btn { align-self: stretch; display: flex; justify-content: center; align-items: center; gap: 10px; height: 50px; margin-top: 18px; font-size: 15px; }
.login-box > .login-note { margin: 28px 0 0; font-size: 13px; }
@media (max-width: 960px) { body.login { grid-template-columns: 1fr; } .login-brand { display: none; } .login-logo.mobile { display: block; margin: 0 auto 20px; border: 1px solid var(--border); } .login-box h2 { font-size: 23px; } }

@media (max-width: 1100px) { .grid > .block.half { grid-column: 1 / -1; } .user-chip span { display: none; } .user-chip { padding: 4px; } }
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); }
  html.menu-open .sidebar { transform: none; }
  html.menu-open .overlay { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 40; }
  html.collapsed .sidebar { width: 284px; }
  html.collapsed .brand-text, html.collapsed .nav-label, html.collapsed .nav-link span { display: revert; }
  html.collapsed .nav-link { justify-content: flex-start; padding: 10px 14px; }
  .collapse-btn { display: none; }
  .only-mobile { display: inline-block; }
  .content { padding: 16px; } .topbar { padding: 0 12px; }
  .hide-mobile, .crumb { display: none; }
}
@media print {
  .sidebar, .topbar, .toolbar, .howto, .card-tools, .pager { display: none !important; }
  body { background: #fff; } .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .grid > .block { animation: none; }
}

form.inline { display: inline-flex; gap: 6px; align-items: center; vertical-align: middle; }
form.inline input { min-width: 180px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
details.rename { margin-bottom: 6px; } details.rename summary { cursor: pointer; color: var(--primary); font-weight: 600; } details.rename form { margin-top: 6px; }
svg.qr { width: 220px; height: 220px; background: #fff; border-radius: 12px; border: 1px solid var(--border); fill: #000; align-self: center; }
.secret { letter-spacing: .08em; word-break: break-all; }
.login-box .form label small { font-weight: 400; color: var(--muted); }
