/* =====================================================
   DESIGN TOKENS -- Chaart-inspired theme (cream, floating white cards, colorful gradients)
   ===================================================== */
:root {
    --canvas: #F1E7DA;
    --surface-1: #FFFFFF;
    --surface-2: #F7F3EC;
    --surface-3: #EFE7D9;
    --ink: #1F1B2E;
    --ink-muted: #8A8496;
    --ink-faint: #B3ADC0;
    --border: rgba(31,27,46,0.08);

    --primary: #6C4EE3;
    --primary-hover: #5B3FD1;
    --primary-active: #4A32B8;
    --primary-soft: rgba(108,78,227,0.10);

    --purple: #6C4EE3;
    --purple-2: #8B6EF5;
    --teal: #3FBFB0;
    --teal-2: #6FDCCF;
    --orange: #F4813F;
    --orange-2: #FBAE72;
    --pink: #E14C82;
    --blue: #3B7DDB;
    --green: #22A06B;
    --yellow: #C99A1E;
    --red: #E8555A;

    --online: #22A06B;
    --idle: #C99A1E;
    --dnd: #E8555A;
    --offline: #B3ADC0;

    --online-soft: rgba(34,160,107,0.10);
    --idle-soft: rgba(201,154,30,0.12);
    --dnd-soft: rgba(232,85,90,0.10);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-pill: 9999px;

    --shadow-sm: 0 1px 2px rgba(31,27,46,0.04), 0 2px 8px rgba(31,27,46,0.03);
    --shadow-md: 0 4px 14px rgba(31,27,46,0.06);
    --shadow-lg: 0 12px 30px rgba(31,27,46,0.10);

    --font-display: 'Poppins', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;

    --sidebar-bg: #FFFFFF;
    --sidebar-text: #8A8496;
    --sidebar-text-strong: #1F1B2E;
    --sidebar-hover: #F7F3EC;
    --sidebar-active: #1F1B2E;
    --sidebar-border: rgba(31,27,46,0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--canvas);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100vw;
}

h1, h2, h3, .brand-text, .profile-name, .summary-label, .summary-count,
.section-title, th, .btn {
    font-family: var(--font-display);
}

h1, h2, h3 { color: var(--ink); letter-spacing: -0.01em; }

td, .summary-count, .summary-money, input[type="number"] {
    font-variant-numeric: tabular-nums;
}

a { color: var(--primary); }

/* ---------- Auth pages (login, register, select project) ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 15%, rgba(108,78,227,0.10), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(63,191,176,0.10), transparent 45%),
        var(--canvas);
    padding: 2rem 1rem;
}

.auth-box {
    background: var(--surface-1);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
}

.auth-box-wide { max-width: 440px; }

.auth-box h2 {
    margin-bottom: 0.3rem;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-display);
}

.auth-box .subtitle {
    color: var(--ink-muted);
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
}

.auth-box label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
    margin-top: 1rem;
}

.auth-box input,
.auth-box select {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface-2);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-box input:focus,
.auth-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.auth-box button {
    width: 100%;
    margin-top: 1.6rem;
    padding: 0.75rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 0.92rem;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.auth-box button:hover { background: var(--primary-hover); }
.auth-box button:active { transform: translateY(1px); }

.footer-link { margin-top: 1.2rem; text-align: center; font-size: 0.85rem; color: var(--ink-muted); }
.footer-link a { font-weight: 700; }

.alert {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    border: 1px solid transparent;
}

.alert-error { background: var(--dnd-soft); color: #B4383D; border-color: rgba(232,85,90,0.3); }
.alert-success { background: var(--online-soft); color: #146B49; border-color: rgba(34,160,107,0.3); }
.alert-success a { color: #146B49; font-weight: 700; margin-left: 0.5rem; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.4rem 0 0.75rem; }
.radio-group { margin-top: 0.5rem; }
.radio-label { display: flex !important; align-items: center; gap: 0.45rem; font-weight: 400 !important; font-size: 0.88rem; margin-top: 0.6rem !important; color: var(--ink); }
.radio-label input { width: auto; }

/* ---------- Sidebar layout: white floating card ---------- */
.app-layout {
    display: flex;
    min-height: 100vh;
    padding: 18px;
    gap: 18px;
    align-items: flex-start;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 18px;
    min-height: calc(100vh - 36px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 22px 16px;
    overflow: hidden;
}

.brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 0 4px; }
.brand-bars { display: flex; align-items: flex-end; gap: 2px; height: 15px; }
.brand-bars span { width: 4px; border-radius: 2px; display: block; }
.brand-bars span:nth-child(1) { height: 55%; background: var(--orange); }
.brand-bars span:nth-child(2) { height: 100%; background: var(--purple); }
.brand-bars span:nth-child(3) { height: 75%; background: var(--teal); }
.brand-text { font-weight: 700; font-size: 14.5px; color: var(--sidebar-text-strong); }

