:root {
    --brand: #0d9488;
    --brand-600: #0f766e;
    --brand-700: #115e59;
    --brand-soft: #ccfbf1;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f4f7f6;
    --sidebar-bg: #0b2f2b;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 0.92rem;
}

a {
    color: var(--brand-600);
}

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

.app-sidebar {
    width: 262px;
    flex: 0 0 262px;
    background: linear-gradient(180deg, #0b2f2b 0%, #07211e 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.15rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    box-shadow: 0 8px 18px rgba(13, 148, 136, 0.35);
}

.brand-text strong {
    display: block;
    color: #fff;
    font-size: 0.96rem;
    letter-spacing: 0.01em;
}

.brand-text span {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #7ba8a0;
}

.sidebar-label {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #5f8a83;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0 0.65rem;
    flex: 1 0 auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.58rem 0.75rem;
    margin-bottom: 0.15rem;
    border-radius: 0.55rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.95), rgba(13, 148, 136, 0.6));
    color: #fff;
    box-shadow: 0 8px 18px rgba(13, 148, 136, 0.28);
}

.sidebar-nav i {
    width: 1.15rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-foot {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    color: #6b938d;
}

.app-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.4rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.page-title {
    font-size: 1.06rem;
    font-weight: 700;
    margin: 0;
}

.page-subtitle {
    font-size: 0.75rem;
    color: var(--muted);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-700);
    font-weight: 700;
    display: grid;
    place-items: center;
}

.user-info {
    line-height: 1.1;
    text-align: right;
}

.user-name {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
}

.user-role {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
}

.app-content {
    padding: 1.35rem;
    flex: 1;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1.4rem;
    border-top: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.75rem;
}

/* ------------------------------------------------------------------ cards */
.card {
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    padding: 0.8rem 1rem;
    border-radius: 0.8rem 0.8rem 0 0 !important;
}

.card-header .card-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.stat-card .card-body {
    padding: 1rem 1.05rem;
}

.stat-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.bg-teal {
    background: #ccfbf1;
    color: #0f766e;
}

.bg-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.bg-amber {
    background: #fef3c7;
    color: #b45309;
}

.bg-purple {
    background: #ede9fe;
    color: #6d28d9;
}

.bg-rose {
    background: #ffe4e6;
    color: #be123c;
}

.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
}

.stat-value {
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.25;
}

.stat-sub {
    font-size: 0.72rem;
    color: var(--muted);
}

/* ------------------------------------------------------------------ misc */
.btn-brand {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand-700);
    border-color: var(--brand-700);
    color: #fff;
}

.table {
    --bs-table-color: var(--ink);
    margin-bottom: 0;
    font-size: 0.85rem;
}

.table > thead {
    background: #f8fafc;
}

.table > thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.table > tbody > tr > td {
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    background-color: #f0fdfa;
}

.table-total > td {
    background: #f8fafc;
    font-weight: 700;
}

.row-jatuh-tempo > * {
    background: #fff7ed !important;
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: #eef2f1;
}

.progress-bar {
    border-radius: 999px;
}

.badge {
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.35em 0.6em;
}

.empty-state {
    text-align: center;
    padding: 2.2rem 1rem;
    color: var(--muted);
}

.empty-state i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    color: #94a3b8;
}

.filter-bar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.auth-note {
    font-size: 0.72rem;
    color: var(--muted);
}

.info-grid dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
}

.info-grid dd {
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.kartu-anggota {
    border-top: 4px solid var(--brand-600);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--brand-600);
}

/* ------------------------------------------------------------------ login */
.login-page {
    background: radial-gradient(1200px 600px at 10% 10%, #0f766e 0%, #062f2b 55%, #041f1c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: var(--ink);
}

.login-wrapper {
    width: min(940px, 100%);
}

.login-card {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #fff;
    border-radius: 1.1rem;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(2, 25, 22, 0.45);
}

.login-intro {
    background: linear-gradient(160deg, #0f766e 0%, #0b2f2b 100%);
    color: #e2f5f1;
    padding: 2.4rem 2.2rem;
}

.login-intro h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.login-intro p {
    font-size: 0.85rem;
    color: #a8ccc5;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.83rem;
}

.login-features li {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    color: #d6ece8;
}

.login-features i {
    color: #5eead4;
}

.login-form {
    padding: 2.4rem 2.2rem;
}

.login-form h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.login-hint {
    margin-top: 1.5rem;
    padding: 0.75rem 0.9rem;
    background: #f1f5f9;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.6;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
}

.form-control,
.form-select {
    font-size: 0.87rem;
    border-color: #d7e0dd;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.15);
}

.input-group-text {
    background: #f8fafc;
    color: var(--muted);
}

/* ------------------------------------------------------------------ print */
@media print {
    .app-sidebar,
    .app-topbar,
    .app-footer,
    .no-print,
    .alert {
        display: none !important;
    }

    .app-content {
        padding: 0;
    }

    body {
        background: #fff;
        font-size: 0.8rem;
    }

    .card {
        border: 0 !important;
        box-shadow: none !important;
    }

    .card-header {
        background: transparent;
    }

    .table > thead {
        background: #f1f5f9 !important;
    }

    .table {
        font-size: 0.75rem;
    }

    a[href]::after {
        content: "";
    }

    .print-header {
        display: block !important;
    }
}

.print-header {
    display: none;
    text-align: center;
    margin-bottom: 1rem;
}

.print-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.print-header p {
    margin: 0;
    font-size: 0.78rem;
    color: #475569;
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 0 0 40px rgba(2, 25, 22, 0.5);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-intro {
        display: none;
    }

    .app-content {
        padding: 1rem;
    }
}
