:root {
  --brand: #1F4E8C;
  --brand-dark: #163A68;
  --accent: #2E74B5;
  --ok: #1E8E3E;
  --no: #C5221F;
  --bg: #F2F5F9;
  --card: #FFFFFF;
  --text: #1B2430;
  --muted: #5F6B7A;
  --line: #DCE3EC;
  --input: #FFFFFF;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 4px 14px rgba(16, 32, 64, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F151D; --card: #171F2A; --text: #E8EDF3; --muted: #9AA7B6;
    --line: #2A3542; --input: #121923; --accent: #6FA7E6;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1 { font-size: 24px; margin: 8px 0 4px; }
h2 { font-size: 22px; margin: 8px 0 4px; }
h3 { font-size: 18px; margin: 0 0 6px; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff;
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 720px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 8px; background: #fff; padding: 2px; }
.brand-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 11px; opacity: .85; }

/* ---- layout ---- */
.container { max-width: 720px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 16px; margin-bottom: 14px;
}
.card.center { text-align: center; padding: 32px 20px; }
.login-logo { width: 150px; height: auto; margin-bottom: 4px; background: #fff; border-radius: 12px; padding: 6px; }
.gsi { display: flex; justify-content: center; margin: 18px 0 6px; min-height: 44px; }

.info-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 13px; }
.info-strip b { font-size: 14px; word-break: break-word; }

.banner {
  background: #FFF4D6; color: #7A4B00; border: 1px solid #F3D48A;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
}

/* ---- sections ---- */
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: var(--accent);
  margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.section-title .num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}
.group-title { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.field textarea { min-height: 72px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.field.changed input, .field.changed textarea { border-color: var(--accent); }

.item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--input); }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.item-label { font-size: 14px; font-weight: 600; flex: 1; }
.item .remarks input { width: 100%; font: inherit; font-size: 14px; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.item .remarks input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.remarks-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }

