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

:root{
    --primary:#0e3d34;
    --primary-light:#145247;
    --accent:#d6a85f;
    --bg:#f5f7f6;
    --white:#ffffff;
    --text:#1d2b27;
    --muted:#7a8581;
    --border:#e7ece9;
    --success:#1d9b6c;
    --warning:#e7a43b;
    --danger:#e74c3c;
    --shadow:0 10px 35px rgba(16,52,44,.08);
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:Arial,Helvetica,sans-serif;
    background:var(--bg);
    color:var(--text);
}

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


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

.sidebar{
    width:260px;
    background:var(--primary);
    color:white;
    position:fixed;
    height:100vh;
    display:flex;
    flex-direction:column;
    z-index:1000;
}

.sidebar-top{
    padding:25px 20px;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
    text-decoration:none;
    color:white;
}

.brand-logo{
    width:48px;
    height:48px;
    border-radius:50%;
    background:white;
    padding:4px;
    overflow:hidden;
}

.brand-logo img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
}

.brand h2{
    font-size:21px;
}

.brand span{
    font-size:12px;
    opacity:.65;
}

.menu{
    padding:25px 14px;
    flex:1;
}

.menu-title{
    font-size:11px;
    letter-spacing:1px;
    opacity:.5;
    margin:0 10px 15px;
}

.menu-item{
    display:flex;
    align-items:center;
    gap:14px;
    color:rgba(255,255,255,.7);
    text-decoration:none;
    padding:13px 14px;
    margin-bottom:5px;
    border-radius:4px;
    transition:.3s;
}

.menu-item ion-icon{
    font-size:20px;
}

.menu-item:hover,
.menu-item.active{
    background:rgba(255,255,255,.12);
    color:white;
}

.sidebar-bottom{
    padding:18px;
    border-top:1px solid rgba(255,255,255,.08);
}

.help-box{
    display:flex;
    gap:10px;
    align-items:center;
    background:rgba(255,255,255,.08);
    padding:12px;
    border-radius:4px;
    margin-bottom:12px;
}

.help-icon{
    font-size:24px;
}

.help-box h4{
    font-size:13px;
}

.help-box p{
    font-size:11px;
    opacity:.6;
    margin-top:3px;
}

.logout-btn{
    width:100%;
    padding:12px;
    border:none;
    background:transparent;
    color:#fff;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:10px;
    font-size:14px;
}


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

.main-content{
    margin-left:260px;
    width:calc(100% - 260px);
}

.topbar{
    min-height:85px;
    background:white;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px 35px;
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    z-index:500;
}

.top-left{
    display:flex;
    align-items:center;
    gap:18px;
}

.top-left h1{
    font-size:21px;
}

.top-left p{
    color:var(--muted);
    font-size:13px;
    margin-top:5px;
}

.menu-toggle{
    display:none;
    border:none;
    background:none;
    font-size:28px;
    cursor:pointer;
}

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

.notification-btn{
    border:none;
    background:#f3f6f4;
    width:42px;
    height:42px;
    border-radius:50%;
    cursor:pointer;
    position:relative;
    font-size:20px;
}

.notification-btn span{
    position:absolute;
    width:8px;
    height:8px;
    background:var(--danger);
    border-radius:50%;
    top:8px;
    right:10px;
}

.profile-mini{
    display:flex;
    align-items:center;
    gap:10px;
}

.avatar{
    width:42px;
    height:42px;
    background:var(--accent);
    color:white;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
}

.profile-info{
    display:flex;
    flex-direction:column;
}

.profile-info strong{
    font-size:13px;
}

.profile-info span{
    font-size:11px;
    color:var(--muted);
}


/* ================= SECTIONS ================= */

.page-section{
    padding:35px;
}

.section-heading{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:25px;
}

.section-heading span{
    color:var(--accent);
    font-size:11px;
    font-weight:bold;
    letter-spacing:1px;
}

.section-heading h2{
    margin:5px 0;
    font-size:26px;
}

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


/* ================= STATS ================= */

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

.stat-card{
    background:white;
    padding:22px;
    border-radius:4px;
    box-shadow:var(--shadow);
    display:flex;
    gap:15px;
}

.stat-icon{
    min-width:50px;
    height:50px;
    border-radius:4px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:23px;
}

.sales-icon{
    background:#e8f4f0;
    color:var(--primary);
}

.commission-icon{
    background:#fff4df;
    color:#d69a2d;
}

