/* =========================================================
   MARWAR INFOTECH
   BUSINESS CONTROL CENTER
   COMPLETE APPLICATION CSS
========================================================= */

:root{
    --bg:#f4eee6;
    --surface:#fffdf9;
    --surface-2:#faf5ee;
    --border:#e7ddd1;

    --dark:#21150e;
    --dark-2:#2b1c12;
    --dark-3:#453326;

    --gold:#b98a4c;
    --gold-dark:#8b5e34;
    --gold-light:#d8b47d;

    --text:#2b1c12;
    --muted:#81766c;
    --muted-2:#a99b8e;

    --green:#3c7958;
    --blue:#47739c;
    --purple:#765b9d;
    --orange:#b66d35;
    --red:#a64a3c;
    --teal:#397f7b;

    --shadow:0 15px 45px rgba(43,28,18,.07);
    --shadow-lg:0 25px 70px rgba(43,28,18,.13);

    --radius:14px;
    --radius-sm:9px;

    --sidebar:270px;
    --header:76px;
}


/* =========================================================
   RESET
========================================================= */

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

html{
    scroll-behavior:smooth;
}

body{
    min-height:100vh;
    background:var(--bg);
    color:var(--text);
    font-family:"DM Sans",Arial,sans-serif;
    font-size:14px;
}

button,
input,
textarea,
select{
    font:inherit;
}

button{
    border:0;
    cursor:pointer;
}

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

img{
    max-width:100%;
    display:block;
}

svg{
    width:18px;
    height:18px;
    stroke-width:1.8;
}

.hidden{
    display:none !important;
}


/* =========================================================
   TYPOGRAPHY
========================================================= */

h1,
h2,
h3,
h4{
    color:var(--text);
}

h1,
h2,
h3{
    font-family:"Playfair Display",Georgia,serif;
}

.eyebrow,
.panel-kicker,
.page-eyebrow{
    display:inline-block;
    color:var(--gold-dark);
    font-size:9px;
    font-weight:800;
    letter-spacing:2px;
    text-transform:uppercase;
}


/* =========================================================
   APP LOADER
========================================================= */

.app-loader{
    position:fixed;
    inset:0;
    z-index:9999;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:15px;
    background:var(--dark);
    color:#fff;
    transition:.4s ease;
}

.loader-logo{
    width:70px;
    height:70px;
    display:grid;
    place-items:center;
    border-radius:18px;
    background:var(--gold);
    color:#fff;
    font-weight:800;
    font-size:23px;
    box-shadow:0 20px 50px rgba(0,0,0,.3);
}

.loader-text{
    display:flex;
    flex-direction:column;
    text-align:center;
    gap:3px;
}

.loader-text strong{
    font-size:14px;
    letter-spacing:2px;
}

.loader-text span{
    color:#bcae9e;
    font-size:10px;
}

.loader-spinner{
    width:25px;
    height:25px;
    margin-top:8px;
    border:2px solid rgba(255,255,255,.2);
    border-top-color:var(--gold-light);
    border-radius:50%;
    animation:spin .8s linear infinite;
}

@keyframes spin{
    to{
        transform:rotate(360deg);
    }
}


/* =========================================================
   LOGIN
========================================================= */

.login-screen{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:30px;
    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(185,138,76,.14),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(139,94,52,.1),
            transparent 30%
        ),
        var(--bg);
}

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

.login-brand{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    margin-bottom:20px;
}

.login-brand > div:last-child{
    display:flex;
    flex-direction:column;
}

.login-brand strong{
    font-size:14px;
    letter-spacing:1.5px;
}

.login-brand span{
    color:var(--muted);
    font-size:10px;
    margin-top:3px;
}

.brand-mark{
    width:48px;
    height:48px;
    display:grid;
    place-items:center;
    flex-shrink:0;
    border-radius:12px;
    background:var(--gold);
    color:#fff;
    font-weight:800;
    letter-spacing:-1px;
}

.login-card{
    background:rgba(255,253,249,.96);
    border:1px solid var(--border);
    border-radius:20px;
    padding:38px;
    box-shadow:var(--shadow-lg);
}

