
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

/* =========================================================
   1. VARIABLES & RESET
========================================================= */

:root {
    --green: #103b32;
    --dark: #092820;
    --gold: #e9b66d;
    --cream: #f5efe4;
    --white: #fffdf8;
    --text: #243a32;
    --muted: #7d8982;
    --line: #e8e9e3;
    --shadow: 0 18px 55px rgba(9, 40, 32, .09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f7f8f5;
    color: var(--text);
    font-family: 'DM Sans', Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}


/* =========================================================
   2. LOGIN & AUTHENTICATION
========================================================= */

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 15%, #e5eee7, transparent 35%),
        linear-gradient(135deg, var(--cream), var(--white));
}

.auth-card {
    width: min(100%, 430px);
    padding: 38px;
    background: #fff;
    border: 1px solid #edf0eb;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.brand-mark,
.brand-mini {
    display: grid;
    place-items: center;
    background: var(--gold);
    color: var(--dark);
    font-weight: 800;
    border-radius: 13px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    font-size: 25px;
}

.auth-card h1 {
    margin: 0;
    color: var(--green);
    font-size: 29px;
}

.auth-card h1 span {
    color: #b98742;
}

.auth-card form {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.auth-card label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
}

.auth-card input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
}

.auth-card input:focus {
    border-color: #6b9a84;
    box-shadow: 0 0 0 3px #e5f0e9;
}

.tiny {
    margin-top: 24px;
    font-size: 11px;
}

.center {
    text-align: center;
}


/* =========================================================
   3. BUTTONS & ALERTS
========================================================= */

.btn {
    padding: 13px 16px;
    border: 0;
    border-radius: 11px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--green);
    color: #fff;
}

.btn-block {
    width: 100%;
    margin-top: 14px;
}

.alert {
    padding: 12px;
    background: #fff0ed;
    color: #a33d2e;
    border-radius: 10px;
    font-size: 13px;
}

.muted {
    color: var(--muted);
}


/* =========================================================
   4. MAIN APPLICATION LAYOUT
========================================================= */

.app-shell {
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;

    display: flex;
    flex-direction: column;

    width: 255px;
    padding: 25px 17px;

    background: var(--dark);
    color: #eaf0ec;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 0 8px 30px;

    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;
}

.side-brand b {
    color: var(--gold);
}

.brand-mini {
    width: 36px;
    height: 36px;
}

.side-label {
    padding: 0 12px;
    color: #80958b;
    font-size: 9px;
    letter-spacing: 1.8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;

    margin: 3px 0;
    padding: 12px;

    border-radius: 10px;
    color: #bdcbc3;
    font-size: 13px;

    transition: background .2s, color .2s;
}

.nav-link.active,
.nav-link:hover {
    background: #1b493d;
    color: #fff;
}

.nav-icon {
    width: 20px;
    color: var(--gold);
    text-align: center;
    font-size: 17px;
}

.sidebar-bottom {
    margin-top: auto;
}

/* Main Content */

.main-content {
    max-width: 1600px;
    margin-left: 255px;
    padding: 28px 34px;
}

/* Topbar */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 25px;
}

.topbar-title {
    min-width: 0;
    margin-right: auto;
}

.topbar-title h2 {
    margin: 0;
    font-size: 22px;
}

.menu-toggle {
    display: none;
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: #fff;
}

/* User Profile */

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
}

.user-chip small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-weight: 400;
}

.avatar {
    display: grid;
    place-items: center;

    width: 37px;
    height: 37px;

    border-radius: 50%;
    background: #e5eee7;
    color: var(--green);
    font-weight: 800;
}


/* =========================================================
   5. DASHBOARD WELCOME
========================================================= */