/* YES / NO toggle */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.seg button {
  font: inherit; font-weight: 700; font-size: 13px; padding: 8px 14px; min-width: 56px;
  background: var(--card); color: var(--muted); border: 0; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on-yes { background: var(--ok); color: #fff; }
.seg button.on-no { background: var(--no); color: #fff; }

/* count */
.count { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.count button { font: inherit; font-size: 18px; width: 40px; height: 38px; background: var(--card); color: var(--text); border: 0; cursor: pointer; }
.count input { width: 56px; height: 38px; text-align: center; font: inherit; font-weight: 700; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--input); color: var(--text); }
.count input:focus { outline: none; }

/* ---- buttons ---- */
.btn-primary, .btn-secondary, .btn-ghost {
  font: inherit; font-weight: 700; border-radius: 12px; padding: 14px 18px; cursor: pointer;
  display: inline-block; text-decoration: none; text-align: center;
}
.btn-primary { width: 100%; background: var(--brand); color: #fff; border: 0; font-size: 16px; }
.btn-primary:active { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-secondary { width: 100%; background: var(--accent); color: #fff; border: 0; margin-top: 10px; }
.btn-ghost { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.5); padding: 8px 12px; font-size: 13px; }
main .btn-ghost { border-color: var(--line); color: var(--muted); margin-top: 8px; }
.submit-card { margin-bottom: 32px; }

.msg { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.msg.error { background: #FDE8E7; color: #8A1C18; }
.msg.ok { background: #E6F4EA; color: #155E2B; }

.spinner {
  width: 36px; height: 36px; margin: 0 auto 14px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.check-big { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 40px; line-height: 72px; }
.done-detail { text-align: left; font-size: 14px; margin: 12px auto; max-width: 420px; }
.done-detail div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.done-detail span:last-child { font-weight: 600; text-align: right; word-break: break-word; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 16px; }
.modal-box { background: var(--card); color: var(--text); border-radius: 16px; padding: 20px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions button { flex: 1; padding: 12px; }
.modal-actions .btn-ghost { border-color: var(--line); color: var(--text); }

@media (min-width: 600px) {
  .modal { align-items: center; }
}

/* =====================================================================
 *  MENU & IT ACTIVITY
 * ===================================================================== */
.mainnav { max-width: 720px; margin: 0 auto; padding: 0 16px 8px; display: flex; gap: 6px; }
.mainnav button {
  flex: 1; font: inherit; font-size: 14px; font-weight: 700; padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.35); background: transparent; color: rgba(255,255,255,.85); cursor: pointer;
}
.mainnav button.on { background: #fff; color: var(--brand); border-color: #fff; }

.subtabs { display: flex; gap: 4px; background: var(--card); border-radius: 12px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 14px; }
.subtabs button {
  flex: 1; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 6px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.subtabs button.on { background: var(--accent); color: #fff; }
.pill { background: var(--no); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; line-height: 1.5; }

.field select {
  width: 100%; font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.field input[type="date"], .field input[type="month"] { min-height: 46px; -webkit-appearance: none; appearance: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid2 .field { min-width: 0; }

/* aset */
.asset-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.asset-bar input {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.asset-bar input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn-scan {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; font-size: 14px;
  background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 0 14px; cursor: pointer;
}
.asset-results { border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow-y: auto; margin-bottom: 10px; }
.asset-hit {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  font: inherit; font-size: 14px; color: var(--text); background: var(--card); border: 0; border-bottom: 1px solid var(--line);
  padding: 9px 12px; cursor: pointer;
}
.asset-hit:last-child { border-bottom: 0; }
.asset-hit:active { background: var(--input); }
.asset-chosen {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 14px;
  border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--input);
}
.pad { padding: 10px 12px; }
.warn { color: #B06000; }
.icon-btn {
  font: inherit; font-size: 16px; line-height: 1; width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer;
}

/* filter riwayat */
.filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; align-items: end; }
.filters .field { min-width: 0; margin-bottom: 10px; }
.filters .check, .filters input[type="search"] { grid-column: 1 / -1; }
.filters input[type="search"] {
  font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; }

/* daftar record */
.rec-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.rec {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--card); border: 0; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px;
}
.rec-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.rec-date { font-size: 12px; font-weight: 700; color: var(--accent); }
.rec-desc { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-meta { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; }
.b-done { background: #E6F4EA; color: #155E2B; }
.b-prog { background: #FFF4D6; color: #7A4B00; }

/* modal detail & scan */
.modal-tall { max-height: 88vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.modal-head h3 { margin: 0; }
.case-detail { margin: 6px 0 14px; max-width: none; }
.case-detail div { flex-direction: column; gap: 2px; justify-content: flex-start; }
.case-detail span:first-child { font-size: 11px; color: var(--muted); font-weight: 700; }
.case-detail span:last-child { text-align: left; font-weight: 500; white-space: pre-wrap; }
.scan-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; margin: 8px 0; }
.scan-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }

@media (max-width: 420px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field:first-child { grid-column: 1 / -1; }
}

/* =====================================================================
 *  WIFI CHECK
 * ===================================================================== */
.seg-wide { display: flex; width: 100%; }
.seg-wide button { flex: 1; }
.seg button.on-pick { background: var(--accent); color: #fff; }

.affix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--input); }
.affix span { display: flex; align-items: center; padding: 0 10px; font-weight: 700; color: var(--muted); border-right: 1px solid var(--line); }
.affix input { border: 0 !important; border-radius: 0 !important; flex: 1; min-width: 0; }

.suggest { margin-top: -4px; }
.suggest p { margin: 0 0 8px; }
.ok-text { color: var(--ok); font-weight: 600; }
.suggest-group { margin-bottom: 8px; }
.suggest-group .group-title { margin: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 196px; overflow-y: auto; }
.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; cursor: pointer;
  font: inherit; font-size: 13px; line-height: 1.25; color: var(--text);
  background: var(--input); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px;
}
.chip span { font-size: 10px; color: var(--muted); }
.chip-new { border-color: var(--ok); }
.chip:active { background: var(--line); }

.photo-pick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  min-height: 120px; border: 2px dashed var(--line); border-radius: 12px; padding: 12px; text-align: center;
  color: var(--accent); font-weight: 700; font-size: 14px;
}
.photo-pick img { max-width: 100%; max-height: 320px; border-radius: 8px; }

.b-bad { background: #FDE8E7; color: #8A1C18; }
.rec-bad { box-shadow: inset 4px 0 0 var(--no), var(--shadow); }
.rec-meta .photo-link { color: var(--accent); font-weight: 700; margin-left: 4px; }
.filters .wf-bad { grid-column: auto; align-self: end; }

/* =====================================================================
 *  CHART 3D
 * ===================================================================== */
:root {
  --series-front: #2a78d6;  /* seri tunggal (biru) */
  --series-top:   #6aa3e6;
  --series-side:  #1d559a;
  --chart-grid:   #E4E9F0;
  --chart-axis:   #8A95A3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --series-front: #3987e5; --series-top: #74abee; --series-side: #2a63a8;
    --chart-grid: #26313D; --chart-axis: #7D8A99;
  }
}
.c3d { position: relative; }
.c3d-head { margin-bottom: 6px; }
.c3d-title { font-weight: 700; font-size: 15px; color: var(--text); }
.c3d-sub { font-size: 12px; color: var(--muted); }
.c3d-plot { position: relative; width: 100%; overflow: hidden; }
.c3d-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.c3d-empty { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }
.c3d-grid { stroke: var(--chart-grid); stroke-width: 1; }
.c3d-base { stroke: var(--chart-axis); stroke-width: 1; }
.c3d-axis, .c3d-lbl { fill: var(--muted); font-size: 10px; }
.c3d-val { fill: var(--text); font-size: 10px; font-weight: 700; }
.c3d-front { fill: var(--series-front); }
.c3d-top { fill: var(--series-top); }
.c3d-side { fill: var(--series-side); }
.c3d-hit { fill: transparent; cursor: pointer; }
.c3d-bar { outline: none; transition: opacity .15s; }
.c3d-plot svg.c3d-active .c3d-bar:not(.c3d-on) { opacity: .55; }
.c3d-tip {
  position: absolute; z-index: 2; width: 140px; pointer-events: none;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); padding: 6px 8px; font-size: 12px; line-height: 1.35;
}
.c3d-table { margin-top: 6px; font-size: 12px; color: var(--muted); }
.c3d-table summary { cursor: pointer; }
.c3d-table table { width: 100%; border-collapse: collapse; margin-top: 6px; color: var(--text); }
.c3d-table th, .c3d-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.c3d-table td:last-child, .c3d-table th:last-child { text-align: right; }
.chart-card { padding-bottom: 12px; }
.chart-card + .chart-card { margin-top: -4px; }

/* =====================================================================
 *  MENU BERIKON (4 menu)
 * ===================================================================== */
.mainnav { gap: 4px; }
.mainnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 4px 5px; font-size: 11.5px; line-height: 1.1; min-width: 0;
}
.mainnav button svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.mainnav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (min-width: 560px) {
  .mainnav button { flex-direction: row; gap: 7px; font-size: 14px; padding: 8px 10px; }
  .mainnav button svg { width: 20px; height: 20px; }
}
#mPhotoClear { width: 100%; }

/* =====================================================================
 *  PC USER (LOCAL USER) + menu 5 tombol
 * ===================================================================== */
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.affix.pwd input { font-family: inherit; letter-spacing: .5px; }
.affix .eye {
  border: 0; border-left: 1px solid var(--line); background: var(--card); color: var(--accent);
  font: inherit; font-size: 13px; font-weight: 700; padding: 0 12px; cursor: pointer;
}
#uPaneForm .photo-pick { min-height: 110px; }
@media (max-width: 559px) {
  .mainnav { gap: 3px; padding-left: 10px; padding-right: 10px; }
  .mainnav button { font-size: 10.5px; padding: 6px 2px 5px; border-radius: 9px; }
  .mainnav button svg { width: 20px; height: 20px; }
}
.mainnav .lbl-sm { display: none; }
@media (max-width: 559px) {
  .mainnav .lbl-lg { display: none; }
  .mainnav .lbl-sm { display: inline; }
}

/* =====================================================================
 *  INVENTORY + menu 6 tombol (geser ke samping di HP)
 * ===================================================================== */
@media (max-width: 559px) {
  .mainnav {
    overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 8px;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
            mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav button { flex: 0 0 74px; scroll-snap-align: start; }
}
.ro-val {
  min-height: 44px; padding: 11px 12px; border-radius: 10px; font-size: 15px;
  background: var(--bg); color: var(--muted); border: 1px dashed var(--line); word-break: break-word;
}
input.auto-val { background: var(--bg); color: var(--muted); border-style: dashed; cursor: default; }
.span2 { grid-column: 1 / -1; }
.id-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.id-tools .btn-scan { padding: 9px 12px; }
.id-tools p { margin: 0; }
.inv-new { width: 100%; justify-content: center; min-height: 46px; }
.btn-primary.danger { background: var(--no); }
#iDisposeBtn { width: 100%; color: var(--no); border-color: var(--no); }

/* =====================================================================
 *  SIDEBAR KIRI DI KOMPUTER (>= 960px); di HP/tablet tetap menu atas
 * ===================================================================== */
.nav-toggle { display: none; }
@media (min-width: 960px) {
  :root { --side-w: 220px; }
  body.nav-mini { --side-w: 72px; }
  body:has(#mainNav:not(.hidden)) { padding-left: var(--side-w); transition: padding-left .2s ease; }

  .mainnav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
    width: var(--side-w); max-width: none; margin: 0;
    display: flex; flex-direction: column; gap: 4px;
    padding: calc(14px + env(safe-area-inset-top)) 10px 14px;
    background: var(--brand-dark); overflow-y: auto; overflow-x: hidden;
    -webkit-mask-image: none; mask-image: none;
    transition: width .2s ease;
  }
  .mainnav::before {
    content: "MENU"; color: rgba(255,255,255,.55); font-size: 11px; font-weight: 700;
    letter-spacing: 1.2px; padding: 4px 10px 10px;
  }
  body.nav-mini .mainnav::before { content: ""; padding: 4px 0 10px; }

  .mainnav button {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px;
    width: 100%; padding: 11px 12px; font-size: 14px; border-radius: 10px;
    border: 0; color: rgba(255,255,255,.85); background: transparent;
  }
  .mainnav button:hover { background: rgba(255,255,255,.1); }
  .mainnav button.on { background: #fff; color: var(--brand); }
  .mainnav button svg { width: 22px; height: 22px; flex-shrink: 0; }
  .mainnav .lbl-lg { display: inline; }
  .mainnav .lbl-sm { display: none; }

  .nav-toggle { display: flex; margin-top: auto; opacity: .75; }
  .nav-toggle svg { transition: transform .2s ease; }
  body.nav-mini .nav-toggle svg { transform: rotate(180deg); }

  body.nav-mini .mainnav button { justify-content: center; padding: 11px 0; }
  body.nav-mini .mainnav button span { display: none; }
}

/* =====================================================================
 *  PIE 3D + palet kategori (urutan tetap; lolos validator terang & gelap)
 * ===================================================================== */
:root {
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100;
  --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #6250d6; --cat-8: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
    --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; --cat-8: #e66767;
  }
}
.c3d-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.c3d-pie-plot { flex: 1 1 260px; max-width: 360px; }
.c3d-pct { fill: #fff; font-size: 12px; font-weight: 800; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 2px; pointer-events: none; }
.c3d-slice { cursor: pointer; outline: none; transition: opacity .15s; }
.c3d-plot svg.c3d-active .c3d-slice:not(.c3d-on) { opacity: .5; }
.c3d-legend { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.c3d-leg {
  display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 8px;
  font: inherit; font-size: 13px; color: var(--text); text-align: left;
  background: transparent; border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer;
}
.c3d-leg:hover, .c3d-leg.on { background: var(--bg); }
.c3d-sw { width: 12px; height: 12px; border-radius: 3px; }
.c3d-leg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c3d-leg-n { color: var(--muted); font-size: 12px; min-width: 28px; text-align: right; }
.filters .inv-search, .filters .inv-new { grid-column: 1 / -1; }
.filters .inv-search { margin-bottom: 8px; }
.b-photo-yes { background: #E8F0FB; color: #1d4f8f; }
.b-photo-no { background: var(--bg); color: var(--muted); border: 1px dashed var(--line); }
.rec-tags { display: flex; gap: 4px; align-items: center; }

/* Riwayat IT Activity: kelompok per tanggal (dropdown) */
#histList { gap: 10px; }
.day-group { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.day-sum {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 14px; cursor: pointer; list-style: none; user-select: none;
}
.day-sum::-webkit-details-marker { display: none; }
.day-sum::before { content: '▸'; color: var(--muted); font-size: 13px; transition: transform .15s; }
.day-group[open] > .day-sum::before { transform: rotate(90deg); }
.day-name { flex: 1; font-weight: 700; font-size: 14px; color: var(--text); }
.day-pills { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.day-count {
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: var(--bg); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.day-body { margin: 0; padding: 0 10px 10px; }
.day-body .rec { box-shadow: none; border: 1px solid var(--line); }

/* HP (iPhone): tombol Scan di sebelah kolom cari tidak boleh terdesak */
.filters .asset-bar input[type="search"] { width: auto; flex: 1 1 0; min-width: 0; }
.asset-bar .btn-scan { flex-shrink: 0; }

/* Inventory: tombol muat lebih banyak */
.load-more {
  width: 100%; margin: -20px 0 32px; padding: 12px; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--accent); background: var(--card); border: 1px solid var(--line);
}

/* Inventory: Ganti massal & Cek data */
.inv-tools { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.btn-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--accent); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
}
.btn-tool:disabled { opacity: .6; cursor: default; }
.bulk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bulk-head .check { margin-bottom: 6px; }
.bulk-list { display: flex; flex-direction: column; }
.bulk-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.bulk-row input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.bulk-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; word-break: break-word; }
.bulk-top { display: flex; gap: 6px; align-items: center; }
.check-body > p:first-child { margin-top: 0; }
.fix-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.fix-card .check { margin-bottom: 6px; }
.fix-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fix-btn { min-height: 38px; }
.fix-ignore {
  font: inherit; font-size: 13px; color: var(--muted); background: transparent;
  border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
.diff-row { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-top: 1px solid var(--line); word-break: break-word; }
.day-count.warn-count { background: #FFF4D6; color: #7A4B00; }
#iCheckCount { margin-left: 2px; }

/* Serah Terima: tanda tangan di layar */
.caps { text-transform: uppercase; }
.sign-wrap { margin-top: 4px; }
.sign-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.sign-head .btn-tool { min-height: 34px; padding: 4px 12px; }
/* kertas putih + tinta gelap di mode gelap juga, supaya tanda tangan di PDF tetap hitam */
.sign-pad {
  display: block; width: 100%; height: 180px; background: #fff; border: 2px dashed var(--line); border-radius: 12px;
  touch-action: none; cursor: crosshair;
}
.sign-pad.signed { border-style: solid; border-color: var(--accent); }
.btn-link { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }

/* =====================================================================
 *  TAMPILAN MODERN (lapisan gaya; tidak mengubah struktur/JS)
 * ===================================================================== */
:root {
  --brand: #1E4F96;
  --brand-dark: #12305C;
  --brand-2: #2F7BE0;
  --accent: #2563EB;
  --accent-soft: rgba(37, 99, 235, .10);
  --ok: #16A34A;
  --no: #DC2626;
  --bg: #F3F6FB;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --input: #F8FAFC;
  --radius: 18px;
  --ring: 0 0 0 4px rgba(37, 99, 235, .16);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -6px rgba(15, 23, 42, .08);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .05), 0 18px 40px -10px rgba(15, 23, 42, .18);
  --grad: linear-gradient(135deg, #1E4F96 0%, #2F7BE0 100%);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #1D4A8C; --brand-dark: #0B1A33; --brand-2: #3B82F6;
    --accent: #60A5FA; --accent-soft: rgba(96, 165, 250, .14);
    --bg: #0A0F1A; --card: #121A28; --text: #E6EDF7; --muted: #94A3B8;
    --line: #223047; --input: #0E1522;
    --ring: 0 0 0 4px rgba(96, 165, 250, .22);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -8px rgba(0,0,0,.55);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 22px 48px -12px rgba(0,0,0,.7);
    --grad: linear-gradient(135deg, #1D4A8C 0%, #3B82F6 100%);
  }
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(47, 123, 224, .14), transparent 60%),
    radial-gradient(900px 380px at 100% 0%, rgba(99, 102, 241, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
::selection { background: rgba(37, 99, 235, .22); }

/* ---- top bar: gradasi + kaca ---- */
.topbar {
  background: linear-gradient(120deg, rgba(18, 48, 92, .96) 0%, rgba(30, 79, 150, .94) 55%, rgba(47, 123, 224, .92) 100%);
  box-shadow: 0 8px 24px -12px rgba(15, 35, 80, .55);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
/* efek kaca hanya di HP/tablet: di komputer backdrop-filter membuat sidebar
   (position: fixed di dalam .topbar) terkurung setinggi topbar */
@media (max-width: 959px) {
  .topbar {
    -webkit-backdrop-filter: saturate(160%) blur(14px);
            backdrop-filter: saturate(160%) blur(14px);
  }
}
.topbar-inner { padding: 12px 16px; }
.brand img { border-radius: 10px; padding: 3px; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.brand-title { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-sub { opacity: .75; }
.btn-ghost { border-radius: 999px; transition: background .2s, border-color .2s, color .2s; }
.topbar .btn-ghost { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.2); }

/* ---- kartu & animasi masuk ---- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
}
.view:not(.hidden) { animation: fadeUp .38s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card.center { padding: 36px 22px; }
.login-logo { box-shadow: var(--shadow); border-radius: 16px; padding: 10px; width: 160px; }
#viewLogin .card { max-width: 440px; margin: 6vh auto 0; box-shadow: var(--shadow-lg); }

.info-strip > div {
  background: var(--input); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0;
}
.info-strip .muted { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.banner { border-radius: 14px; }

/* ---- judul seksi ---- */
.section-title { font-size: 16px; font-weight: 800; color: var(--text); gap: 10px; }
.section-title .num {
  width: 28px; height: 28px; border-radius: 9px; background: var(--grad); flex-shrink: 0;
  box-shadow: 0 4px 10px -2px rgba(37, 99, 235, .45); font-weight: 800;
}
.group-title { letter-spacing: .8px; font-size: 11px; }

/* ---- input ---- */
.field label { font-weight: 700; font-size: 12.5px; color: var(--muted); }
.field input, .field textarea, .field select,
.asset-bar input, .filters input[type="search"], .item .remarks input {
  border: 1.5px solid var(--line); border-radius: 12px; background-color: var(--input);
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
.field input:hover, .field textarea:hover, .field select:hover,
.asset-bar input:hover, .filters input[type="search"]:hover { border-color: #CBD5E1; }
.field input:focus, .field textarea:focus, .field select:focus,
.asset-bar input:focus, .filters input[type="search"]:focus, .item .remarks input:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring); background-color: var(--card);
}
.field.changed input, .field.changed textarea { border-color: var(--accent); background-color: var(--accent-soft); }
.affix { border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .18s, box-shadow .18s; }
.affix:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.affix input:focus { box-shadow: none !important; }
.ro-val { border-radius: 12px; }

/* ---- item checklist ---- */
.item { border-radius: 14px; background: var(--card); padding: 14px; transition: border-color .2s, box-shadow .2s; }
.item:hover { border-color: #CBD5E1; box-shadow: 0 4px 14px -6px rgba(15, 23, 42, .12); }
.item .remarks input { background-color: var(--input); }

/* ---- toggle YES/NO jadi pil ---- */
.seg { border: 0; background: var(--bg); padding: 3px; gap: 3px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border-radius: 9px; background: transparent; transition: background .18s, color .18s, box-shadow .18s, transform .1s; }
.seg button + button { border-left: 0; }
.seg button:active { transform: scale(.96); }
.seg button.on-yes { background: linear-gradient(135deg, #16A34A, #22C55E); box-shadow: 0 4px 10px -3px rgba(22, 163, 74, .55); }
.seg button.on-no { background: linear-gradient(135deg, #DC2626, #F05252); box-shadow: 0 4px 10px -3px rgba(220, 38, 38, .55); }
.seg button.on-pick { background: var(--grad); box-shadow: 0 4px 10px -3px rgba(37, 99, 235, .5); }

.count { border: 1.5px solid var(--line); border-radius: 12px; }
.count button { transition: background .15s; }
.count button:hover { background: var(--bg); }

/* ---- tombol ---- */
.btn-primary, .btn-secondary, .btn-scan, .btn-tool, .load-more, .icon-btn, .fix-ignore, .chip, .rec, .asset-hit {
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, opacity .2s;
}
.btn-primary {
  background: var(--grad); border-radius: 14px; padding: 15px 18px;
  box-shadow: 0 10px 22px -10px rgba(37, 99, 235, .75), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(37, 99, 235, .85), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:active:not(:disabled) { transform: scale(.99); background: var(--grad); }
.btn-primary.danger, .btn-primary.danger:active { background: linear-gradient(135deg, #B91C1C, #EF4444); box-shadow: 0 10px 22px -10px rgba(220, 38, 38, .75); }
.btn-secondary { border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.btn-secondary:hover { background: rgba(37, 99, 235, .18); }
main .btn-ghost { border-radius: 12px; }
main .btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-scan { background: var(--grad); border-radius: 12px; box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .7); }
.btn-scan:hover { transform: translateY(-1px); }
.btn-tool, .load-more { border-radius: 12px; border-width: 1.5px; }
.btn-tool:hover:not(:disabled), .load-more:hover { border-color: var(--accent); background: var(--accent-soft); }
.icon-btn { border-radius: 10px; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.msg { border-radius: 12px; font-weight: 500; }

/* ---- spinner & sukses ---- */
.spinner {
  border: 0; width: 40px; height: 40px;
  background: conic-gradient(from 0deg, transparent 0 25%, var(--brand-2) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: spin .8s linear infinite;
}
.check-big {
  background: linear-gradient(135deg, #16A34A, #4ADE80);
  box-shadow: 0 0 0 10px rgba(34, 197, 94, .12), 0 14px 30px -10px rgba(22, 163, 74, .7);
  animation: pop .5s var(--ease) both;
}
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* ---- modal ---- */
.modal { background: rgba(10, 15, 26, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal:not(.hidden) .modal-box { animation: sheetUp .32s var(--ease) both; }
.modal-box { border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
@keyframes sheetUp { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- menu atas (HP/tablet) ---- */
.mainnav button {
  border-radius: 12px; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06);
  transition: background .2s, color .2s, transform .12s, box-shadow .2s;
}
.mainnav button:hover { background: rgba(255,255,255,.14); }
.mainnav button:active { transform: scale(.96); }
.mainnav button.on { background: #fff; color: var(--brand); border-color: #fff; box-shadow: 0 6px 16px -6px rgba(0,0,0,.45); }

/* ---- sub tab ---- */
.subtabs { border: 1px solid var(--line); border-radius: 14px; padding: 5px; }
.subtabs button { border-radius: 10px; transition: background .2s, color .2s; }
.subtabs button:hover:not(.on) { color: var(--text); background: var(--bg); }
.subtabs button.on { background: var(--grad); box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .7); }
.pill { font-weight: 700; }

/* ---- daftar record ---- */
.rec { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.rec:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(37, 99, 235, .35); }
.badge { border-radius: 999px; padding: 3px 9px; font-size: 10.5px; letter-spacing: .3px; }
.b-done { background: rgba(22, 163, 74, .12); color: #15803D; }
.b-prog { background: rgba(234, 179, 8, .16); color: #A16207; }
.b-bad  { background: rgba(220, 38, 38, .12); color: #B91C1C; }
.b-photo-yes { background: var(--accent-soft); color: var(--accent); }
.day-group { border: 1px solid var(--line); border-radius: 16px; }
.day-sum { transition: background .2s; }
.day-sum:hover { background: var(--bg); }
.day-count { background: var(--accent-soft); }
.day-body .rec:hover { transform: none; box-shadow: 0 4px 14px -6px rgba(15, 23, 42, .15); }

/* ---- aset, chip, foto ---- */
.asset-results { border-radius: 14px; border-width: 1.5px; box-shadow: var(--shadow); }
.asset-hit:hover { background: var(--accent-soft); }
.asset-chosen { border-radius: 14px; border-width: 1.5px; background: var(--accent-soft); }
.chip { border-radius: 12px; }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.photo-pick { border-radius: 16px; background: var(--input); transition: border-color .2s, background .2s; }
.photo-pick:hover { border-color: var(--accent); background: var(--accent-soft); }
.fix-card { border-radius: 14px; }
.sign-pad { border-radius: 14px; }

/* ---- sidebar komputer ---- */
@media (min-width: 960px) {
  .mainnav {
    background: linear-gradient(180deg, #0F2A52 0%, #12305C 45%, #163C72 100%);
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: 8px 0 30px -18px rgba(0,0,0,.6);
  }
  .mainnav button { border: 0; background: transparent; position: relative; box-shadow: none; }
  .mainnav button:hover { background: rgba(255,255,255,.08); }
  .mainnav button.on { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
  .mainnav button.on::before {
    content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px;
    border-radius: 0 4px 4px 0; background: linear-gradient(180deg, #7DD3FC, #3B82F6);
  }
  .mainnav button.on svg { color: #93C5FD; }
}

/* ---- mode gelap: warna lembut ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .field input:hover,
  :root:not([data-theme="light"]) .field textarea:hover,
  :root:not([data-theme="light"]) .field select:hover,
  :root:not([data-theme="light"]) .item:hover { border-color: #33445E; }
  :root:not([data-theme="light"]) .b-done { color: #4ADE80; }
  :root:not([data-theme="light"]) .b-prog { color: #FACC15; }
  :root:not([data-theme="light"]) .b-bad  { color: #F87171; }
  :root:not([data-theme="light"]) .banner { background: rgba(234,179,8,.12); color: #FDE68A; border-color: rgba(234,179,8,.3); }
  :root:not([data-theme="light"]) .msg.error { background: rgba(220,38,38,.15); color: #FCA5A5; }
  :root:not([data-theme="light"]) .msg.ok { background: rgba(22,163,74,.15); color: #86EFAC; }
}
@media (min-width: 960px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mainnav { background: linear-gradient(180deg, #08111F 0%, #0B1A33 100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* =====================================================================
 *  TEMA IT (lapisan terakhir): IBM Plex Sans + JetBrains Mono,
 *  navy gelap + aksen cyan, grid halus, angka/label teknis monospace
 * ===================================================================== */
:root {
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --brand: #0B4F8A;
  --brand-dark: #0B1220;
  --brand-2: #0891B2;
  --accent: #0369A1;
  --accent-soft: rgba(3, 105, 161, .09);
  --cyan: #06B6D4;
  --ok: #15803D;
  --no: #DC2626;
  --warn: #B45309;
  --bg: #F1F4F8;
  --card: #FFFFFF;
  --text: #0B1220;
  --muted: #5B6779;
  --line: #DDE3EB;
  --input: #F7F9FB;
  --radius: 12px;
  --ring: 0 0 0 3px rgba(6, 182, 212, .25);
  --shadow: 0 1px 2px rgba(11, 18, 32, .05), 0 6px 18px -8px rgba(11, 18, 32, .10);
  --shadow-lg: 0 2px 4px rgba(11, 18, 32, .06), 0 16px 36px -12px rgba(11, 18, 32, .22);
  --grad: linear-gradient(135deg, #0B4F8A 0%, #0891B2 100%);
  --grid-line: rgba(11, 18, 32, .045);
  --series-front: #0284C7; --series-top: #38BDF8; --series-side: #075985;
  --chart-grid: #E3E8EF; --chart-axis: #8B97A8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #0E5A9C; --brand-dark: #05080F; --brand-2: #0EA5C6;
    --accent: #38BDF8; --accent-soft: rgba(56, 189, 248, .12); --cyan: #22D3EE;
    --ok: #22C55E; --warn: #F59E0B;
    --bg: #070B12; --card: #0D1420; --text: #E2E8F0; --muted: #8E9BAE;
    --line: #1C2738; --input: #0A101A;
    --ring: 0 0 0 3px rgba(34, 211, 238, .28);
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px -10px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.5), 0 20px 44px -14px rgba(0,0,0,.75);
    --grad: linear-gradient(135deg, #0E5A9C 0%, #0EA5C6 100%);
    --grid-line: rgba(148, 163, 184, .05);
    --series-front: #0EA5E9; --series-top: #7DD3FC; --series-side: #0369A1;
    --chart-grid: #1A2433; --chart-axis: #6B7A8F;
  }
}

body {
  font-family: var(--sans);
  background:
    radial-gradient(900px 360px at 0% -10%, rgba(6, 182, 212, .10), transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3 { letter-spacing: -.01em; font-weight: 700; }
::selection { background: rgba(6, 182, 212, .25); }

/* ---- label & angka teknis: monospace ---- */
.section-title .num, .rec-date, .badge, .pill, .day-count, .info-strip .muted,
.field label, .group-title, .remarks-label, .brand-sub, .eyebrow, .kpi-label, .kpi-value,
.c3d-sub, .c3d-table, .meter-val, .dash-row-k, .count input, .seg button, .chip span {
  font-family: var(--mono);
}
.c3d-axis, .c3d-lbl, .c3d-val, .c3d-pct { font-family: var(--mono); }
.field label { font-size: 11px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
.group-title { letter-spacing: 1px; }
.badge { border-radius: 6px; font-weight: 700; letter-spacing: .4px; }
.pill { border-radius: 6px; }

/* ---- top bar: konsol gelap + garis cyan ---- */
.topbar {
  background: linear-gradient(115deg, #0B1220 0%, #0F2240 60%, #0B3B66 100%);
  border-bottom: 1px solid rgba(34, 211, 238, .25);
  box-shadow: 0 1px 0 rgba(34, 211, 238, .08), 0 10px 26px -14px rgba(0, 0, 0, .7);
}
.brand img { background: transparent; padding: 0; border-radius: 8px; box-shadow: 0 0 0 1px rgba(34, 211, 238, .35), 0 4px 14px rgba(0, 0, 0, .35); }
.brand-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16.5px; letter-spacing: 0; }
.brand-sub { font-size: 10px; letter-spacing: 1.4px; opacity: .7; color: #A5F3FC; }
.brand-led {
  width: 7px; height: 7px; border-radius: 50%; background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .2), 0 0 8px #22C55E; animation: led 2.4s ease-in-out infinite;
}
@keyframes led { 50% { opacity: .45; box-shadow: 0 0 0 2px rgba(34, 197, 94, .15), 0 0 2px #22C55E; } }
#btnLogout { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .3px; }
#btnLogout.hidden { display: none; }
#btnLogout svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---- menu atas (HP/tablet) ---- */
.mainnav button { border-radius: 8px; border-color: rgba(148, 197, 255, .14); background: rgba(255,255,255,.04); }
.mainnav button.on { background: rgba(34, 211, 238, .14); color: #E0FBFF; border-color: rgba(34, 211, 238, .55); box-shadow: inset 0 -2px 0 #22D3EE; }
.mainnav button.on svg { color: #22D3EE; }

/* ---- sidebar komputer ---- */
@media (min-width: 960px) {
  .mainnav { background: linear-gradient(180deg, #0B1220 0%, #0C1A2E 100%); border-right: 1px solid rgba(34, 211, 238, .12); }
  .mainnav::before { content: "// NAVIGASI"; font-family: var(--mono); color: rgba(165, 243, 252, .55); letter-spacing: 1.5px; font-size: 10.5px; }
  .mainnav button { border-radius: 8px; color: rgba(226, 232, 240, .78); background: transparent; border: 0; }
  .mainnav button:hover { background: rgba(34, 211, 238, .07); color: #fff; }
  .mainnav button.on { background: rgba(34, 211, 238, .11); color: #fff; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .22); }
  .mainnav button.on::before { background: #22D3EE; box-shadow: 0 0 10px #22D3EE; }
  .mainnav button.on svg { color: #22D3EE; }
}
@media (min-width: 960px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mainnav { background: linear-gradient(180deg, #05080F 0%, #08111F 100%); }
}

/* ---- kartu, seksi, input, tombol ---- */
.card { border-radius: var(--radius); }
.section-title { font-size: 15px; font-weight: 700; }
.section-title .num {
  width: 26px; height: 26px; border-radius: 6px; font-size: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(6, 182, 212, .35);
}
.field input, .field textarea, .field select, .asset-bar input, .filters input[type="search"], .item .remarks input,
.affix, .count, .ro-val { border-radius: 8px; }
.item { border-radius: 10px; }
.seg { border-radius: 9px; }
.seg button { border-radius: 7px; font-size: 12px; letter-spacing: .5px; }
.btn-primary { border-radius: 10px; letter-spacing: .2px; }
.btn-secondary, .btn-scan, .btn-tool, .load-more, main .btn-ghost { border-radius: 8px; }
.subtabs { border-radius: 10px; }
.subtabs button { border-radius: 7px; }
.rec, .day-group, .asset-results, .asset-chosen, .photo-pick, .fix-card, .modal-box { border-radius: 12px; }
.rec:hover { border-color: rgba(6, 182, 212, .45); }
.chip { border-radius: 8px; }
.login-logo { border-radius: 10px; }
.spinner { background: conic-gradient(from 0deg, transparent 0 25%, var(--cyan) 100%); }
.msg.warn-msg { background: rgba(245, 158, 11, .12); color: #92400E; border: 1px solid rgba(245, 158, 11, .3); font-size: 13px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .msg.warn-msg { color: #FCD34D; }
}

/* =====================================================================
 *  DASHBOARD
 * ===================================================================== */
#app:has(#viewDash:not(.hidden)) { max-width: 1180px; }
.eyebrow { display: block; font-size: 10.5px; letter-spacing: 1.6px; color: var(--cyan); font-weight: 600; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.dash-head h2 { margin: 2px 0; font-size: 22px; }
.dash-tools { display: flex; gap: 8px; align-items: stretch; }
.dash-tools input[type="month"] {
  font: inherit; font-family: var(--mono); font-size: 14px; color: var(--text); background: var(--input);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 42px;
}
.dash-tools input[type="month"]:focus { outline: none; border-color: var(--cyan); box-shadow: var(--ring); }
.dash-tools .btn-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px 11px; box-shadow: var(--shadow); min-width: 0; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.kpi-ok::before { background: var(--ok); }
.kpi-warn::before { background: #F59E0B; }
.kpi-bad::before { background: var(--no); }
.kpi-info::before { background: var(--cyan); }
.kpi-label { font-size: 10.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 24px; font-weight: 700; line-height: 1.2; margin-top: 4px; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-ok .kpi-value { color: var(--ok); }
.kpi-bad .kpi-value { color: var(--no); }
.kpi-warn .kpi-value { color: var(--warn); }
.kpi-top { grid-template-columns: repeat(4, 1fr); }
.kpi-top .kpi { padding: 14px 16px; background: linear-gradient(180deg, var(--card), var(--input)); }
.kpi-top .kpi-value { font-size: 28px; }

.dash-sec { margin-top: 22px; }
.dash-sec-head { display: flex; align-items: center; gap: 12px; margin: 0 2px 12px; }
.dash-sec-head h3 { margin: 0; font-size: 17px; }
.dash-ico {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: #0B1220; color: #22D3EE; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .35), 0 6px 14px -8px rgba(6, 182, 212, .8);
}
.dash-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; align-items: start; }
@media (min-width: 760px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid .span-all { grid-column: 1 / -1; }
}
.dash-grid .chart-card + .chart-card { margin-top: 0; }
.dash-empty { padding: 30px 0; }

.meters { display: flex; flex-direction: column; gap: 11px; margin-top: 8px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.meter-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-val { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.meter-bar { height: 7px; border-radius: 4px; background: var(--input); box-shadow: inset 0 0 0 1px var(--line); margin: 5px 0 3px; overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 4px; background: var(--cyan); }
.meter-fill.ok { background: linear-gradient(90deg, #16A34A, #4ADE80); }
.meter-fill.warn { background: linear-gradient(90deg, #D97706, #FBBF24); }
.meter-fill.bad { background: linear-gradient(90deg, #B91C1C, #F87171); }
.meter-sub { font-size: 11.5px; color: var(--muted); }

.dash-list { display: flex; flex-direction: column; margin-top: 6px; }
.dash-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.dash-row:first-child { border-top: 0; }
.dash-row-k { font-size: 11.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.dash-row-main { min-width: 0; }
.dash-row-t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dash-row-s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row .badge { white-space: nowrap; }
.dash-list-empty { font-size: 13px; color: var(--ok); padding: 14px 0 4px; }
.dash-more { width: 100%; margin-top: 10px; }

@media (max-width: 640px) {
  .kpi-top { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 20px; }
  .kpi-top .kpi-value { font-size: 23px; }
  .dash-tools { width: 100%; }
  .dash-tools input[type="month"] { flex: 1; min-width: 0; }
}
