/* ============================================================
   LPR - Garasi — Tema Modern VibeCoder
   ============================================================ */
:root {
    --ink: #0F2E36;
    --muted: #5B7C84;
    --indigo: #05F2F2;      /* warna utama (solid, tanpa gradasi) */
    --violet: #0B8A94;      /* aksen tua (utk teks & garis) */
    --pink: #7FF7F7;
    --sky: #0EA5E9;
    --emerald: #10B981;
    --amber: #F59E0B;
    --rose: #F43F5E;
    --grad: #05F2F2;        /* SOLID — tanpa gradasi */
    --glass: rgba(255, 255, 255, 0.62);
    --glass-brd: rgba(255, 255, 255, 0.85);
    --line: rgba(11, 122, 138, 0.20);
    --radius: 16px;
    --shadow: 0 10px 26px rgba(5, 180, 190, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: #F2FDFD;

    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 20px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
}
.sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
    display: flex;
    flex-direction: column;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-brd);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 20px 14px 16px;
    min-height: calc(100vh - 40px);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 2px 8px 18px; }
.logo {
    width: 44px; height: 44px; border-radius: 13px;
    background: var(--grad);
    color: var(--ink); font-weight: 800; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 18px rgba(5, 180, 190, 0.35);
    letter-spacing: .5px;
}
.brand-t { font-weight: 800; font-size: 15.5px; line-height: 1.15; }
.brand-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.nav-group[open] { padding-bottom: 0; }
.nav-group-label {
    padding: 0;
    font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .9px;
    color: var(--muted);
}
.nav-group-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%;
    padding: 9px 12px 3px;
    background: none; border: none; cursor: pointer;
    font: inherit; text-align: left; color: inherit;
    border-radius: 10px;
    list-style: none;
    transition: background .15s;
}
.nav-group-toggle::-webkit-details-marker { display: none; }
.nav-group-toggle::marker { content: ''; display: none; }
.nav-group-toggle:hover { background: rgba(255, 255, 255, 0.55); }
.nav-chev {
    font-size: 11px; color: var(--muted);
    transition: transform .2s ease;
}
/* tertutup (native <details> tanpa [open]) → panah menghadap kanan */
.nav-group:not([open]) .nav-chev { transform: rotate(-90deg); }
.nav-group-body { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.nav-group:not([open]) .nav-group-body { display: none; }
.nav-item.nav-sub { padding-left: 20px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10.5px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--ink);
    font-size: 14px; font-weight: 600;
    transition: background .15s, transform .05s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.75); }
.nav-item.is-act {
    background: var(--grad);
    color: var(--ink);
    box-shadow: 0 8px 18px rgba(5, 180, 190, 0.32);
}
.nav-ico { font-size: 17px; width: 22px; text-align: center; }
.side-foot {
    margin-top: auto; padding: 14px 10px 0;
    border-top: 1px solid var(--line);
    color: var(--muted); font-size: 11.5px; line-height: 1.5;
}

