@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
    --ink: #1a1f36;
    --muted: #6b7294;
    --canvas: #f0f2f8;
    --surface: #ffffff;
    --line: #e4e8f1;
    --navy: #14213d;
    --teal: #0ea5a0;
    --teal-light: #e6faf9;
    --blue: #3b82f6;
    --green: #10b981;
    --red: #ef4444;
    --orange: #f59e0b;
    --purple: #8b5cf6;
    --shadow-xs: 0 1px 2px rgba(20,33,61,.04);
    --shadow: 0 4px 16px rgba(20,33,61,.06);
    --shadow-md: 0 8px 30px rgba(20,33,61,.08);
    --shadow-lg: 0 16px 50px rgba(20,33,61,.12);
    --shadow-hover: 0 12px 40px rgba(20,33,61,.12);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --transition: .25s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
    background: var(--canvas);
    background-image: 
        radial-gradient(circle at 5% 0%, rgba(14,165,160,.06), transparent 30%),
        radial-gradient(circle at 95% 100%, rgba(59,130,246,.04), transparent 30%);
    color: var(--ink);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .brand-lockup { font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif; }
h3 { font-weight: 800; letter-spacing: -.03em; font-size: 1.6rem; }
h5 { font-weight: 700; letter-spacing: -.02em; }
.text-muted { color: var(--muted) !important; }

/* ===== NAVBAR ===== */
.app-navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #134e4a 100%) !important;
    box-shadow: 0 4px 20px rgba(15,23,42,.25);
    min-height: 68px;
    padding: .5rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
}
.navbar-brand { letter-spacing: .02em; padding: 0; }
.brand-lockup { align-items: center; display: inline-flex; gap: 10px; line-height: 1.1; }
.brand-lockup > span:last-child { font-size: .95rem; font-weight: 700; }
.brand-lockup small { color: rgba(255,255,255,.5); display: block; font-family: 'Inter', sans-serif; font-size: .62rem; font-weight: 500; letter-spacing: .04em; margin-top: 3px; text-transform: uppercase; }
.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, #2dd4bf, #22d3ee);
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(45,212,191,.3);
    color: #0f172a;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    width: 36px;
    transition: var(--transition);
}
.brand-mark:hover { transform: rotate(-5deg) scale(1.05); }
.brand-mark i { color: inherit; font-size: 1.05rem; margin: 0; }
.navbar .nav-link {
    border-radius: var(--radius-xs);
    color: rgba(255,255,255,.65) !important;
    font-size: .82rem;
    font-weight: 500;
    margin: 0 1px;
    padding: 8px 14px !important;
    transition: var(--transition);
    position: relative;
}
.navbar .nav-link:hover { background: rgba(255,255,255,.1); color: #fff !important; }
.navbar .nav-link.active {
    background: rgba(45,212,191,.15);
    color: #5eead4 !important;
    font-weight: 600;
}
.navbar .nav-link i { margin-right: 5px; font-size: .88rem; }
.navbar-toggler { border-color: rgba(255,255,255,.2); padding: 6px 10px; }
.navbar-toggler:focus { box-shadow: 0 0 0 2px rgba(45,212,191,.3); }
.navbar .dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: .5rem;
    margin-top: .5rem;
}
.navbar .dropdown-item {
    border-radius: var(--radius-xs);
    padding: .55rem .85rem;
    font-size: .82rem;
    font-weight: 500;
    transition: var(--transition);
}
.navbar .dropdown-item:hover { background: var(--teal-light); color: var(--teal); }
.navbar .dropdown-item i { margin-right: 8px; width: 16px; text-align: center; }
.navbar .dropdown-divider { margin: .35rem .5rem; border-color: var(--line); }

.btn-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    padding: 6px 14px 6px 10px;
    transition: var(--transition);
}
.btn-user:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-user i { font-size: 1.2rem; }
.btn-user .user-badge {
    background: rgba(255,255,255,.15);
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 2px 8px;
    text-transform: uppercase;
}
.btn-user .user-badge.admin { background: rgba(245,158,11,.25); color: #fbbf24; }

/* ===== CONTAINER ===== */
.container { max-width: 1200px; }
.container.mt-4 { margin-top: 2rem !important; }
.page-heading { gap: 12px; }
.eyebrow { color: var(--teal); font-size: .65rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.page-heading h3 { margin-top: .2rem; }
.role-pill {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-xs);
    color: #64748b;
    font-size: .75rem;
    font-weight: 600;
    padding: .45rem .75rem;
    white-space: nowrap;
}
.role-pill i { color: var(--teal); margin-right: 4px; }

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border: 1px solid rgba(228,232,241,.8) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow) !important;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md) !important; }
.card-header {
    background: rgba(255,255,255,.95) !important;
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem;
}
.card-header h5 { font-size: .92rem; font-weight: 700; margin-bottom: 0; color: var(--ink); }
.card-body { padding: 1.25rem; }