.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 28px 30px;
    overflow: hidden;

    background: linear-gradient(110deg, var(--green), #1b5948);
    color: #fff;
    border-radius: 19px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #a17a42;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

.welcome h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.welcome p:last-child {
    margin: 0;
    color: #d0ded5;
    font-size: 13px;
}

.welcome-icon {
    color: var(--gold);
    font-size: 76px;
    opacity: .8;
}


/* =========================================================
   6. DASHBOARD STATISTICS
========================================================= */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.stat-card,
.panel {
    padding: 20px;
    background: #fff;
    border: 1px solid #edf0eb;
    border-radius: 15px;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
}

.stat-card strong {
    display: block;
    margin: 9px 0 4px;
    color: var(--green);
    font-size: 30px;
}

.stat-card small {
    color: #9aa39d;
    font-size: 10px;
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stat-top b {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    background: #edf4ee;
    color: var(--green);
    border-radius: 10px;
    font-size: 17px;
}


/* =========================================================
   7. FINANCE CARDS
========================================================= */

.finance-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 14px;
    margin: 15px 0;
}

.finance-card {
    position: relative;
    min-width: 0;
    padding: 19px 20px;
    overflow: hidden;

    background: #fff;
    border: 1px solid #edf0eb;
    border-radius: 15px;
}

.finance-card > span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.finance-card > strong {
    display: block;
    margin: 9px 0 5px;
    color: var(--green);
    font-size: clamp(17px, 2vw, 23px);
    overflow-wrap: anywhere;
}

.finance-card > small {
    color: #9aa39d;
    font-size: 10px;
}

.balance-card {
    border: 0;
    background: linear-gradient(115deg, var(--green), #1b5948);
    color: #fff;
}

.balance-card > span,
.balance-card > small {
    color: #d0ded5;
}

.balance-card > strong {
    color: #fff;
    font-size: clamp(19px, 2.2vw, 27px);
}

.balance-mark {
    position: absolute;
    top: 12px;
    right: 18px;

    color: var(--gold);
    font-size: 36px;
    font-weight: 800;
    opacity: .16;
}

.money-in {
    color: #16845b !important;
}

.money-out {
    color: #bd5547 !important;
}


/* =========================================================
   8. DASHBOARD CONTENT & CHART
========================================================= */

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
    gap: 15px;
}

.content-grid .panel {
    min-width: 0;
    margin-top: 0;
}

.panel {
    margin-top: 20px;
}

.panel h3 {
    margin: 0;
    font-size: 16px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.panel-head p {
    margin: 6px 0 18px;
    font-size: 12px;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.chart-legend i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 3px;
}

.legend-in {
    background: #1b765b;
}

.legend-out {
    margin-left: 7px;
    background: var(--gold);
}

.cash-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 12px;

    height: 185px;
    padding: 12px 8px 0;

    border-bottom: 1px solid var(--line);
}

.chart-month {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;

    min-width: 0;
    height: 100%;
}

.bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 145px;
}

.bar {
    display: block;
    width: 15px;
    max-width: 3vw;
    min-height: 3px;
    border-radius: 5px 5px 2px 2px;
}

.bar-in {
    background: #1b765b;
}

.bar-out {
    background: var(--gold);
}

.chart-month small {
    padding-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
}


/* =========================================================
   9. TASK PANEL
========================================================= */

.task-row {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 13px 0;
    border-bottom: 1px solid #f0f1ed;
}

.task-row:last-child {
    border-bottom: 0;
}

.task-symbol {
    display: grid;
    flex-shrink: 0;
    place-items: center;

    width: 34px;
    height: 34px;

    background: #edf4ee;
    color: var(--green);
    border-radius: 10px;
}

.task-row > span:nth-child(2) {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
}

.task-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.task-row > b {
    color: var(--green);
    font-size: 14px;
}


/* =========================================================
   10. TABLES
========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.recent-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.recent-table th,
.recent-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f1ed;
    text-align: left;
    font-size: 11px;
    white-space: nowrap;
}

.recent-table th {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.recent-table tr:last-child td {
    border-bottom: 0;
}

.text-right {
    text-align: right !important;
}

.type-pill {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
}

.pill-in {
    background: #e7f4ed;
    color: #16845b;
}

.pill-out {
    background: #fff1e5;
    color: #a36b2d;
}

.empty-state {
    padding: 35px 12px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}


/* =========================================================
   11. QUICK ACCESS
========================================================= */

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-grid a,
.resident-menu a {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 12px;

    font-size: 12px;
    font-weight: 700;
}