.login-heading{
    margin-bottom:25px;
}

.login-heading h1{
    margin:7px 0 10px;
    font-size:40px;
    line-height:1.05;
}

.login-heading p{
    color:var(--muted);
    font-size:12px;
    line-height:1.7;
}

.login-card form{
    display:grid;
    gap:5px;
}

.form-group{
    display:grid;
    gap:7px;
    margin-bottom:8px;
}

.form-group label{
    font-size:10px;
    font-weight:700;
    color:#62554b;
}

.form-group input,
.form-group textarea,
.form-group select{
    width:100%;
    border:1px solid var(--border);
    border-radius:9px;
    padding:12px 13px;
    outline:none;
    background:#fff;
    color:var(--text);
    transition:.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus{
    border-color:var(--gold);
    box-shadow:0 0 0 3px rgba(185,138,76,.1);
}

.form-error{
    padding:10px 12px;
    border:1px solid #efc8c0;
    border-radius:8px;
    background:#fff0ed;
    color:#a13f2f;
    font-size:11px;
    margin:5px 0;
}

.login-btn{
    width:100%;
    justify-content:center;
    margin-top:8px;
}

.login-footer{
    display:flex;
    justify-content:space-between;
    gap:15px;
    margin-top:25px;
    padding-top:17px;
    border-top:1px solid var(--border);
    color:var(--muted-2);
    font-size:9px;
}


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

.primary-btn{
    min-height:40px;
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 15px;
    border-radius:9px;
    background:var(--dark-2);
    color:#fff;
    font-size:11px;
    font-weight:800;
    transition:.25s;
}

.primary-btn:hover{
    background:var(--gold-dark);
    transform:translateY(-1px);
}

.primary-btn:disabled{
    opacity:.55;
    cursor:not-allowed;
    transform:none;
}

.compact-btn{
    min-height:38px;
    padding:9px 13px;
}

.icon-btn{
    width:36px;
    height:36px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:#f3eadf;
    color:var(--gold-dark);
    transition:.2s;
}

.icon-btn:hover{
    background:var(--gold);
    color:#fff;
}

.text-btn{
    display:inline-flex;
    align-items:center;
    gap:5px;
    background:transparent;
    color:var(--gold-dark);
    font-size:10px;
    font-weight:800;
}

.text-btn svg{
    width:13px;
    height:13px;
}

.mobile-only{
    display:none;
}


/* =========================================================
   MAIN APP
========================================================= */

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

.main-content{
    flex:1;
    min-width:0;
    min-height:100vh;
}


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

.sidebar{
    width:var(--sidebar);
    min-height:100vh;
    position:fixed;
    inset:0 auto 0 0;
    z-index:100;
    display:flex;
    flex-direction:column;
    background:
        linear-gradient(
            180deg,
            #21150e 0%,
            #2b1c12 100%
        );
    color:#fff;
    padding:17px 13px;
}

.sidebar-top{
    min-height:0;
    overflow:hidden;
    display:flex;
    flex-direction:column;
}

.sidebar-brand{
    display:flex;
    align-items:center;
    gap:10px;
    padding:4px 7px 19px;
}

.sidebar-brand .brand-mark{
    width:43px;
    height:43px;
    border-radius:11px;
    font-size:14px;
}

.brand-text{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.brand-text strong{
    font-size:15px;
    white-space:nowrap;
}

.brand-text span{
    color:#a99b8e;
    font-size:8px;
    margin-top:3px;
    white-space:nowrap;
}

.business-mini-card{
    display:flex;
    align-items:center;
    gap:10px;
    padding:11px;
    margin:0 2px 15px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:10px;
    background:rgba(255,255,255,.045);
}

.business-mini-icon{
    width:32px;
    height:32px;
    flex-shrink:0;
    display:grid;
    place-items:center;
    border-radius:8px;
    background:rgba(185,138,76,.2);
    color:var(--gold-light);
}

.business-mini-icon svg{
    width:15px;
}

.business-mini-card div:last-child{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.business-mini-card span{
    color:#958678;
    font-size:7px;
    letter-spacing:1.3px;
    font-weight:800;
}

.business-mini-card strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    margin-top:3px;
    font-size:10px;
}


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

.sidebar-nav{
    display:flex;
    flex-direction:column;
    gap:3px;
    overflow-y:auto;
    padding-right:3px;
}

.sidebar-nav::-webkit-scrollbar{
    width:3px;
}

.sidebar-nav::-webkit-scrollbar-thumb{
    background:#5b4738;
    border-radius:10px;
}

.nav-section-title{
    margin:12px 8px 5px;
    color:#76675a;
    font-size:7px;
    letter-spacing:1.7px;
    font-weight:800;
}

.nav-item{
    width:100%;
    min-height:39px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:9px 10px;
    border-radius:8px;
    background:transparent;
    color:#cbbcad;
    text-align:left;
    font-size:10px;
    transition:.2s;
}

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

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

.nav-item.active{
    background:#8b5e34;
    color:#fff;
    box-shadow:0 8px 20px rgba(0,0,0,.12);
}

.nav-item span:nth-child(2){
    flex:1;
}

.nav-badge{
    min-width:20px;
    height:19px;
    display:grid;
    place-items:center;
    padding:0 5px;
    border-radius:10px;
    background:rgba(255,255,255,.1);
    color:#d7c9ba;
    font-size:8px;
    font-weight:800;
}

.nav-badge.warning{
    background:rgba(205,151,70,.2);
    color:#e1b978;
}

.nav-badge.danger{
    background:rgba(178,73,61,.2);
    color:#df958c;
}


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

.sidebar-user{
    display:flex;
    align-items:center;
    gap:9px;
    margin-top:auto;
    padding:13px 5px 3px;
    border-top:1px solid rgba(255,255,255,.08);
}

.user-avatar{
    width:34px;
    height:34px;
    flex-shrink:0;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:var(--gold);
    color:#fff;
    font-size:11px;
    font-weight:800;
}

.user-info{
    min-width:0;
    display:flex;
    flex-direction:column;
    flex:1;
}

.user-info strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:10px;
}

.user-info span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    margin-top:3px;
    color:#978a7d;
    font-size:8px;
}

