/* ==========================================================
   Akuntansi Percetakan — tema bersih, putih, aksen biru/teal
   ========================================================== */
:root {
    --brand: #0d9488;
    --brand-dark: #0f766e;
    --brand-soft: #e6f6f4;
    --blue: #2563eb;
    --blue-soft: #eaf0fe;
    --ink: #101828;
    --ink-2: #344054;
    --muted: #667085;
    --line: #e4e8ee;
    --bg: #f5f7fa;
    --card: #ffffff;
    --danger: #d92d20;
    --danger-soft: #fef3f2;
    --warn: #b54708;
    --warn-soft: #fffaeb;
    --ok: #067647;
    --ok-soft: #ecfdf3;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.green { color: var(--ok); }
.red { color: var(--danger); }
.hidden { display: none !important; }

/* ---------- kerangka ---------- */
.app { display: flex; min-height: 100vh; --sidebar-w: 246px; }
.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--line);
}
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px; flex: none;
    background: linear-gradient(135deg, var(--brand), #2563eb);
    color: #fff; display: grid; place-items: center;
}
.brand-mark .ico { width: 20px; height: 20px; }
.brand-name { font-size: 13.5px; font-weight: 700; line-height: 1.25; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nav { padding: 10px 10px 20px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #98a2b3; padding: 16px 10px 6px; }
.nav-item, .nav-group-head {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 9px;
    color: #5b6478; font-size: 13.2px; font-weight: 500;
    text-decoration: none; position: relative;
    background: none; border: 0; width: 100%; text-align: left; font-family: inherit; cursor: pointer;
}
.nav-item .ico, .nav-group-head .ico { width: 18px; height: 18px; color: #6b7ff5; flex: none; }
.nav-item:hover, .nav-group-head:hover { background: #f5f7fb; color: var(--ink); text-decoration: none; }
.nav-item:hover .ico, .nav-group-head:hover .ico { color: #4f63e6; }
.nav-item.active { background: #eef2fd; color: #2f4bd8; font-weight: 600; }
.nav-item.active .ico { color: #2f4bd8; }
.nav-group { margin: 1px 0; }
.nav-group-head.active { color: #3b4a68; font-weight: 600; }
.nav-caret { margin-left: auto; width: 15px; height: 15px; color: #9aa4b8; transition: transform .18s ease; flex: none; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 4px 14px; margin-left: 8px; border-left: 1px solid #edf0f6; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item { font-size: 12.9px; padding: 8px 10px; }
.nav-sub .nav-item .ico { width: 16px; height: 16px; color: #7d8cf2; }
.nav-sub .nav-item.active .ico { color: #2f4bd8; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    background: #eef2f7; color: var(--ink-2);
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--muted); }
.logout { color: #98a2b3; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.logout:hover { background: var(--danger-soft); color: var(--danger); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 14px 26px; display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 30;
}
.topbar-title h1 { font-size: 19px; }
.topbar-title p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 16px; cursor: pointer; }
.content { padding: 24px 26px 40px; flex: 1; }
.app-wide .content { padding: 24px 20px 40px; }
.footer {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 14px 26px; border-top: 1px solid var(--line);
    font-size: 11.5px; color: var(--muted); background: #fff;
}

/* ---------- kartu & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 18px; align-items: stretch; }
/* Kartu dalam satu baris grid harus sama tinggi: jarak antar kartu murni dari `gap`,
   jadi margin antar kartu (.card + .card) dimatikan di dalam grid. */
.grid > .card { margin-top: 0; height: 100%; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split-66 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split > .card + .card, .split-66 > .card + .card { margin-top: 0; }
.stack > * + * { margin-top: 18px; }
.section-gap { margin-top: 22px; }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; }
.kpi-label > span:first-child { min-width: 0; }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-value.sm { font-size: 18px; }
.kpi-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.kpi-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); }
.kpi-ic.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-ic.warn { background: var(--warn-soft); color: var(--warn); }
.kpi-ic.red { background: var(--danger-soft); color: var(--danger); }

/* ---------- ringkasan (penjualan / pembelian / biaya) ---------- */
.ringkasan-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.period-pick { display: flex; gap: 8px; align-items: center; margin: 0; }
.period-pick input[type="date"] { width: auto; min-width: 158px; height: 37px; padding: 6px 10px; }
.period-pick select { width: auto; height: 37px; padding: 6px 30px 6px 10px; }
.sr-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 13px; font-weight: 700; letter-spacing: .01em; color: #3c4257; text-transform: uppercase; }
.stat-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-main { min-width: 0; }
.stat-value { font-size: 21px; font-weight: 700; letter-spacing: -.01em; color: #101828; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.stat-trend { text-align: center; flex: none; }
.chart-trend { width: 44px; height: 34px; display: block; margin: 0 auto; }
.stat-pct { font-size: 11.5px; font-weight: 600; margin-top: 1px; color: #475467; }
.stat-split { display: flex; align-items: center; gap: 8px; flex: none; }
.chart-split { width: 40px; height: 40px; display: block; }
.stat-compare { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 9px; margin-top: auto; text-align: right; }

.stat-gauge { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.gauge { width: 100%; max-width: 260px; height: auto; display: block; }
.gauge-rows { width: 100%; }

.seg-toggle { display: flex; width: 100%; margin-bottom: 12px; }
.seg-toggle .seg { flex: 1; text-align: center; }
.donut-block { display: flex; justify-content: center; padding: 6px 0 12px; }
.chart-donut { width: 100%; max-width: 210px; height: auto; }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.legend-list li { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.legend-list .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { font-weight: 600; color: #475467; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-inline { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
.legend-wrap { border-top: 1px solid var(--line); padding-top: 12px; }
.legend-wrap .legend-list li { font-size: 11px; }

.mini-stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border-left: 3px solid var(--line); }
.mini-stat.accent-teal { border-left-color: #4bbfae; }
.mini-stat.accent-red { border-left-color: #f2647f; }
.mini-stat.accent-amber { border-left-color: #f7c548; }
.mini-stat.accent-blue { border-left-color: #3f9fd8; }
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: #475467; }
.mini-count { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mini-body { display: flex; align-items: center; gap: 12px; }
.mini-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #eef4fb; color: #3f6ea8; flex: none; }
.mini-value { font-size: 19px; font-weight: 700; color: #101828; font-variant-numeric: tabular-nums; line-height: 1.15; }
.mini-note { font-size: 11px; color: var(--muted); margin-top: 2px; }

@media (max-width: 900px) {
    .ringkasan-tools { width: 100%; justify-content: space-between; }
    .stat-compare { text-align: left; }
}
@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; row-gap: 10px; }
    .topbar-title { min-width: 0; flex: 1 1 auto; }
    .topbar-actions { flex: 1 1 100%; margin-left: 0; }
    .ringkasan-tools { width: 100%; flex-wrap: wrap; gap: 8px; }
    .period-pick { width: 100%; }
    .period-pick select, .period-pick input[type="date"] { flex: 1 1 0; min-width: 0; width: auto; }
    .topbar-actions { max-width: 100%; }
}
@media (max-width: 700px) {
    .stat-value { font-size: 19px; }
    .col-tax { width: 110px; }
    .mini-value { font-size: 17px; }
}

/* ---------- unggah logo & tanda tangan ---------- */
.upload-preview {
    display: flex; align-items: center; justify-content: center;
    min-height: 110px; padding: 14px; border: 1px dashed #d5dbe3; border-radius: 10px;
    background: #fbfcfe;
}
.upload-preview img { max-width: 100%; max-height: 120px; display: block; object-fit: contain; }
.upload-preview.signature { min-height: 120px; }
.upload-preview.signature img { max-height: 110px; }
.upload-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #98a2b3; font-size: 11.5px; }
.upload-empty .ico { width: 26px; height: 26px; }
.bank-picker { display: flex; flex-direction: column; gap: 6px; }
.bank-picker .check { min-height: 30px; }

/* ---------- tabel ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
    text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .03em;
    text-transform: uppercase; color: var(--muted);
    background: #fafbfc; padding: 9px 14px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.tbl td { padding: 10px 14px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
table.tbl tbody tr:hover { background: #f9fbfc; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tfoot td { background: #fafbfc; font-weight: 600; border-top: 1px solid var(--line); }
table.tbl .th-num, table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl.compact td, table.tbl.compact th { padding: 7px 10px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.t-main { font-weight: 600; color: var(--ink); }
.t-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-ic { width: 44px; height: 44px; border-radius: 50%; background: #f2f5f9; color: #98a2b3; display: grid; place-items: center; margin: 0 auto 10px; }
.empty p { font-size: 13px; }

/* ---------- tombol ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8.5px 14px; border-radius: 9px; border: 1px solid transparent;
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    background: var(--brand); color: #fff; text-decoration: none; line-height: 1.2; min-height: 37px;
    transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 16px; height: 16px; }
.btn-outline { background: #fff; color: var(--ink-2); border-color: #d0d5dd; }
.btn-outline:hover { background: #f9fafb; color: var(--ink); border-color: #b9c0ca; }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-soft:hover { background: #d5efeb; color: var(--brand-dark); }
.btn-blue { background: var(--blue); }
.btn-blue:hover { background: #1d4ed8; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b42318; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover { background: #fee4e2; color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; min-height: 30px; }
.btn-xs { padding: 4px 8px; font-size: 11.5px; border-radius: 6px; min-height: 26px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: #f9fafb; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="email"], input[type="password"],
input[type="tel"], input[type="search"], select, textarea {
    font: inherit; font-size: 13.2px; color: var(--ink);
    background: #fff; border: 1px solid #d5dbe3; border-radius: 8px;
    padding: 8.5px 11px; width: 100%; min-width: 0; box-sizing: border-box;
}
/* Semua kontrol satu baris harus setinggi sama (input, select, file, date) */
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="email"], input[type="password"],
input[type="tel"], input[type="search"], select { min-height: 37px; }
input[type="file"] {
    font: inherit; font-size: 12.4px; color: var(--ink-2); box-sizing: border-box;
    background: #fff; border: 1px dashed #d5dbe3; border-radius: 8px;
    padding: 0 10px; width: 100%; height: 37px; line-height: 35px; overflow: hidden;
}
input[type="file"]::file-selector-button {
    font: inherit; font-size: 12px; font-weight: 600; margin-right: 10px;
    padding: 4px 10px; border-radius: 6px; border: 1px solid #d5dbe3;
    background: #f8fafc; color: var(--ink-2); cursor: pointer;
}
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,148,136,.14); }
input[readonly], select[disabled], input[disabled] { background: #f7f9fb; color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; min-height: 37px; }
.field .check { min-height: 37px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.form-actions .spacer { flex: 1; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { flex: 1 1 160px; }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-form input, .search-form select { width: auto; min-width: 140px; }

/* ---------- filter bar ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .field { flex: 0 1 auto; }
.filters .field > label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }

/* ---------- badge & alert ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
    background: #f2f4f7; color: var(--ink-2); white-space: nowrap;
}
.badge-baru, .badge-draft { background: #f2f4f7; color: #475467; }
.badge-produksi { background: var(--warn-soft); color: var(--warn); }
.badge-selesai, .badge-paid { background: var(--ok-soft); color: var(--ok); }
.badge-ditagih { background: var(--blue-soft); color: var(--blue); }
.badge-batal, .badge-lost { background: var(--danger-soft); color: var(--danger); }
.badge-q-sent { background: var(--blue-soft); color: var(--blue); }
.badge-q-deal { background: var(--ok-soft); color: var(--ok); }
.badge-q-draft { background: #f2f4f7; color: #475467; }
.badge-q-lost { background: var(--danger-soft); color: var(--danger); }
.badge-i-unpaid { background: var(--warn-soft); color: var(--warn); }
.badge-i-partial { background: var(--blue-soft); color: var(--blue); }
.badge-i-paid { background: var(--ok-soft); color: var(--ok); }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: #05603a; border-color: #abefc6; }
.alert-error { background: var(--danger-soft); color: #912018; border-color: #fecdca; }
.alert-info { background: var(--blue-soft); color: #1e40af; border-color: #c7d7fe; }
.alert-warn { background: var(--warn-soft); color: #93370d; border-color: #fedf89; }

/* ---------- tab ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 0 6px; }
.tabs a {
    padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ---------- misc ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }
.doc-links { display: flex; gap: 8px; flex-wrap: wrap; }
.attn-list { list-style: none; margin: 0; padding: 0; }
.attn-list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f2f5; font-size: 13px; align-items: center; }
.attn-list li:last-child { border-bottom: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.dot.warn { background: #f79009; }
.dot.red { background: var(--danger); }
.dot.blue { background: var(--blue); }
.total-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px; }
.total-line.grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 15.5px; font-weight: 700; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f2f4f7; font-size: 11.5px; color: var(--ink-2); }
.progress { height: 6px; border-radius: 99px; background: #eef1f5; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); }

/* item rows (dokumen) */
.items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.items-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.items-table td { padding: 6px 6px; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
.items-table input, .items-table select { padding: 7px 9px; font-size: 12.8px; }
.items-table .row-total { padding-top: 14px; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.items-table td.col-item { min-width: 220px; }
.items-table td.col-qty { width: 90px; }
.items-table td.col-unit { width: 92px; }
.items-table td.col-price { width: 130px; }
.items-table td.col-sub { width: 130px; }
.items-table td.col-act { width: 40px; }
.row-del { background: #fff; border: 1px solid var(--line); color: var(--muted); border-radius: 7px; width: 28px; height: 28px; cursor: pointer; }
.row-del:hover { background: var(--danger-soft); color: var(--danger); border-color: #fecdca; }
.totals-box { margin-left: auto; width: 320px; max-width: 100%; }
.duration-note { font-size: 11.5px; color: var(--muted); }

/* ---------- halaman dokumen (cetak) ---------- */
.doc-page { background: #eef1f5; min-height: 100vh; padding: 26px 16px 60px; overflow-x: auto; font-family: 'Inter', system-ui, sans-serif; color: #111827; }
.doc-toolbar {
    max-width: 210mm; margin: 0 auto 16px; display: flex; gap: 8px; flex-wrap: wrap;
    align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
    box-shadow: var(--shadow);
}
.doc-sheet {
    width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff;
    padding: 16mm 15mm; box-shadow: 0 6px 24px rgba(16,24,40,.10); position: relative;
    font-size: 12px; line-height: 1.5;
}
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #0f766e; padding-bottom: 12px; }
.doc-company { display: flex; gap: 12px; }
.doc-logo { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, #0d9488, #2563eb); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 19px; }
.doc-company h2 { font-size: 16px; margin: 0; color: #0f766e; }
.doc-company .tag { font-size: 10.5px; color: #667085; text-transform: uppercase; letter-spacing: .05em; }
.doc-company .addr { font-size: 10.5px; color: #475467; margin-top: 3px; max-width: 330px; }
.doc-title { text-align: right; }
.doc-title h1 { font-size: 22px; letter-spacing: .06em; color: #111827; margin: 0; }
.doc-title .no { font-size: 11.5px; color: #475467; margin-top: 3px; }
.doc-title .date { font-size: 11px; color: #667085; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 16px 0 14px; }
.doc-box { background: #f8fafc; border: 1px solid #e5e9ef; border-radius: 8px; padding: 10px 12px; }
.doc-box h4 { font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: #667085; margin: 0 0 5px; }
.doc-box .name { font-weight: 700; font-size: 12.5px; }
.doc-box .ln { font-size: 11px; color: #475467; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 11px; }
.doc-table th { background: #0f766e; color: #fff; text-align: left; padding: 7px 9px; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.doc-table td { padding: 7px 9px; border-bottom: 1px solid #e9edf2; vertical-align: top; }
.doc-table .num { text-align: right; white-space: nowrap; }
.doc-table tbody tr:nth-child(even) { background: #fbfcfd; }
.doc-totals { margin-left: auto; width: 290px; margin-top: 10px; }
.doc-totals .ln { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 11.5px; }
.doc-totals .ln.grand { border-top: 1.5px solid #0f766e; margin-top: 4px; padding-top: 7px; font-size: 13.5px; font-weight: 700; color: #0f766e; }
.doc-banks { margin-top: 14px; border: 1px solid #e5e9ef; border-radius: 8px; padding: 10px 12px; background: #f8fafc; font-size: 11px; }
.doc-banks h4 { margin: 0 0 6px; font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: #667085; }
.doc-note { margin-top: 12px; font-size: 10.5px; color: #475467; white-space: pre-line; }
.doc-sign { margin-top: 26px; display: flex; justify-content: space-between; gap: 30px; page-break-inside: avoid; }
.doc-sign > div { width: 46%; text-align: center; font-size: 11px; }
.doc-sign .space { height: 58px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.doc-sign .space .sign-img { max-height: 56px; max-width: 82%; object-fit: contain; }
.doc-logo { object-fit: contain; }
.doc-sign .nm { border-top: 1px solid #98a2b3; padding-top: 4px; font-weight: 600; }
.doc-foot { position: absolute; bottom: 9mm; left: 15mm; right: 15mm; border-top: 1px solid #e5e9ef; padding-top: 6px; font-size: 9px; color: #98a2b3; display: flex; justify-content: space-between; gap: 10px; }
.doc-watermark { position: absolute; top: 40%; left: 0; right: 0; text-align: center; font-size: 68px; font-weight: 700; color: rgba(13,148,136,.07); transform: rotate(-18deg); pointer-events: none; letter-spacing: .1em; }

/* ---------- grafik dashboard ---------- */
.chart-wrap { padding: 14px 16px 8px; }
svg.chart { width: 100%; height: auto; display: block; }
.donut-wrap { width: 150px; flex: none; }
svg.donut { width: 150px; height: 150px; display: block; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.segmented { display: inline-flex; background: #f2f4f7; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented .seg { padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.segmented .seg:hover { background: #e9edf2; color: var(--ink); text-decoration: none; }
.segmented .seg.active { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow); }
.col-tax { width: 132px; }
.col-tax select { padding: 7px 6px; font-size: 12px; }

/* ---------- bar periode dashboard ---------- */
.period-bar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.period-bar .field > label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.period-bar input[type="date"] { min-width: 172px; height: 37px; padding: 6px 10px; }
.period-bar select { height: 37px; padding: 6px 30px 6px 10px; min-width: 0; }
.period-bar select[name="bmonth"] { min-width: 148px; }
.period-bar select[name="byear"] { min-width: 96px; }
.period-bar input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .65; }
.period-bar input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }
.period-bar .filters { align-items: flex-end; }
.period-current { font-weight: 600; color: var(--ink-2); }
.period-range { margin-left: auto; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 15% 10%, #e7f6f4 0%, transparent 60%), radial-gradient(800px 500px at 85% 90%, #e8effd 0%, transparent 55%), #f5f7fa; }
.auth-card { width: 100%; max-width: 390px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px 28px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 42px; height: 42px; }
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .lead { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.auth-card .field + .field { margin-top: 13px; }
.auth-card .btn { margin-top: 20px; }
.auth-hint { margin-top: 16px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split, .split-66 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
    .app { --sidebar-w: 246px; }
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-scrim { position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 35; display: none; }
    .sidebar-scrim.show { display: block; }
    .menu-btn { display: inline-flex; }
    .content { padding: 18px 16px 34px; }
    .topbar { padding: 12px 16px; }
    .footer { padding: 12px 16px; }
    .cols-3, .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .cols-2, .cols-3, .cols-4, .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
    .topbar-title h1 { font-size: 16.5px; }
    .kpi-value { font-size: 19px; }
    .kv { grid-template-columns: 108px minmax(0, 1fr); }
    .tabs { overflow-x: auto; flex-wrap: nowrap; }
    .tabs a { white-space: nowrap; }
    .totals-box { width: 100%; }
}

/* ---------- print ---------- */
@page { size: A4; margin: 11mm 12mm; }
@media print {
    body { background: #fff !important; }
    .sidebar, .topbar, .footer, .no-print, .doc-toolbar, .alert { display: none !important; }
    .content { padding: 0 !important; }
    .main { display: block; }
    .doc-page { background: #fff; padding: 0; }
    .doc-sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
    .doc-foot { position: static; margin-top: 16px; }
    .card { box-shadow: none; break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
}

/* ============================================================
   Portal karyawan (staff/) — mobile first
   ============================================================ */
.staff-body { background: #f5f7fa; }
.staff-app { max-width: 620px; margin: 0 auto; padding: 0 14px 96px; min-height: 100vh; }
.staff-bar { display: flex; align-items: center; gap: 10px; padding: 16px 2px 12px; }
.staff-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.staff-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto; }
.staff-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.staff-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.staff-logout { margin-left: auto; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: #fff; }
.staff-logout:hover { color: var(--danger); border-color: #fecdca; }
.staff-main { display: block; }
.staff-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.staff-card.mini { margin-bottom: 0; }
.staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.staff-clock { text-align: center; padding: 2px 0 12px; }
.clk-time { font-size: 40px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.1; }
.clk-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.staff-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.staff-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; border: 1px solid transparent; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: transform .1s ease; }
.staff-btn .ico { width: 22px; height: 22px; }
.staff-btn.in { background: var(--brand); color: #fff; }
.staff-btn.out { background: #fff; border-color: var(--brand-line, #bfe9e3); color: var(--brand-dark); }
.staff-btn:disabled { opacity: .5; cursor: not-allowed; }
.staff-btn:not(:disabled):active { transform: scale(.98); }
.staff-gps { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--muted); background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.staff-gps .dot { width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; flex: 0 0 auto; }
.staff-gps.ok { background: var(--ok-soft); border-color: #abefc6; color: var(--ok); }
.staff-gps.ok .dot { background: var(--ok); }
.staff-gps.warn { background: var(--warn-soft); border-color: #fedf89; color: var(--warn); }
.staff-gps.warn .dot { background: var(--warn); }
.staff-note { margin-top: 12px; }
.staff-note .field label { font-size: 11.5px; }
.staff-today { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.staff-today > div { display: flex; flex-direction: column; gap: 2px; }
.staff-today span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.staff-today strong { font-size: 13px; }
.staff-hint { margin-top: 10px; font-size: 11.5px; border-radius: 9px; padding: 8px 10px; }
.staff-hint.green { background: var(--ok-soft); color: var(--ok); }
.staff-hint.red { background: var(--danger-soft); color: var(--danger); }
.mini-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mini-value { font-size: 18px; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.mini-value.sm { font-size: 15px; }
.mini-note { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.staff-row { display: flex; align-items: center; gap: 12px; }
.staff-row > div { flex: 1; min-width: 0; }
.staff-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.staff-card-head h2 { font-size: 13.5px; margin: 0; }
.staff-card-head a { font-size: 12px; }
.staff-list { list-style: none; margin: 0; padding: 0; }
.staff-list li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.staff-list li:last-child { border-bottom: 0; }
.staff-list li > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.staff-list .right { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.staff-rules { margin: 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.staff-rules li { margin-bottom: 4px; }
.staff-empty { text-align: center; padding: 18px 8px; color: var(--muted); }
.staff-empty .ico { width: 26px; height: 26px; margin-bottom: 6px; color: #c3cbd6; }
.staff-empty p { font-size: 12px; margin: 0; }
.staff-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
.staff-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); text-decoration: none; padding: 4px 0; }
.staff-nav a .ico { width: 19px; height: 19px; }
.staff-nav a.active { color: var(--brand-dark); font-weight: 600; }
.staff-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.staff-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--line); }
.staff-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
.staff-table td.num, .staff-table th.num { text-align: right; white-space: nowrap; }
@media (max-width: 380px) {
    .clk-time { font-size: 34px; }
    .staff-grid { grid-template-columns: 1fr; }
    .staff-today { grid-template-columns: 1fr 1fr; }
}
.staff-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.staff-filter select { flex: 1 1 120px; min-height: 34px; }