.quick-grid b,
.resident-menu b {
    display: grid;
    flex-shrink: 0;
    place-items: center;

    width: 35px;
    height: 35px;

    background: #edf4ee;
    color: var(--green);
    border-radius: 10px;
    font-size: 18px;
}

.quick-panel {
    margin-top: 15px;
}

.recent-panel {
    margin-top: 15px;
}

.footer-note {
    margin: 30px 0;
    color: #9aa39d;
    text-align: center;
    font-size: 10px;
}


/* =========================================================
   12. RESIDENT / WARGA PORTAL
========================================================= */

.resident-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 25px 18px 50px;
}

.resident-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.resident-top h1 {
    margin: 0;
    font-size: 22px;
}

.resident-top p {
    font-size: 12px;
}

.logout-link {
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}

.resident-hero {
    margin: 24px 0;
    padding: 25px;
    background: linear-gradient(120deg, var(--green), #1b5948);
    color: #fff;
    border-radius: 20px;
}

.resident-hero h2 {
    margin: 8px 0;
    font-size: 24px;
}

.resident-hero p:last-child {
    color: #d0ded5;
    font-size: 13px;
}

.resident-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.resident-menu a {
    padding: 15px;
    background: #fff;
}

.resident-menu a span {
    font-size: 12px;
}


/* =========================================================
   13. RESPONSIVE - TABLET
========================================================= */

@media (max-width: 1000px) {

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .finance-grid {
        grid-template-columns: 1fr 1fr;
    }

    .balance-card {
        grid-column: 1 / -1;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   14. RESPONSIVE - MOBILE
========================================================= */

@media (max-width: 700px) {

    /* Sidebar */

    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Main */

    .main-content {
        margin-left: 0;
        padding: 16px 13px;
    }

    .topbar {
        justify-content: flex-start;
        gap: 10px;
        margin-bottom: 17px;
    }

    .topbar h2 {
        font-size: 19px;
    }

    .menu-toggle {
        display: block;
    }

    .user-chip {
        gap: 7px;
        margin-left: auto;
        font-size: 10px;
    }

    .avatar {
        width: 33px;
        height: 33px;
    }

    /* Welcome */

    .welcome {
        padding: 20px 17px;
    }

    .welcome h1 {
        font-size: 18px;
        line-height: 1.35;
    }

    .welcome p:last-child {
        font-size: 11px;
        line-height: 1.6;
    }

    .welcome-icon {
        font-size: 48px;
    }

    /* Statistics */

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        margin: 12px 0;
    }

    .stat-card {
        padding: 13px;
    }

    .stat-card strong {
        font-size: 23px;
    }

    .stat-card small {
        font-size: 9px;
    }

    .stat-top span {
        font-size: 10px;
    }

    .stat-top b {
        width: 29px;
        height: 29px;
    }

    /* Finance */

    .finance-grid {
        gap: 8px;
        margin: 10px 0;
    }

    .finance-card {
        padding: 14px 12px;
    }

    .finance-card > span {
        font-size: 10px;
    }

    .finance-card > strong {
        font-size: 15px;
    }

    .finance-card > small {
        font-size: 9px;
    }

    /* Panels */

    .panel {
        margin-top: 10px;
        padding: 15px;
    }

    .panel-head h3 {
        font-size: 14px;
    }

    .panel-head p {
        font-size: 10px;
        line-height: 1.5;
    }

    .content-grid {
        gap: 10px;
    }

    /* Chart */

    .chart-legend {
        font-size: 9px;
    }

    .cash-chart {
        height: 160px;
    }

    .bars {
        height: 120px;
    }

    .bar {
        width: 11px;
    }

    /* Task */

    .task-row {
        padding: 11px 0;
    }

    /* Table */

    .recent-table th,
    .recent-table td {
        padding: 10px 8px;
    }

    /* Quick access */

    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .quick-grid a {
        min-width: 0;
        padding: 12px;
        font-size: 11px;
    }

    /* Authentication */

    .auth-card {
        padding: 27px 22px;
    }

    /* Resident */

    .resident-menu {
        gap: 9px;
    }

}