.logout-btn{
    width:31px;
    height:31px;
    display:grid;
    place-items:center;
    border-radius:8px;
    background:#403025;
    color:#bbaea0;
    transition:.2s;
}

.logout-btn:hover{
    background:#8b5e34;
    color:#fff;
}

.logout-btn svg{
    width:14px;
}


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

.sidebar-overlay{
    display:none;
    position:fixed;
    inset:0;
    z-index:90;
    background:rgba(0,0,0,.5);
    backdrop-filter:blur(2px);
}


/* =========================================================
   HEADER
========================================================= */

.main-content{
    margin-left:var(--sidebar);
}

.top-header{
    height:var(--header);
    position:sticky;
    top:0;
    z-index:50;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:0 30px;
    background:rgba(255,253,249,.94);
    border-bottom:1px solid var(--border);
    backdrop-filter:blur(12px);
}

.header-left,
.header-right{
    display:flex;
    align-items:center;
}

.header-left{
    gap:13px;
}

.header-right{
    gap:12px;
}

.page-heading{
    display:flex;
    flex-direction:column;
}

.page-eyebrow{
    font-size:7px;
    letter-spacing:1.6px;
}

.page-heading h1{
    margin-top:3px;
    font-size:20px;
    line-height:1;
}

.header-date{
    display:flex;
    align-items:center;
    gap:6px;
    color:var(--muted);
    font-size:9px;
}

.header-date svg{
    width:14px;
    height:14px;
    color:var(--gold-dark);
}


/* =========================================================
   PAGE CONTAINER
========================================================= */

.page-container{
    width:100%;
    max-width:1600px;
    margin:auto;
    padding:30px;
}

.page{
    display:none;
}

.page.active-page{
    display:block;
}


/* =========================================================
   DASHBOARD WELCOME
========================================================= */

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

