:root{
    --blue:#0878c9;
    --blue2:#075d99;
    --ink:#172333;
    --muted:#728096;
    --line:#e6ebf1;
    --bg:#f5f7fa;
    --white:#fff;
    --green:#1f9d68;
    --red:#d85b5b;
    --shadow:0 8px 28px rgba(20,45,75,.07)
}

*{
    box-sizing:border-box
}

body{
    margin:0;
    font-family:Inter,Segoe UI,Arial,sans-serif;
    color:var(--ink);
    background:var(--bg)
}

button,
a{
    font:inherit
}

a{
    text-decoration:none;
    color:inherit
}

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

/* =========================
   SIDEBAR
   ========================= */

.sidebar{
    width:250px;
    background:#102235;
    color:#c8d4df;
    display:flex;
    flex-direction:column;
    position:fixed;
    inset:0 auto 0 0;
    z-index:50;

    /* Sidebar scrolling */
    overflow-y:auto;
    overflow-x:hidden;

    /* Firefox */
    scrollbar-width:thin;
    scrollbar-color:rgba(255,255,255,.30) transparent;
}

/* Chrome / Edge / Safari scrollbar */

.sidebar::-webkit-scrollbar{
    width:6px
}

.sidebar::-webkit-scrollbar-track{
    background:transparent
}

.sidebar::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.30);
    border-radius:10px
}

.sidebar::-webkit-scrollbar-thumb:hover{
    background:rgba(255,255,255,.45)
}

.side-brand{
    height:82px;
    padding:17px 20px;
    display:flex;
    align-items:center;
    gap:12px;
    border-bottom:1px solid rgba(255,255,255,.08)
}

.brand-mark{
    width:43px;
    height:43px;
    border-radius:12px;
    background:#0878c9;
    color:#fff;
    display:grid;
    place-items:center;
    font-size:21px;
    font-weight:800
}

.side-brand strong{
    display:block;
    color:#fff;
    font-size:17px
}

.side-brand span{
    display:block;
    font-size:11px;
    color:#8fa2b5;
    margin-top:3px
}

.side-label{
    font-size:10px;
    letter-spacing:1.3px;
    color:#71879a;
    padding:25px 20px 9px;
    font-weight:700
}

.side-nav{
    padding:0 10px
}

.side-nav a,
.side-bottom a{
    height:43px;
    display:flex;
    align-items:center;
    gap:11px;
    padding:0 11px;
    border-radius:8px;
    margin-bottom:3px;
    font-size:13px
}

.side-nav a:hover,
.side-bottom a:hover{
    background:rgba(255,255,255,.06);
    color:#fff
}

.side-nav a.active{
    background:#0878c9;
    color:#fff;
    box-shadow:0 5px 14px rgba(8,120,201,.25)
}

.side-nav em{
    font-style:normal;
    font-size:9px;
    margin-left:auto;
    color:#71879a
}

.side-nav .active em{
    color:#d9efff
}

.nav-icon{
    width:20px;
    text-align:center;
    font-size:16px;
    opacity:.9
}

.side-bottom{
    margin-top:auto;
    padding:13px 10px;
    border-top:1px solid rgba(255,255,255,.08)
}

.side-bottom .logout{
    color:#ffb4b4
}

/* =========================
   MAIN AREA
   ========================= */

.main-area{
    margin-left:250px;
    min-height:100vh;
    width:calc(100% - 250px);
    display:flex;
    flex-direction:column
}

.topbar{
    height:82px;
    background:#fff;
    border-bottom:1px solid var(--line);
    display:flex;
    align-items:center;
    padding:0 30px;
    justify-content:space-between
}

.top-title span{
    font-size:14px;
    font-weight:700;
    display:block
}

.top-title small{
    color:var(--muted);
    font-size:11px
}

.top-actions{
    display:flex;
    align-items:center;
    gap:22px
}

.date-chip{
    font-size:11px;
    color:var(--muted)
}

.user-chip{
    display:flex;
    align-items:center;
    gap:10px
}

.user-chip strong{
    font-size:12px;
    display:block
}

