/**
 * =============================================================================
 * FILE / DIREKTORI : public/assets/css/style.css
 * DESKRIPSI        : Desain sistem utama aplikasi SIRKAT.
 *                     Palet   : Navy institusional + aksen emas (kepercayaan &
 *                               formalitas khas dokumen keuangan sekolah).
 *                     Tipografi: Plus Jakarta Sans (UI) - satu keluarga font,
 *                               dibedakan lewat berat huruf.
 *                     Berisi  : layout aplikasi, komponen (kartu, tabel, form,
 *                               modal, toast), halaman login, dan animasi.
 * =============================================================================
 */

:root {
    --navy-900: #0f2340;
    --navy-800: #16304f;
    --navy-700: #1e3a5f;
    --navy-600: #2a4d78;
    --gold-500: #c99b3f;
    --gold-400: #dbb45f;
    --gold-100: #faf3e2;

    --bg: #f4f6f9;
    --surface: #ffffff;
    --border: #e3e8ef;
    --text: #1b2431;
    --text-muted: #64748b;

    --green: #16a34a;
    --green-bg: #e9f8ef;
    --red: #dc2626;
    --red-bg: #fdecec;
    --amber: #d97706;
    --amber-bg: #fef3e2;
    --blue: #2563eb;
    --blue-bg: #eaf1fd;
    --purple: #7c3aed;
    --purple-bg: #f1eafd;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 35, 64, .06);
    --shadow: 0 6px 20px rgba(15, 35, 64, .08);
    --shadow-lg: 0 20px 50px rgba(15, 35, 64, .18);
    --sidebar-w: 264px;
    --topbar-h: 68px;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c9d3e0; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ===================== LAYOUT SHELL ===================== */
.app-wrapper { min-height: 100vh; }

.topbar {
    height: var(--topbar-h);
    background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    position: sticky; top: 0; z-index: 40;
    box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-weight: 700; letter-spacing: .2px; display: flex; gap: 8px; align-items: center; }
.topbar-title i { color: var(--gold-400); }
.btn-icon {
    width: 38px; height: 38px; display: grid; place-items: center;
    background: rgba(255,255,255,.08); border: none; border-radius: 10px; color: #fff;
    transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn-icon:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }

.topbar-right { position: relative; display: flex; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 10px; border-radius: 12px; transition: background .2s var(--ease); }
.user-chip:hover { background: rgba(255,255,255,.08); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--gold-500); color: var(--navy-900);
    display: grid; place-items: center; font-weight: 800; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 13.5px; }
.user-role { font-size: 11.5px; color: #cdd8e8; }
.user-dropdown {
    position: absolute; top: 56px; right: 0; background: var(--surface); color: var(--text);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 180px; padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all .18s var(--ease); z-index: 50;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.user-dropdown a:hover { background: var(--red-bg); color: var(--red); }
.user-dropdown .logout-form { margin: 0; }
.user-dropdown .logout-form button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: var(--radius-sm); font: inherit; font-size: 14px; color: inherit; cursor: pointer; text-align: left; }
.user-dropdown .logout-form button:hover { background: var(--red-bg); color: var(--red); }

.app-body { display: block; }

.main-content { padding: 26px 28px 60px; }

/* ===================== TOPBAR: LAUNCHER TRIGGER + BREADCRUMB ===================== */
.btn-launcher-trigger { position: relative; }
.launcher-dots {
    display: grid; grid-template-columns: repeat(3, 4px); grid-template-rows: repeat(3, 4px); gap: 3px;
}
.launcher-dots i { width: 4px; height: 4px; border-radius: 50%; background: #fff; display: block; transition: transform .3s var(--ease), background .3s var(--ease); }
.btn-launcher-trigger:hover .launcher-dots i { background: var(--gold-400); }
.btn-launcher-trigger[aria-expanded="true"] .launcher-dots i { background: var(--gold-400); transform: scale(1.25); }

.topbar-title { transition: opacity .15s var(--ease); }
.topbar-title:hover { opacity: .85; }
.topbar-crumb {
    display: flex; align-items: center; gap: 8px; color: #cdd8e8; font-size: 13px; font-weight: 500;
    padding-left: 8px; margin-left: 2px; border-left: 1px solid rgba(255,255,255,.18);
}
.topbar-crumb i { font-size: 10px; color: #8fa0bd; }
@media (max-width: 620px) { .topbar-crumb { display: none; } }

/* ===================== APP LAUNCHER (pengganti sidebar) ===================== */
.app-launcher-overlay {
    position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center;
    background: rgba(15, 23, 40, .55); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
    opacity: 0; visibility: hidden; transition: opacity .28s var(--ease), visibility .28s var(--ease), backdrop-filter .28s var(--ease);
    padding: min(9vh, 80px) 20px 40px;
    overflow-y: auto;
}
.app-launcher-overlay.show { opacity: 1; visibility: visible; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.app-launcher-panel {
    width: 100%; max-width: 980px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg);
    transform: scale(.94) translateY(18px); opacity: 0; transition: transform .32s var(--ease), opacity .32s var(--ease);
    overflow: hidden; display: flex; flex-direction: column; max-height: 82vh;
}
.app-launcher-overlay.show .app-launcher-panel { transform: scale(1) translateY(0); opacity: 1; }

.launcher-head {
    display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
    background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
}
.launcher-search-wrap { flex: 1; position: relative; display: flex; align-items: center; }
.launcher-search-wrap i { position: absolute; left: 16px; color: #9fb0cb; font-size: 14px; }
.launcher-search {
    width: 100%; padding: 12px 16px 12px 42px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.1); color: #fff; font-size: 14.5px; outline: none;
    transition: background .2s var(--ease), border-color .2s var(--ease);
}
.launcher-search::placeholder { color: #a8b7cf; }
.launcher-search:focus { background: rgba(255,255,255,.16); border-color: var(--gold-400); }
.launcher-close { flex-shrink: 0; }

.launcher-body { padding: 22px 26px 30px; overflow-y: auto; }
.launcher-section + .launcher-section { margin-top: 22px; }
.launcher-section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 800; margin-bottom: 12px; }

.launcher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }

.launcher-tile {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
    padding: 16px 8px; border-radius: 16px; color: var(--text); position: relative;
    opacity: 0; transform: translateY(14px) scale(.92);
    transition: background .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.app-launcher-overlay.show .launcher-tile {
    animation: launcherTileIn .42s var(--ease) forwards;
    animation-delay: calc(var(--i, 0) * 28ms);
}
@keyframes launcherTileIn { to { opacity: 1; transform: translateY(0) scale(1); } }

.launcher-tile:hover { background: var(--bg); transform: translateY(-3px); box-shadow: var(--shadow); }
.launcher-tile:hover .launcher-tile-icon { transform: scale(1.08) rotate(-3deg); }
.launcher-tile.is-active { background: var(--gold-100); }
.launcher-tile.is-active .launcher-tile-label { color: var(--navy-900); font-weight: 700; }
.launcher-tile.is-active::after {
    content: ''; position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-500);
}

.launcher-tile-icon {
    position: relative; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
    font-size: 21px; transition: transform .22s var(--ease);
}
.launcher-tile-label { font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--text); }

.launcher-tile--navy .launcher-tile-icon   { background: var(--navy-900); color: var(--gold-400); }
.launcher-tile--gold .launcher-tile-icon   { background: var(--gold-100); color: var(--gold-500); }
.launcher-tile--blue .launcher-tile-icon   { background: var(--blue-bg); color: var(--blue); }
.launcher-tile--purple .launcher-tile-icon { background: var(--purple-bg); color: var(--purple); }
.launcher-tile--green .launcher-tile-icon  { background: var(--green-bg); color: var(--green); }
.launcher-tile--amber .launcher-tile-icon  { background: var(--amber-bg); color: var(--amber); }

.launcher-tile-badge {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
    background: var(--amber); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center;
    box-shadow: 0 0 0 2px var(--surface);
}
.launcher-tile-badge.is-danger { background: var(--red); }
.launcher-tile-badge[hidden] { display: none; }

.launcher-tile[hidden], .launcher-section[hidden] { display: none; }

.launcher-empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.launcher-empty i { font-size: 30px; margin-bottom: 10px; display: block; opacity: .5; }

@media (max-width: 620px) {
    .app-launcher-overlay { padding: 0; align-items: stretch; }
    .app-launcher-panel { max-width: none; max-height: none; height: 100%; border-radius: 0; }
    .launcher-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

/* ===================== PAGE HEAD ===================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 800; color: var(--navy-900); }
.page-subtitle { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ===================== STAT CARDS ===================== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: var(--surface); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
.stat-blue .stat-icon { background: var(--blue-bg); color: var(--blue); }
.stat-amber .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-green .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-red .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-value { display: block; font-size: 19px; font-weight: 800; color: var(--navy-900); }
.stat-label { font-size: 12.5px; color: var(--text-muted); }

/* ===================== GRID / CARD ===================== */
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); margin-bottom: 18px; overflow: hidden;
}
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy-900); display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--gold-500); }
.card-body { padding: 18px 20px; }
.card-body.no-pad { padding: 6px 0; }
.link-more { font-size: 13px; font-weight: 600; color: var(--navy-700); display: flex; align-items: center; gap: 6px; transition: gap .2s var(--ease); }
.link-more:hover { gap: 10px; color: var(--gold-500); }