.welcome-row h2{
    margin:7px 0 7px;
    font-size:35px;
    line-height:1.1;
}

.welcome-row h2 span{
    color:var(--gold-dark);
}

.welcome-row p{
    max-width:650px;
    color:var(--muted);
    font-size:11px;
    line-height:1.7;
}

.period-selector{
    display:flex;
    gap:3px;
    padding:3px;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--surface);
}

.period-btn{
    padding:8px 12px;
    border-radius:7px;
    background:transparent;
    color:var(--muted);
    font-size:9px;
    font-weight:700;
}

.period-btn.active{
    background:var(--dark-2);
    color:#fff;
}


/* =========================================================
   STAT CARDS
========================================================= */

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

.stat-card{
    min-height:110px;
    display:flex;
    align-items:center;
    gap:13px;
    padding:17px;
    border:1px solid var(--border);
    border-radius:13px;
    background:var(--surface);
    box-shadow:0 8px 25px rgba(43,28,18,.035);
    transition:.25s;
}

.stat-card:hover{
    transform:translateY(-2px);
    box-shadow:var(--shadow);
}

.stat-icon{
    width:42px;
    height:42px;
    flex-shrink:0;
    display:grid;
    place-items:center;
    border-radius:10px;
}

.stat-icon svg{
    width:18px;
}

.stat-icon.gold{
    background:#f3e7d5;
    color:#9a6b35;
}

.stat-icon.green{
    background:#e4f0e8;
    color:var(--green);
}

.stat-icon.blue{
    background:#e4edf5;
    color:var(--blue);
}

.stat-icon.purple{
    background:#eee8f6;
    color:var(--purple);
}

.stat-icon.orange{
    background:#f7eadf;
    color:var(--orange);
}

.stat-icon.red{
    background:#f8e6e3;
    color:var(--red);
}

.stat-icon.teal{
    background:#e2f0ef;
    color:var(--teal);
}

.stat-icon.dark{
    background:#ebe4df;
    color:var(--dark-2);
}

.stat-content{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.stat-content span{
    color:var(--muted-2);
    font-size:7px;
    letter-spacing:1.1px;
    font-weight:800;
}

.stat-content strong{
    margin:4px 0;
    color:var(--text);
    font-size:21px;
    line-height:1;
}

.stat-content small{
    color:var(--muted);
    font-size:8px;
}


/* =========================================================
   DASHBOARD GRID
========================================================= */

.dashboard-grid{
    display:grid;
    grid-template-columns:1.25fr .75fr;
    gap:16px;
    margin-bottom:16px;
}


/* =========================================================
   PANELS
========================================================= */

.panel{
    min-width:0;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--surface);
    box-shadow:0 8px 25px rgba(43,28,18,.035);
}

.panel-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:15px;
    padding:20px 21px 17px;
    border-bottom:1px solid #eee6de;
}

.panel-header h3{
    margin-top:5px;
    font-size:20px;
}

.panel-value{
    color:var(--muted);
    font-size:8px;
}

.panel-value strong{
    color:var(--gold-dark);
    font-size:15px;
}


/* =========================================================
   DAILY ACTIVITY
========================================================= */

.activity-metrics{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:1px;
    padding:1px;
    background:var(--border);
}

.activity-metric{
    min-height:95px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:6px;
    padding:15px;
    background:var(--surface);
}

.activity-metric span{
    color:var(--muted);
    font-size:9px;
}

.activity-metric strong{
    color:var(--text);
    font-size:23px;
}


/* =========================================================
   MINI FOLLOWUP LIST
========================================================= */

.mini-list{
    min-height:190px;
    max-height:300px;
    overflow:auto;
    padding:7px 20px 15px;
}

.empty-mini{
    min-height:160px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:8px;
    color:var(--muted-2);
    font-size:10px;
}

.empty-mini svg{
    width:27px;
    height:27px;
    color:#cbbcad;
}


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

.chart-placeholder{
    min-height:300px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    color:var(--muted-2);
    font-size:10px;
    padding:20px;
}