.user-chip small{
    font-size:10px;
    color:var(--muted)
}

.avatar{
    width:36px;
    height:36px;
    border-radius:50%;
    background:#e8f3fb;
    color:var(--blue2);
    display:grid;
    place-items:center;
    font-weight:800
}

.content{
    padding:30px;
    flex:1
}

/* =========================
   PAGE HEADING
   ========================= */

.page-heading{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:20px;
    margin-bottom:25px
}

.page-heading h1{
    font-size:25px;
    margin:0 0 6px
}

.page-heading p{
    margin:0;
    color:var(--muted);
    font-size:12px
}

.heading-actions{
    display:flex;
    gap:9px
}

/* =========================
   BUTTONS
   ========================= */

.btn{
    border:0;
    border-radius:7px;
    padding:10px 14px;
    font-size:11px;
    font-weight:700;
    cursor:pointer
}

.btn.primary{
    background:var(--blue);
    color:#fff
}

.btn.secondary{
    background:#fff;
    border:1px solid var(--line);
    color:var(--ink)
}

/* =========================
   SUMMARY CARDS
   ========================= */

.summary-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin-bottom:18px
}

.summary-card,
.panel{
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    box-shadow:var(--shadow)
}

.summary-card{
    padding:18px
}

.card-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    color:var(--muted);
    font-size:11px
}

.card-icon{
    width:31px;
    height:31px;
    border-radius:8px;
    display:grid;
    place-items:center;
    font-weight:800
}

.card-icon.income{
    background:#eaf8f1;
    color:var(--green)
}

.card-icon.expense{
    background:#fff0f0;
    color:var(--red)
}

.card-icon.receivable{
    background:#edf6fd;
    color:var(--blue)
}

.card-icon.payable{
    background:#f3efff;
    color:#7955c8
}

.summary-card>strong{
    display:block;
    font-size:22px;
    margin:13px 0 4px
}

.summary-card>small{
    color:#9aa6b4;
    font-size:10px
}

/* =========================
   DASHBOARD GRIDS
   ========================= */

.dashboard-grid{
    display:grid;
    grid-template-columns:1.6fr 1fr;
    gap:18px;
    margin-bottom:18px
}

.bottom-grid{
    display:grid;
    grid-template-columns:1.6fr 1fr;
    gap:18px
}

.panel{
    min-height:100px
}

.panel-head{
    padding:18px 20px 13px;
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    border-bottom:1px solid #eef1f4
}

.panel-head h2{
    font-size:14px;
    margin:0 0 4px
}

.panel-head p{
    font-size:10px;
    color:var(--muted);
    margin:0
}

.panel-head>a{
    font-size:10px;
    color:var(--blue);
    font-weight:700
}

.period{
    font-size:10px;
    border:1px solid var(--line);
    padding:7px 9px;
    border-radius:6px;
    color:var(--muted)
}

/* =========================
   CHART
   ========================= */

.chart-placeholder{
    height:260px;
    display:flex;
    padding:16px 20px 15px
}

.chart-y{
    width:42px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    padding-bottom:24px;
    color:#a2adba;
    font-size:9px
}

.chart-area{
    position:relative;
    flex:1;
    border-left:1px solid #eef1f4
}

.chart-area:before{
    content:"";
    position:absolute;
    inset:0 0 25px;
    background:repeating-linear-gradient(
        to bottom,
        #eef1f4 0,
        #eef1f4 1px,
        transparent 1px,
        transparent 25%
    )
}

.empty-chart{
    position:absolute;
    inset:18px 20px 40px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center
}

.chart-symbol{
    width:42px;
    height:42px;
    border-radius:50%;
    background:#eef6fc;
    color:var(--blue);
    display:grid;
    place-items:center;
    margin-bottom:9px
}

.empty-chart strong{
    font-size:11px
}

.empty-chart span{
    font-size:9px;
    color:#9aa6b4;
    max-width:260px;
    line-height:1.5;
    margin-top:4px
}

.months{
    position:absolute;
    bottom:0;
    left:0;
    right:0;
    display:flex;
    justify-content:space-between;
    color:#9aa6b4;
    font-size:8px
}

