:root {
  --navy-950: #061430;
  --navy-900: #0a1f46;
  --navy-800: #102b5e;
  --navy-700: #1a3c7a;
  --cobalt: #2458d6;
  --cobalt-dark: #1a44ad;
  --sky: #9cbcff;
  --sky-soft: #dce7fc;
  --ice: #eef3fb;
  --ink: #0c1b36;
  --muted: #5a6b8c;
  --line: #d5dfef;
  --line-strong: #b8c7e2;
  --red: #c0393b;
  --red-soft: #fbe9e9;
  --radius: 14px;
  --grid: linear-gradient(rgba(156, 188, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(156, 188, 255, .07) 1px, transparent 1px);
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--ice); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { min-height: 100vh; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sky); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 14px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: #fff; }
.brand-mark { position: relative; width: 22px; height: 28px; margin-left: 6px; }
.brand-logo { height: 26px; width: auto; margin-left: 6px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .28); }
.brand-mark::before, .brand-mark::after { content: ''; position: absolute; inset: 0; border-radius: 4px; }
.brand-mark::before { background: var(--sky); opacity: .5; transform: translate(-6px, 3px) rotate(-9deg); }
.brand-mark::after { background: linear-gradient(var(--cobalt) 0 0) 5px 8px / 12px 2px no-repeat, linear-gradient(var(--line-strong) 0 0) 5px 14px / 10px 2px no-repeat, linear-gradient(var(--line-strong) 0 0) 5px 20px / 7px 2px no-repeat, #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 12px 18px; font-size: 14px; font-weight: 700; transition: background .15s, border-color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--cobalt); color: #fff; box-shadow: 0 8px 18px -8px rgba(36, 88, 214, .8); }
.btn-primary:hover:not(:disabled) { background: var(--cobalt-dark); }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: var(--sky-soft); }
.btn-light span { font-size: 20px; font-weight: 500; line-height: 0; }
.btn-quiet { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.btn-quiet:hover { color: var(--ink); border-color: var(--line-strong); }
.btn-reject { background: #fff; color: var(--red); border: 1px solid #efc9c9; }
.btn-reject:hover:not(:disabled) { background: var(--red-soft); }
.btn-block { width: 100%; margin-top: 6px; }

/* Fields */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; }
.field label span { color: var(--cobalt); }
.field input, .field select { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field select { appearance: none; padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%235a6b8c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 15px center; }
.field input:focus, .field select:focus { border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(36, 88, 214, .14); }
.field input:disabled { background: var(--ice); color: var(--muted); }
.field .mono-input { font-family: var(--mono); font-size: 14px; }
.field-hint { font-size: 12px; line-height: 1.5; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 10px; margin: -4px 0 18px; font-size: 13px; color: var(--navy-800); cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--cobalt); flex: none; }
.field-label { font-size: 13px; font-weight: 600; }
.field-label .req { color: var(--cobalt); }
.field textarea { width: 100%; min-height: 84px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; outline: none; resize: vertical; line-height: 1.45; transition: border-color .15s, box-shadow .15s; }
.field textarea:focus { border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(36, 88, 214, .14); }
.field input:read-only:not([type="date"]) { background: var(--ice); color: var(--navy-800); }
.optional { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 500; }

/* Pilihan Dokumen / Barang */
.section-nav { display: flex; gap: 6px; padding: 16px 0 0; }
.section-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid rgba(156, 188, 255, .3); border-radius: 999px; background: transparent; color: #dbe6fb; font-size: 14px; font-weight: 600; }
.section-btn:hover { background: rgba(156, 188, 255, .12); }
.section-btn[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--navy-900); }
.section-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--cobalt); color: #fff; font-family: var(--mono); font-size: 11px; text-align: center; }
.section-btn[aria-pressed="true"] .section-count { background: var(--cobalt); }
.tally .is-warn dd { color: #ffb4a8; }
.tally dd small { display: block; margin-top: 2px; font-family: var(--sans); font-size: 12px; font-weight: 600; color: #ffb4a8; }

/* Barang */
.item-name { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.item-meta .qty, .item-meta .serial { padding: 2px 8px; border-radius: 6px; background: var(--ice); color: var(--navy-800); font-size: 11px; font-weight: 600; }
.item-meta .serial { font-family: var(--mono); font-weight: 500; }
.loan { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.loan-permanent { background: var(--ice); color: var(--muted); }
.loan-open { background: #fff3d6; color: #8a5a00; }
.loan-overdue { background: var(--red-soft); color: var(--red); }
.loan-returned { background: #dff3e6; color: #1f6b3a; }
.link-btn.return-btn { margin: 0; padding: 2px 4px; color: var(--cobalt); font-size: 12px; }
.link-btn.return-btn:hover { text-decoration: underline; }
.entry.is-overdue { box-shadow: inset 4px 0 0 var(--red); }

.credit { padding: 8px 16px 28px; color: var(--muted); font-size: 12px; text-align: center; }
.credit b { font-weight: 700; }
.auth .credit { width: 100%; margin-top: 8px; color: #8fa3cc; }
.auth .credit b { color: #dbe6fb; }

/* Jenis dokumen */
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-mark { flex: none; width: 18px; height: 18px; border: 2px solid var(--line-strong); border-radius: 50%; transition: border .15s; }
.radio-text { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
.radio-text small { display: block; margin-top: 1px; color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.radio:hover { border-color: var(--line-strong); }
.radio:has(input:checked) { border-color: var(--cobalt); background: #f1f5ff; }
.radio:has(input:checked) .radio-mark { border: 6px solid var(--cobalt); }
.radio:has(input:checked) .radio-text small { color: var(--cobalt-dark); }
.radio:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Kotak cari penerima */
.combo { position: relative; }
.combo input[role="combobox"] { padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235a6b8c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m14 14-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 14px center; }
.combo input.is-chosen { border-color: var(--cobalt); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%232458d6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8.5 3.5 3.5L13 5'/%3E%3C/svg%3E"); font-weight: 600; }
.combo-list { max-height: 232px; margin: 6px 0 0; padding: 6px; overflow-y: auto; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 30px -12px rgba(6, 20, 48, .3); }
.combo-list li { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.combo-list li:hover, .combo-list li.is-active { background: var(--sky-soft); }
.combo-list strong { display: block; font-size: 14px; }
.combo-list small { display: block; color: var(--muted); font-size: 12px; }
.combo-list mark { background: #ffe9a8; color: inherit; border-radius: 2px; }
.combo-avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--navy-900); color: #fff; font-size: 13px; font-weight: 700; }
.combo-check { margin-left: auto; color: var(--cobalt); font-weight: 800; }
.combo-empty { color: var(--muted); font-size: 13px; cursor: default; }
.combo-empty:hover { background: transparent; }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background-color: var(--navy-900); background-image: var(--grid); background-size: 36px 36px; color: #fff; }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 44px clamp(24px, 6vw, 88px); }
.auth-copy h1 { max-width: 12ch; margin: 18px 0 20px; font-size: clamp(38px, 5.2vw, 66px); font-weight: 800; line-height: 1.02; letter-spacing: -.035em; }
.auth-copy h1 em { font-style: normal; color: var(--sky); background: linear-gradient(transparent 64%, rgba(36, 88, 214, .6) 64% 92%, transparent 92%); }
.auth-copy p:last-child { max-width: 44ch; margin: 0; color: #b9c9e8; font-size: 16px; line-height: 1.65; }
.auth-steps { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0; padding: 0; list-style: none; color: #cfdbf3; font-size: 14px; }
.auth-steps li { display: flex; align-items: center; gap: 10px; }
.auth-steps b { padding: 3px 6px; border: 1px solid rgba(156, 188, 255, .35); border-radius: 6px; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--sky); }
.auth-panel { display: grid; place-items: center; align-content: center; padding: 40px 24px; }
.slip { width: min(100%, 420px); padding: 0 32px 28px; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); }
.slip-head { position: relative; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 26px; padding: 18px 0; border-bottom: 2px dashed var(--line); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.slip-head::before, .slip-head::after { content: ''; position: absolute; bottom: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--navy-900); }
.slip-head::before { left: -43px; }
.slip-head::after { right: -43px; }
.slip h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.03em; }
.slip-lead { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.demo-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.demo-accounts ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.demo-accounts button { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--ice); color: var(--navy-800); font-family: var(--mono); font-size: 12px; }
.demo-accounts button:hover { border-color: var(--cobalt); color: var(--cobalt); }

/* Masthead */
.masthead { padding: 0 clamp(16px, 5vw, 64px); background-color: var(--navy-900); background-image: var(--grid); background-size: 36px 36px; color: #fff; }
.masthead-inner, .board { max-width: 1180px; margin: 0 auto; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid rgba(156, 188, 255, .14); }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.who strong { display: block; font-weight: 700; }
.who small { color: #9fb3d9; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--cobalt); font-weight: 800; }
.logout { margin-left: 4px; padding: 7px 12px; border: 1px solid rgba(156, 188, 255, .3); border-radius: 8px; background: transparent; color: #dbe6fb; font-size: 12px; font-weight: 600; }
.logout:hover { background: rgba(156, 188, 255, .12); }
/* Pilihan bahasa: ID / EN */
.lang-switch { display: inline-flex; margin-left: 8px; padding: 2px; border: 1px solid rgba(156, 188, 255, .3); border-radius: 8px; }
.lang-switch button { padding: 5px 9px; border: 0; border-radius: 6px; background: transparent; color: #9fb3d9; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.lang-switch button:hover { color: #fff; }
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--navy-900); }
.auth-tools { display: flex; justify-content: flex-end; width: min(100%, 420px); margin-bottom: 14px; }
.auth-tools .lang-switch { margin: 0; }
.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 44px 0 34px; }
.hero h1 { margin: 12px 0 10px; font-size: clamp(32px, 4.4vw, 50px); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
.hero-sub { margin: 0; color: #b9c9e8; font-size: 15px; }
.hero-sub b { color: #fff; }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid rgba(156, 188, 255, .14); }
.tally div { padding: 20px 20px 24px; border-left: 1px solid rgba(156, 188, 255, .14); }
.tally div:first-child { padding-left: 0; border-left: 0; }
.tally dt { color: #9fb3d9; font-size: 12px; font-weight: 600; }
.tally dd { margin: 8px 0 0; font-family: var(--mono); font-size: 34px; font-weight: 500; letter-spacing: -.03em; }
.tally .is-hot dd { color: var(--sky); }

/* Board */
.board-wrap { padding: 0 clamp(16px, 5vw, 64px); }
.board { padding: 28px 0 64px; }
.board-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; max-width: 100%; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tab { display: flex; align-items: center; gap: 7px; padding: 8px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--navy-900); color: #fff; }
.tab-count { padding: 1px 6px; border-radius: 6px; background: var(--ice); color: var(--navy-700); font-family: var(--mono); font-size: 11px; }
.tab[aria-pressed="true"] .tab-count { background: rgba(156, 188, 255, .2); color: var(--sky-soft); }
.search { position: relative; flex: 0 1 300px; min-width: 0; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: 11px 14px 11px 38px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; outline: none; }
.search input:focus { border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(36, 88, 214, .14); }

.ledger { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.entry { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.6fr) 118px 210px; grid-template-areas: "doc route date status"; align-items: center; gap: 20px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.entry.is-action { border-color: #a9c1f3; background: linear-gradient(90deg, #f1f5ff, #fff 65%); box-shadow: inset 4px 0 0 var(--cobalt); }
.entry small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.entry-doc { grid-area: doc; }
.doc-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.doc-no { min-width: 0; padding: 2px 7px; overflow: hidden; border-radius: 6px; background: var(--ice); color: var(--cobalt-dark); font-family: var(--mono); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.direction { flex: none; color: var(--muted); font-size: 11px; font-weight: 700; }
.entry-doc strong { display: block; font-size: 15px; line-height: 1.35; }
.route { grid-area: route; display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 8px; }
.route span { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.route em { display: block; color: var(--muted); font-size: 12px; font-style: normal; }
.route-arrow { position: relative; height: 2px; background: var(--line-strong); }
.route-arrow::after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-right: 0; border-left: 6px solid var(--line-strong); }
.entry-date { grid-area: date; }
.entry-date span { font-size: 14px; font-weight: 600; }
.entry-status { grid-area: status; display: flex; justify-content: flex-end; }
.stamp { display: inline-grid; justify-items: center; gap: 2px; padding: 6px 12px; border: 2px solid currentColor; border-radius: 8px; outline: 1px solid currentColor; outline-offset: 2px; color: var(--cobalt); line-height: 1.1; text-transform: uppercase; transform: rotate(-3deg); }
.stamp b { font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.stamp i { font-family: var(--mono); font-size: 10px; font-style: normal; text-transform: none; opacity: .85; }
.stamp-rejected { color: var(--red); transform: rotate(2deg); }
.stamp-pending { color: var(--muted); border-style: dashed; outline: 0; transform: none; }
.decide-wrap small { text-align: right; }
.decide { display: flex; justify-content: flex-end; gap: 8px; }
.decide .btn { padding: 9px 15px; font-size: 13px; }
.empty { padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--muted); text-align: center; font-size: 14px; }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 16px; }

/* Sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: flex-end; background: rgba(6, 20, 48, .55); backdrop-filter: blur(3px); animation: fade .2s ease-out; }
.sheet { display: flex; flex-direction: column; width: min(100%, 520px); height: 100%; background: var(--ice); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .5); animation: slide-in .28s cubic-bezier(.2, .8, .2, 1); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 26px 28px 22px; background-color: var(--navy-900); background-image: var(--grid); background-size: 36px 36px; color: #fff; }
.sheet-head h2 { margin: 8px 0 0; font-size: 24px; letter-spacing: -.025em; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid rgba(156, 188, 255, .3); border-radius: 10px; background: transparent; color: #fff; font-size: 22px; line-height: 1; }
.icon-btn:hover { background: rgba(156, 188, 255, .14); }
.sheet-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sheet-body { flex: 1; padding: 24px 28px 8px; overflow-y: auto; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line); background: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.section-label { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scan-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--sky-soft); color: var(--cobalt); }
.capture-card { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #fff; }
.capture-card.has-photo { border-style: solid; }
.capture-card strong { display: block; font-size: 14px; }
.capture-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.capture-thumb { flex: none; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; }
.link-btn { flex: none; margin-left: auto; padding: 6px; border: 0; background: transparent; color: var(--red); font-size: 13px; font-weight: 600; }
.input-scan { display: flex; gap: 8px; }
.input-scan input { flex: 1; min-width: 0; }
.scan-btn { display: grid; place-items: center; flex: none; width: 48px; border: 1px solid #bcd0f7; border-radius: 10px; background: var(--sky-soft); color: var(--cobalt); transition: background .15s, border-color .15s; }
.scan-btn:hover { border-color: var(--cobalt); background: #cddcfb; }
.scan-note { font-size: 12px; line-height: 1.45; }
.scan-note:empty { display: none; }
.scan-note.is-ok { color: var(--cobalt-dark); }
.scan-note.is-low { color: #9a5b00; }

/* Pemilih area teks */
.crop-backdrop { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--navy-950); color: #fff; animation: fade .2s ease-out; }
.crop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 6px; }
.crop-head h2 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; }
.crop-hint { margin: 0; padding: 0 20px 10px; color: #b9c9e8; font-size: 14px; }
.crop-stage { display: flex; flex: 1; min-height: 0; padding: 8px 20px; overflow: auto; overscroll-behavior: contain; }
.crop-frame { position: relative; flex: none; margin: auto; overflow: hidden; border-radius: 6px; line-height: 0; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-tools { display: flex; align-items: center; gap: 16px; padding: 10px 20px 0; }
.zoom-group { display: flex; flex: none; align-items: center; gap: 2px; border: 1px solid rgba(156, 188, 255, .3); border-radius: 10px; }
.zoom-group button { width: 40px; height: 38px; border: 0; background: transparent; color: #fff; font-size: 20px; line-height: 1; }
.zoom-group button:hover { background: rgba(156, 188, 255, .12); }
.zoom-level { min-width: 46px; color: var(--sky); font-family: var(--mono); font-size: 12px; text-align: center; }
.crop-preview-wrap { flex: 1; min-width: 0; }
.crop-preview-wrap small { display: block; margin-bottom: 4px; color: #9fb3d9; font-size: 11px; font-weight: 600; }
.crop-preview { display: block; width: 100%; height: 56px; border-radius: 6px; background: #fff; object-fit: contain; }
.crop-canvas { display: block; }
.crop-box { position: absolute; border: 2px solid #fff; outline: 1px solid rgba(36, 88, 214, .9); box-shadow: 0 0 0 9999px rgba(6, 20, 48, .62); cursor: move; }
.crop-handle { position: absolute; width: 30px; height: 30px; }
.crop-handle::after { content: ''; position: absolute; left: 8px; top: 8px; width: 14px; height: 14px; border: 2px solid var(--cobalt); border-radius: 4px; background: #fff; }
.crop-handle[data-handle="nw"] { left: -15px; top: -15px; cursor: nwse-resize; }
.crop-handle[data-handle="ne"] { right: -15px; top: -15px; cursor: nesw-resize; }
.crop-handle[data-handle="sw"] { left: -15px; bottom: -15px; cursor: nesw-resize; }
.crop-handle[data-handle="se"] { right: -15px; bottom: -15px; cursor: nwse-resize; }
.crop-status { min-height: 20px; margin: 0; padding: 4px 20px 0; color: var(--sky); font-size: 13px; text-align: center; }
.crop-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
/* Foto bukti penerimaan (kamera depan) */
.selfie-stage { position: relative; display: grid; place-items: center; flex: 1; min-height: 0; margin: 8px 20px; overflow: hidden; border-radius: 14px; background: #000; }
.selfie-video, .selfie-shot { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Indikator tarik-untuk-memperbarui: muncul dari atas layar sejauh jarak tarikan (--pull). */
.pull-indicator { position: fixed; top: 0; left: 50%; z-index: 25; transform: translate(-50%, calc(var(--pull, 0px) - 100%)); padding: 8px 14px; border-radius: 0 0 12px 12px; background: #fff; color: var(--navy-900); font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .45); pointer-events: none; }
.pull-indicator.is-ready { color: var(--cobalt); }
.pull-indicator.is-busy { transform: translate(-50%, 12px); }
.selfie-video.is-mirrored { transform: scaleX(-1); }
.selfie-flip { position: absolute; right: 12px; bottom: 12px; background: rgba(6, 20, 48, .7); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.selfie-guide { position: absolute; width: min(58%, 260px); aspect-ratio: 3 / 4; border: 2px dashed rgba(156, 188, 255, .8); border-radius: 50% / 45%; pointer-events: none; }
/* Isian tambahan di dialog kamera (kondisi barang saat pengembalian), muncul setelah foto diambil. */
.camera-extra { flex: none; max-height: 46vh; margin: 4px 20px 0; overflow: auto; }
.camera-extra .field { margin-bottom: 12px; }
.camera-extra .field > label, .camera-extra .field-label { color: #dbe6fb; }
.camera-extra .field > label span, .camera-extra .field-label .req { color: var(--sky); }
.camera-extra .radio { color: var(--ink); }
.camera-extra .field textarea { min-height: 72px; color: var(--ink); }
.item-meta .return-note { flex-basis: 100%; color: var(--muted); font-size: 12px; line-height: 1.4; white-space: pre-line; }
.status-wrap { display: inline-flex; align-items: center; gap: 12px; }
.proof-thumb { padding: 0; border: 2px solid #fff; border-radius: 8px; background: none; box-shadow: 0 0 0 1px var(--line-strong); overflow: hidden; line-height: 0; }
.proof-thumb img { display: block; width: 40px; height: 40px; object-fit: cover; }
.proof-thumb:hover { box-shadow: 0 0 0 2px var(--cobalt); }
.lightbox { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: rgba(6, 20, 48, .82); animation: fade .2s ease-out; }
.lightbox figure { margin: 0; max-width: min(100%, 520px); }
.lightbox img { display: block; max-width: 100%; max-height: 70vh; border-radius: 12px; }
.lightbox figcaption { margin-top: 12px; color: #dbe6fb; font-size: 14px; text-align: center; }
.lightbox .icon-btn { position: absolute; top: 18px; right: 18px; }
.dialog { width: min(100%, 400px); padding: 24px; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); }
.dialog h2 { margin: 6px 0 6px; font-size: 22px; letter-spacing: -.02em; }
.dialog .slip-lead { margin-bottom: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.btn-ghost { border: 1px solid rgba(156, 188, 255, .35); background: transparent; color: #dbe6fb; }
.btn-ghost:hover { background: rgba(156, 188, 255, .12); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--navy-900); color: #fff; font-size: 14px; box-shadow: 0 16px 40px -12px rgba(6, 20, 48, .6); transform: translateX(-50%); animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { opacity: .4; transform: translateX(40px); } }
@keyframes slide-up { from { opacity: .4; transform: translateY(40px); } }

@media (max-width: 1000px) {
  .entry { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "doc status" "route date"; gap: 16px 20px; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-intro { gap: 32px; padding: 28px 24px 8px; }
  .auth-copy h1 { font-size: 40px; }
  .auth-panel { padding: 24px 16px 40px; }
  .tally { grid-template-columns: repeat(2, 1fr); }
  .tally div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .tally div:nth-child(n + 3) { border-top: 1px solid rgba(156, 188, 255, .14); }
}
@media (max-width: 640px) {
  .auth-steps { display: none; }
  .slip { padding: 0 22px 24px; }
  .slip-head::before { left: -33px; }
  .slip-head::after { right: -33px; }
  .who-text { display: none; }
  /* Ponsel: tombol Keluar pindah ke bawah saklar ID/EN agar bilah atas tidak terlalu panjang. */
  .who { display: grid; grid-template-columns: auto auto; grid-template-areas: "avatar lang" "avatar logout"; column-gap: 12px; row-gap: 6px; align-items: center; }
  .who .avatar { grid-area: avatar; }
  .who .lang-switch { grid-area: lang; margin-left: 0; justify-self: stretch; justify-content: center; }
  .who .logout { grid-area: logout; margin-left: 0; width: 100%; text-align: center; }
  .hero { padding: 24px 0 24px; }
  .section-nav { padding-top: 12px; }
  .section-btn { flex: 1; justify-content: center; }
  .hero .btn { width: 100%; }
  .tally div { padding: 16px 12px 18px; }
  .tally dd { font-size: 26px; }
  .search { flex: 1 1 100%; }
  .entry { grid-template-columns: 1fr; grid-template-areas: "doc" "route" "date" "status"; padding: 16px; }
  .entry-status { justify-content: flex-start; }
  .decide-wrap { width: 100%; }
  .decide-wrap small { text-align: left; }
  .decide .btn { flex: 1; }
  .sheet-backdrop { align-items: flex-end; }
  .sheet { height: auto; max-height: 94vh; border-radius: 18px 18px 0 0; overflow: hidden; animation-name: slide-up; }
  .sheet-head, .sheet-body, .sheet-foot { padding-left: 20px; padding-right: 20px; }
  .sheet-foot .btn { flex: 1; }
  .form-row { grid-template-columns: 1fr; }
  .crop-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