.row.g-3 > [class*="col-"] > .card { height: 100%; }
.border-success, .border-danger, .border-primary, .border-info, .border-warning { border-top-width: 3px !important; }
.display-6 { font-size: 2rem; }
.card-title { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.card-text.fs-5 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.2rem !important; }
.metric-card { position: relative; overflow: hidden; border-radius: var(--radius) !important; }
.metric-card:after { content: ''; position: absolute; right: -20px; top: -25px; width: 80px; height: 80px; border-radius: 50%; opacity: .07; background: currentColor; }
.metric-card .display-6 { position: relative; z-index: 1; }
.quick-actions { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.quick-action {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
}
.quick-action:hover { border-color: var(--teal); box-shadow: var(--shadow-md); color: var(--ink); transform: translateY(-3px); }
.quick-action .quick-text { align-items: center; display: flex; flex-direction: column; }
.quick-action strong { font-family: 'Plus Jakarta Sans', sans-serif; font-size: .84rem; margin-top: .6rem; }
.quick-action small { color: var(--muted); margin-top: .2rem; font-size: .72rem; }
.quick-icon { align-items: center; border-radius: 10px; display: inline-flex; font-size: 1.35rem; height: 42px; justify-content: center; width: 42px; }
.quick-icon.blue { background: #eff6ff; color: var(--blue); }
.quick-icon.teal { background: #e6faf9; color: var(--teal); }
.quick-icon.orange { background: #fffbeb; color: var(--orange); }
/* Hanya 1 tombol (akun warga): tampil full width, layout horizontal */
.quick-actions.quick-actions-single { grid-template-columns: 1fr; }
.quick-actions.quick-actions-single .quick-action {
    align-items: center;
    flex-direction: row;
    gap: .85rem;
    justify-content: flex-start;
    min-height: 0;
    padding: 1rem 1.25rem;
    text-align: left;
    width: 100%;
}
.quick-actions.quick-actions-single .quick-action .quick-text { align-items: flex-start; }
.quick-actions.quick-actions-single .quick-action strong,
.quick-actions.quick-actions-single .quick-action small { margin-top: 0; }
/* ===== SUMMARY CARDS ===== */
.summary-card {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: .85rem;
    min-height: 92px;
    padding: 1rem 1.15rem;
    transition: var(--transition);
}
.summary-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.summary-icon { align-items: center; border-radius: 11px; display: inline-flex; flex: 0 0 46px; font-size: 1.3rem; height: 46px; justify-content: center; }
.summary-card small { color: #64748b; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.summary-card p { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.25rem; font-weight: 800; margin: .2rem 0 0; letter-spacing: -.02em; }

/* Sudah Lunas - Rich Green */
.summary-paid {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: #047857;
}
.summary-paid .summary-icon { background: rgba(255,255,255,.22); color: #fff; }
.summary-paid small { color: rgba(255,255,255,.8); }
.summary-paid p { color: #fff; }

/* Belum Lunas - Warm Amber/Orange */
.summary-unpaid {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border-color: #b45309;
}
.summary-unpaid .summary-icon { background: rgba(255,255,255,.22); color: #fff; }
.summary-unpaid small { color: rgba(255,255,255,.8); }
.summary-unpaid p { color: #fff; }

/* Total Terbayar - Cool Blue */
.summary-total {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: #1d4ed8;
}
.summary-total .summary-icon { background: rgba(255,255,255,.22); color: #fff; }
.summary-total small { color: rgba(255,255,255,.8); }
.summary-total p { color: #fff; }
.iuran-table td { font-size: .84rem; padding-bottom: .5rem; padding-top: .5rem; }
.report-summary { border: 1px solid var(--line) !important; border-left: 4px solid; border-radius: var(--radius) !important; }
.report-summary .card-body { align-items: center; display: flex; gap: .8rem; min-height: 92px; padding: 1rem; }
.report-summary-icon { align-items: center; border-radius: 10px; display: inline-flex; flex: 0 0 40px; font-size: 1.1rem; height: 40px; justify-content: center; }
.report-summary small { color: #6b7294; display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.report-summary p { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.05rem; font-weight: 800; margin: .18rem 0 0; letter-spacing: -.02em; }
.report-income { border-left-color: var(--teal) !important; }
.report-income .report-summary-icon { background: #e6faf9; color: var(--teal); }
.report-income p { color: #0d9488; }
.report-expense { border-left-color: var(--red) !important; }
.report-expense .report-summary-icon { background: #fef2f2; color: var(--red); }
.report-expense p { color: #dc2626; }
.report-balance { border-left-color: var(--blue) !important; }
.report-balance .report-summary-icon { background: #eff6ff; color: var(--blue); }
.report-balance p { color: #2563eb; }
.report-dues { border-left-color: #0891b2 !important; }
.report-dues .report-summary-icon { background: #ecfeff; color: #0891b2; }
.report-dues p { color: #0e7490; }

/* ===== TABLES ===== */
.table { margin-bottom: 0; }
.table thead th {
    background: #f8f9fc;
    border-bottom: 1.5px solid var(--line);
    color: #8892a8;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: .65rem .85rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.table td { border-color: #f0f2f7; line-height: 1.3; padding: .65rem .85rem; vertical-align: middle; font-size: .85rem; }
.table-hover tbody tr { transition: background var(--transition); }
.table-hover tbody tr:hover { background: #f8fafc; }
.table tfoot td { padding: .85rem 1rem; border-top: 2px solid var(--line); }
.warga-table thead th { padding: .55rem .75rem; }
.warga-table td { font-size: .84rem; line-height: 1.2; padding: .5rem .75rem; }
.warga-table .btn { font-size: .76rem; line-height: 1; padding: .3rem .5rem; border-radius: var(--radius-xs); }
.warga-table strong { font-weight: 700; }

/* ===== BADGES ===== */
.badge { border-radius: var(--radius-xs); font-size: .66rem; font-weight: 700; line-height: 1.1; padding: 5px 10px; letter-spacing: .02em; }
.bg-success { background-color: var(--teal) !important; }
.bg-danger { background-color: var(--red) !important; }
.bg-primary { background-color: var(--blue) !important; }
.bg-secondary { background-color: #94a3b8 !important; }
.badge-lunas { background: #ecfdf5; color: #059669; }
.badge-belum { background: #fef2f2; color: #dc2626; }

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: .84rem;
    padding: .5rem 1rem;
    transition: var(--transition);
    letter-spacing: .01em;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #2563eb, #0ea5a0); border: 0; box-shadow: 0 4px 14px rgba(37,99,235,.25); }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #0d9488); box-shadow: 0 6px 20px rgba(37,99,235,.3); }
.btn-outline-primary { border-color: #bfdbfe; color: #2563eb; }
.btn-outline-primary:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-outline-danger { border-color: #fecaca; color: #dc2626; }
.btn-outline-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-sm { font-size: .76rem; padding: .3rem .65rem; border-radius: var(--radius-xs); }
.btn-success { background: var(--teal); border-color: var(--teal); }
.btn-success:hover { background: #0d9488; border-color: #0d9488; }

/* ===== FORMS ===== */
.form-label { color: #475569; font-size: .8rem; font-weight: 600; margin-bottom: .4rem; }
.form-control, .form-select { background-color: #f8fafc; border: 1.5px solid var(--line); border-radius: var(--radius-xs); padding: .6rem .85rem; font-size: .85rem; transition: var(--transition); }
.form-control:focus, .form-select:focus { background: #fff; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,165,160,.1); }
.input-group-text { background: #f1f5f9; border-color: var(--line); color: #94a3b8; border-radius: var(--radius-xs) 0 0 var(--radius-xs); font-size: .9rem; }

/* ===== ALERTS & TABS ===== */
.alert { border: 0; border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .85rem 1.1rem; font-size: .85rem; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert i { margin-right: 6px; }
.nav-tabs { border-bottom: 1px solid var(--line); gap: 4px; }
.nav-tabs .nav-link { border: 0; border-radius: var(--radius-xs) var(--radius-xs) 0 0; color: var(--muted); font-weight: 600; font-size: .82rem; padding: .75rem 1rem; transition: var(--transition); }
.nav-tabs .nav-link:hover { background: var(--teal-light); color: var(--teal); }
.nav-tabs .nav-link.active { background: #e6faf9; color: var(--teal); border-bottom: 2px solid var(--teal); }

/* ===== MODALS ===== */
.modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line); padding: 1.1rem 1.25rem; }
.modal-header .modal-title { font-size: 1rem; font-weight: 700; }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top: 1px solid var(--line); padding: .85rem 1.25rem; }

/* ===== FOOTER & MISC ===== */
footer { border-top: 1px solid var(--line); color: var(--muted); }
.text-success { color: var(--teal) !important; }
.text-danger { color: var(--red) !important; }
.text-primary { color: var(--blue) !important; }

@media (max-width: 767.98px) {
    .container.mt-4 { margin-top: 1.25rem !important; }
    .app-navbar { min-height: 56px; }
    .navbar-collapse { padding: .75rem 0; border-top: 1px solid rgba(255,255,255,.1); margin-top: .5rem; }
    .navbar .nav-link { margin: 2px 0; padding: 10px 14px !important; }
    .btn-user { width: 100%; justify-content: center; }
    h3 { font-size: 1.3rem; }
    .page-heading { align-items: flex-start !important; gap: .75rem; }
    .quick-actions { grid-template-columns: 1fr; }
    .card-body { padding: 1rem; }
    .table td, .table thead th { padding: .5rem .6rem; }
    .warga-table td { padding: .4rem .55rem; }
    .table { font-size: .82rem; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-select, .filter-bar .form-control { width: 100%; }
}