.chart-placeholder svg{
    width:42px;
    height:42px;
    color:#c7b7a7;
}


/* =========================================================
   FUNNEL
========================================================= */

.funnel-list{
    padding:15px 21px 22px;
    display:grid;
    gap:15px;
}

.funnel-row{
    display:grid;
    grid-template-columns:90px 1fr 28px;
    align-items:center;
    gap:10px;
}

.funnel-row > span{
    color:var(--muted);
    font-size:9px;
}

.funnel-row > strong{
    text-align:right;
    font-size:10px;
}

.funnel-track{
    height:7px;
    overflow:hidden;
    border-radius:10px;
    background:#eee6de;
}

.funnel-fill{
    height:100%;
    border-radius:10px;
    background:linear-gradient(
        90deg,
        var(--gold-dark),
        var(--gold-light)
    );
    transition:width .5s ease;
}


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

.quick-actions-panel{
    margin-bottom:10px;
}

.quick-actions-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
    padding:18px 20px 21px;
}

.quick-action{
    min-height:78px;
    display:flex;
    align-items:center;
    gap:11px;
    padding:13px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#fff;
    text-align:left;
    transition:.25s;
}

.quick-action:hover{
    border-color:#d6b98f;
    background:#fdf9f3;
    transform:translateY(-2px);
}

.quick-action-icon{
    width:36px;
    height:36px;
    flex-shrink:0;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:#f3eadf;
    color:var(--gold-dark);
}

.quick-action-icon svg{
    width:16px;
}

.quick-action > div:nth-child(2){
    min-width:0;
    flex:1;
    display:flex;
    flex-direction:column;
    gap:4px;
}

.quick-action strong{
    font-size:10px;
}

.quick-action span{
    color:var(--muted);
    font-size:8px;
    line-height:1.4;
}

.quick-action > svg:last-child{
    width:14px;
    color:#b8a99a;
}


/* =========================================================
   GENERIC MODULE PAGE
   Useful for Leads / Sales / Expenses etc.
========================================================= */

.module-page{
    animation:pageIn .25s ease;
}

@keyframes pageIn{
    from{
        opacity:0;
        transform:translateY(6px);
    }
    to{
        opacity:1;
        transform:none;
    }
}

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

.module-heading h2{
    margin:5px 0;
    font-size:35px;
}

.module-heading p{
    color:var(--muted);
    font-size:10px;
}

.module-actions{
    display:flex;
    gap:8px;
}


/* =========================================================
   TOOLBAR
========================================================= */

.table-panel{
    overflow:hidden;
}

.table-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    padding:15px 18px;
    border-bottom:1px solid var(--border);
}

.toolbar-left,
.toolbar-right{
    display:flex;
    align-items:center;
    gap:8px;
}

.search-box{
    min-width:260px;
    height:37px;
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 10px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
}

.search-box svg{
    width:14px;
    color:#a99b8e;
}

.search-box input{
    width:100%;
    border:0;
    outline:0;
    background:transparent;
    color:var(--text);
    font-size:10px;
}

.filter-select{
    height:37px;
    padding:0 10px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
    outline:0;
    color:var(--text);
    font-size:10px;
}


/* =========================================================
   TABLE
========================================================= */

.table-wrap{
    width:100%;
    overflow-x:auto;
}

.data-table{
    width:100%;
    min-width:800px;
    border-collapse:collapse;
}

.data-table th{
    padding:11px 14px;
    background:#faf6f0;
    border-bottom:1px solid var(--border);
    color:#9b8e82;
    font-size:8px;
    letter-spacing:.7px;
    text-transform:uppercase;
    text-align:left;
    white-space:nowrap;
}

.data-table td{
    padding:13px 14px;
    border-bottom:1px solid #eee7df;
    color:var(--text);
    font-size:10px;
    vertical-align:middle;
}

.data-table tbody tr:hover{
    background:#fdfaf6;
}

.data-table tbody tr:last-child td{
    border-bottom:0;
}

.table-primary{
    display:flex;
    flex-direction:column;
    gap:3px;
}