.pending-icon{
    background:#fff0ed;
    color:#e06c4d;
}

.wallet-icon{
    background:#eef1ff;
    color:#5969d8;
}

.stat-card p{
    color:var(--muted);
    font-size:13px;
}

.stat-card h2{
    margin:7px 0;
    font-size:21px;
}

.growth{
    font-size:11px;
    color:var(--success);
}

.pending-text{
    font-size:11px;
    color:var(--warning);
}

.small-btn{
    margin-top:5px;
    border:none;
    color:var(--primary);
    background:transparent;
    font-weight:bold;
    cursor:pointer;
}


/* ================= CONTENT GRID ================= */

.content-grid{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:20px;
    margin-top:25px;
}

.card{
    background:white;
    border-radius:4px;
    box-shadow:var(--shadow);
    padding:25px;
}

.card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.card-header h2{
    font-size:18px;
}

.card-header p{
    font-size:12px;
    color:var(--muted);
    margin-top:4px;
}

.card-header select{
    border:1px solid var(--border);
    padding:8px;
    border-radius:4px;
}


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

.chart{
    height:270px;
    padding-top:25px;
}

.chart-bars{
    height:100%;
    display:flex;
    justify-content:space-around;
    align-items:end;
}

.bar-item{
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:end;
    gap:10px;
}

.bar{
    width:30px;
    background:linear-gradient(
        180deg,
        var(--primary-light),
        var(--primary)
    );
    border-radius:4px 4px 3px 3px;
}

.bar-item span{
    color:var(--muted);
    font-size:11px;
}


/* ================= QUICK ACTION ================= */

.quick-card button{
    width:100%;
    display:flex;
    align-items:center;
    gap:13px;
    border:none;
    background:#f7f9f8;
    padding:15px;
    border-radius:4px;
    margin-top:12px;
    cursor:pointer;
    text-align:left;
    transition:.3s;
}

.quick-card button:hover{
    background:#eaf2ef;
}

.quick-card ion-icon{
    font-size:23px;
    color:var(--primary);
}

.quick-card div{
    display:flex;
    flex-direction:column;
}

.quick-card span{
    font-size:11px;
    color:var(--muted);
}


/* ================= SEARCH ================= */

.search-box{
    display:flex;
    align-items:center;
    gap:8px;
    background:white;
    padding:11px 14px;
    border-radius:4px;
    box-shadow:var(--shadow);
}

.search-box input{
    border:none;
    outline:none;
    width:200px;
}


/* ================= PRODUCTS ================= */

.product-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}

.product-card{
    background:white;
    border-radius:4px;
    overflow:hidden;
    box-shadow:var(--shadow);
    transition:.3s;
}

.product-card:hover{
    transform:translateY(-5px);
}

.product-image{
    height:210px;
    position:relative;
    overflow:hidden;
}

.product-image img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.commission-badge{
    position:absolute;
    top:12px;
    left:12px;
    background:var(--primary);
    color:white;
    padding:6px 9px;
    border-radius:4px;
    font-size:10px;
}

.product-info{
    padding:17px;
}

.category{
    font-size:11px;
    color:var(--accent);
    font-weight:bold;
}

.product-info h3{
    font-size:16px;
    margin:7px 0 12px;
}

.product-price{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.product-price strong{
    color:var(--primary);
}

.product-price span{
    font-size:10px;
    color:var(--success);
}


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

.product-actions{
    display:grid;
    grid-template-columns:1fr 1.4fr;
    gap:8px;
    margin-top:15px;
}

.product-actions button{
    width:100%;
    border:none;
    padding:11px 8px;
    border-radius:4px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    font-size:12px;
}

.share-btn{
    background:#edf4f1;
    color:var(--primary);
}

.order-btn{
    background:var(--primary);
    color:white;
}

.order-btn:hover{
    background:var(--primary-light);
}


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

.table-wrapper{
    overflow-x:auto;
}

table{
    width:100%;
    border-collapse:collapse;
}

th,
td{
    text-align:left;
    padding:16px;
    border-bottom:1px solid var(--border);
    font-size:13px;
}

th{
    color:var(--muted);
    font-size:11px;
    text-transform:uppercase;
}

.commission{
    color:var(--success);
    font-weight:bold;
}

.status{
    padding:6px 10px;
    border-radius:4px;
    font-size:10px;
}

.completed{
    background:#e8f7ef;
    color:var(--success);
}

.pending{
    background:#fff4df;
    color:#d69a2d;
}


/* ================= COMMISSION ================= */

.commission-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:20px;
    margin-bottom:25px;
}