/* ===================== FORMS ===================== */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group-wide { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--navy-800); }
.form-control {
    padding: 10px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
    background: #fff; color: var(--text); transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
    width: 100%;
}
.form-control:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 4px rgba(30,58,95,.1); }
.form-control[readonly], .form-control[disabled] { background: #f2f4f7; color: #7c8798; }
textarea.form-control { resize: vertical; min-height: 60px; }
.form-checkbox label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.check-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); white-space: nowrap; cursor: pointer; user-select: none; }
.check-inline input { width: 15px; height: 15px; cursor: pointer; }
.filter-bar .form-control { width: auto; min-width: 160px; }
.toolbar-body { padding-bottom: 14px; }

/* ===================== SEARCH BOX (dipakai di seluruh toolbar tabel CRUD) ===================== */
.search-box { position: relative; flex: 1 1 240px; min-width: 200px; }
.search-box i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9aa7bb; font-size: 13px; }
.search-box .form-control { width: 100%; padding-left: 36px; }

/* ===================== TABEL: SORTABLE HEADER ===================== */
.th-sortable { cursor: pointer; user-select: none; transition: color .16s var(--ease), background .16s var(--ease); white-space: nowrap; }
.th-sortable:hover { color: var(--navy-900); background: #eef2f7; }
.th-sortable i { font-size: 10.5px; margin-left: 3px; color: #b7c1d1; transition: color .16s var(--ease); }
.th-sortable.th-sort-active { color: var(--navy-900); }
.th-sortable.th-sort-active i { color: var(--gold-500); }

/* ===================== TABLE LOADING STATE ===================== */
.table-loading { position: relative; opacity: .45; pointer-events: none; transition: opacity .15s var(--ease); min-height: 120px; }
.table-loading::after {
    content: ''; position: absolute; top: 40px; left: 50%; width: 30px; height: 30px; margin-left: -15px;
    border: 3px solid var(--border); border-top-color: var(--navy-700); border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== PAGINATION ===================== */
.pagination-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 14px 20px; border-top: 1px solid var(--border);
}
.pagination-info { font-size: 12.5px; color: var(--text-muted); }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.page-btn {
    min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 600; color: var(--navy-800); border: 1px solid var(--border); background: #fff;
    transition: all .16s var(--ease);
}
.page-btn:hover { border-color: var(--navy-700); background: var(--navy-900); color: #fff; }
.page-btn.active { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.page-btn.disabled { opacity: .4; pointer-events: none; }
.page-ellipsis { color: var(--text-muted); padding: 0 4px; font-size: 12.5px; }

/* ===================== SMALL TEXT / UTILITY ===================== */
.text-muted { color: var(--text-muted); }
.text-muted-sm { color: var(--text-muted); font-size: 11.5px; }
.fw-600 { font-weight: 600; }
.form-hint { color: var(--text-muted); font-size: 11.5px; }
.tag-purple { background: var(--purple-bg); color: var(--purple); }

/* ===================== USER CELL (tabel Pengguna) ===================== */
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; flex-shrink: 0; }

/* ===================== TAHUN ANGGARAN SWITCHER (topbar) ===================== */
.tahun-switcher {
    display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 12px; cursor: pointer;
    background: rgba(255,255,255,.08); color: #fff; font-size: 13px; font-weight: 700; margin-right: 8px;
    transition: background .2s var(--ease);
}
.tahun-switcher:hover { background: rgba(255,255,255,.18); }
.tahun-switcher i:first-child { color: var(--gold-400); }
.tahun-switcher-caret { font-size: 10px; opacity: .8; }
.tahun-wrap { position: relative; }
.tahun-dropdown {
    position: absolute; top: calc(100% + 10px); left: 0; background: var(--surface); color: var(--text);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 230px; padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all .18s var(--ease); z-index: 55;
}
.tahun-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.tahun-dropdown-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 700; padding: 8px 10px 6px; }
.tahun-dropdown-empty { padding: 12px 10px; color: var(--text-muted); font-size: 13px; }
.tahun-option {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px;
    border-radius: var(--radius-sm); border: none; background: none; font-size: 13.5px; font-weight: 600; color: var(--text);
    cursor: pointer; transition: background .16s var(--ease);
}
.tahun-option:hover { background: var(--gold-100); }
.tahun-option.active { background: var(--blue-bg); color: var(--navy-900); }
.tahun-option i.fa-check { color: var(--green); }

.dynamic-row-form .row-grid {
    display: grid; grid-template-columns: 1.4fr 1.6fr .7fr .8fr 1fr .7fr auto; gap: 10px; align-items: center;
}
.action-bar { margin-top: 18px; display: flex; justify-content: flex-end; }

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-sm); border: none; font-size: 14px; font-weight: 600;
    transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-700); box-shadow: 0 6px 16px rgba(15,35,64,.25); }