.table-primary strong{
    font-size:10px;
}

.table-primary small{
    color:var(--muted);
    font-size:8px;
}


/* =========================================================
   BADGES
========================================================= */

.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:23px;
    padding:4px 8px;
    border-radius:20px;
    font-size:8px;
    font-weight:800;
    white-space:nowrap;
}

.badge-new{
    background:#eee9e3;
    color:#6e6258;
}

.badge-contacted{
    background:#e7edf4;
    color:#456b8e;
}

.badge-interested{
    background:#f7ecdb;
    color:#9a6b35;
}

.badge-hot{
    background:#f8e2df;
    color:#a64a3c;
}

.badge-warm{
    background:#f8eedf;
    color:#a87838;
}

.badge-cold{
    background:#e8edf2;
    color:#63778a;
}

.badge-won,
.badge-paid,
.badge-live{
    background:#e2f0e7;
    color:#397052;
}

.badge-lost,
.badge-unpaid,
.badge-expired{
    background:#f7e5e2;
    color:#9e473b;
}

.badge-pending,
.badge-partial,
.badge-followup{
    background:#f7eddc;
    color:#9a6b35;
}


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

.row-actions{
    display:flex;
    align-items:center;
    gap:4px;
}

.row-action{
    width:29px;
    height:29px;
    display:grid;
    place-items:center;
    border-radius:7px;
    background:#f3eadf;
    color:var(--gold-dark);
}

.row-action:hover{
    background:var(--gold);
    color:#fff;
}

.row-action.danger{
    color:#a64a3c;
}

.row-action.danger:hover{
    background:#a64a3c;
    color:#fff;
}

.row-action svg{
    width:13px;
}


/* =========================================================
   FORMS / MODALS
========================================================= */

.modal-overlay{
    position:fixed;
    inset:0;
    z-index:500;
    display:grid;
    place-items:center;
    padding:20px;
    background:rgba(20,12,7,.62);
    backdrop-filter:blur(4px);
}

.modal-card{
    width:min(720px,100%);
    max-height:92vh;
    overflow:auto;
    border:1px solid var(--border);
    border-radius:17px;
    background:var(--surface);
    box-shadow:0 30px 90px rgba(0,0,0,.25);
    animation:modalIn .2s ease;
}

@keyframes modalIn{
    from{
        opacity:0;
        transform:translateY(12px) scale(.98);
    }
    to{
        opacity:1;
        transform:none;
    }
}

.modal-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    padding:23px 25px 18px;
    border-bottom:1px solid var(--border);
}

.modal-header h3{
    margin-top:5px;
    font-size:25px;
}

.quick-modal-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    padding:22px 25px 25px;
}

.modal-action{
    min-height:70px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:14px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#fff;
    color:var(--text);
    text-align:left;
    font-size:10px;
    font-weight:700;
    transition:.2s;
}

.modal-action:hover{
    border-color:#d5b789;
    background:#fdf8f0;
}

.modal-action svg{
    color:var(--gold-dark);
}


/* =========================================================
   FORM GRID
========================================================= */

.form-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:14px;
    padding:23px 25px;
}

.form-grid .full{
    grid-column:1/-1;
}

.form-actions{
    grid-column:1/-1;
    display:flex;
    justify-content:flex-end;
    gap:8px;
    padding-top:15px;
    border-top:1px solid var(--border);
}


/* =========================================================
   EMPTY STATES
========================================================= */

.empty-state{
    min-height:280px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:9px;
    padding:30px;
    color:var(--muted-2);
    text-align:center;
}

.empty-state svg{
    width:40px;
    height:40px;
    color:#c9baaa;
}

.empty-state h3{
    color:var(--text);
    font-size:20px;
}

.empty-state p{
    max-width:380px;
    color:var(--muted);
    font-size:10px;
    line-height:1.6;
}


/* =========================================================
   PROGRESS
========================================================= */

.progress-wrap{
    display:grid;
    gap:7px;
}

.progress-head{
    display:flex;
    justify-content:space-between;
    gap:10px;
}