.commission-summary{
    background:white;
    padding:25px;
    border-radius:4px;
    box-shadow:var(--shadow);
}

.commission-summary ion-icon{
    font-size:30px;
    color:var(--primary);
}

.commission-summary p{
    margin-top:14px;
    color:var(--muted);
    font-size:13px;
}

.commission-summary h2{
    margin-top:8px;
}


/* ================= WITHDRAW ================= */

.withdraw-container{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:25px;
    align-items:center;
}

.withdraw-info{
    padding:40px;
}

.withdraw-info > span{
    font-size:11px;
    color:var(--accent);
    font-weight:bold;
    letter-spacing:1px;
}

.withdraw-info h2{
    font-size:48px;
    color:var(--primary);
    margin:12px 0;
}

.withdraw-info p{
    color:var(--muted);
}

.withdraw-note{
    margin-top:25px;
    background:#edf6f2;
    padding:14px;
    border-radius:4px;
    display:flex;
    gap:10px;
}

.withdraw-note ion-icon{
    color:var(--primary);
    font-size:22px;
}

.withdraw-form h2{
    font-size:21px;
}

.withdraw-form p{
    color:var(--muted);
    font-size:13px;
    margin:7px 0 22px;
}

.withdraw-form label{
    display:block;
    margin:14px 0 7px;
    font-size:13px;
    font-weight:bold;
}

.withdraw-form input,
.withdraw-form select{
    width:100%;
    padding:12px;
    border:1px solid var(--border);
    border-radius:4px;
    outline:none;
}

.withdraw-form button{
    width:100%;
    margin-top:20px;
    padding:13px;
    border:none;
    background:var(--primary);
    color:white;
    border-radius:4px;
    cursor:pointer;
}


/* ================= PROFILE ================= */

.profile-large{
    display:flex;
    align-items:center;
    gap:18px;
    padding-bottom:25px;
    border-bottom:1px solid var(--border);
}

.large-avatar{
    width:75px;
    height:75px;
    font-size:25px;
}

.profile-large p{
    color:var(--muted);
    font-size:13px;
    margin:5px 0;
}

.verified-badge{
    color:var(--success);
    font-size:12px;
}

.profile-details{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:18px;
    margin-top:25px;
}

.profile-details label{
    display:block;
    font-size:12px;
    margin-bottom:7px;
    color:var(--muted);
}

.profile-details input{
    width:100%;
    padding:12px;
    border:1px solid var(--border);
    border-radius:4px;
}

.save-profile{
    margin-top:25px;
    padding:12px 25px;
    background:var(--primary);
    color:white;
    border:none;
    border-radius:4px;
    cursor:pointer;
}


/* ================= MODAL ================= */

.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    opacity:0;
    visibility:hidden;
    transition:.3s;
    z-index:5000;
}

.modal-overlay.show{
    opacity:1;
    visibility:visible;
}

.order-modal{
    background:white;
    width:100%;
    max-width:750px;
    max-height:90vh;
    overflow-y:auto;
    border-radius:4px;
    padding:28px;
    transform:translateY(30px);
    transition:.3s;
}

.modal-overlay.show .order-modal{
    transform:translateY(0);
}

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

.modal-header span{
    font-size:10px;
    letter-spacing:1px;
    color:var(--accent);
    font-weight:bold;
}

.modal-header h2{
    margin-top:5px;
}

.close-modal{
    width:40px;
    height:40px;
    border:none;
    background:#f4f6f5;
    border-radius:50%;
    cursor:pointer;
    font-size:22px;
}

.selected-product{
    display:flex;
    align-items:center;
    gap:15px;
    background:#f4f8f6;
    padding:18px;
    border-radius:4px;
    margin:22px 0;
}

.selected-product-icon{
    width:52px;
    height:52px;
    background:var(--primary);
    color:white;
    border-radius:4px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
}

.selected-product span{
    font-size:11px;
    color:var(--muted);
}

.selected-product h3{
    margin:3px 0;
}

.selected-product p{
    color:var(--primary);
    font-weight:bold;
}

.form-title{
    font-size:14px;
    font-weight:bold;
    margin:20px 0 15px;
}

.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:15px;
}

