/* =====================================================
   Jurnalin v2 — Layout & komponen dasar
   ===================================================== */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: var(--sp-4) 0;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px var(--sp-5) var(--sp-4);
    margin-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border-light);
}
.brand-logo {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px; letter-spacing: .5px;
    flex-shrink: 0;
}
.brand-logo img { width: 56%; height: 56%; display: block; }
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.1; }
.brand-tag  { font-size: 11px; color: var(--text-muted); }

.nav-section { padding: var(--sp-3) var(--sp-3) 0; }
.nav-label {
    padding: 0 var(--sp-3) var(--sp-2);
    font-size: 10.5px; font-weight: 600; letter-spacing: .8px;
    text-transform: uppercase; color: var(--text-muted);
}
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 8px var(--sp-3);
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px; font-weight: 500;
    transition: background .12s, color .12s;
}
.nav-link i { font-size: 16px; color: var(--text-muted); width: 18px; text-align: center; }
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { background: var(--bg-subtle); color: var(--text); font-weight: 600; }
.nav-link.active i { color: var(--brand); }
.nav-spacer { flex: 1; }

/* ---------- Content ---------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-4);
    padding: 0 var(--sp-6);
    height: 60px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-3); }
.company-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: var(--radius-pill);
    background: var(--bg-subtle); border: 1px solid var(--border);
    font-size: 13px; font-weight: 500; cursor: pointer;
}
.company-pill .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--brand); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
}
.btn-icon { color: var(--text-muted); display: none; background: none; border: none; cursor: pointer; }

/* ---------- Page canvas (proporsi: max-width + center) ---------- */
.page { padding: var(--sp-6); }
.page-inner { max-width: var(--content-max); margin: 0 auto; }
.page-header { margin-bottom: var(--sp-5); }
.page-title { font-size: 22px; font-weight: 650; margin: 0 0 2px; }
.page-subtitle { color: var(--text-secondary); font-size: 13.5px; margin: 0; }