.progress-head span{
    color:var(--muted);
    font-size:9px;
}

.progress-head strong{
    font-size:9px;
}

.progress-bar{
    height:8px;
    overflow:hidden;
    border-radius:20px;
    background:#eee5db;
}

.progress-value{
    height:100%;
    border-radius:20px;
    background:linear-gradient(
        90deg,
        var(--gold-dark),
        var(--gold-light)
    );
}


/* =========================================================
   REPORT CARDS
========================================================= */

.report-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
}

.report-card{
    padding:20px;
    border:1px solid var(--border);
    border-radius:13px;
    background:var(--surface);
}

.report-card span{
    display:block;
    color:var(--muted);
    font-size:8px;
    letter-spacing:1px;
    font-weight:800;
}

.report-card strong{
    display:block;
    margin-top:8px;
    font-size:27px;
}

.report-card small{
    display:block;
    margin-top:5px;
    color:var(--muted);
    font-size:8px;
}


/* =========================================================
   RENEWAL STATUS
========================================================= */

.renewal-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    padding:15px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#fff;
}

.renewal-main{
    min-width:0;
}

.renewal-main strong{
    display:block;
    font-size:10px;
}

.renewal-main span{
    display:block;
    margin-top:4px;
    color:var(--muted);
    font-size:8px;
}

.days-left{
    padding:5px 8px;
    border-radius:20px;
    background:#f7eddc;
    color:#9a6b35;
    font-size:8px;
    font-weight:800;
}

.days-left.danger{
    background:#f8e4e1;
    color:#a64a3c;
}


/* =========================================================
   SETTINGS
========================================================= */

.settings-grid{
    display:grid;
    grid-template-columns:260px 1fr;
    gap:16px;
}

.settings-nav{
    padding:10px;
    border:1px solid var(--border);
    border-radius:13px;
    background:var(--surface);
}

.settings-nav button{
    width:100%;
    padding:11px;
    border-radius:8px;
    background:transparent;
    color:var(--muted);
    text-align:left;
    font-size:10px;
}

.settings-nav button.active,
.settings-nav button:hover{
    background:#f2e7d9;
    color:var(--gold-dark);
    font-weight:700;
}

.settings-content{
    min-width:0;
}


/* =========================================================
   TOAST
========================================================= */

.toast{
    position:fixed;
    right:25px;
    bottom:25px;
    z-index:1000;
    min-width:250px;
    max-width:380px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:13px 15px;
    border:1px solid #dfd1c1;
    border-radius:10px;
    background:#fffdf9;
    box-shadow:var(--shadow-lg);
    color:var(--text);
    font-size:10px;
    animation:toastIn .25s ease;
}

.toast svg{
    color:var(--green);
    flex-shrink:0;
}

@keyframes toastIn{
    from{
        opacity:0;
        transform:translateY(10px);
    }
    to{
        opacity:1;
        transform:none;
    }
}


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

.app-footer{
    min-height:50px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    margin:0 30px;
    border-top:1px solid var(--border);
    color:var(--muted-2);
    font-size:8px;
}


/* =========================================================
   SCROLLBAR
========================================================= */

*{
    scrollbar-width:thin;
    scrollbar-color:#cdbba8 transparent;
}

::-webkit-scrollbar{
    width:6px;
    height:6px;
}

::-webkit-scrollbar-track{
    background:transparent;
}

::-webkit-scrollbar-thumb{
    background:#cdbba8;
    border-radius:10px;
}

::-webkit-scrollbar-thumb:hover{
    background:#a98d70;
}


/* =========================================================
   RESPONSIVE — 1200px
========================================================= */

@media(max-width:1200px){

    :root{
        --sidebar:245px;
    }

    .stats-grid{
        grid-template-columns:repeat(3,1fr);
    }

    .dashboard-grid{
        grid-template-columns:1fr;
    }

    .quick-actions-grid{
        grid-template-columns:repeat(2,1fr);
    }

    .main-content{
        margin-left:var(--sidebar);
    }

}


/* =========================================================
   RESPONSIVE — 900px
========================================================= */