.form-group{
    margin-bottom:15px;
}

.form-group label{
    display:block;
    font-size:12px;
    font-weight:bold;
    margin-bottom:7px;
}

.form-group input,
.form-group select,
.form-group textarea{
    width:100%;
    padding:12px 13px;
    border:1px solid var(--border);
    border-radius:4px;
    outline:none;
    font-family:inherit;
}

.form-group textarea{
    height:90px;
    resize:none;
}

.quantity-section{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:18px 0;
    border-top:1px solid var(--border);
    border-bottom:1px solid var(--border);
}

.quantity-section h4{
    font-size:14px;
}

.quantity-section p{
    color:var(--muted);
    font-size:11px;
    margin-top:4px;
}

.quantity-box{
    display:flex;
    align-items:center;
    border:1px solid var(--border);
    border-radius:4px;
    overflow:hidden;
}

.quantity-box button{
    width:38px;
    height:38px;
    border:none;
    background:#f5f7f6;
    cursor:pointer;
    font-size:17px;
}

.quantity-box span{
    width:45px;
    text-align:center;
    font-weight:bold;
}

.order-summary{
    background:#f7faf8;
    padding:20px;
    border-radius:4px;
    margin-top:20px;
}

.order-summary h3{
    font-size:15px;
    margin-bottom:15px;
}

.summary-row{
    display:flex;
    justify-content:space-between;
    padding:8px 0;
    font-size:13px;
    color:var(--muted);
}

.summary-row strong{
    color:var(--text);
}

.commission-value{
    color:var(--success)!important;
}

.total-row{
    border-top:1px solid var(--border);
    margin-top:8px;
    padding-top:14px;
    font-size:15px;
    color:var(--text);
}

.total-row strong{
    color:var(--primary);
}

.place-order-btn{
    width:100%;
    margin-top:20px;
    padding:14px;
    border:none;
    background:var(--primary);
    color:white;
    border-radius:4px;
    cursor:pointer;
    font-size:14px;
}


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

.toast{
    position:fixed;
    right:25px;
    top:25px;
    background:var(--primary);
    color:white;
    padding:14px 18px;
    border-radius:4px;
    display:flex;
    align-items:center;
    gap:10px;
    box-shadow:var(--shadow);
    transform:translateX(150%);
    transition:.4s;
    z-index:6000;
}

.toast.show{
    transform:translateX(0);
}

.toast ion-icon{
    font-size:22px;
}


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

@media(max-width:1200px){

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

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

}

@media(max-width:900px){

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

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

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

    .menu-toggle{
        display:block;
    }

    .content-grid,
    .withdraw-container{
        grid-template-columns:1fr;
    }

    .profile-details{
        grid-template-columns:1fr;
    }

}

@media(max-width:600px){

    .topbar{
        padding:15px;
    }

    .top-left h1{
        font-size:16px;
    }

    .top-left p{
        display:none;
    }

    .profile-info,
    .profile-mini > ion-icon{
        display:none;
    }

    .page-section{
        padding:20px 15px;
    }

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

    .section-heading{
        flex-direction:column;
        align-items:flex-start;
        gap:15px;
    }

    .search-box{
        width:100%;
    }

    .search-box input{
        width:100%;
    }

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

    .product-actions{
        grid-template-columns:1fr;
    }

    .order-modal{
        padding:20px 15px;
    }

}