/* =========================
   QUICK ACTIONS
   ========================= */

.quick-grid{
    padding:14px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:9px
}

.quick-grid button{
    text-align:left;
    background:#fafbfd;
    border:1px solid #edf0f3;
    border-radius:8px;
    padding:13px;
    cursor:pointer
}

.quick-grid button:hover{
    border-color:#cfe6f6;
    background:#f5fbff
}

.quick-icon{
    width:30px;
    height:30px;
    display:grid;
    place-items:center;
    border-radius:7px;
    background:#eaf5fc;
    color:var(--blue);
    margin-bottom:9px;
    font-weight:800
}

.quick-grid b{
    display:block;
    font-size:10px
}

.quick-grid small{
    display:block;
    color:#9aa6b4;
    font-size:8px;
    margin-top:3px
}

/* =========================
   EMPTY STATE
   ========================= */

.empty-state{
    min-height:185px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    text-align:center;
    padding:20px
}

.empty-icon{
    width:38px;
    height:38px;
    border-radius:50%;
    background:#f2f5f8;
    color:#9aa6b4;
    display:grid;
    place-items:center;
    margin-bottom:9px
}

.empty-state strong{
    font-size:11px
}

.empty-state span{
    font-size:9px;
    color:#9aa6b4;
    max-width:350px;
    line-height:1.5;
    margin-top:5px
}

/* =========================
   MODULE LIST
   ========================= */

.module-list{
    padding:8px 18px 12px
}

.module-list>div{
    display:grid;
    grid-template-columns:32px 1fr auto;
    align-items:center;
    min-height:42px;
    border-bottom:1px solid #f0f2f5;
    gap:8px
}

.module-list>div:last-child{
    border-bottom:0
}

.module-list span{
    font-size:9px;
    font-weight:800;
    color:var(--blue);
    background:#edf6fc;
    border-radius:6px;
    width:25px;
    height:25px;
    display:grid;
    place-items:center
}

.module-list b{
    font-size:10px
}

.module-list small{
    font-size:8px;
    color:#9aa6b4
}

/* =========================
   FOOTER
   ========================= */

.app-footer{
    height:48px;
    border-top:1px solid var(--line);
    background:#fff;
    padding:0 30px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    color:#98a3af;
    font-size:9px
}

.mobile-menu{
    display:none;
    border:0;
    background:none;
    font-size:21px;
    color:var(--ink)
}

/* =========================
   RESPONSIVE
   ========================= */

@media(max-width:1100px){

    .summary-grid{
        grid-template-columns:repeat(2,1fr)
    }

    .dashboard-grid,
    .bottom-grid{
        grid-template-columns:1fr
    }

    .date-chip{
        display:none
    }
}

@media(max-width:900px){

    .sidebar{
        transform:translateX(-100%);
        transition:.2s
    }

    .sidebar.open{
        transform:translateX(0);
        box-shadow:10px 0 30px rgba(0,0,0,.18)
    }

    .main-area{
        margin-left:0;
        width:100%
    }

    .mobile-menu{
        display:block
    }

    .topbar{
        padding:0 18px
    }

    .content{
        padding:20px
    }

    .page-heading{
        align-items:flex-start;
        flex-direction:column
    }

    .heading-actions{
        width:100%
    }

    .heading-actions .btn{
        flex:1
    }

    .app-footer{
        padding:0 18px
    }
}

@media(max-width:600px){

    .summary-grid{
        grid-template-columns:1fr 1fr;
        gap:10px
    }

    .summary-card{
        padding:14px
    }

    .summary-card>strong{
        font-size:18px
    }

    .top-actions{
        gap:0
    }

    .user-chip strong{
        display:none
    }

    .page-heading h1{
        font-size:21px
    }

    .chart-placeholder{
        height:230px;
        padding-left:10px;
        padding-right:10px
    }

    .quick-grid{
        grid-template-columns:1fr
    }

    .bottom-grid{
        gap:12px
    }

    .app-footer{
        font-size:8px
    }
}