.btn-outline { background: #fff; color: var(--navy-800); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--navy-700); color: var(--navy-900); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(1.08); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-warning { background: var(--amber); color: #fff; }
.btn-warning:hover { filter: brightness(1.08); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.btn-icon-sm {
    width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--navy-700);
    display: inline-grid; place-items: center; transition: all .16s var(--ease); margin: 0 2px;
}
.btn-icon-sm:hover { background: var(--navy-900); color: #fff; border-color: var(--navy-900); transform: translateY(-1px); }

/* ===================== TABLE ===================== */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.6px; }
.table th {
    text-align: left; padding: 12px 16px; background: #f8fafc; color: var(--text-muted);
    font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: #f9fbfd; }
.table .text-right { text-align: right; }
.table .text-center { text-align: center; }
.mono { font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 12.5px; color: var(--navy-700); }
.group-row td { background: var(--gold-100); font-weight: 700; color: var(--navy-900); }
.subtotal-row td { font-weight: 600; border-top: 1.5px solid var(--border); }
.total-row td { font-weight: 800; border-top: 2px solid var(--navy-900); font-size: 14.5px; }
.total-row.positive td:last-child { color: var(--green); }
.total-row.negative td:last-child { color: var(--red); }

/* ===================== TAGS / BADGES ===================== */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-purple { background: var(--purple-bg); color: var(--purple); }
.tag-amber { background: var(--amber-bg); color: var(--amber); }
.tag-grey { background: #eef1f5; color: #64748b; }

.badge { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.badge-draft { background: #eef1f5; color: #64748b; }
.badge-diajukan { background: var(--amber-bg); color: var(--amber); }
.badge-revisi { background: var(--purple-bg); color: var(--purple); }
.badge-disetujui { background: var(--green-bg); color: var(--green); }
.badge-ditolak { background: var(--red-bg); color: var(--red); }
.badge-aktif { background: var(--green-bg); color: var(--green); }
.badge-tutup { background: #eef1f5; color: #64748b; }

/* ===================== SERAPAN / BUDGET PROGRESS BAR ===================== */
.serapan-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.serapan-bar { flex: 1; height: 8px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.serapan-bar-fill { height: 100%; border-radius: 6px; transition: width .25s var(--ease); }
.serapan-bar-fill.low { background: var(--green); }
.serapan-bar-fill.mid { background: var(--amber); }
.serapan-bar-fill.high { background: var(--red); }
.serapan-pct { font-size: 12px; font-weight: 800; min-width: 42px; text-align: right; }
.unit-group-title { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--navy-50, #f4f6fa); font-weight: 800; color: var(--navy-900); }

/* ===================== EMPTY STATE ===================== */
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-muted); }
.empty-state i { font-size: 34px; color: #cbd5e1; margin-bottom: 10px; display: block; }

/* ===================== MINI LIST (dashboard) ===================== */
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #f1f4f8; transition: background .15s var(--ease); }
.mini-item:hover { background: #f9fbfd; }
.mini-item-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-bg); color: var(--blue); flex-shrink: 0; }
.mini-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-item-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-item-sub { font-size: 11.5px; color: var(--text-muted); }

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,25,45,.55); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; z-index: 100;
    opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility .2s var(--ease);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-box {
    background: #fff; border-radius: var(--radius-lg); padding: 24px; width: 92%; max-width: 460px;
    box-shadow: var(--shadow-lg); transform: translateY(14px) scale(.97); transition: transform .22s var(--ease);
}
.modal-overlay.show .modal-box { transform: translateY(0) scale(1); }
.modal-box h3 { margin: 0 0 16px; font-size: 17px; color: var(--navy-900); }
.modal-box .form-group { margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ===================== TOAST ===================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
    min-width: 280px; max-width: 340px; background: #fff; border-left: 4px solid var(--navy-900); border-radius: 10px;
    padding: 13px 16px; box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 10px;
    animation: toastIn .28s var(--ease);
    font-size: 13.5px;
}
.toast.success { border-color: var(--green); }
.toast.success i { color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.error i { color: var(--red); }
.toast.leaving { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ===================== PENGATURAN SEKOLAH — LOGO UPLOADER ===================== */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.logo-uploader { display: flex; align-items: center; gap: 20px; }
.logo-preview {
    width: 88px; height: 88px; flex: 0 0 auto; border-radius: 16px; border: 1.5px dashed var(--border);
    background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview-placeholder { color: var(--text-muted); font-size: 30px; }
.logo-uploader-info { flex: 1 1 auto; }
.logo-uploader-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--text-muted); }
.logo-uploader-buttons { display: flex; gap: 8px; }

/* ===================== PROFIL SAYA — AVATAR (varian bulat dari logo-preview) ===================== */
.avatar-preview { border-radius: 50%; }
.avatar-preview-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800; color: var(--navy-900); background: var(--gold-500);
}

/* ===================== HAK AKSES MENU — MATRIX TOGGLE ===================== */
.perm-matrix th, .perm-matrix td { white-space: nowrap; }
.perm-matrix td:first-child, .perm-matrix th:first-child { white-space: normal; min-width: 220px; }
.perm-section-row td {
    background: var(--bg); font-weight: 700; font-size: 12px; text-transform: uppercase;
    letter-spacing: .4px; color: var(--text-muted); padding: 8px 16px;
}
.perm-toggle {
    background: none; border: none; cursor: pointer; font-size: 26px; padding: 2px;
    color: #c3cbd6; transition: color .15s var(--ease), transform .15s var(--ease);
}
.perm-toggle:hover { transform: scale(1.08); }
.perm-toggle.is-on { color: var(--green); }
.perm-toggle.is-off { color: #c3cbd6; }
.perm-reset-role {
    width: 22px; height: 22px; margin-left: 6px; font-size: 11px; border-radius: 6px;
    border: none; background: transparent; color: var(--text-muted); cursor: pointer;
}
.perm-reset-role:hover { background: var(--navy-900); color: #fff; }

/* ===================== UPLOAD ZONE ===================== */
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px; text-align: center;
    color: var(--text-muted); cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--gold-500); background: var(--gold-100); }
.upload-zone i { font-size: 30px; color: var(--gold-500); margin-bottom: 8px; display: block; }
.upload-zone span { color: var(--navy-700); font-weight: 700; }
.upload-progress { height: 8px; background: #eef1f5; border-radius: 6px; margin-top: 12px; overflow: hidden; }
.upload-progress-bar { height: 100%; width: 0%; background: var(--gold-500); transition: width .25s var(--ease); }
.bukti-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.bukti-item {
    display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 12.5px; color: var(--navy-800); transition: all .16s var(--ease);
}
.bukti-item:hover { border-color: var(--navy-700); background: #f9fbfd; }
.bukti-item i { color: var(--red); }

/* ===================== ALERTS ===================== */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px; }
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); }
.alert-warning { background: var(--amber-bg); color: var(--amber); }
.alert-warning b, .alert-error b, .alert-success b { display: block; margin-bottom: 3px; }

/* ===================== LOG AKTIVITAS: modal detail snapshot ===================== */
.snapshot-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.snapshot-table td { padding: 5px 8px; border-bottom: 1px solid #f1f4f8; vertical-align: top; }
.snapshot-table td:first-child { color: var(--text-muted); width: 38%; font-weight: 600; }

/* ===================== ALUR PERSETUJUAN: builder tahap ===================== */
.flow-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.flow-tab { padding: 8px 18px; border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; background: #f1f4f8; color: var(--text-muted); }
.flow-tab.active { background: var(--navy-900); color: #fff; }
.flow-stage-list { display: flex; flex-direction: column; gap: 10px; }
.flow-stage {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border);
    border-radius: 12px; background: #fff; transition: background .15s var(--ease);
}
.flow-stage.dragging { opacity: .4; }
.flow-stage.inactive { opacity: .55; }
.flow-stage-handle { cursor: grab; color: #cbd5e1; font-size: 16px; }
.flow-stage-num {
    width: 30px; height: 30px; border-radius: 50%; background: var(--blue-bg); color: var(--blue);
    display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.flow-stage-body { flex: 1; min-width: 0; }
.flow-stage-title { font-weight: 700; font-size: 13.5px; }
.flow-stage-sub { font-size: 12px; color: var(--text-muted); }
.flow-arrow { text-align: center; color: #cbd5e1; font-size: 13px; margin: -2px 0; }

/* ===================== RIWAYAT REVISI RKAT: timeline & diff ===================== */
.rev-timeline { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.rev-node {
    flex: 1; min-width: 200px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
    background: #fff; position: relative;
}
.rev-node.rev-current { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.rev-node-title { font-weight: 800; font-size: 13.5px; margin-bottom: 4px; }
.rev-node-meta { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.diff-added { background: var(--green-bg); }
.diff-removed { background: var(--red-bg); text-decoration: line-through; color: #94a3b8; }
.diff-changed { background: var(--amber-bg); }
.diff-old-val { color: #94a3b8; text-decoration: line-through; margin-right: 6px; }

/* ===================== ANIMATIONS ===================== */
.fade-in { animation: fadeInUp .35s var(--ease) both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.row-new { animation: rowHighlight 1s var(--ease); }
@keyframes rowHighlight { from { background: var(--gold-100); } to { background: transparent; } }
.row-leaving { animation: rowLeave .25s var(--ease) forwards; }
@keyframes rowLeave { to { opacity: 0; transform: translateX(20px); } }

/* ===================== LOGIN PAGE ===================== */
.login-body { margin: 0; font-family: 'Plus Jakarta Sans', sans-serif; background: var(--navy-900); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-visual {
    position: relative; overflow: hidden; background: linear-gradient(150deg, var(--navy-900), var(--navy-700) 60%, var(--navy-600));
    color: #fff; display: flex; align-items: center; padding: 60px;
}
.login-visual-inner { position: relative; z-index: 2; max-width: 420px; }
.login-visual-icon { font-size: 46px; color: var(--gold-400); margin-bottom: 18px; }
.login-visual h1 { font-size: 34px; margin: 0 0 10px; font-weight: 800; letter-spacing: .5px; }
.login-visual p { color: #c5d2e5; font-size: 15px; margin: 0 0 28px; }
.login-visual-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 13px; }
.login-visual-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #e4ebf6; }
.login-visual-list i { color: var(--gold-400); }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; }
.blob-1 { width: 340px; height: 340px; background: var(--gold-500); top: -80px; right: -100px; }
.blob-2 { width: 260px; height: 260px; background: #3b5f8f; bottom: -80px; left: -60px; }

.login-form-side { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form { width: 100%; max-width: 380px; background: #fff; padding: 34px 32px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.login-form-head h2 { margin: 0 0 6px; font-size: 22px; color: var(--navy-900); }
.login-form-head p { margin: 0 0 24px; color: var(--text-muted); font-size: 13.5px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon i:first-child { position: absolute; left: 13px; color: #9aa7bb; font-size: 14px; }
.input-icon input { padding-left: 38px; padding-right: 38px; }
.input-icon-toggle { position: absolute; right: 30px;top:12px; background: none; border: none; color: #9aa7bb; }
.login-hint { text-align: center; font-size: 11.5px; color: var(--text-muted); margin: 16px 0 0; }
.btn-loader { display: inline-flex; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1180px) {
    .grid-2 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .dynamic-row-form .row-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .main-content { padding: 20px 16px 60px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display: none; }
}
@media (max-width: 620px) {
    .stat-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .dynamic-row-form .row-grid { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .topbar-title span, .topbar-title { font-size: 14px; }
    .user-info { display: none; }
    .filter-bar .form-control { width: 100%; }
    .search-box { flex-basis: 100%; }
    .tahun-switcher-label { display: none; }
    .tahun-switcher { padding: 8px 10px; margin-right: 4px; }
    .tahun-dropdown { left: auto; right: 0; min-width: 220px; width: auto; }
    .pagination-bar { flex-direction: column; align-items: stretch; text-align: center; }
    .pagination-controls { justify-content: center; }
}

/* ===================== NOTIFIKASI & PERINGATAN PAGU ===================== */
.notif-wrap { position: relative; margin-right: 8px; }
.notif-btn {
    position: relative; width: 40px; height: 40px; display: grid; place-items: center;
    background: rgba(255,255,255,.08); border: none; border-radius: 12px; color: #fff; font-size: 16px;
    transition: background .2s var(--ease);
}
.notif-btn:hover { background: rgba(255,255,255,.18); }
.notif-btn:focus-visible, .notif-panel-foot:focus-visible, .notif-item:focus-visible {
    outline: 2px solid var(--gold-400); outline-offset: 2px;
}
.notif-count {
    position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 10px; border: 2px solid var(--navy-800); color: #fff;
    font-size: 10.5px; font-weight: 800; line-height: 16px; text-align: center;
}
.notif-count[data-level="danger"] { background: var(--red); }
.notif-count[data-level="warning"] { background: var(--amber); }
.notif-count[hidden] { display: none; }

.notif-panel {
    position: absolute; top: calc(100% + 10px); right: 0; width: 390px; max-width: calc(100vw - 24px);
    background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all .18s var(--ease);
    z-index: 56; overflow: hidden;
}
.notif-panel.show { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-panel-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 14px 16px 11px; border-bottom: 1px solid var(--border);
}
.notif-panel-head strong { font-size: 14.5px; color: var(--navy-900); }
.notif-panel-head span { font-size: 12px; color: var(--text-muted); }
.notif-panel-foot {
    display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 700;
    color: var(--navy-700); border-top: 1px solid var(--border); background: #f8fafc;
}
.notif-panel-foot:hover { color: var(--gold-500); }

.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item {
    display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1f4f8;
    transition: background .15s var(--ease);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f9fbfd; }
.notif-item-icon {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    flex-shrink: 0; font-size: 14px;
}
.notif-item.is-danger .notif-item-icon { background: var(--red-bg); color: var(--red); }
.notif-item.is-warning .notif-item-icon { background: var(--amber-bg); color: var(--amber); }
.notif-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-item-title { font-weight: 700; font-size: 13px; color: var(--navy-900); }
.notif-item-text { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item-meta { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.notif-empty { text-align: center; padding: 30px 20px; color: var(--text-muted); font-size: 13px; }
.notif-empty i { font-size: 28px; color: #cbd5e1; display: block; margin-bottom: 8px; }
.notif-empty p { margin: 0; }
.notif-card { margin-bottom: 22px; }
.notif-note { font-size: 12.5px; color: var(--text-muted); max-width: 78ch; line-height: 1.6; }

/* Baris dokumen menunggu: garis kiri penanda umur */
.table tbody tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.table tbody tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.cell-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.text-over { color: var(--red); font-weight: 700; }

/* Bar pemakaian pagu: solid = disetujui, bergaris = dalam proses */
.pagu-meter-cell { display: flex; align-items: center; gap: 10px; min-width: 170px; margin: 5px 0 2px; }
.pagu-bar { flex: 1; height: 8px; background: #eef1f5; border-radius: 6px; overflow: hidden; display: flex; }
.pagu-seg { display: block; height: 100%; transition: width .25s var(--ease); }
.pagu-seg-terserap { background: var(--green); }
.pagu-seg-proses { background: repeating-linear-gradient(135deg, var(--green) 0 4px, #a9dfbf 4px 8px); }
.pagu-bar.is-near .pagu-seg-terserap, .pagu-bar.is-full .pagu-seg-terserap { background: var(--amber); }
.pagu-bar.is-near .pagu-seg-proses, .pagu-bar.is-full .pagu-seg-proses { background: repeating-linear-gradient(135deg, var(--amber) 0 4px, #f3cf9c 4px 8px); }
.pagu-bar.is-over .pagu-seg-terserap { background: var(--red); }
.pagu-bar.is-over .pagu-seg-proses { background: repeating-linear-gradient(135deg, var(--red) 0 4px, #f0a9a9 4px 8px); }
.pagu-pct { font-size: 12px; font-weight: 800; min-width: 54px; text-align: right; }
.pagu-pct.is-near, .pagu-pct.is-full { color: var(--amber); }
.pagu-pct.is-over { color: var(--red); }

/* Panel status pagu di form Realisasi */
#paguMeter[hidden] { display: none; }
.pagu-panel { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: #fafbfd; font-size: 13px; }
.pagu-panel.is-ok { border-color: #bfe6cd; background: var(--green-bg); }
.pagu-panel.is-near, .pagu-panel.is-full { border-color: #f1d3a5; background: var(--amber-bg); }
.pagu-panel.is-over { border-color: #f3b8b8; background: var(--red-bg); }
.pagu-panel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--navy-900); }
.pagu-panel.is-over .pagu-panel-head i { color: var(--red); }
.pagu-panel.is-near .pagu-panel-head i, .pagu-panel.is-full .pagu-panel-head i { color: var(--amber); }
.pagu-panel.is-ok .pagu-panel-head i { color: var(--green); }
.pagu-panel-line { margin-left: auto; font-size: 12.5px; color: var(--text-muted); }
.pagu-panel-msg { margin: 6px 0 4px; line-height: 1.5; }
.pagu-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 12px 0 0; }
.pagu-panel-grid dt { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.pagu-panel-grid dd { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--navy-900); }

@media (max-width: 620px) {
    .notif-panel { position: fixed; top: var(--topbar-h); left: 12px; right: 12px; width: auto; max-width: none; }
    .notif-wrap { margin-right: 4px; }
    .pagu-panel-line { margin-left: 0; width: 100%; }
}

.chart-toggle .btn.active { background: var(--blue, #2563eb); color: #fff; border-color: var(--blue, #2563eb); }

/* ===================== RKAT: RINCIAN MULTI-VOLUME & MULTI-SATUAN ===================== */
.rincian-form { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rincian-form label, .rf-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--navy-800); }
.rf-label small { margin-left: 8px; font-weight: 500; color: var(--text-muted); }
.rf-top { display: grid; grid-template-columns: 1.2fr 1.8fr 1.2fr; gap: 12px; }
.rf-volume { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
#volFactors { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.vol-factor { display: grid; grid-template-columns: 86px minmax(90px, 1fr) minmax(120px, 1.4fr) 34px; gap: 10px; align-items: center; }
.vol-factor[hidden], #btnAddFactor[hidden], #btnCancelEdit[hidden] { display: none !important; }
.vol-badge { display: inline-flex; justify-content: center; padding: 8px 6px; border-radius: var(--radius-sm); background: var(--navy-700); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.vol-spacer { display: block; }
.rf-bottom { display: grid; grid-template-columns: 200px 1fr auto; gap: 12px; align-items: end; }
.rf-preview { display: flex; flex-direction: column; gap: 2px; padding: 9px 14px; border-radius: var(--radius-sm); background: var(--gold-100); border: 1px dashed var(--gold-500); min-height: 62px; justify-content: center; }
.rf-preview-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.rf-preview-rumus { font-size: 13px; color: var(--text); word-break: break-word; }
.rf-preview-total { font-size: 17px; color: var(--navy-900); }
.rf-actions { display: flex; gap: 8px; }
#tableRincian tr.row-editing { outline: 2px solid var(--gold-500); outline-offset: -2px; background: var(--gold-100); }
#tableRincian .cell-volume { white-space: nowrap; }
#tableRincian .cell-aksi { white-space: nowrap; }

/* ===================== RKAT — STRUKTUR KEGIATAN -> RINCIAN ===================== */
.kegiatan-bar { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; margin-bottom: 14px; background: var(--blue-bg); border: 1px solid #cfdcf7; border-radius: var(--radius-sm); }
.kb-title { font-size: 13.5px; color: var(--navy-800); }
.kb-title i { margin-right: 4px; color: var(--blue); }
.kb-title small { display: block; margin-top: 2px; color: var(--text-muted); font-weight: 400; }
.kb-fields { display: grid; grid-template-columns: 1.4fr 1.6fr auto auto; gap: 10px; align-items: center; }
.kb-fields .btn[hidden] { display: none !important; }
.rf-kegiatan label small { font-weight: 500; color: var(--text-muted); margin-left: 4px; }

#tableRincian .th-no { width: 64px; }
#tableRincian tbody.kg-group { border-top: 2px solid #d5dce8; }
#tableRincian tr.kg-head td { background: #eef2f8; font-weight: 700; color: var(--navy-900); }
#tableRincian tr.kg-head:hover td { background: #e8eef7; }
#tableRincian .kg-nama { font-size: 14.5px; }
#tableRincian .kg-count { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
#tableRincian .kg-ket { margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--text-muted); }
#tableRincian .kg-subtotal { white-space: nowrap; }
#tableRincian .kg-persen { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
#tableRincian tr.kg-empty td { padding: 12px 16px 12px 64px; font-size: 12.5px; font-style: italic; color: var(--text-muted); background: #fbfcfe; }
#tableRincian tr.kg-empty[hidden], #tableRincian tbody[hidden] { display: none !important; }
#tableRincian tbody.kg-group.kg-editing tr.kg-head td { outline: 2px solid var(--gold-500); outline-offset: -2px; background: var(--gold-100); }
#tableRincian .cell-no { white-space: nowrap; font-weight: 600; color: var(--text-muted); }
#tableRincian tr.kg-head .cell-no { color: var(--navy-900); }
#tableRincian .drag-handle, #tableRincian .kg-handle { display: inline-block; width: 18px; margin-right: 4px; color: #94a3b8; cursor: grab; text-align: center; touch-action: none; }
#tableRincian .drag-handle:hover, #tableRincian .kg-handle:hover { color: var(--navy-700); }
#tableRincian .drag-handle:active, #tableRincian .kg-handle:active { cursor: grabbing; }
#tableRincian tr.drag-ghost, #tableRincian tbody.drag-ghost { opacity: .45; background: var(--gold-100); }
/* Tanpa Kegiatan: baris judulnya baru relevan bila sudah ada kegiatan lain */
#tableRincian:not(.has-kegiatan) tbody.kg-fixed tr.kg-head, #tableRincian:not(.has-kegiatan) tbody.kg-fixed tr.kg-empty { display: none; }
/* Saat menyeret baris, grup "Tanpa Kegiatan" yang kosong ikut tampil sebagai tujuan */
#tableRincian.is-dragging tbody.kg-fixed[hidden] { display: table-row-group !important; }
#tableRincian.is-dragging.has-kegiatan tbody.kg-group { outline: 1px dashed #b7c4dc; outline-offset: -1px; }
/* ===== Pencarian & filter rincian ===== */
.flt-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; padding: 10px 12px; background: #f7f9fc; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.flt-bar.is-active { border-color: var(--gold-500); background: var(--gold-100); }
.flt-search { position: relative; flex: 1 1 280px; min-width: 220px; }
.flt-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; font-size: 13px; }
.flt-search .form-control { padding-left: 34px; padding-right: 32px; width: 100%; }
.flt-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #64748b; cursor: pointer; padding: 4px 7px; border-radius: 6px; }
.flt-clear:hover { background: #e8edf5; color: var(--text); }
.flt-bar select.form-control { flex: 0 1 180px; min-width: 140px; width: auto; }
.flt-bar [hidden] { display: none !important; }
.flt-info { margin-left: auto; font-size: 12.5px; color: var(--text-muted); }
.flt-bar.is-active .flt-info { color: var(--navy-900); font-weight: 600; }
.flt-hide { display: none !important; }
.flt-empty { margin-top: 12px; padding: 18px; text-align: center; border: 1px dashed #cbd5e1; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13.5px; }
.flt-empty .btn { margin-left: 10px; }
/* Saat difilter, seret-urut dinonaktifkan agar urutan tidak ambigu */
#tableRincian.is-filtered .drag-handle, #tableRincian.is-filtered .kg-handle { opacity: .3; cursor: not-allowed; }

/* ===== Draf otomatis ===== */
.ch-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.draft-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.draft-status.is-ok { background: var(--green-bg); color: var(--green); }
.draft-status.is-pending { background: var(--amber-bg); color: var(--amber); }
.draft-status.is-error { background: var(--red-bg); color: var(--red); }
.alert-info { background: var(--blue-bg); color: var(--blue); }
.draft-banner:not([hidden]) { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.draft-banner .db-teks { flex: 1 1 320px; line-height: 1.5; }
.draft-banner .db-aksi { display: flex; gap: 8px; flex-wrap: wrap; }
.draft-banner[hidden] { display: none; }

/* ===== Ringkasan per Triwulan (di bawah tabel Rincian Anggaran) ===== */
.tw-summary { margin-top: 22px; padding-top: 18px; border-top: 2px solid #d5dce8; }
.tw-summary-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tw-summary-head h4 { margin: 0; font-size: 15px; color: var(--navy-900); }
.tw-summary-head h4 i { color: var(--gold-500); margin-right: 4px; }
.tw-summary-head small { color: var(--text-muted); font-size: 12.5px; }
.tw-alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; line-height: 1.5; }
.tw-alert i { margin-top: 3px; }
.tw-alert-ok { background: var(--green-bg); color: var(--green); }
.tw-alert-warn { background: var(--amber-bg); color: var(--amber); }
.tw-alert-danger { background: var(--red-bg); color: var(--red); font-weight: 600; }
.tw-alert-info { background: var(--blue-bg); color: var(--blue); }
.tw-table .tw-col-porsi { min-width: 200px; }
.tw-table .tw-jumlah, .tw-table .tw-kum { white-space: nowrap; }
.tw-porsi { display: flex; align-items: center; gap: 10px; }
.tw-bar { flex: 1; height: 10px; border-radius: 999px; background: #e8edf5; overflow: hidden; min-width: 90px; }
.tw-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--blue); transition: width .35s var(--ease), background .2s; }
.tw-persen-teks { min-width: 52px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tw-table tr[data-status="waspada"] .tw-bar > span { background: var(--amber); }
.tw-table tr[data-status="kritis"] .tw-bar > span { background: var(--red); }
.tw-table tr[data-status="kosong"] .tw-bar > span { background: #cbd5e1; }
.tw-table tr[data-status="waspada"] td { background: #fffaf0; }
.tw-table tr[data-status="kritis"] td { background: #fff5f5; }
.tw-table tr[data-status="kosong"] td { color: var(--text-muted); }
.tw-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tw-st-normal { background: var(--green-bg); color: var(--green); }
.tw-st-waspada { background: var(--amber-bg); color: var(--amber); }
.tw-st-kritis { background: var(--red-bg); color: var(--red); }
.tw-st-kosong { background: #eef1f5; color: #64748b; }
.tw-table tfoot td { background: #f7f9fc; border-top: 2px solid #d5dce8; }
@media (max-width: 900px) { .kb-fields { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .rf-top { grid-template-columns: 1fr 1fr; }
    .rf-top .rf-uraian { grid-column: 1 / -1; order: -1; }
    .rf-bottom { grid-template-columns: 1fr; }
    .rf-actions { justify-content: flex-end; }
}
@media (max-width: 620px) {
    .rf-top { grid-template-columns: 1fr; }
    .vol-factor { grid-template-columns: 1fr 1fr 34px; }
    .vol-factor .vol-badge { grid-column: 1 / -1; justify-self: start; padding: 4px 12px; }
}

/* ===================== MODAL KONFIRMASI (confirmDialog) ===================== */
.confirm-overlay { z-index: 300; }
.confirm-box { max-width: 420px; text-align: center; padding: 28px 26px 22px; }
.confirm-box h3 { margin: 12px 0 8px; }
.confirm-msg { margin: 0 0 20px; color: var(--text-muted); font-size: 14px; line-height: 1.55; white-space: pre-line; }
.confirm-box .modal-actions { justify-content: center; }
.confirm-box .modal-actions .btn { min-width: 120px; }
.confirm-icon { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.confirm-icon.is-danger { background: var(--red-bg); color: var(--red); }
.confirm-icon.is-info { background: var(--blue-bg); color: var(--blue); }

/* ===================== RKAT: catatan per baris & edit header ===================== */
.row-catatan { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.row-catatan i { margin-right: 3px; }
.rf-catatan label small { font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.header-edit-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.header-edit-bar small { color: var(--text-muted); }

/* ===================== RKAT — SALIN DARI TAHUN SEBELUMNYA ===================== */
.modal-box.modal-lg { max-width: 980px; max-height: 92vh; overflow-y: auto; }
.salin-grid { display: grid; grid-template-columns: 1fr 1.3fr 1.2fr 1fr; gap: 12px; align-items: start; }
.salin-grid .form-group { margin-bottom: 8px; }
.salin-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.salin-chip {
    border: 1px solid var(--border); background: #fff; color: var(--text-muted); border-radius: 999px;
    padding: 3px 10px; font-size: 11.5px; cursor: pointer; transition: all .15s var(--ease);
}
.salin-chip:hover { border-color: var(--navy-900); color: var(--navy-900); }
.salin-chip.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.salin-docs { border: 1px solid var(--border); border-radius: 10px; max-height: 270px; overflow: auto; margin: 4px 0 12px; }
.salin-docs .table { margin: 0; font-size: 12.5px; }
.salin-docs thead th { position: sticky; top: 0; background: var(--bg); z-index: 1; }
.salin-docs .col-chk { width: 34px; text-align: center; }
.salin-docs tr.is-dup td { background: var(--amber-bg); }
.salin-akun { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.salin-akun summary { cursor: pointer; font-weight: 600; font-size: 13px; }
#salinAkunList { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 18px; max-height: 160px; overflow: auto; }
#salinAkunList .check-inline { white-space: normal; font-size: 12.5px; color: inherit; }
.salin-opsi { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.salin-total {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center;
    background: var(--bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
.salin-total b { font-size: 14.5px; }
@media (max-width: 760px) {
    .salin-grid { grid-template-columns: 1fr 1fr; }
    #salinAkunList { grid-template-columns: 1fr; }
}

/* ===================== RKAT — IMPORT DARI EXCEL ===================== */
.imp-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--bg); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 14px; margin-top: 14px;
}
.imp-bar-teks { font-size: 13px; color: var(--text-muted); }
.imp-bar-teks i { color: var(--green); margin-right: 4px; }
.imp-bar-aksi { display: flex; gap: 8px; flex-wrap: wrap; }
.imp-upload { margin-bottom: 12px; }
.imp-ringkas { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.imp-pill { border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; }
.imp-pill.ok { background: var(--green-bg); color: var(--green); }
.imp-pill.warn { background: var(--amber-bg); color: var(--amber); }
.imp-pill.err { background: var(--red-bg); color: var(--red); }
.imp-pill.info { background: #eef1f5; color: #475569; }
.imp-filter { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.imp-tabel { border: 1px solid var(--border); border-radius: 10px; max-height: 330px; overflow: auto; margin-bottom: 12px; }
.imp-tabel .table { margin: 0; font-size: 12.5px; }
.imp-tabel thead th { position: sticky; top: 0; background: var(--bg); z-index: 1; white-space: nowrap; }
.imp-tabel tr.is-err td { background: #fff5f5; }
.imp-tabel tr.is-warn td { background: var(--amber-bg); }
.imp-tabel td.cell-err { color: var(--red); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--red); }
.imp-tabel .imp-pesan { min-width: 220px; font-size: 12px; }
.imp-tabel .imp-pesan .p-err { color: var(--red); }
.imp-tabel .imp-pesan .p-warn { color: var(--amber); }
.imp-mode { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.imp-mode .is-disabled { opacity: .5; cursor: not-allowed; }

/* ===================== IZIN PENDAPATAN PER UNIT (Identitas Sekolah) ===================== */
.izin-matrix th, .izin-matrix td { white-space: nowrap; }
.izin-matrix td:first-child, .izin-matrix th:first-child { white-space: normal; min-width: 220px; }
.izin-matrix .izin-row-nonaktif td { opacity: .6; }
.izin-toggle:disabled { cursor: not-allowed; opacity: .75; }
.izin-toggle:disabled:hover { transform: none; }
.izin-state { display: inline-block; min-width: 30px; margin-left: 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .4px; vertical-align: middle; }
.izin-state.is-on { color: var(--green); }
.izin-state.is-off { color: #94a3b8; }
.izin-draft { display: block; margin-top: 2px; font-size: 11px; white-space: normal; }
.izin-blok { display: none; }
.izin-blok.is-show { display: block; }

/* ===================== BUKTI TRANSAKSI REALISASI (multi-berkas + pratinjau) ===================== */
.bukti-counter { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.bukti-counter b { color: var(--navy-900); }
.bukti-counter.is-full { color: var(--amber); }
.upload-zone.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: auto; }
.upload-zone.is-disabled:hover { border-color: var(--border); background: transparent; }
.bukti-q { margin-top: 10px; font-size: 12.5px; color: var(--navy-800); }
.bukti-q-name { display: block; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bukti-q .upload-progress { margin-top: 0; }
.bukti-empty { margin-top: 16px; padding: 18px; text-align: center; font-size: 13px; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 10px; }
.bukti-note { margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }
#buktiGrid.bukti-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.bukti-card { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.bukti-card:hover { border-color: var(--navy-700); box-shadow: 0 2px 10px rgba(15, 30, 60, .07); }
.bukti-thumb { position: relative; flex: 0 0 64px; width: 64px; height: 64px; border: 0; padding: 0; border-radius: 9px; overflow: hidden; background: #f1f4f8; cursor: zoom-in; display: flex; align-items: center; justify-content: center; }
.bukti-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bukti-thumb i { font-size: 26px; color: var(--red); }
.bukti-badge { position: absolute; left: 3px; bottom: 3px; font-size: 9px; font-weight: 800; letter-spacing: .4px; padding: 1px 5px; border-radius: 4px; background: rgba(15, 30, 60, .78); color: #fff; }
.bukti-meta { flex: 1; min-width: 0; }
.bukti-name { font-size: 12.5px; font-weight: 700; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bukti-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.bukti-actions { display: flex; flex-direction: column; gap: 4px; }
.btn-bukti-count { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--navy-800); cursor: pointer; }
.btn-bukti-count:hover { border-color: var(--navy-700); background: #f9fbfd; }
.btn-bukti-count i { color: var(--gold-500); }

/* Viewer pratinjau */
body.bv-open { overflow: hidden; }
.bv-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(10, 18, 36, .78); display: flex; align-items: center; justify-content: center; padding: 18px; opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility .2s; }
.bv-overlay.show { opacity: 1; visibility: visible; }
.bv-box { width: min(1100px, 100%); height: min(88vh, 860px); background: #fff; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.bv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.bv-title { min-width: 0; display: flex; flex-direction: column; }
.bv-title b { font-size: 14px; color: var(--navy-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-title span { font-size: 11.5px; color: var(--text-muted); }
.bv-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.bv-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--navy-800); cursor: pointer; text-decoration: none; }
.bv-btn:hover { background: #f1f4f8; }
.bv-body { flex: 1; min-height: 0; display: flex; }
.bv-list { flex: 0 0 84px; overflow-y: auto; padding: 10px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; background: #fafbfd; }
.bv-thumb { width: 62px; height: 62px; flex: 0 0 62px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: #eef1f5; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bv-thumb.active { border-color: var(--gold-500); }
.bv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bv-thumb i { font-size: 22px; color: var(--red); }
.bv-stage { flex: 1; min-width: 0; position: relative; overflow: auto; background: #20293a; display: flex; align-items: center; justify-content: center; }
.bv-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.bv-img.is-zoom { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.bv-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.bv-loading, .bv-error { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #cfd6e4; font-size: 22px; pointer-events: none; }
.bv-error { font-size: 14px; }
.bv-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 12px; font-size: 12px; text-align: center; background: rgba(255, 255, 255, .92); color: var(--text-muted); }
.bv-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 640px) {
    .bv-overlay { padding: 0; }
    .bv-box { height: 100%; border-radius: 0; }
    .bv-list { flex-basis: 70px; padding: 8px; }
    .bv-thumb { width: 52px; height: 52px; flex-basis: 52px; }
}

/* ===== Pagu & Riwayat Realisasi per baris RKAT ===== */
.stat-value-sm { font-size: 18px; }
.empty-state-sm { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.pagu-table .pagu-group td { background: #f4f6fa; font-weight: 700; font-size: 12.5px; color: var(--navy-900); }
.pagu-line { cursor: pointer; }
.pagu-line:hover, .pagu-line.is-open { background: #f8fafc; }
.pagu-chevron { transition: transform .2s var(--ease); color: var(--text-muted); font-size: 11px; }
.pagu-line.is-open .pagu-chevron { transform: rotate(90deg); }
.pagu-riwayat-row[hidden] { display: none; }
.pagu-riwayat-row > td { background: #fafbfd; padding: 0 12px 14px; }
.riwayat-box { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: #fff; margin-top: 4px; }
.riwayat-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin: 0 0 8px; }
.riwayat-summary dt { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.riwayat-summary dd { margin: 0; font-size: 14px; font-weight: 800; color: var(--navy-900); }
.riwayat-summary small { display: block; font-size: 11px; color: var(--text-muted); }
.riwayat-summary .is-sisa { padding: 6px 10px; border-radius: 8px; background: var(--green-bg); }
.riwayat-summary .is-sisa.is-near, .riwayat-summary .is-sisa.is-full { background: var(--amber-bg); }
.riwayat-summary .is-sisa.is-over { background: var(--red-bg); }
.riwayat-table { margin-top: 10px; }
.riwayat-table .riwayat-awal td { background: #f4f6fa; font-size: 12.5px; }
.riwayat-table .riwayat-nonaktif td { color: var(--text-muted); background: #fafafa; }
.riwayat-table .riwayat-nonaktif td:nth-child(3) { text-decoration: none; }
.riwayat-table tfoot td { border-top: 2px solid var(--border); }
.riwayat-note { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pagu-panel-link { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 700; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===================== REVIEW / KOMENTAR / PENOLAKAN PER BARIS RKAT =====================
   Dipakai: views/rkat/_review_inline.php, _review_ringkas.php, views/approval/_rincian_review.php,
   assets/js/review.js. Warna baris: merah = ditolak, kuning = perlu diperbaiki,
   biru = sudah ditanggapi unit, abu-biru = komentar. */
.modal-box.modal-xl { max-width: 1180px; max-height: 92vh; overflow-y: auto; }
.rv-ask { z-index: 130; }
.rv-ask-konteks { background: #f4f6f9; border-left: 3px solid var(--navy-700); padding: 8px 10px; margin: -4px 0 12px; font-size: 12.5px; color: var(--text-muted); border-radius: 4px; max-height: 90px; overflow: auto; }
.rv-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rv-modal-head h3 { margin: 0; }

.rv-panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.rv-panel-judul { font-weight: 700; font-size: 15px; color: var(--navy-900); }
.rv-panel-ringkas { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rv-panel-tip { margin-bottom: 12px; }
.rv-ringkas-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.rv-ringkas { margin-bottom: 16px; }

.table tbody tr.rv-row-tolak td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.table tbody tr.rv-row-tolak { background: #fff6f6; }
.table tbody tr.rv-row-revisi td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
.table tbody tr.rv-row-revisi { background: #fffaf0; }
.table tbody tr.rv-row-ditanggapi td:first-child { box-shadow: inset 4px 0 0 var(--blue); }
.table tbody tr.rv-row-ditanggapi { background: #f5f9ff; }
.table tbody tr.rv-row-komentar td:first-child { box-shadow: inset 4px 0 0 #94a3b8; }

.rv-note { margin-top: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 12.5px; line-height: 1.5; }
.rv-note.rv-tolak { border-color: #f3b9b9; background: var(--red-bg); }
.rv-note.rv-revisi { border-color: #f4d29a; background: var(--amber-bg); }
.rv-note.rv-komentar { background: var(--blue-bg); border-color: #c5d8f7; }
.rv-note.rv-st-selesai, .rv-note.rv-st-dibatalkan { opacity: .72; background: #f7f9fb; border-color: var(--border); }
.rv-note.rv-st-dibatalkan .rv-isi { text-decoration: line-through; }
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.rv-by { font-size: 11.5px; color: var(--text-muted); }
.rv-isi { color: var(--text); word-break: break-word; }
.rv-pesan { margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.75); border-left: 3px solid #94a3b8; }
.rv-pesan-unit { border-left-color: var(--blue); }
.rv-pesan-approver { border-left-color: var(--amber); }
.rv-pesan-sistem { border-left-color: #cbd5e1; color: var(--text-muted); font-style: italic; }
.rv-waktu { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.rv-aksi { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rv-btns { white-space: nowrap; }
.rv-btn-revisi { color: var(--amber); }
.rv-btn-tolak { color: var(--red); }
.rv-yatim, .rv-yatim-panel { margin-top: 10px; }
.rv-yatim summary { cursor: pointer; font-weight: 700; }
.rv-yatim-item { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.rv-table .rv-note { max-width: 560px; }
.js-rv-ringkas { display: flex; gap: 4px; flex-wrap: wrap; }
@media print { .rv-note, .rv-ringkas, .rv-aksi { display: none !important; } }

/* ===== Multi-triwulan pada form Rincian (pilihan TW 1-4 + Semua) ===== */
.tw-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tw-opt { position: relative; cursor: pointer; margin: 0; }
.tw-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tw-opt span { display: inline-block; padding: 7px 11px; border: 1px solid #cfd8e6; border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.tw-opt:hover span { border-color: var(--navy-900); }
.tw-opt input:checked + span { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.tw-opt input:focus-visible + span { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.tw-opt-all span { border-style: dashed; }
.tw-opt-all input:checked + span { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-900); }
.rf-top .rf-tw { min-width: 240px; }
.rf-preview-tw { font-size: 12px; color: var(--navy-900); font-weight: 600; margin-top: 2px; }
.cell-tw { white-space: nowrap; }
.tw-chip { display: inline-block; margin: 0 3px 3px 0; padding: 1px 8px; border-radius: 999px; background: var(--blue-bg); color: var(--blue); font-size: 11.5px; font-weight: 700; }
.tw-bagi { white-space: normal; min-width: 130px; }

/* ===== Form Realisasi: isian terisi otomatis dari Rencana RKAT ===== */
.form-control.is-auto { background: #f1f5fb; border-color: #c4d2e8; color: var(--navy-900); pointer-events: none; cursor: not-allowed; background-image: none; }
.form-hint { display: block; margin: -2px 0 6px; font-size: 12px; color: var(--text-muted); }

/* ===================== FILTER TERSIMPAN ===================== */
.ft-wrap { position: relative; display: inline-block; }
.ft-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold-500); color: #fff; font-size: 11px; font-weight: 800; }
.ft-panel { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(380px, 92vw); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15,35,64,.16); }
.ft-panel[hidden] { display: none; }
.ft-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.ft-empty { padding: 14px; color: var(--text-muted); font-size: 13px; text-align: center; }
.ft-item { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); }
.ft-item:hover { background: var(--navy-50, #f4f6fa); }
.ft-go { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 8px 10px; cursor: pointer; font: inherit; color: inherit; }
.ft-name { display: block; font-weight: 700; font-size: 13px; color: var(--navy-900); }
.ft-sub { display: block; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-icon { background: none; border: 0; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; color: var(--text-muted); }
.ft-icon:hover { background: #eef1f5; }
.ft-star.is-on { color: var(--gold-500); }
.ft-del:hover { color: var(--red); }
.ft-save { border-top: 1px solid var(--border); padding: 12px; }
.ft-save-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--navy-900); }
.ft-save-row { display: flex; gap: 8px; }
.ft-save-row .form-control { flex: 1; min-width: 0; }
.ft-check { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.ft-info { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }
.ft-info i { color: var(--gold-500); }
.ft-info a { margin-left: 6px; text-decoration: underline; }
.filter-bar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ===================== DASHBOARD: GRAFIK ===================== */
.chart-title { margin: 0 0 8px; font-size: 13px; color: var(--navy-900); }
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 340px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: #fff; border: 0; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-muted); }
.seg button.on { background: var(--navy-900); color: #fff; }
.chart-sum { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.chart-sum b { display: block; font-size: 17px; color: var(--navy-900); }
.chart-sum .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.lvl-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.lvl-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* Level serapan: hijau / kuning / merah (selalu disertai ikon + teks, bukan warna saja) */
.lvl { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.lvl-hijau { background: var(--green-bg); color: #0f7a37; }
.lvl-kuning { background: #fff4cc; color: #8a6100; }
.lvl-merah { background: var(--red-bg); color: #b3261e; }
.lvl-kosong { background: #eef1f5; color: #64748b; }
.matrix-tw td, .matrix-tw th { text-align: center; }
.matrix-tw td:first-child, .matrix-tw th:first-child { text-align: left; }
.matrix-tw .sub { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 768px) { .chart-box, .chart-box.tall { height: 260px; } .ft-panel { left: auto; right: 0; } }
.serapan-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .serapan-grid { grid-template-columns: 1fr; } }

#akunJenisKasWrap[hidden] { display: none !important; }