/* ---------- Card ---------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-5);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-surface); color: var(--text);
    transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }

/* ---------- Flash ---------- */
.flash-wrap { max-width: var(--content-max); margin: 0 auto; padding: var(--sp-4) var(--sp-6) 0; }
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius-sm);
    font-size: 13.5px; margin-bottom: var(--sp-3); border: 1px solid transparent;
}
.flash.success { background: var(--success-bg); color: var(--success); border-color: #BFE6CC; }
.flash.error   { background: var(--danger-bg);  color: var(--danger);  border-color: #F1C9C9; }
.flash.warning { background: var(--warning-bg); color: var(--warning); border-color: #EBD7AE; white-space: pre-wrap; }

/* ---------- Stub (placeholder Fase 0) ---------- */
.stub {
    text-align: center; padding: var(--sp-7) var(--sp-5);
    color: var(--text-secondary);
}
.stub-icon {
    width: 64px; height: 64px; margin: 0 auto var(--sp-4);
    border-radius: var(--radius-lg); background: var(--bg-subtle);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--brand);
}
.stub h2 { font-size: 18px; margin: 0 0 6px; color: var(--text); }
.badge-soon {
    display: inline-block; margin-top: var(--sp-4);
    padding: 4px 12px; border-radius: var(--radius-pill);
    background: var(--info-bg); color: var(--info);
    font-size: 12px; font-weight: 600;
}

/* ---------- Auth ---------- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: var(--sp-5);
    position: relative;
    /* Overlay gelap di atas foto agar form login jelas terbaca.
       Foto: public/assets/img/login-bg.jpg (fallback warna gelap bila belum ada). */
    background:
        linear-gradient(180deg, rgba(8,15,26,.62) 0%, rgba(8,15,26,.78) 100%),
        var(--brand);
    background-size: cover;
    background-position: center;
}
.auth-wrap::before {
    content: ""; position: absolute; inset: 0; z-index: 0;
    background: url("../img/login-bg.jpg") center / cover no-repeat;
    /* Pergelap & sedikit turunkan saturasi langsung pada gambar */
    filter: brightness(.55) saturate(.9);
}
.auth-wrap::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(8,15,26,.45) 0%, rgba(8,15,26,.70) 100%);
}
.auth-card {
    position: relative; z-index: 2;
    width: 100%; max-width: 380px;
    background: var(--bg-surface); border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
    padding: var(--sp-6);
}
.auth-brand { text-align: center; margin-bottom: var(--sp-5); }
.auth-brand .brand-logo { width: 44px; height: 44px; margin: 0 auto var(--sp-3); font-size: 17px; }
.auth-brand h1 { font-size: 19px; margin: 0; }
.auth-brand small { color: var(--text-muted); font-size: 12.5px; }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input:not([type=checkbox]):not([type=radio]) {
    width: 100%; padding: 9px 12px; font-size: 14px;
    border: 1px solid var(--border-strong, #CBD5E1); border-radius: var(--radius-sm);
    background: #fff; color: var(--text);
}
.field input:not([type=checkbox]):not([type=radio]):focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61,83,103,.12); }
.field label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.field label.check input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; cursor: pointer; }
.tax-opts { display: flex; gap: 10px; }
.tax-opt { flex: 1; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 11px 14px; margin: 0; transition: border-color .12s, background .12s; }
.tax-opt:hover { border-color: var(--border-strong, #CBD5E1); }
.tax-opt:has(input:checked) { border-color: var(--brand); background: #F4F7FA; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Form controls ---------- */
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.input {
    width: 100%; padding: 9px 12px; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; color: var(--text); font-family: inherit;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61,83,103,.12); }
.hint { font-size: 12px; color: var(--text-muted); margin: 6px 0 0; }

/* Select lebih clean: chevron kustom, tanpa appearance bawaan OS */
select.input {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%2397A1AE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
select.input:hover { border-color: var(--border-strong, #CBD5E1); }
select.input.input-sm { padding-right: 30px; background-position: right 9px center; }

/* ---------- Combobox (searchable dropdown) ---------- */
.combo { position: relative; }
.combo-btn {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 6px 10px; min-width: 200px; font: inherit; font-size: 13px; text-align: left;
    background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
    transition: border-color .12s;
}
.combo-btn:hover { border-color: var(--border-strong, #CBD5E1); }
.combo-btn i { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.combo-btn .combo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-btn.is-empty .combo-text { color: var(--text-muted); }

.combo-panel {
    display: none; position: fixed; z-index: 200;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(16,24,40,.18); overflow: hidden;
}
.combo-panel.open { display: block; }
.combo-search-wrap { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.combo-search-wrap i { color: var(--text-muted); font-size: 13px; }
.combo-search { flex: 1; border: none; outline: none; font: inherit; font-size: 13.5px; background: transparent; color: var(--text); }
.combo-list { max-height: 280px; overflow-y: auto; padding: 5px; }
.combo-opt {
    width: 100%; display: block; text-align: left; padding: 8px 10px; font: inherit; font-size: 13px;
    background: none; border: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-opt:hover { background: var(--bg-hover); }
.combo-opt.sel { background: var(--bg-subtle); color: var(--brand); font-weight: 600; }
.combo-opt b { font-weight: 600; }
.combo-empty { padding: 14px 10px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Pemilih tipe (radio cards) */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.type-card {
    position: relative; cursor: pointer;
    display: flex; flex-direction: column; gap: 3px;
    padding: var(--sp-4); border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--bg-surface); transition: border-color .12s, background .12s;
}
.type-card:hover { border-color: var(--border-strong, #CBD5E1); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card i { font-size: 20px; color: var(--text-muted); }
.type-card .type-title { font-weight: 600; font-size: 14px; }
.type-card .type-desc { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.type-card.selected { border-color: var(--brand); background: #F4F7FA; }
.type-card.selected i { color: var(--brand); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: var(--sp-4); border-bottom: 1px solid var(--border); }
.tab {
    padding: 8px 14px; font-size: 13.5px; font-weight: 500; color: var(--text-secondary);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
    text-align: left; padding: 11px var(--sp-4); font-size: 11.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted);
    background: var(--bg-subtle); border-bottom: 1px solid var(--border);
}
.table tbody td { padding: 11px var(--sp-4); border-bottom: 1px solid var(--border-light); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }
.table-compact tbody td, .table-compact thead th { padding: 8px var(--sp-3); }
.ta-right { text-align: right; }
.cell-strong { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-muted); }
.amt-debit  { font-weight: 600; color: var(--text); }
.amt-credit { font-weight: 600; color: var(--success); }

.card-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 13.5px; background: var(--bg-surface);
}
.input-sm { padding: 6px 9px; font-size: 13px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

/* ---------- Badge ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: var(--radius-pill);
    font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.badge i { font-size: 11px; }
.badge-muted   { background: var(--bg-subtle); color: var(--text-secondary); }
.badge-brand   { background: #E7EDF3; color: var(--brand); }
.badge-info    { background: var(--info-bg); color: var(--info); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-success { background: var(--success-bg); color: var(--success); }

/* ---------- Dropdown (company switcher) ---------- */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { background: var(--bg-hover); }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
    min-width: 240px; background: var(--bg-surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 6px; overflow: hidden;
}
.dropdown-label { padding: 6px 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); }
.dropdown-menu form { margin: 0; }
.dropdown-item {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13.5px; text-align: left;
    background: none; border: none; cursor: pointer; color: var(--text); font-family: inherit;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.active { font-weight: 600; color: var(--brand); }
.dropdown-item i { color: var(--brand); }

/* ---------- Back link ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.back-link:hover { color: var(--brand); }

/* ---------- Steps (workflow 3 langkah) ---------- */
.steps { display: flex; align-items: center; gap: 6px; margin-bottom: var(--sp-5); }
.step { display: flex; align-items: center; gap: 9px; }
.step-dot {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    border: 1.5px solid var(--border); background: var(--bg-surface); color: var(--text-muted);
}
.step-label { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.step.active .step-dot { border-color: var(--brand); color: var(--brand); background: #EEF3F8; }
.step.active .step-label { color: var(--text); }
.step.done .step-dot { border-color: var(--success); background: var(--success); color: #fff; }
.step.done .step-label { color: var(--text); }
.step-line { flex: 1; height: 2px; background: var(--border); max-width: 80px; }
.step-line.done { background: var(--success); }

/* ---------- Stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.stat { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 650; line-height: 1; }
.stat-sub { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.stat-foot { font-size: 11.5px; margin-top: 6px; }
.stat-foot.warn { color: var(--warning); }

/* ---------- Action row ---------- */
.action-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.action-card { padding: var(--sp-4); }
.action-head { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.action-head i { color: var(--brand); }
.export-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-ghost-danger { border-color: transparent; color: var(--danger); background: transparent; }
.btn-ghost-danger:hover { background: var(--danger-bg); }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.dash-grid .action-head { margin-bottom: var(--sp-4); }

.barchart { display: flex; align-items: flex-end; gap: var(--sp-3); height: 160px; padding-top: var(--sp-4); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar { width: 100%; max-width: 46px; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 3px; transition: opacity .15s; }
.bar:hover { opacity: .82; }
.bar-current { background: var(--accent); }
.bar-val { font-size: 10.5px; color: var(--text-muted); font-weight: 600; height: 14px; }
.bar-label { font-size: 11.5px; color: var(--text-secondary); font-weight: 500; }

.list-row {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    padding: 10px 0; border-bottom: 1px solid var(--border-light); color: var(--text);
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { color: var(--text); }
.list-row:hover .cell-strong { color: var(--brand); }
.act-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-subtle); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.empty-mini { color: var(--text-muted); font-size: 13px; padding: var(--sp-4) 0; display: flex; align-items: center; gap: 8px; }
.empty-mini i { color: var(--success); }

.top-row { margin-bottom: var(--sp-3); }
.top-head { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: 13px; margin-bottom: 5px; }
.top-head span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-bar { height: 7px; background: var(--bg-subtle); border-radius: var(--radius-pill); overflow: hidden; }
.top-bar-fill { height: 100%; background: var(--brand); border-radius: var(--radius-pill); }

/* ---------- Pie chart ---------- */
.pie-wrap { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; padding-top: var(--sp-2); }
.pie-svg { width: 200px; height: 200px; flex-shrink: 0; }
.pie-legend { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: var(--radius-sm); font-size: 13px; }
.legend-row:hover { background: var(--bg-subtle); }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.legend-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.legend-pct { flex-shrink: 0; color: var(--text-muted); font-size: 12px; width: 44px; text-align: right; }
.legend-val { flex-shrink: 0; font-weight: 600; width: 110px; text-align: right; white-space: nowrap; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center span { font-size: 11px; color: var(--text-muted); }
.donut-center strong { font-size: 17px; font-weight: 600; color: var(--text); }
@media (max-width: 640px) { .pie-wrap { justify-content: center; } .pie-legend { min-width: 100%; } }

/* ---------- Dokumen Project ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.doc-slot { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.doc-slot-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); }
.doc-step { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-step.done { background: var(--success); color: #fff; }
.doc-slot-title { font-weight: 600; font-size: 14px; }
.doc-file { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg-subtle); border-radius: var(--radius-sm); margin-bottom: var(--sp-3); }
.doc-file > i { font-size: 22px; color: var(--brand); flex-shrink: 0; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.doc-empty { color: var(--text-muted); font-size: 13px; padding: 14px 0; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); margin-bottom: var(--sp-3); }

.doc-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doc-cell-name { display: inline-flex; align-items: center; gap: 5px; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.doc-cell-act { display: inline-flex; gap: 8px; flex-shrink: 0; color: var(--text-muted); }
.doc-cell-act a:hover, .btn-link:hover { color: var(--brand); }
.btn-link { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0; font-size: 14px; }
.doc-add { color: var(--text-light); font-size: 18px; }
.doc-add:hover { color: var(--brand); }
@media (max-width: 640px) { .doc-grid { grid-template-columns: 1fr; } }

/* Sel rekap dokumen — gaya bertumpuk, bersih (SaaS akuntansi) */
.dcell { display: flex; align-items: flex-start; gap: 8px; }
.dcell-stack { min-width: 0; line-height: 1.45; }
.dcell-no { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.dcell-meta { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.dcell-act { display: inline-flex; gap: 9px; margin-left: auto; padding-left: 6px; color: var(--text-muted); opacity: .35; transition: opacity .12s; font-size: 13px; }
tr:hover .dcell-act { opacity: 1; }
.dcell-act a:hover, .dcell-act .btn-link:hover { color: var(--brand); }
.dcell-add { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px dashed var(--border-strong, #CBD5E1); border-radius: 8px; color: var(--text-light); background: none; cursor: pointer; transition: all .12s; }
.dcell-add:hover { border-color: var(--brand); color: var(--brand); background: var(--bg-subtle); }

/* Header kelola (back + judul project) */
.kelola-head { display: flex; align-items: center; gap: 14px; margin-bottom: var(--sp-4); }
.kelola-title { line-height: 1.3; min-width: 0; }
.ktitle { display: block; font-size: 16px; font-weight: 600; }
.ksub { display: block; font-size: 13px; color: var(--text-secondary); }

/* Toggle Kartu / Tabel */
.view-toggle { display: inline-flex; gap: 2px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; margin-bottom: var(--sp-4); }
.vt { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; font-size: 13px; font-weight: 500; color: var(--text-secondary); border-radius: 5px; }
.vt:hover { color: var(--text); }
.vt.active { background: var(--bg-surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* Kartu project (pipeline) */
.pcard-grid { display: flex; flex-direction: column; gap: 14px; }
.pcard { width: 100%; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.phead { display: flex; align-items: flex-start; gap: 12px; }
.pav { width: 38px; height: 38px; border-radius: 9px; background: #E7EDF3; color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.pname { font-size: 15px; font-weight: 600; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pname:hover { color: var(--brand); }
.pclient { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvalue { margin-left: auto; text-align: right; flex-shrink: 0; }
.pvalue .l { font-size: 11px; color: var(--text-muted); }
.pvalue .v { font-size: 14.5px; font-weight: 600; }
.pipe { display: flex; align-items: flex-start; margin: 16px 0 12px; }
.pstep { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 0 0 auto; width: 76px; text-decoration: none; text-align: center; }
.pstep.pstepbtn { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
.pdot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.pstep.done .pdot { background: var(--success-bg); color: var(--success); }
.pstep.partial .pdot { background: var(--warning-bg); color: var(--warning); }
.pstep.empty .pdot { background: var(--bg-subtle); color: var(--text-light); }
.plabel { font-size: 11.5px; color: var(--text-secondary); }
.psub { font-size: 11px; color: var(--text-muted); white-space: nowrap; max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
.pstep.pstepbtn:hover .pdot, .pstep[href]:hover .pdot { outline: 2px solid var(--brand); outline-offset: 1px; }
.pline { flex: 1; height: 2px; background: var(--border); margin-top: 14px; }
.pline.on { background: var(--success); }
.bar { height: 7px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; margin: 2px 0 6px; }
.bfill { height: 100%; background: var(--success); border-radius: 999px; }
.brow { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.amt-danger { color: var(--danger); font-weight: 600; }
.pactions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }

/* ---------- Pager ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-4); }
.btn.disabled { opacity: .5; pointer-events: none; }
textarea.input { resize: vertical; font-family: inherit; }

/* ---------- Filter bar ---------- */
.filter-bar {
    display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: var(--sp-4); margin-bottom: var(--sp-4); box-shadow: var(--shadow-sm);
}
.filter-bar .input { min-width: 140px; }

/* ---------- Journal grouping ---------- */
.jrnl tbody tr.jrnl-top td { border-top: 2px solid var(--border); }
.jrnl tbody tr:hover { background: transparent; }
.jrnl tbody tr.jrnl-top:hover td, .jrnl tbody tr.jrnl-top:hover ~ tr td { background: var(--bg-subtle); }

/* ---------- Modal ---------- */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 100;
    background: rgba(15,23,42,.45); align-items: flex-start; justify-content: center; padding: 6vh 16px;
}
.modal-overlay.open { display: flex; }
.modal {
    width: 100%; max-width: 460px; background: var(--bg-surface);
    border-radius: var(--radius-lg); box-shadow: 0 20px 50px rgba(16,24,40,.25); overflow: hidden;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px;
}
.modal-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: var(--sp-5); max-height: 64vh; overflow-y: auto; }
.modal-body .field { margin-bottom: var(--sp-3); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); background: var(--bg-subtle); }
.modal-lg { max-width: 900px; }
.bukti-frame { width: 100%; height: 76vh; border: none; display: block; background: var(--bg-subtle); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar { position: fixed; left: -100%; z-index: 50; transition: left .2s; box-shadow: var(--shadow); }
    .sidebar.open { left: 0; }
    .btn-icon { display: inline-flex; }
    .page { padding: var(--sp-4); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .action-row { grid-template-columns: 1fr; }
    .type-cards { grid-template-columns: 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   COLOR & VIBRANCY LAYER  (ditambahkan — de-monokrom)
   Warna dengan tujuan: bantu scanning, jaga keterbacaan.
   ===================================================== */

/* Logo & avatar — gradient hidup */
.brand-logo { background: var(--grad-logo); box-shadow: 0 2px 6px rgba(37,99,235,.32); }
.avatar     { background: var(--grad-avatar); box-shadow: 0 2px 6px rgba(79,70,229,.30); }
.company-pill .dot { background: var(--c-green); box-shadow: 0 0 0 3px rgba(21,128,61,.14); }

/* Sidebar — ikon menu berwarna per item (pakai --ink) */
nav.nav-section .nav-link { --ink: var(--c-slate); }
nav.nav-section .nav-link:nth-of-type(1) { --ink: var(--c-blue); }
nav.nav-section .nav-link:nth-of-type(2) { --ink: var(--c-cyan); }
nav.nav-section .nav-link:nth-of-type(3) { --ink: var(--c-teal); }
nav.nav-section .nav-link:nth-of-type(4) { --ink: var(--c-indigo); }
nav.nav-section .nav-link:nth-of-type(5) { --ink: var(--c-violet); }
nav.nav-section .nav-link:nth-of-type(6) { --ink: var(--c-amber); }
nav.nav-section .nav-link:nth-of-type(7) { --ink: var(--c-rose); }
nav.nav-section .nav-link:nth-of-type(8) { --ink: var(--c-green); }
nav.nav-section .nav-link:nth-of-type(9) { --ink: var(--c-blue); }
nav.nav-section .nav-link i { color: var(--ink); opacity: .92; }
nav.nav-section .nav-link:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--text); }
nav.nav-section .nav-link.active {
    background: color-mix(in srgb, var(--ink) 14%, transparent);
    color: var(--text);
    box-shadow: inset 3px 0 0 var(--ink);
}
nav.nav-section .nav-link.active i { color: var(--ink); opacity: 1; }

/* KPI / stat cards — strip aksen warna di atas (kecuali grid KPI dashboard yang sudah berikon) */
.stat-grid:not(.kpi-grid) .stat { position: relative; overflow: hidden; }
.stat-grid:not(.kpi-grid) .stat::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--c-blue);
}
.stat-grid:not(.kpi-grid) .stat:nth-child(1)::before { background: var(--c-blue); }
.stat-grid:not(.kpi-grid) .stat:nth-child(2)::before { background: var(--c-indigo); }
.stat-grid:not(.kpi-grid) .stat:nth-child(3)::before { background: var(--c-green); }
.stat-grid:not(.kpi-grid) .stat:nth-child(4)::before { background: var(--c-amber); }
.stat-grid:not(.kpi-grid) .stat:nth-child(5)::before { background: var(--c-rose); }

/* Avatar inisial project (Docutrack) — gradient */
.pav { background: var(--grad-pav); color: #fff; }

/* Card header — ikon judul berwarna + sentuhan tint */
.card-bar { background: linear-gradient(180deg, var(--bg-subtle), var(--bg-surface)); }
.card-bar > span > i:first-child { color: var(--c-indigo); }

/* Tabs aktif — underline lebih hidup */
.tab.active { border-bottom-color: var(--c-blue); color: var(--c-blue); }

/* Tombol utama — gradient halus + kedalaman */
.btn-primary { background: var(--grad-brand); border-color: #2C3E4F; box-shadow: 0 1px 2px rgba(44,62,79,.25); }
.btn-primary:hover { background: linear-gradient(135deg, #324E72, #243341); color: #fff; }

/* Section header bar (mis. judul daftar) tetap netral untuk keterbacaan tabel */

/* Aksen latar halaman — sangat halus, hangat di sudut atas */
.page { background:
    radial-gradient(1100px 360px at 100% -8%, rgba(79,70,229,.05), transparent 70%),
    radial-gradient(900px 320px at -6% 0%, rgba(37,99,235,.045), transparent 70%);
}

/* ---------- Sortable table headers ---------- */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--brand); }
.th-sort::after { content: "\2195"; opacity: .3; margin-left: 5px; font-size: 10px; }
.th-sort.sorted[data-dir="asc"]::after  { content: "\2191"; opacity: 1; color: var(--c-blue); }
.th-sort.sorted[data-dir="desc"]::after { content: "\2193"; opacity: 1; color: var(--c-blue); }

/* Ikon pada label stat-card */
.stat-label i { margin-right: 5px; color: var(--c-indigo); }

/* Header tanggal sortable di Jurnal (server-side) */
.jp-sort { color: inherit; text-decoration: none; white-space: nowrap; cursor: pointer; }
.jp-sort:hover { color: var(--c-blue); }

/* ---------- Improvements batch ---------- */
/* Kode akun di Laporan: light grey */
.kode-akun { color: var(--text-muted); font-weight: 500; }

/* Keterangan editable di Batches — gaya "seamless" (tampak teks, kotak muncul saat hover/fokus) */
.ket-edit {
    width: 100%;
    min-width: 240px;
    border: 1px solid transparent;
    background: transparent;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font: inherit;
    color: var(--text);
    line-height: 1.4;
    transition: border-color .12s, background .12s, box-shadow .12s;
    cursor: text;
    text-overflow: ellipsis;
}
.ket-edit:hover { border-color: var(--border); background: var(--bg-surface); }
.ket-edit:focus {
    border-color: var(--brand);
    background: var(--bg-surface);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
    text-overflow: clip;
}

/* Rekening sumber dana: daftar pilihan (checklist) */
.bank-checklist { display: flex; flex-direction: column; gap: 6px; }
.bank-opt { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: background .12s, border-color .12s; }
.bank-opt:hover { background: var(--bg-hover); }
.bank-opt input { width: auto; margin: 0; }
.bank-opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, transparent); }

/* ---------- Jurnal: akordion (1 baris ringkas per entri) ---------- */
.jrnl-sum { cursor: pointer; }
.jrnl-sum:hover { background: var(--bg-hover); }
.jrnl-sum .chev { font-size: 10px; color: var(--text-muted); display: inline-block; transition: transform .15s; }
.jrnl-sum.open .chev { transform: rotate(90deg); color: var(--c-blue); }
.jrnl-det > td { background: var(--bg-subtle); border-top: none; padding-top: 6px; padding-bottom: 6px; }
.jrnl-det:last-child > td { box-shadow: inset 0 -1px 0 var(--border-light); }

/* ---------- Foto profil (avatar) ---------- */
img.avatar { object-fit: cover; padding: 0; background: var(--bg-subtle); box-shadow: none; border: 1px solid var(--border); }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.avatar-sm-init { display: inline-flex; align-items: center; justify-content: center; background: var(--grad-pav); color: #fff; font-weight: 600; font-size: 12px; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.avatar-lg-init { display: flex; align-items: center; justify-content: center; background: var(--bg-subtle); color: var(--text-muted); font-size: 32px; }