/* =========================================================
   RESELLER DASHBOARD POLISH + SHIMMER LOADING
========================================================= */
.dashboard-page {
    padding-top: 28px;
}
.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    padding: 27px 30px;
    margin-bottom: 22px;
    color: #fff;
    background: linear-gradient(115deg, #0e3d34 0%, #145247 68%, #1d6656 100%);
    box-shadow: var(--shadow);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: 12%;
    top: -145px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(255,255,255,.035), 0 0 0 58px rgba(255,255,255,.025);
    pointer-events: none;
}
.dashboard-hero-copy,
.dashboard-hero-link {
    position: relative;
    z-index: 1;
}
.dashboard-hero-copy > span {
    display: inline-block;
    color: #e4c58e;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 9px;
}
.dashboard-hero-copy h2 {
    font-size: 23px;
    line-height: 1.3;
    margin-bottom: 7px;
}
.dashboard-hero-copy p {
    color: rgba(255,255,255,.72);
    font-size: 12px;
}
.dashboard-hero-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: 12px 15px;
    color: #153e34;
    background: #f3dba9;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: transform .2s ease, background .2s ease;
}
.dashboard-hero-link:hover {
    background: #fff0cf;
    transform: translateY(-2px);
}
.dashboard-hero-link ion-icon { font-size: 16px; }
.dashboard-page .stat-card {
    min-height: 136px;
    align-items: flex-start;
    border: 1px solid rgba(14,61,52,.045);
    transition: transform .2s ease, box-shadow .2s ease;
}
.dashboard-page .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(16,52,44,.11);
}
.dashboard-page .stat-card h2 {
    font-size: 22px;
    letter-spacing: -.45px;
}
.dashboard-page .stat-icon { border-radius: 4px; }
.dashboard-page .content-grid { align-items: stretch; }
.dashboard-page .card { border: 1px solid rgba(14,61,52,.045); }
.chart-range-label {
    color: var(--muted);
    font-size: 11px;
    padding: 7px 10px;
    background: #f5f8f6;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.dashboard-page .bar {
    min-height: 4px;
    transition: height .35s ease;
}
.dashboard-page .quick-card button {
    border: 1px solid transparent;
}
.dashboard-page .quick-card button:hover {
    border-color: #dce9e3;
    transform: translateX(2px);
}