@media(max-width:900px){

    :root{
        --sidebar:0px;
    }

    .sidebar{
        width:270px;
        left:-280px;
        transition:left .25s ease;
        box-shadow:20px 0 60px rgba(0,0,0,.18);
    }

    .sidebar.open{
        left:0;
    }

    .sidebar-overlay.open{
        display:block;
    }

    .main-content{
        margin-left:0;
    }

    .mobile-only{
        display:grid;
    }

    .top-header{
        padding:0 18px;
    }

    .page-container{
        padding:24px 18px;
    }

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

    .settings-grid{
        grid-template-columns:1fr;
    }

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

}


/* =========================================================
   RESPONSIVE — 650px
========================================================= */

@media(max-width:650px){

    body{
        font-size:13px;
    }

    .top-header{
        height:66px;
        padding:0 13px;
    }

    .header-right .header-date{
        display:none;
    }

    .compact-btn{
        padding:9px 11px;
    }

    .compact-btn span{
        display:none;
    }

    .page-container{
        padding:20px 13px;
    }

    .welcome-row{
        align-items:flex-start;
        flex-direction:column;
        gap:15px;
    }

    .welcome-row h2{
        font-size:30px;
    }

    .period-selector{
        width:100%;
    }

    .period-btn{
        flex:1;
    }

    .stats-grid{
        grid-template-columns:1fr 1fr;
        gap:9px;
    }

    .stat-card{
        min-height:100px;
        padding:12px;
        gap:9px;
    }

    .stat-icon{
        width:35px;
        height:35px;
    }

    .stat-icon svg{
        width:15px;
    }

    .stat-content strong{
        font-size:17px;
    }

    .stat-content span{
        font-size:6px;
        letter-spacing:.8px;
    }

    .stat-content small{
        font-size:7px;
    }

    .panel-header{
        padding:17px 15px 14px;
    }

    .panel-header h3{
        font-size:18px;
    }

    .activity-metrics{
        grid-template-columns:repeat(2,1fr);
    }

    .activity-metric{
        min-height:80px;
    }

    .activity-metric strong{
        font-size:20px;
    }

    .quick-actions-grid{
        grid-template-columns:1fr;
        padding:13px;
    }

    .quick-action{
        min-height:68px;
    }

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

    .module-heading h2{
        font-size:30px;
    }

    .table-toolbar{
        align-items:stretch;
        flex-direction:column;
    }

    .toolbar-left,
    .toolbar-right{
        width:100%;
    }

    .search-box{
        min-width:0;
        flex:1;
    }

    .form-grid{
        grid-template-columns:1fr;
        padding:18px;
    }

    .form-grid .full{
        grid-column:auto;
    }

    .quick-modal-grid{
        grid-template-columns:1fr;
        padding:17px;
    }

    .report-grid{
        grid-template-columns:1fr;
    }

    .app-footer{
        margin:0 13px;
        padding:15px 0;
        flex-direction:column;
        align-items:flex-start;
    }

}


/* =========================================================
   RESPONSIVE — 430px
========================================================= */

@media(max-width:430px){

    .login-screen{
        padding:15px;
    }

    .login-card{
        padding:25px 20px;
        border-radius:15px;
    }

    .login-heading h1{
        font-size:33px;
    }

    .login-footer{
        flex-direction:column;
        gap:6px;
    }

    .stats-grid{
        grid-template-columns:1fr;
    }

    .stat-card{
        min-height:88px;
    }

    .stat-content strong{
        font-size:20px;
    }

    .funnel-row{
        grid-template-columns:72px 1fr 23px;
        gap:7px;
    }

    .funnel-row > span{
        font-size:8px;
    }

}


/* =========================================================
   PRINT
========================================================= */

@media print{

    .sidebar,
    .top-header,
    .app-footer,
    .quick-actions-panel,
    .module-actions{
        display:none !important;
    }

    .main-content{
        margin-left:0;
    }

    .page-container{
        padding:0;
    }

    .panel,
    .stat-card{
        box-shadow:none;
    }

}