.profile-block { text-align: center; margin-bottom: 22px; }

.avatar-wrap { position: relative; width: 68px; height: 68px; margin: 0 auto 10px; }

.avatar-img {
    width: 68px; height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-2), var(--teal-2));
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    border: 3px solid var(--surface-2);
}

.avatar-img-photo { object-fit: cover; }

.avatar-edit-badge {
    position: absolute;
    bottom: -2px; right: -2px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    border: 2.5px solid var(--sidebar-bg);
    cursor: pointer;
}
.avatar-edit-badge svg { width: 12px; height: 12px; }

.avatar-placeholder-lg {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-2), var(--teal-2));
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 26px;
    color: #fff;
}

.profile-name { font-weight: 700; font-size: 13.5px; color: var(--sidebar-text-strong); margin-bottom: 2px; }
.profile-email { font-size: 11px; color: var(--ink-muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-display);
    color: var(--sidebar-text);
    text-decoration: none;
    position: relative;
    transition: background 0.12s ease, color 0.12s ease;
}

.nav-icon-chip {
    width: 28px; height: 28px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-icon { width: 15px; height: 15px; flex-shrink: 0; }

.sidebar-nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.sidebar-nav a:hover .nav-icon-chip { transform: scale(1.06); }

.sidebar-nav a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-nav a.active .nav-icon-chip { box-shadow: 0 0 0 2px rgba(255,255,255,0.16); }

.chip-purple { background: #EFE9FE; color: var(--purple); }
.chip-teal { background: #E3F7F3; color: var(--teal); }
.chip-orange { background: #FEEBDE; color: var(--orange); }
.chip-pink { background: #FDE7EE; color: var(--pink); }
.chip-blue { background: #E4EFFD; color: var(--blue); }
.chip-green { background: #E5F6EC; color: var(--green); }
.chip-yellow { background: #FDF3D8; color: var(--yellow); }
.chip-red { background: #FBE7E7; color: var(--red); }
.chip-gray { background: #EDEBF2; color: #6B6478; }

/* ---------- Collapsible submenu group ---------- */
.sidebar-group { margin: 0.05rem 0; }

.sidebar-group summary {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-display);
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    list-style: none;
    transition: background 0.12s ease, color 0.12s ease;
}

.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.sidebar-group .group-label { flex: 1; }
.sidebar-group .chevron { width: 13px; height: 13px; flex-shrink: 0; transition: transform 0.15s ease; }
.sidebar-group[open] > summary .chevron { transform: rotate(90deg); }
.sidebar-group[open] > summary { color: var(--sidebar-text-strong); }

.sidebar-submenu {
    display: flex;
    flex-direction: column;
    padding-left: 0.6rem;
    margin-top: 0.1rem;
    gap: 0.05rem;
    border-left: 2px solid var(--surface-3);
    margin-left: 1.3rem;
}

.sidebar-submenu a { padding: 0.4rem 0.6rem; font-size: 12px; }
.sidebar-submenu a .nav-icon { width: 14px; height: 14px; }

.sidebar-blob {
    position: absolute;
    bottom: -30px; left: -40px;
    width: 150px; height: 150px;
    background: linear-gradient(135deg, var(--teal-2), var(--purple-2));
    opacity: 0.14;
    border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%;
    z-index: 0;
    pointer-events: none;
}

.sidebar-footer {
    padding: 14px 8px 4px;
    border-top: 1px solid var(--sidebar-border);
    margin-top: 12px;
    font-size: 0.78rem;
    display: flex;
    gap: 0.9rem;
}

.sidebar-footer a { color: var(--primary); text-decoration: none; font-weight: 700; }
.sidebar-footer a:hover { color: var(--primary-hover); }

.content-area { flex: 1; min-width: 0; }

.container { max-width: 100%; margin: 0; padding: 6px 6px 24px; }

h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; }
.subtitle { color: var(--ink-muted); font-size: 0.88rem; margin-top: 0.2rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.6rem 1.35rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: #35304A; }
.btn:active { transform: translateY(1px); }

.btn-secondary {
    background: var(--surface-1);
    color: var(--ink);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-2); }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.header-actions { display: flex; gap: 0.6rem; }

/* ---------- Search bar ---------- */
.search-bar {
    display: flex;
    align-items: end;
    gap: 1.25rem;
    background: var(--surface-1);
    padding: 1.1rem 1.3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-bar label { display: block; font-size: 0.72rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.search-bar input, .search-bar select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar input:focus, .search-bar select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Status filter pills (di atas tabel) ---------- */
.status-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.status-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-pill);
    background: var(--surface-1);
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.status-filter-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.status-filter-count {
    background: rgba(0,0,0,0.06);
    color: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.4rem;
    border-radius: var(--radius-pill);
}

.status-filter-pill.active {
    color: #fff;
    background: var(--ink);
}
.status-filter-pill.active .status-filter-count { background: rgba(255,255,255,0.2); }

.status-filter-pill.status-filter-waiting-to-pr.active,
.status-filter-pill.status-filter-waiting-to-pv.active { background: var(--idle); }
.status-filter-pill.status-filter-waiting-to-disbursment.active { background: var(--blue); }
.status-filter-pill.status-filter-done-disbursment.active { background: var(--green); }
.status-filter-pill.status-filter-sudah-di-invoice-insentif-only.active { background: var(--purple); }
.status-filter-pill.status-filter-pending.active { background: var(--ink-muted); }
.search-actions { display: flex; gap: 0.5rem; }

/* ---------- Form card ---------- */
.form-card { background: var(--surface-1); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm); max-width: 560px; }
.form-card-wide { max-width: 920px; }
.form-card h3 { margin-bottom: 1.1rem; font-size: 1.05rem; font-weight: 700; }

.form-card label { display: block; font-size: 0.76rem; font-weight: 700; color: var(--ink-muted); margin-top: 1rem; margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.03em; }

.form-card input, .form-card select, .form-card textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface-2);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-card input:disabled { background: var(--surface-3); color: var(--ink-faint); cursor: not-allowed; }
.form-card textarea { resize: vertical; }
.form-actions { margin-top: 1.75rem; display: flex; gap: 0.6rem; }
.required-note { font-weight: 500; color: var(--dnd); font-size: 0.72rem; text-transform: none; letter-spacing: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.1rem; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface-1); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
th, td { padding: 0.7rem 0.9rem; text-align: left; font-size: 0.83rem; }
th { background: var(--surface-2); color: var(--ink-muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; white-space: nowrap; }
td { border-top: 1px solid var(--border); color: var(--ink); }
tbody tr:hover { background: var(--surface-2); }
.empty-state { text-align: center; color: var(--ink-faint); padding: 2.5rem !important; font-size: 0.88rem; }

.truncate-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.table-compact th { font-size: 0.6rem; padding: 0.5rem 0.6rem; }
.table-compact td { font-size: 0.68rem; padding: 0.5rem 0.6rem; }
.table-compact .truncate-cell { max-width: 140px; overflow: visible; text-overflow: unset; white-space: normal; word-break: break-word; display: block; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; align-items: start; }

.kv-table { width: 100%; border-collapse: collapse; box-shadow: none; background: transparent; border-radius: 0; margin-bottom: 0.5rem; }
.kv-table tr { border-bottom: 1px solid var(--border); }
.kv-table tr:last-child { border-bottom: none; }
.kv-table td { padding: 0.65rem 0.25rem; font-size: 0.85rem; border-top: none; vertical-align: top; }
.kv-table td:first-child { color: var(--ink-muted); font-weight: 600; width: 42%; white-space: nowrap; }
.kv-table td:last-child { color: var(--ink); text-align: right; }

.table-scroll { overflow-x: auto; border-radius: var(--radius-lg); }
.table-scroll table { border-radius: 0; }

.action-cell a { margin-right: 0.85rem; color: var(--primary); text-decoration: none; font-size: 0.8rem; font-weight: 700; }
.action-cell a:hover { text-decoration: underline; }
.action-cell a.text-danger { color: var(--dnd); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 0.22rem 0.65rem; border-radius: var(--radius-pill); font-size: 0.7rem; font-weight: 700; }
.badge-ditagihkan { background: #E4EFFD; color: var(--blue); }
.badge-ca { background: var(--idle-soft); color: #966616; }
.badge-opex { background: var(--surface-2); color: var(--ink-muted); }
.badge-pembayaran_sistem { background: #E4EFFD; color: var(--blue); }
.badge-open_hold_salary, .badge-open_hold_insentif { background: var(--idle-soft); color: #966616; }
.badge-others { background: var(--surface-2); color: var(--ink-faint); }
.badge-done { background: var(--online-soft); color: #146B49; }
.badge-pending { background: var(--surface-2); color: var(--ink-faint); }
.badge-returned { background: #FDE7EE; color: #A32659; }

.text-muted { color: var(--ink-faint); font-size: 0.85rem; }
.text-danger { color: var(--dnd); }
.text-green { color: var(--online); }
.text-orange { color: var(--idle); }

.quick-add-link { color: var(--primary); text-decoration: none; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.quick-add-link:hover { text-decoration: underline; }
.inline-btn { background: none; border: none; font-family: inherit; }

.billing-inline-form { display: flex; gap: 0.6rem; align-items: center; padding: 0.4rem 0; flex-wrap: wrap; }
.billing-inline-form input { padding: 0.5rem 0.7rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; font-family: inherit; background: var(--surface-2); color: var(--ink); }
.billing-inline-form input[name="no_billing"] { flex: 1; min-width: 160px; }
.billing-inline-form input[name="deskripsi_billing"] { flex: 1.5; min-width: 180px; }

/* ---------- Status select (inline editable) ---------- */
.inline-status-form { margin: 0; }
.status-select { padding: 0.32rem 0.65rem; border: none; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 700; cursor: pointer; background: var(--surface-2); color: var(--ink-muted); font-family: inherit; }
.status-select.status-pending { background: var(--surface-2); color: var(--ink-faint); }
.status-select.status-waiting-to-pr, .status-select.status-waiting-to-pv { background: var(--idle-soft); color: #966616; }
.status-select.status-waiting-to-disbursment { background: #E4EFFD; color: var(--blue); }
.status-select.status-done-disbursment { background: var(--online-soft); color: #146B49; }
.status-select.status-sudah-di-invoice-insentif-only { background: #EFE9FE; color: var(--purple); }

/* ---------- Dashboard summary cards: colorful gradients ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }

.summary-card { border-radius: var(--radius-lg); padding: 1.3rem 1.4rem; color: #fff; box-shadow: var(--shadow-sm); background: linear-gradient(135deg, var(--purple-2), var(--purple)); }
.summary-label { font-size: 0.75rem; font-weight: 600; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.03em; }
.summary-count { font-size: 1.6rem; font-weight: 700; margin-top: 0.5rem; }
.summary-money { font-size: 1.2rem; }

.card-grid .summary-card:nth-child(1) { background: linear-gradient(135deg, var(--purple-2), var(--purple)); }
.card-grid .summary-card:nth-child(2) { background: linear-gradient(135deg, var(--teal-2), var(--teal)); }
.card-grid .summary-card:nth-child(3) { background: var(--ink); }
.card-grid .summary-card:nth-child(4) { background: linear-gradient(135deg, var(--orange-2), var(--orange)); }
.summary-card-billed, .summary-card-unbilled { color: #fff; }

.section-title { margin: 2rem 0 0.9rem; font-size: 1.05rem; font-weight: 700; }

.chart-card { background: var(--surface-1); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }

.reminder-box { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 1.15rem 1.4rem; margin: 1.6rem 0 2rem; }
.reminder-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: #FDA5A5; font-size: 0.9rem; margin-bottom: 0.75rem; }
.reminder-box table { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10); box-shadow: none; }
.reminder-box th { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55); }
.reminder-box td { color: #fff; border-top: 1px solid rgba(255,255,255,0.08); }
.reminder-box tbody tr:hover { background: rgba(255,255,255,0.04); }
.reminder-box a { color: #fff; font-weight: 700; }

/* ---------- CA Settlement ---------- */
.ca-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.ca-summary > div { background: var(--surface-1); border-radius: var(--radius-lg); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm); }
.ca-summary span { display: block; font-size: 0.75rem; color: var(--ink-muted); margin-bottom: 0.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.ca-summary strong { font-size: 1.2rem; font-family: var(--font-display); }

.pr-assign-form { display: flex; flex-direction: column; gap: 0.3rem; min-width: 220px; }
.pr-search-input {
    padding: 0.35rem 0.55rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--ink);
}
.pr-search-input:focus { outline: none; border-color: var(--primary); }
.pr-select-item {
    padding: 0.32rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 0.76rem;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--ink);
    max-width: 260px;
}

.breakdown-row { display: flex; gap: 0.6rem; margin-bottom: 0.65rem; align-items: center; flex-wrap: wrap; }
.breakdown-row select, .breakdown-row input { padding: 0.55rem 0.7rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; font-family: inherit; background: var(--surface-2); color: var(--ink); }
.breakdown-row select:focus, .breakdown-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.jenis-settlement-select { flex: 1.2; min-width: 140px; }
.pr-select { flex: 1.5; min-width: 160px; }
.breakdown-row input[name="nominal[]"] { flex: 1; min-width: 100px; }
.keterangan-input { flex: 1.3; min-width: 140px; }

.btn-remove-row { background: var(--dnd-soft); color: var(--dnd); border: none; border-radius: var(--radius-sm); width: 34px; height: 34px; cursor: pointer; font-size: 1.15rem; flex-shrink: 0; }
.btn-remove-row:hover { background: rgba(232,85,90,0.2); }
.btn-add-row { margin-top: 0.35rem; font-size: 0.82rem; }

/* ---------- Master Data ---------- */
.master-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.master-tab { padding: 0.65rem 1.15rem; text-decoration: none; color: var(--ink-muted); font-size: 0.87rem; font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.master-tab:hover { color: var(--ink); }
.master-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.master-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; align-items: start; }

/* ---------- Alur PV -- flowchart vertikal ---------- */
.flow-picker-hint { color: var(--ink-muted); font-size: 0.9rem; line-height: 1.6; }
.flow-branch { margin-bottom: 2rem; }
.flow-branch-title { font-weight: 700; color: var(--ink-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.flow-board-v { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 0.5rem 0; }
.flow-stage-v { width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.flow-stage-label { text-align: center; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.flow-nodes-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; width: 100%; }
.flow-node { background: var(--surface-1); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 1.1rem 1.3rem; min-width: 220px; max-width: 320px; flex: 1 1 220px; text-decoration: none; color: var(--ink); display: block; }
.flow-node-link:hover { box-shadow: var(--shadow-md); }
.flow-node-title { font-weight: 700; font-size: 0.95rem; }
.flow-node-sub { font-size: 0.74rem; color: var(--ink-muted); margin-top: 0.3rem; word-break: break-word; }
.flow-node-current { background: var(--primary-soft); }
.flow-node-empty { color: var(--ink-faint); font-style: italic; text-align: center; box-shadow: none; border: 1.5px dashed var(--border); }
.flow-node-external-link { display: inline-block; margin-top: 0.5rem; font-size: 0.72rem; font-weight: 700; color: var(--primary) !important; text-decoration: none; }
.flow-node-external-link:hover { text-decoration: underline; }
.flow-arrow-v { display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 1.6rem; padding: 0.6rem 0; }

/* ---------- Task Kanban Board ---------- */
.kanban-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; align-items: start; }
@media (max-width: 900px) { .kanban-board { grid-template-columns: 1fr; } }
.kanban-column { background: var(--surface-1); border-radius: var(--radius-lg); padding: 1rem; min-height: 200px; box-shadow: var(--shadow-sm); }
.kanban-column-header { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-family: var(--font-display); font-size: 0.85rem; padding: 0.3rem 0.4rem 0.9rem; border-bottom: 1px solid var(--border); margin-bottom: 0.9rem; }
.kanban-count { background: var(--surface-2); color: var(--ink-muted); font-size: 0.72rem; font-weight: 700; padding: 0.1rem 0.55rem; border-radius: var(--radius-pill); }
.kanban-cards { display: flex; flex-direction: column; gap: 0.7rem; min-height: 60px; }
.kanban-empty { color: var(--ink-faint); font-size: 0.8rem; text-align: center; padding: 1rem 0; font-style: italic; }
.kanban-card { background: var(--surface-2); border-radius: var(--radius-md); padding: 0.85rem 0.95rem; cursor: grab; }
.kanban-card:hover { box-shadow: var(--shadow-sm); }
.kanban-card-top { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.kanban-card-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.35rem; }
.kanban-card-desc { font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 0.55rem; }
.kanban-card-meta { display: flex; gap: 0.9rem; font-size: 0.74rem; color: var(--ink-muted); margin-bottom: 0.5rem; }
.kanban-card-actions { display: flex; gap: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.kanban-card-actions a { font-size: 0.74rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.kanban-card-actions a.text-danger { color: var(--dnd); }

.priority-rendah { background: var(--surface-2); color: var(--ink-faint); }
.priority-sedang { background: #E4EFFD; color: var(--blue); }
.priority-tinggi { background: var(--idle-soft); color: #966616; }
.priority-urgent { background: var(--dnd-soft); color: #B4383D; }

.task-progress-card { background: var(--surface-1); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.task-progress-bar-track { background: var(--surface-2); border-radius: var(--radius-pill); height: 10px; overflow: hidden; margin: 0.75rem 0 1rem; }
.task-progress-bar-fill { background: linear-gradient(135deg, var(--teal-2), var(--teal)); height: 100%; border-radius: var(--radius-pill); }
.task-progress-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--ink-muted); }
.task-progress-stats strong { color: var(--ink); font-family: var(--font-display); }

@media (max-width: 1200px) {
    .app-layout { padding: 12px; gap: 12px; }
    .sidebar { width: 210px; padding: 18px 12px; }
}

@media (max-width: 900px) {
    .master-layout { grid-template-columns: 1fr; }
    .app-layout { flex-direction: column; padding: 10px; }
    .sidebar { width: 100%; min-height: auto; position: relative; top: 0; }
    .container { padding: 12px; }
    .card-grid, .kanban-board, .detail-grid { grid-template-columns: 1fr; }
    .search-bar { flex-direction: column; align-items: stretch; }
    .search-bar > div { width: 100%; }
}