.main { min-width: 0; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    flex-wrap: wrap;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-brd);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 14px 20px;
    margin-bottom: 20px;
}
.tb-title { font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.tb-title .crumb { color: var(--muted); }
.tb-title .sep { color: #C3E5E8; }
.tb-user { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tb-date { font-size: 13px; color: var(--muted); }
.chip-user { display: flex; align-items: center; gap: 10px; }
.ava {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--grad); color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
    box-shadow: 0 6px 14px rgba(5, 180, 190, 0.3);
}
.cu-txt { display: flex; flex-direction: column; line-height: 1.2; }
.cu-name { font-weight: 700; font-size: 13.5px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-role { font-size: 11px; color: var(--muted); }
.cu-role.is-admin { color: var(--violet); font-weight: 700; }

/* ---------- Page ---------- */
.page { display: flex; flex-direction: column; gap: 24px; padding-bottom: 30px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -0.3px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-brd);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-h h2 { margin: 0; font-size: 16.5px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.card-h .hint { font-size: 12.5px; color: var(--muted); }
.card-body { min-width: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-4, .grid-3, .grid-2, .grid-2-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2, .grid-2-1 { grid-template-columns: 1fr; } }

/* stat cards */
.stat {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-brd);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
}
.stat .st-label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; display: flex; justify-content: space-between; align-items: center; }
.stat .st-num { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; word-break: break-word; }
.stat .st-num.saldo-neg { color: var(--rose); }
.stat .st-num.saldo-pos { color: var(--emerald); }
.stat .st-num.saldo-nol { color: var(--ink); }
.stat .st-sub { font-size: 12px; color: var(--muted); }
.st-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 19px; background: rgba(255,255,255,.8); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px;
    border-radius: 11px;
    font-size: 13.5px; font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
    color: var(--ink);
    cursor: pointer;
    transition: filter .15s, transform .05s, box-shadow .15s;
    white-space: nowrap;
}
.btn:hover { filter: brightness(0.97); box-shadow: 0 6px 14px rgba(5,180,190,.14); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: var(--ink); border: none; box-shadow: 0 8px 18px rgba(5,180,190,.32); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { background: #FEE2E2; color: var(--rose); border: 1px solid rgba(244,63,94,.25); }
.btn-ghost { background: transparent; border: 1px dashed rgba(92,115,146,.4); color: var(--muted); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-logout { padding: 7px 12px; font-size: 12.5px; background: rgba(255,255,255,.7); }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.8);
    font-size: 14px; text-decoration: none; cursor: pointer;
    transition: all .15s;
}
.icon-btn:hover { background: var(--grad); color: var(--ink); border-color: transparent; }
.icon-btn.is-danger:hover { background: var(--rose); }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.tbl th {
    text-align: left; padding: 10px 12px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--muted); font-weight: 800;
    border-bottom: 1.5px solid var(--line);
    background: rgba(255,255,255,.5);
    white-space: nowrap;
}
.tbl td { padding: 10.5px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, 0.55); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .cnt { text-align: center; }
.tbl .acts { white-space: nowrap; display: flex; gap: 6px; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line); background: #E6FDFD; font-size: 14px; }
.mono-num { font-variant-numeric: tabular-nums; }

/* badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.b-ok   { background: #D1FAE5; color: #047857; }
.b-warn { background: #FEF3C7; color: #B45309; }
.b-danger { background: #FEE2E2; color: #BE123C; }
.b-info { background: #D5FAFA; color: #0B8A94; }
.b-muted{ background: rgba(92,115,146,.12); color: var(--muted); }
.b-lunas{ background: #D1FAE5; color: #047857; }
.b-tempo{ background: #FEF3C7; color: #B45309; }

/* status kedaluarsa cell */
.st-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.st-ok::before { background: var(--emerald); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.st-warn::before { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.st-danger::before { background: var(--rose); box-shadow: 0 0 0 3px rgba(244,63,94,.18); }
.st-none::before { background: #BEE3E6; }
.st-ok { color: #047857; } .st-warn { color: #B45309; } .st-danger { color: #BE123C; } .st-none { color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid .full { grid-column: auto; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field > label .req { color: var(--rose); }
.field .help { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email],
input[type=month], input[type=time], input[type=datetime-local], input[type=tel], input[type=search],
input[type=url], select, textarea {
    width: 100%;
    padding: 10px 13px;
    font: inherit; font-size: 14px;
    color: var(--ink);
    background: rgba(255,255,255,.78);
    border: 1.5px solid rgba(92,115,146,.22);
    border-radius: 11px;
    outline: none;
    transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 4px rgba(5, 180, 190, 0.14);
    background: #fff;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
input[readonly] { background: rgba(92,115,146,.08); }
.field .preview { font-weight: 800; font-size: 17px; color: var(--indigo); min-height: 22px; }

.input-group { display: flex; align-items: center; }
.input-group .ig-pre {
    padding: 10px 12px; border-radius: 11px 0 0 11px;
    background: var(--grad); color: var(--ink);
    font-size: 13px; font-weight: 700;
    border: 1.5px solid transparent;
}
.input-group input { border-radius: 0 11px 11px 0; }
.rupiah-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* file upload bon */
.bon-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bon-thumb { max-width: 170px; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 4px 12px rgba(5,180,190,.12); display: block; }
input[type=file] { font-size: 13px; }
input[type=file]::file-selector-button {
    font: inherit; font-weight: 700; border: none;
    background: var(--grad); color: var(--ink);
    padding: 8px 14px; border-radius: 9px; margin-right: 12px; cursor: pointer;
}
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--indigo); }

/* Work Order di dashboard: ikon berkedip */
@keyframes woBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .25; transform: scale(.85); }
}
.wo-blink { display: inline-block; animation: woBlink 1.15s infinite ease-in-out; }
.wo-card-head { display: flex; align-items: center; gap: 10px; }
.wo-row {
    display: flex; align-items: flex-start; gap: 13px;
    padding: 12px 2px; border-bottom: 1px dashed var(--line);
}
.wo-row:last-child { border-bottom: none; }
.wo-row .w-ico { flex: 0 0 auto; font-size: 21px; width: 40px; height: 40px; border-radius: 11px; background: #fff; box-shadow: 0 4px 10px rgba(5,180,190,.14); display: flex; align-items: center; justify-content: center; }
.wo-row .w-main { flex: 1; min-width: 0; }
.wo-row .w-t1 { font-weight: 800; font-size: 13.5px; line-height: 1.35; }
.wo-row .w-t2 { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.wo-row .w-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wo-remind { font-size: 12px; color: #B45309; font-weight: 700; display: inline-flex; gap: 5px; align-items: center; }
.wo-overdue { border-left: 3px solid var(--rose); padding-left: 12px; background: rgba(244,63,94,.06); }
.perm-sep {
    margin-top: 6px; padding: 8px 2px 2px;
    font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
    color: var(--muted);
}
.radio-row { display: flex; gap: 20px; align-items: center; padding-top: 6px; }
.radio-row label { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; cursor: pointer; }
.radio-row input[type=radio] { width: 17px; height: 17px; accent-color: var(--indigo); }
.radio-mini { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.radio-mini label { display: inline-flex; gap: 3px; align-items: center; font-size: 12px; margin-right: 3px; cursor: pointer; font-weight: 600; }
.radio-mini input[type=radio] { width: 14px; height: 14px; accent-color: var(--indigo); margin: 0; }

/* checkbox hak akses menu */
.perm-box { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.perm-item {
    display: flex; align-items: center; gap: 9px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--line);
    padding: 9px 12px;
    border-radius: 11px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: border .15s, box-shadow .15s;
}
.perm-item:hover { border-color: rgba(5,180,190,.5); box-shadow: 0 3px 10px rgba(5,180,190,.1); }
.perm-item:has(input:checked) { border-color: var(--indigo); background: #E2FCFC; }
.perm-ico { font-size: 15px; }
.perm-group.is-off { opacity: .55; }
.perm-group.is-off .perm-item { pointer-events: none; background: rgba(92,115,146,.06); border-style: dashed; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; border: 1px solid transparent; }
.alert-ok   { background: #D1FAE5; color: #065F46; border-color: rgba(16,185,129,.3); }
.alert-err  { background: #FEE2E2; color: #9F1239; border-color: rgba(244,63,94,.3); }
.alert-info { background: #D5FAFA; color: #0A7C86; border-color: rgba(5,180,190,.25); }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 16px; align-items: end; }
.toolbar .field { min-width: 0; }
.toolbar .field.grow { grid-column: span 2; }
.toolbar .field > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar .btn, .toolbar .toolbar-actions { justify-self: start; }
.toolbar-spacer { display: none; }
@media (max-width: 900px) { .toolbar .field.grow { grid-column: 1 / -1; } }
@media (max-width: 640px) { .toolbar { grid-template-columns: 1fr; } }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; }
.pg {
    min-width: 32px; height: 32px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; border: 1px solid var(--line);
    background: rgba(255,255,255,.85); color: var(--ink);
    font-size: 13px; font-weight: 700; text-decoration: none;
}
.pg:hover { background: #fff; box-shadow: 0 4px 10px rgba(5,180,190,.15); }
.pg.is-act { background: var(--grad); color: var(--ink); border-color: transparent; }
.pg.is-dis { opacity: .4; pointer-events: none; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.list-foot .info { font-size: 12.5px; color: var(--muted); }
.totalbar { display: flex; justify-content: flex-end; padding: 14px 18px; background: #E6FDFD; border-radius: 12px; }
.totalbar .tt { font-weight: 800; font-size: 14.5px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.totalbar .tt .ttl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.totalbar .tt .val { font-size: 20px; }

/* ---------- Empty state ---------- */
.empty-state {
    padding: 42px 20px; text-align: center;
    color: var(--muted); font-size: 14px; font-weight: 600;
}
.empty-ico { font-size: 40px; margin-bottom: 10px; }

/* ---------- Modal ---------- */
.modal-veil {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(31, 27, 58, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-veil[hidden] { display: none; }
.modal-box {
    position: relative;
    max-width: 560px; width: 100%; max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 30px 70px rgba(31,27,58,.4);
    animation: pop .18s ease;
}
.modal-box.is-lg { max-width: 1200px; width: min(1200px, 100%); }
.modal-x {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 32px; height: 32px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: var(--muted);
    cursor: pointer; font-size: 13px;
}
.modal-x:hover { background: #FEE2E2; color: var(--rose); }
.modal-body { min-width: 0; }
.modal-body .modal-title { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.modal-body .modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ringkasan (recap) */
.recap { display: flex; flex-direction: column; gap: 14px; }
.recap .rrow { display: flex; justify-content: space-between; gap: 14px; font-size: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.recap .rrow:last-child { border-bottom: none; padding-bottom: 0; }
.recap .rrow b { text-align: right; font-variant-numeric: tabular-nums; }
.recap .rlabel { color: var(--muted); font-weight: 600; }
.recap .big { font-size: 20px; font-weight: 800; }
.recap .bon-wrap { text-align: center; background: #F2FDFD; border-radius: 14px; padding: 14px; }
.bon-img { max-width: 100%; max-height: 66vh; border-radius: 10px; box-shadow: 0 10px 26px rgba(31,27,58,.25); }

/* chart area */
.chart-box { position: relative; height: 320px; }
.chart-box.sm { height: 240px; }
.chart-wrap canvas { max-width: 100%; }

/* doc warning list */
.warn-list { display: flex; flex-direction: column; }
.warn-row {
    display: flex; align-items: center; gap: 14px;
    padding: 11px 4px; border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}
.warn-row:last-child { border-bottom: none; }
.warn-row .w-ico { font-size: 20px; width: 34px; height: 34px; display:flex; align-items:center; justify-content:center; background:#fff; border-radius:10px; box-shadow:0 3px 8px rgba(5,180,190,.12); flex:0 0 auto;}
.warn-row .w-main { flex: 1; min-width: 0; }
.warn-row .w-t1 { font-weight: 800; font-size: 13px; }
.warn-row .w-t2 { font-size: 12px; color: var(--muted); }
.warn-row .w-date { text-align: right; font-weight: 700; font-size: 12.5px; white-space: nowrap; }

.login-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%; max-width: 410px;
    background: var(--glass);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid var(--glass-brd);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(5, 180, 190, 0.25);
    padding: 38px 34px 30px;
}
.login-card .logo-lg { display:flex; justify-content:center; margin-bottom: 14px; }
.login-card .logo-lg .logo { width: 62px; height: 62px; border-radius: 18px; font-size: 22px; }
.login-card h1 { text-align:center; font-size: 21px; margin: 0 0 3px; letter-spacing: -.3px; }
.login-card .lg-sub { text-align:center; color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 15px; }
.login-card .form-actions { margin-top: 18px; }
.login-card .form-actions .btn { width: 100%; padding: 12px; font-size: 14.5px; }
.login-card .lg-foot { text-align:center; margin-top: 18px; color: var(--muted); font-size: 11.5px; }

/* nav mobile (chips) vs desktop */
.nav-desk { display: flex; }
.nav-mob { display: none; }
.nav-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    font-size: 13px; font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.nav-chip.is-act { background: var(--grad); color: var(--ink); border-color: transparent; box-shadow: 0 6px 14px rgba(5,180,190,.3); }

/* Baris atas dashboard */
.grid > * { min-width: 0; } /* cegah isi (mis. tabel) memaksa kolom melebar */
.list-scroll { max-height: 400px; overflow-y: auto; padding-right: 4px; }
.list-scroll::-webkit-scrollbar { width: 8px; }
.list-scroll::-webkit-scrollbar-thumb { background: rgba(11, 122, 138, .25); border-radius: 8px; }

/* Barcode tampil ukuran asli */
.barcode-full { background: #fff; border-radius: 12px; padding: 16px; overflow: auto; max-height: 78vh; text-align: center; }
.barcode-full img { width: auto; height: auto; max-width: none; }

@media (max-width: 1100px) {
}

@media (max-width: 920px) {
    .layout { grid-template-columns: 1fr; padding: 10px; gap: 12px; }
    .main { min-width: 0; }
    .sidebar {
        position: static; min-height: 0;
        padding: 12px; gap: 8px;
        flex-direction: column; align-items: stretch;
        border-radius: 16px;
    }
    .brand { padding: 2px 4px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
    .brand-t { font-size: 15px; }
    .brand-s { display: none; }
    .nav-desk { display: none; }
    .nav-mob { display: flex; flex-direction: row; flex-wrap: wrap; gap: 7px; }
    .side-foot { display: none; }
    .tb-date { display: none; }
    .topbar { padding: 10px 14px; border-radius: 14px; margin-bottom: 14px; }
    .tb-title { font-size: 13.5px; }
    .cu-name { max-width: 120px; }
    .page { gap: 14px; padding-bottom: 20px; }
    .page-head h1 { font-size: 19px; }
    .page-head .sub { font-size: 12.5px; }
    .card { padding: 16px; border-radius: 14px; }
    .card-h h2 { font-size: 15px; }
    .form-grid { gap: 12px; }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4, .grid-2-1, .form-grid { grid-template-columns: 1fr; }
    .stat { padding: 13px 15px; }
    .stat .st-num { font-size: 21px; }
    .tbl th, .tbl td { padding: 8px 9px; font-size: 12.5px; }
    .toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
    .toolbar .field, .toolbar .field.grow { min-width: 0; width: 100%; }
    .toolbar .field > label { font-size: 12px; }
    .toolbar .btn { width: 100%; }
    .head-actions { width: 100%; }
    .head-actions .btn { flex: 1 1 auto; justify-content: center; }
    input[type=text], input[type=password], input[type=date], input[type=number], input[type=email],
    input[type=month], input[type=time], input[type=datetime-local], input[type=tel], select, textarea { font-size: 16px; } /* cegah zoom otomatis iOS */
    .form-actions .btn { flex: 1; justify-content: center; }
    .list-foot { flex-direction: column; align-items: flex-start; }
    .list-foot .pager { align-self: center; }
    .alert { font-size: 12.5px; padding: 10px 13px; }
    .totalbar { padding: 11px 13px; }
    .warn-row { gap: 10px; padding: 9px 2px; }
    .warn-row .w-t1 { font-size: 12.5px; }
    .login-body { padding: 14px; }
    .login-card { padding: 26px 20px 22px; border-radius: 20px; }
    .perm-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .modal-veil { padding: 10px; align-items: flex-end; }
    .modal-box { padding: 20px 16px; border-radius: 18px 18px 0 0; max-height: 92vh; }
    .wo-row { flex-wrap: wrap; }
    .wo-row .w-acts { width: 100%; justify-content: flex-end; }
    .chart-box { height: 240px; }
    .page-head .head-actions { margin-top: 4px; }
}
@media (max-width: 400px) {
    .perm-box { grid-template-columns: 1fr; }
}

/* ============================================================
   DR-FBC — komponen tambahan
   ============================================================ */
.brand-s { min-height: 14px; }

/* tombol/ikon WhatsApp */
.wa-btn { color: #2F6A4F; border-color: rgba(18,140,126,.35); background: #EAF4FC; font-size: 15px; }
.wa-btn:hover { background: #128C7E; color: #fff; border-color: transparent; }
.wa-off { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border-radius: 9px; border: 1px dashed var(--line); color: #B6DEE1; font-size: 13px; }
.btn-wa { background: #0F8F63; color: #fff; border: none; box-shadow: 0 8px 18px rgba(37,211,102,.32); }
.btn-wa:hover { filter: brightness(1.05); }
.btn-wa:disabled, .btn-wa.is-off { background: #CCE7EA; box-shadow: none; color: #5B7378; cursor: not-allowed; }

/* dialog "Apakah Anda nginap?" */
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
@media (max-width: 560px) { .pick-grid { grid-template-columns: 1fr; } }
.pick-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 22px 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(92,115,146,.22);
    background: rgba(255,255,255,.85);
    cursor: pointer; text-align: center; text-decoration: none; color: var(--ink);
    transition: border .15s, box-shadow .15s, transform .05s;
}
.pick-card:hover { border-color: var(--indigo); box-shadow: 0 10px 24px rgba(5,180,190,.18); }
.pick-card:active { transform: translateY(1px); }
.pick-card .pk-ico { font-size: 30px; }
.pick-card .pk-t { font-weight: 800; font-size: 15px; }
.pick-card .pk-s { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* blok kondisional form inap */
.cond-block {
    border: 1px solid var(--line);
    border-left: 4px solid var(--indigo);
    border-radius: 14px;
    background: rgba(255,255,255,.55);
    padding: 16px 18px;
    display: flex; flex-direction: column; gap: 14px;
}
.cond-block.is-bongkar { border-left-color: var(--violet); }
.cond-block .cb-title { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cond-block .cb-sub { font-size: 12px; color: var(--muted); margin-top: -8px; }
[hidden] { display: none !important; }

/* segmented kontrol (lokasi inap) */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 12px;
    border: 1.5px solid rgba(92,115,146,.22);
    background: rgba(255,255,255,.8);
    font-size: 13.5px; font-weight: 700; cursor: pointer;
    transition: border .15s, background .15s, box-shadow .15s;
}
.seg label:hover { border-color: rgba(5,180,190,.55); }
.seg input { width: 16px; height: 16px; accent-color: var(--indigo); margin: 0; }
.seg label.is-on { border-color: var(--indigo); background: #E2FCFC; box-shadow: 0 4px 12px rgba(5,180,190,.14); }

/* panel ringkasan biaya inap */
.cost-panel {
    border-radius: 16px; padding: 18px 20px;
    background: #E2FCFC;
    border: 1px solid rgba(5,180,190,.22);
    display: flex; flex-direction: column; gap: 12px;
}
.cost-panel .cp-title { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cost-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; align-items: baseline; }
.cost-row .cr-l { color: var(--muted); font-weight: 600; }
.cost-row .cr-v { font-weight: 800; font-variant-numeric: tabular-nums; }
.cost-panel .cp-total {
    display: flex; justify-content: space-between; align-items: baseline;
    border-top: 1.5px dashed rgba(5,180,190,.4); padding-top: 12px;
}
.cost-panel .cp-total .tt { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.cost-panel .cp-total .tv { font-size: 23px; font-weight: 800; color: var(--indigo); letter-spacing: -.5px; }

/* kartu aksi dashboard */
.act-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.act-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px; border-radius: 16px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-brd);
    box-shadow: var(--shadow);
    text-decoration: none; color: var(--ink);
    transition: transform .06s, box-shadow .15s;
}
.act-card:hover { box-shadow: 0 16px 34px rgba(5,180,190,.18); }
.act-card:active { transform: translateY(1px); }
.act-card .ac-ico {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 23px;
    background: var(--grad); color: var(--ink); box-shadow: 0 8px 18px rgba(5,180,190,.28);
}
.act-card .ac-t { font-weight: 800; font-size: 15px; }
.act-card .ac-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

/* header seksi dalam form */
.form-sec { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 12.5px;
    text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
    margin: 22px 0 14px; line-height: 1.4; }
.form-sec:first-child { margin-top: 0; }
.form-sec::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* baris tabel untuk laporan */
.cell-strong { font-weight: 700; }
.cell-sub { font-size: 12px; color: var(--muted); }
.doc-badge { display: inline-flex; align-items: center; gap: 6px; }

/* kartu pemilih sopir (login sopir) */
.self-card {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    border-radius: 16px; padding: 14px 18px;
    background: rgba(255,255,255,.6); border: 1px solid var(--glass-brd);
}
.self-card .sc-ava { width: 44px; height: 44px; border-radius: 14px; background: var(--grad); color: var(--ink);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }
.self-card .sc-t { font-weight: 800; font-size: 15px; }
.self-card .sc-s { font-size: 12.5px; color: var(--muted); }
.self-card .sc-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (max-width: 920px) {
    .brand-s { display: none; }
    .act-grid { gap: 12px; }
    .cost-panel { padding: 14px 15px; }
    .cost-panel .cp-total .tv { font-size: 20px; }
    .cond-block { padding: 13px 14px; }
    .seg label { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================
   MOBILE-FIRST PASS (≤920px & ≤640px)
   Tujuan: konten (tabel & tombol input) muncul cepat, tabel tidak
   perlu di-scroll ke samping, target sentuh cukup besar.
   Aturan di bawah sengaja diletakkan paling akhir agar menang.
   ============================================================ */

/* --- kolom aksi & tombol --- */
.acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.acts form { margin: 0; }

/* --- kotak tambah (dipakai sebagai fallback bila JS mati) --- */
.addbox { padding: 14px 16px; border: 1px dashed rgba(92,115,146,.4); border-radius: 14px; background: rgba(255,255,255,.5); }

/* --- collapsible panel (filter/keterangan) --- */
details.panel { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.5); }
details.panel > summary {
    list-style: none; cursor: pointer; padding: 12px 16px;
    font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 8px;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: '▾'; margin-left: auto; color: var(--muted); font-size: 12px; }
details.panel[open] > summary::after { content: '▴'; }
details.panel > .panel-body { padding: 0 16px 16px; }

/* --- empty state dengan tombol aksi --- */
.empty-state .es-act { margin-top: 14px; display: flex; justify-content: center; }

/* --- daftar ringkas master (kartu kecil di dashboard) --- */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.mini {
    display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
    padding: 14px 16px; border-radius: 14px;
    background: rgba(255,255,255,.62); border: 1px solid var(--glass-brd);
    box-shadow: 0 8px 20px rgba(5,180,190,.08);
}
.mini:active { transform: translateY(1px); }
.mini .mi { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: var(--grad); color: var(--ink); font-size: 19px; flex: 0 0 auto; }
.mini .mt { font-weight: 800; font-size: 13.5px; }
.mini .ms { font-size: 12px; color: var(--muted); }

/* --- bar total melayang (form inap di HP) --- */
.mob-total { display: none; }
@media (max-width: 920px) {
    /* ---------- HEADER RINGKAS ---------- */
    .layout { padding: 8px; gap: 10px; }
    .layout > * { min-width: 0; }      /* kunci: cegah strip menu melebarkan halaman */
    .sidebar, .main { min-width: 0; max-width: 100%; }
    .sidebar {
        position: sticky; top: 8px; z-index: 40;
        flex-direction: row; align-items: center; gap: 10px;
        min-height: 0; padding: 8px 10px; border-radius: 14px;
    }
    .brand { padding: 0; border: none; margin: 0; gap: 9px; flex: 0 0 auto; }
    .brand .logo { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
    .brand-t { font-size: 13.5px; }
    .brand-s { display: none; }
    .nav-desk { display: none; }
    /* Semua menu WAJIB terlihat tanpa digeser: chip dibungkus ke baris berikutnya */
    .nav-mob {
        display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px;
        padding: 0; min-width: 0; max-width: 100%; flex: 1 1 auto;
        justify-content: flex-start;
    }
    .nav-chip { padding: 7px 11px; font-size: 12.5px; flex: 0 0 auto; }
    .sidebar { flex-wrap: wrap; }
    .brand { flex: 0 0 100%; }        /* logo di baris pertama, chip menyusul */
    .nav-chip.is-act { box-shadow: 0 4px 10px rgba(5,180,190,.28); }
    .side-foot { display: none; }

    /* topbar: cukup nama + keluar */
    .topbar { padding: 8px 12px; border-radius: 14px; margin-bottom: 12px; gap: 10px; }
    .tb-title { display: none; }
    .tb-date { display: none; }
    .tb-user { width: 100%; justify-content: space-between; }
    .cu-name { max-width: 150px; }
    .ava { width: 32px; height: 32px; font-size: 14px; }

    .page { gap: 14px; padding-bottom: 76px; }
    .page-head { gap: 10px; }
    .page-head h1 { font-size: 18px; }
    .head-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .head-actions .btn { width: 100%; min-width: 0; justify-content: center; padding: 11px 10px;
        overflow: hidden; text-overflow: ellipsis; }
    .head-actions .btn-primary { grid-column: 1 / -1; }  /* aksi utama selebar layar */
    .card { padding: 14px; border-radius: 14px; min-width: 0; }
    .tablewrap { max-width: 100%; }
    .page, .page-head, .card-h, .toolbar { min-width: 0; }

    /* tombol & target sentuh lebih besar */
    .btn { padding: 11px 15px; font-size: 13.5px; }
    .icon-btn { width: 40px; height: 40px; font-size: 16px; border-radius: 11px; }
    .pg { min-width: 38px; height: 38px; }

    /* bar total melayang (hanya di form inap) */
    .mob-total {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 60;
        padding: 12px 16px; border-radius: 16px;
        background: #05F2F2;   /* solid, tanpa gradasi */
        color: var(--ink); box-shadow: 0 14px 30px rgba(5,180,190,.4);
    }
    .mob-total .mtl { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; opacity: .9; }
    .mob-total .mtv { font-size: 19px; font-weight: 800; letter-spacing: -.4px; }
}

/* ---------- TABEL → KARTU DI HP (tanpa scroll samping) ---------- */
@media (max-width: 640px) {
    .tablewrap { overflow-x: visible; }
    table.tbl { min-width: 0; width: 100%; font-size: 13.5px; }
    table.tbl thead { display: none; }
    table.tbl, table.tbl tbody, table.tbl tfoot, table.tbl tr, table.tbl td { display: block; width: auto; }
    table.tbl tr {
        border: 1px solid var(--line); border-radius: 14px;
        background: rgba(255, 255, 255, 0.55);
        padding: 4px 2px; margin-bottom: 12px;
        box-shadow: 0 4px 12px rgba(5,180,190,.06);
    }
    table.tbl tr:last-child { margin-bottom: 0; }
    table.tbl tbody tr:hover td { background: transparent; }
    table.tbl td {
        display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
        padding: 9px 12px; border-bottom: 1px dashed var(--line);
        text-align: left !important; white-space: normal;
    }
    table.tbl td:last-child { border-bottom: none; }
    table.tbl td::before {
        content: attr(data-label);
        flex: 0 0 40%; max-width: 40%;
        font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
        color: var(--muted); padding-top: 2px;
    }
    table.tbl td:not([data-label])::before { content: none; }
    table.tbl td > *, table.tbl td .cell-sub { text-align: right; }
    table.tbl td .acts { justify-content: flex-end; width: 100%; }
    table.tbl td .doc-badge { justify-content: flex-end; }
    /* baris kosong & kartu nomor */
    table.tbl td.empty-cell { display: block; border-bottom: none; padding: 0; }
    table.tbl td.empty-cell::before { content: none; }
    table.tbl td.cell-no { display: none; }   /* nomor urut tidak perlu di kartu */
    table.tbl tfoot tr { background: #E6FDFD; box-shadow: none; }
    table.tbl tfoot td { display: block; text-align: right !important; }
    table.tbl tfoot td::before { content: none; }
    .list-foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .toolbar { gap: 10px; }
    details.panel > summary { padding: 11px 13px; }
    details.panel > .panel-body { padding: 0 13px 13px; }
    .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mini { padding: 12px; gap: 10px; }
    .mini .mi { width: 34px; height: 34px; font-size: 16px; }
}

/* ---------- baris statistik ringkas di HP (hemat tinggi, biar tabel cepat terlihat) ---------- */
@media (max-width: 640px) {
    .stat-row .stat, .stat-row-4 .stat { padding: 10px 11px; gap: 3px; }
    .stat-row .st-num, .stat-row-4 .st-num { font-size: 16px; letter-spacing: -.3px; }
    .stat-row .st-label, .stat-row-4 .st-label { font-size: 9.5px; letter-spacing: 0; line-height: 1.25; }
    .stat-row .st-sub, .stat-row-4 .st-sub { display: none; }
    .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
    .stat-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
}

/* ---------- strip pesan keselamatan di dashboard ---------- */
.safety-strip {
    display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 10px; padding: 9px 15px; border-radius: 12px;
    background: #E2FCFC;
    border: 1px solid rgba(5,180,190,.35);
    font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.4;
}
@media (max-width: 640px) { .safety-strip { font-size: 12.5px; padding: 8px 12px; } }


/* ============================================================
   KOMPATIBILITAS SAFARI / iPadOS
   Safari lama TIDAK mendukung `gap` pada flexbox → jarak antar
   elemen hilang sehingga label & input tampak menumpuk.
   Semua container flex di bawah ini memakai margin `> * + *`
   yang bekerja di semua browser (tanpa efek ganda).
   ============================================================ */

/* 1) Field: label & input tidak boleh rapat */
.field { display: block; gap: 0; }
.field > label { display: block; margin: 0 0 6px; }
.field .help { display: block; margin-top: 6px; }
.field > label + input, .field > label + select, .field > label + textarea,
.field > label + .input-group, .field > label + .bon-pick, .field > label + .seg { margin-top: 0; }
.field > input + .help, .field > select + .help, .field > textarea + .help,
.field > .input-group + .help, .field > .seg + .help { margin-top: 6px; }

/* 2) Baris judul / kepala kartu */
.card-h, .page-head, .list-foot { gap: 0; }
.card-h > * + * { margin-left: 12px; }
.page-head > * + * { margin-left: 14px; }
.list-foot > * + * { margin-left: 12px; }

/* 3) Baris tombol / aksi */
.form-actions, .acts, .seg, .nav-mob, .radio-row, .mini, .perm-box { gap: 0; }
.form-actions > * + * { margin-left: 10px; margin-top: 8px; }
.acts > * + * { margin-left: 6px; }
.seg > * + * { margin-left: 8px; }
.radio-row > * + * { margin-left: 20px; }
.nav-mob > * + * { margin-left: 7px; }

/* 4) Elemen ber-ikon (ikon + teks di dalamnya) */
.seg label > * + * { margin-left: 8px; }
.pick-card > * + * { margin-top: 6px; }
.mini > * + * { margin-left: 12px; }
.self-card > * + * { margin-left: 14px; }
.warn-row > * + * { margin-left: 13px; }
.wo-row > * + * { margin-left: 13px; }
.act-card > * + * { margin-left: 14px; }
.brand > * + * { margin-left: 12px; }
.chip-user > * + * { margin-left: 10px; }
.tb-user > * + * { margin-left: 14px; }
.wo-remind > * + * { margin-left: 5px; }
.badge > * + * { margin-left: 5px; }
.doc-badge > * + * { margin-left: 6px; }
.cost-row > * + * { margin-left: 12px; }
.recap .rrow > * + * { margin-left: 14px; }
.cp-total > * + * { margin-left: 12px; }
.empty-state .es-act > * + * { margin-left: 8px; }

/* 5) Penumpuk vertikal */
.nav, .nav-group, .nav-group-body { gap: 0; }
.nav > * + * { margin-top: 4px; }
.nav-group-body > * + * { margin-top: 4px; }
.stat > * + * { margin-top: 6px; }
.recap > * + * { margin-top: 14px; }
.cost-panel > * + * { margin-top: 12px; }
.cond-block > * + * { margin-top: 14px; }
.warn-list > * + * { margin-top: 0; }
.pick-grid { gap: 14px; }                /* grid: gap didukung Safari */
.form-grid, .grid, .grid-2, .grid-3, .grid-4, .grid-2-1, .mini-grid, .perm-box, .toolbar, .act-grid, .stat-row, .stat-row-4 { /* grid gap aman */ }

/* 6) Jaga jarak judul seksi form */
.form-sec { display: block; margin: 22px 0 14px; }
.form-sec::after { display: none; }
.form-sec { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.form-sec:first-child { margin-top: 0; }


/* ============================================================
   Safari/iPadOS: input[type=date|time] TIDAK bisa menyusut di bawah
   lebar bawaannya → meluber & menimpa kolom sebelahnya.
   Kunci: izinkan min-width:0, kunci lebar ke 100% & appearance seragam.
   ============================================================ */
input, select, textarea, .input-group { min-width: 0; max-width: 100%; box-sizing: border-box; }
input[type=date], input[type=time], input[type=datetime-local], input[type=month] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    -webkit-appearance: none;
    appearance: none;
    -webkit-min-logical-width: 0;
    min-inline-size: 0;
    display: block;
    text-align: left;
    line-height: 1.35;
    padding: 10px 12px;
}
/* Safari tetap menampilkan ikon pemilih tanggal/jam */
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator { opacity: .6; margin-left: 4px; cursor: pointer; }
/* kolom grid tidak boleh melebar karena isi */
.field, .form-grid > *, .toolbar > *, .grid > * { min-width: 0; }
/* label panjang jangan menekan kolom tetangga */
.field > label { overflow-wrap: anywhere; }


/* ============ ANTI-MELUBER (kunci lebar maksimum) ============ */
.btn, .icon-btn, .badge, .nav-chip { max-width: 100%; }
.btn { overflow: hidden; text-overflow: ellipsis; }
.card, .tablewrap, .page, .main, .layout, .card-body, .grid > * { min-width: 0; max-width: 100%; }

/* Isi sel tabel (mode kartu di HP) wajib boleh menyusut & membungkus */
@media (max-width: 640px) {
    table.tbl td > * { min-width: 0; max-width: 100%; }
    table.tbl td .cell-sub,
    table.tbl td .cell-strong { white-space: normal !important; overflow-wrap: anywhere; }
    table.tbl td.num { white-space: normal !important; }
    table.tbl td .acts { flex-wrap: wrap; }
    table.tbl td, table.tbl td * { max-width: 100%; }
}


/* ============ Kunci akhir anti-2px: kepala halaman & tabel ============ */
.page-head { min-width: 0; }
.page-head > * { min-width: 0; max-width: 100%; }
.head-actions { min-width: 0; max-width: 100%; gap: 10px; row-gap: 8px; }
.head-actions > * { margin: 0; }
.head-actions .btn { min-width: 0; flex: 0 1 auto; }
.tablewrap { max-width: 100%; }
table.tbl { max-width: 100%; }
.card, .card-body { max-width: 100%; }

/* Di layar sempit: kepala halaman menumpuk (tanpa margin mendatar → tidak ada overflow) */
@media (max-width: 920px) {
    .page-head { flex-direction: column; align-items: stretch; }
    .page-head > * + * { margin-left: 0; margin-top: 12px; }
    .head-actions { width: 100%; }
}