/* Reusable shimmer */
@keyframes resellerShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.reseller-shimmer,
.dashboard-page.is-loading .stat-card p,
.dashboard-page.is-loading .stat-card h2,
.dashboard-page.is-loading .stat-card .growth,
.dashboard-page.is-loading .stat-card .pending-text,
.dashboard-page.is-loading .card-header h2,
.dashboard-page.is-loading .card-header p,
.dashboard-page.is-loading .bar,
.dashboard-page.is-loading .quick-card button strong,
.dashboard-page.is-loading .quick-card button span {
    color: transparent !important;
    background: linear-gradient(100deg, #edf1ef 20%, #f9fbfa 38%, #edf1ef 56%);
    background-size: 220% 100%;
    animation: resellerShimmer 1.25s linear infinite;
    border-radius: 4px;
}
.dashboard-page.is-loading .stat-card p { width: 92px; height: 12px; }
.dashboard-page.is-loading .stat-card h2 { width: 142px; height: 23px; margin: 9px 0; }
.dashboard-page.is-loading .stat-card .growth,
.dashboard-page.is-loading .stat-card .pending-text { display: block; width: 112px; height: 10px; }
.dashboard-page.is-loading .card-header h2 { width: 150px; height: 18px; }
.dashboard-page.is-loading .card-header p { width: 190px; height: 10px; margin-top: 7px; }
.dashboard-page.is-loading .bar { min-height: 16px; }
.dashboard-page.is-loading .quick-card button strong { display: block; width: 125px; height: 12px; }
.dashboard-page.is-loading .quick-card button span { display: block; width: 155px; height: 9px; margin-top: 7px; }
.dashboard-page.is-loading .stat-card .small-btn { opacity: .35; }

/* Initial Firebase authentication skeleton */
.reseller-page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    background: #f5f7f6;
}
.auth-loader-sidebar {
    width: 260px;
    flex: 0 0 260px;
    min-height: 100vh;
    padding: 25px 20px;
    background: #0e3d34;
}
.auth-loader-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,.1); }
.auth-loader-brand i { width: 46px; height: 46px; border-radius: 50%; }
.auth-loader-brand span { width: 105px; height: 17px; }
.auth-loader-nav { display: grid; gap: 16px; padding: 32px 4px; }
.auth-loader-nav i { display: block; height: 39px; border-radius: 4px; }
.auth-loader-sidebar i,
.auth-loader-brand span,
.auth-loader-top i,
.auth-loader-top b,
.auth-loader-title i,
.auth-loader-stats i,
.auth-loader-panels i {
    background: linear-gradient(100deg, rgba(255,255,255,.11) 20%, rgba(255,255,255,.24) 38%, rgba(255,255,255,.11) 56%);
    background-size: 220% 100%;
    animation: resellerShimmer 1.25s linear infinite;
}
.auth-loader-main { flex: 1; min-width: 0; }
.auth-loader-top {
    height: 85px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 35px;
    background: #fff;
    border-bottom: 1px solid #e7ece9;
}
.auth-loader-top > div { display: grid; gap: 8px; }
.auth-loader-top i:first-child { width: 190px; height: 17px; background-color: #edf1ef; }
.auth-loader-top i:last-child { width: 235px; height: 9px; background-color: #edf1ef; }
.auth-loader-top b { width: 42px; height: 42px; border-radius: 50%; background-color: #edf1ef; }
.auth-loader-content { padding: 35px; }
.auth-loader-title { display: grid; gap: 10px; margin-bottom: 26px; }
.auth-loader-title i:first-child { width: 230px; height: 22px; background-color: #e8eeeb; }
.auth-loader-title i:last-child { width: 290px; height: 11px; background-color: #e8eeeb; }
.auth-loader-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.auth-loader-stats i { height: 136px; border-radius: 4px; background-color: #e8eeeb; }
.auth-loader-panels { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 25px; }
.auth-loader-panels i { height: 310px; border-radius: 4px; background-color: #e8eeeb; }
.auth-loader-message { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); color: #78847e; font-size: 12px; }

/* =========================================================
   FINANCIAL DASHBOARD
========================================================= */
.finance-page { padding-top: 30px; }
.finance-heading { gap: 20px; }
.finance-month-control { display: grid; gap: 7px; min-width: 190px; }
.finance-month-control label { color: #738079; font-size: 11px; font-weight: 700; }
.finance-month-control select,
.finance-orders-heading select {
    min-width: 170px;
    padding: 10px 12px;
    color: #263a33;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    outline: none;
}
.finance-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.finance-stat-card {
    min-width: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid rgba(14,61,52,.055);
    border-radius: 4px;
    box-shadow: var(--shadow);
}
.finance-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.finance-stat-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 4px; font-size: 19px; }
.finance-stat-icon.sales { color: #0e6653; background: #e8f4f0; }
.finance-stat-icon.orders { color: #6673c4; background: #eef0ff; }
.finance-stat-icon.delivered { color: #16865c; background: #e9f7ef; }
.finance-stat-icon.progress { color: #bb812b; background: #fff5e4; }
.finance-stat-icon.earned { color: #997027; background: #fff4dc; }
.finance-stat-icon.pending { color: #b86a53; background: #fff0ed; }
.finance-stat-card > strong { display: block; margin: 15px 0 7px; color: #1e332b; font-size: 23px; letter-spacing: -.4px; overflow-wrap: anywhere; }
.finance-stat-card > small { color: #8b9690; font-size: 10px; line-height: 1.5; }
.finance-wallet-strip {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 22px;
    margin-top: 18px;
    background: #edf5f1;
    border: 1px solid #dceae3;
    border-radius: 4px;
}
.finance-wallet-icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; color: #0e3d34; background: #dcebe4; border-radius: 4px; font-size: 22px; }
.finance-wallet-strip > div:nth-child(2) { display: grid; gap: 3px; }
.finance-wallet-strip span { color: #5f7068; font-size: 11px; }
.finance-wallet-strip strong { color: #0e3d34; font-size: 19px; }
.finance-wallet-strip small { color: #84918a; font-size: 10px; }
.finance-wallet-strip > a { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #0e5748; text-decoration: none; font-size: 11px; font-weight: 700; white-space: nowrap; }
.finance-analysis-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; margin-top: 20px; }
.finance-analysis-grid .card { min-width: 0; border: 1px solid rgba(14,61,52,.045); }
.finance-chart-card { min-height: 290px; }
.finance-chart { height: 205px; display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; align-items: end; padding: 22px 4px 0; }
.finance-chart-column { display: flex; height: 100%; min-width: 0; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.finance-chart-column > strong { max-width: 100%; overflow: hidden; color: #75817b; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.finance-chart-track { width: min(100%, 38px); height: 130px; display: flex; align-items: flex-end; overflow: hidden; background: #f1f5f2; border-radius: 4px 4px 0 0; }
.finance-chart-track span { width: 100%; min-height: 3px; display: block; background: linear-gradient(180deg, #2a7865, #0e3d34); border-radius: 4px 4px 0 0; transition: height .3s ease; }
.finance-chart-column > small { color: #78857e; font-size: 10px; }
.impact-list { display: grid; gap: 0; margin-top: 18px; }
.impact-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf1ee; }
.impact-list > div:last-child { border-bottom: 0; }
.impact-list span { color: #77847d; font-size: 11px; }
.impact-list strong { color: #223a30; font-size: 12px; text-align: right; }
.finance-footnote { margin-top: 11px; padding: 11px; color: #7b8981; background: #f7f9f8; border-radius: 4px; font-size: 10px; line-height: 1.6; }
.finance-orders-card { margin-top: 20px; padding: 0; overflow: hidden; border: 1px solid rgba(14,61,52,.05); }
.finance-orders-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.finance-orders-heading h2 { color: #24382f; font-size: 17px; }
.finance-orders-heading p { color: #85918a; font-size: 11px; margin-top: 5px; }
.finance-orders-heading select { min-width: 145px; font-size: 11px; }
.finance-table { min-width: 850px; }
.finance-table th { padding: 14px 16px; background: #fafcfb; white-space: nowrap; }
.finance-table td { padding: 15px 16px; vertical-align: middle; }
.finance-table td:first-child { color: #718078; white-space: nowrap; font-size: 11px; }
.finance-table td:nth-child(2) b { color: #28473b; font-size: 11px; }
.finance-customer { display: grid; gap: 4px; color: #293d34; font-size: 11px; font-weight: 700; min-width: 150px; }
.finance-customer small { color: #8b9690; font-size: 10px; font-weight: 400; }
.finance-customer .finance-items { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-amount { color: #243b31; font-weight: 700; white-space: nowrap; }
.finance-commission { font-size: 10px; font-weight: 700; white-space: nowrap; }
.finance-commission.earned { color: #16865c; }
.finance-commission.pending { color: #b47b2b; }
.finance-commission.voided { color: #bd6253; }
.finance-table .status { display: inline-block; white-space: nowrap; }
.finance-table .status.cancelled { color: #b75d50; background: #fff0ed; }
.finance-empty { padding: 34px !important; text-align: center !important; color: #87938c !important; font-size: 12px !important; }
.finance-page.is-loading .finance-stat-card > strong,
.finance-page.is-loading .finance-stat-card > small,
.finance-page.is-loading .finance-orders-heading h2,
.finance-page.is-loading .finance-orders-heading p,
.finance-page.is-loading .finance-chart-column > strong,
.finance-page.is-loading .finance-chart-track span,
.finance-page.is-loading .impact-list span,
.finance-page.is-loading .impact-list strong {
    color: transparent !important;
    background: linear-gradient(100deg, #edf1ef 20%, #f9fbfa 38%, #edf1ef 56%);
    background-size: 220% 100%;
    animation: resellerShimmer 1.25s linear infinite;
    border-radius: 4px;
}
.finance-page.is-loading .finance-stat-card > strong { width: 135px; height: 24px; }
.finance-page.is-loading .finance-stat-card > small { display: block; width: 150px; height: 10px; }
.finance-page.is-loading .finance-chart-track span { background: linear-gradient(100deg, #edf1ef 20%, #f9fbfa 38%, #edf1ef 56%); background-size: 220% 100%; }
.finance-page.is-loading .finance-orders-card .table-wrapper { opacity: .35; }

@media(max-width:1100px) {
    .finance-stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .finance-analysis-grid { grid-template-columns: 1fr; }
}
@media(max-width:900px) {
    .auth-loader-sidebar { width: 210px; flex-basis: 210px; }
    .auth-loader-stats { grid-template-columns: repeat(2,1fr); }
    .auth-loader-panels { grid-template-columns: 1fr; }
}
@media(max-width:650px) {
    .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
    .dashboard-hero-copy h2 { font-size: 19px; }
    .dashboard-hero-link { width: 100%; justify-content: center; }
    .finance-heading { align-items: stretch; }
    .finance-month-control { width: 100%; }
    .finance-month-control select { width: 100%; }
    .finance-stats-grid { grid-template-columns: 1fr; gap: 12px; }
    .finance-stat-card { padding: 17px; }
    .finance-wallet-strip { align-items: flex-start; flex-wrap: wrap; padding: 16px; }
    .finance-wallet-strip > a { width: 100%; margin-left: 59px; }
    .finance-orders-heading { align-items: flex-start; flex-direction: column; padding: 18px; }
    .finance-orders-heading select { width: 100%; }
    .finance-chart { gap: 7px; }
    .finance-chart-column > strong { font-size: 8px; }
    .auth-loader-sidebar { display: none; }
    .auth-loader-top { padding: 15px; }
    .auth-loader-content { padding: 20px 15px; }
    .auth-loader-stats { gap: 10px; }
    .auth-loader-stats i { height: 112px; }
}
