/* =========================================================
   WAKALASMART - PROFESSIONAL FINTECH UI
   UI ONLY - NO BACKEND / DATABASE CHANGES
   ========================================================= */

:root{
    --ws-primary:#087f5b;
    --ws-primary-dark:#056044;
    --ws-primary-light:#e8f7f1;
    --ws-navy:#172033;
    --ws-text:#263244;
    --ws-muted:#718096;
    --ws-bg:#f5f7f9;
    --ws-white:#ffffff;
    --ws-border:#e5e9ef;
    --ws-danger:#dc3545;
    --ws-warning:#d98b00;
    --ws-success:#087f5b;
    --ws-shadow:0 4px 18px rgba(23,32,51,.06);
    --ws-radius:12px;
    --ws-sidebar:258px;
}

*{
    box-sizing:border-box;
}

html{
    min-height:100%;
    background:var(--ws-bg);
}

body{
    margin:0;
    min-height:100vh;
    background:var(--ws-bg);
    color:var(--ws-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size:14px;
    line-height:1.5;
}

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

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

button{
    cursor:pointer;
}

/* =========================================================
   MAIN APPLICATION SHELL
   ========================================================= */

.ws-app,
.shell{
    min-height:100vh;
    display:flex;
    background:var(--ws-bg);
}

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

.ws-sidebar,
.sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:var(--ws-sidebar);
    background:#fff;
    border-right:1px solid var(--ws-border);
    display:flex;
    flex-direction:column;
    z-index:1000;
    overflow-y:auto;
}

.ws-brand,
.brand{
    height:72px;
    display:flex;
    align-items:center;
    gap:11px;
    padding:0 20px;
    border-bottom:1px solid var(--ws-border);
    font-weight:800;
}

.ws-brand-mark{
    width:38px;
    height:38px;
    border-radius:10px;
    background:var(--ws-primary);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:17px;
    font-weight:900;
    box-shadow:0 5px 12px rgba(8,127,91,.18);
}

.ws-brand-name{
    color:var(--ws-navy);
    font-size:17px;
    letter-spacing:-.3px;
}

.ws-user-profile{
    margin:15px 14px;
    padding:12px;
    border:1px solid var(--ws-border);
    border-radius:10px;
    display:flex;
    gap:10px;
    align-items:center;
    background:#fafbfc;
}

.ws-user-avatar{
    width:38px;
    height:38px;
    flex:0 0 38px;
    border-radius:50%;
    background:var(--ws-primary-light);
    color:var(--ws-primary-dark);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
}

.ws-user-info{
    min-width:0;
}

.ws-user-info strong{
    display:block;
    color:var(--ws-navy);
    font-size:12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.ws-user-info span{
    display:block;
    color:var(--ws-muted);
    font-size:11px;
    margin-top:2px;
}

.ws-nav{
    padding:4px 10px 15px;
    flex:1;
}

.ws-nav-section{
    margin:14px 9px 6px;
    color:#9aa4b2;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.09em;
}

.ws-nav-item{
    position:relative;
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    min-height:42px;
    padding:9px 11px;
    margin:2px 0;
    border-radius:8px;
    color:#4d596b;
    font-weight:600;
    transition:
        background .15s ease,
        color .15s ease;
}

.ws-nav-item:hover{
    background:#f2f7f5;
    color:var(--ws-primary-dark);
}

.ws-nav-item.active{
    background:var(--ws-primary-light);
    color:var(--ws-primary-dark);
}

.ws-nav-item.active:before{
    content:"";
    position:absolute;
    left:-10px;
    top:7px;
    bottom:7px;
    width:3px;
    background:var(--ws-primary);
    border-radius:0 3px 3px 0;
}

.ws-nav-icon{
    width:19px;
    height:19px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 19px;
}

.ws-nav-icon svg{
    width:18px;
    height:18px;
    stroke-width:1.8;
}

.ws-sidebar-bottom{
    padding:10px;
    border-top:1px solid var(--ws-border);
}

.ws-logout{
    width:100%;
    border:0;
    background:transparent;
    color:#687386;
    min-height:42px;
    border-radius:8px;
    text-align:left;
    padding:9px 11px;
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:600;
}

.ws-logout:hover{
    background:#fff1f2;
    color:#c92a3a;
}

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

.ws-main,
.main{
    margin-left:var(--ws-sidebar);
    min-width:0;
    width:calc(100% - var(--ws-sidebar));
    min-height:100vh;
}

.ws-navbar,
.topbar{
    position:sticky;
    top:0;
    z-index:900;
    min-height:70px;
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(12px);
    border-bottom:1px solid var(--ws-border);
    display:flex;
    align-items:center;
    padding:0 28px;
    gap:20px;
}

.ws-navbar-left{
    display:flex;
    align-items:center;
    gap:16px;
    flex:1;
}

.ws-global-search,
.search{
    height:42px;
    width:min(480px,100%);
    display:flex;
    align-items:center;
    gap:9px;
    padding:0 13px;
    border:1px solid var(--ws-border);
    background:#f8fafb;
    border-radius:9px;
    color:#8993a2;
}

.ws-global-search:focus-within{
    border-color:#8bcdb8;
    background:#fff;
    box-shadow:0 0 0 3px rgba(8,127,91,.08);
}

.ws-global-search input,
.search input{
    border:0;
    outline:0;
    background:transparent;
    width:100%;
    color:var(--ws-text);
}

.ws-global-search input::placeholder,
.search input::placeholder{
    color:#a1a9b5;
}

.ws-navbar-actions,
.topright{
    display:flex;
    align-items:center;
    gap:9px;
}

.ws-icon-button{
    width:40px;
    height:40px;
    border:1px solid var(--ws-border);
    background:#fff;
    border-radius:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#667085;
}

.ws-icon-button:hover{
    color:var(--ws-primary);
    border-color:#b9ddd0;
    background:#f7fcfa;
}

.ws-navbar-user{
    display:flex;
    align-items:center;
    gap:9px;
    padding-left:9px;
    border-left:1px solid var(--ws-border);
}

.ws-navbar-user-avatar{
    width:36px;
    height:36px;
    border-radius:50%;
    background:var(--ws-primary);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:12px;
    font-weight:800;
}

.ws-navbar-user strong{
    display:block;
    color:var(--ws-navy);
    font-size:12px;
}

.ws-navbar-user span{
    color:var(--ws-muted);
    font-size:10px;
}

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

.ws-content,
.content{
    width:100%;
    max-width:1600px;
    margin:0 auto;
    padding:28px;
}

.ws-breadcrumb{
    display:flex;
    align-items:center;
    gap:7px;
    color:#8993a2;
    font-size:12px;
    margin-bottom:10px;
}

.ws-breadcrumb strong{
    color:var(--ws-text);
}

.ws-page-header,
.page-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:25px;
}

.ws-page-title,
.page-head h1{
    margin:0;
    color:var(--ws-navy);
    font-size:29px;
    line-height:1.2;
    letter-spacing:-.7px;
    font-weight:800;
}

.ws-page-description,
.page-head p{
    margin:7px 0 0;
    color:var(--ws-muted);
    font-size:13px;
}

.ws-eyebrow,
.eyebrow{
    color:var(--ws-primary);
    font-size:10px;
    font-weight:800;
    letter-spacing:.1em;
    text-transform:uppercase;
    margin-bottom:7px;
}

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

.ws-actions,
.tx-actions{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:9px;
}

.ws-btn,
.btn{
    min-height:40px;
    padding:9px 15px;
    border-radius:8px;
    border:1px solid transparent;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    font-weight:700;
    font-size:13px;
    transition:.15s ease;
}

.ws-btn-primary,
.btn-red{
    background:var(--ws-primary);
    color:#fff;
    border-color:var(--ws-primary);
}

.ws-btn-primary:hover,
.btn-red:hover{
    background:var(--ws-primary-dark);
    border-color:var(--ws-primary-dark);
    transform:translateY(-1px);
}

.ws-btn-secondary,
.btn-outline-red{
    background:#fff;
    color:var(--ws-primary);
    border-color:#a9d6c7;
}

.ws-btn-secondary:hover,
.btn-outline-red:hover{
    background:var(--ws-primary-light);
}

.btn-dark{
    background:var(--ws-navy);
    color:#fff;
}

/* =========================================================
   STATISTICS
   ========================================================= */

.ws-stat-grid,
.cards{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:14px;
    margin-bottom:20px;
}

.ws-stat,
.stat{
    position:relative;
    background:#fff;
    border:1px solid var(--ws-border);
    border-radius:var(--ws-radius);
    padding:18px;
    box-shadow:var(--ws-shadow);
    min-width:0;
}

.ws-stat-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
}

.ws-stat-icon{
    width:38px;
    height:38px;
    border-radius:9px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--ws-primary-light);
    color:var(--ws-primary);
}

.ws-stat-icon svg{
    width:19px;
    height:19px;
}

.ws-stat small,
.stat small{
    display:block;
    color:#7b8798;
    font-size:11px;
    font-weight:700;
    margin-bottom:8px;
}

.ws-stat b,
.stat b{
    display:block;
    color:var(--ws-navy);
    font-size:22px;
    font-weight:800;
    letter-spacing:-.4px;
    overflow-wrap:anywhere;
}

.ws-stat span,
.stat span{
    display:block;
    margin-top:6px;
    color:#8993a2;
    font-size:10px;
}

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

.ws-grid{
    display:grid;
    grid-template-columns:minmax(0,2fr) minmax(300px,1fr);
    gap:18px;
    margin-bottom:18px;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:minmax(0,1.7fr) minmax(320px,1fr);
    gap:18px;
    margin-bottom:18px;
}

.ws-card,
.panel{
    background:#fff;
    border:1px solid var(--ws-border);
    border-radius:var(--ws-radius);
    box-shadow:var(--ws-shadow);
    min-width:0;
}

.ws-card-header,
.panel-head{
    padding:17px 19px;
    border-bottom:1px solid var(--ws-border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}

.ws-card-header h3,
.panel-head h3,
.panel h3{
    margin:0;
    color:var(--ws-navy);
    font-size:15px;
    font-weight:800;
}

.ws-card-header p,
.panel-head p{
    margin:4px 0 0;
}

.ws-card-body{
    padding:19px;
}

.muted{
    color:var(--ws-muted);
    font-size:12px;
}

/* =========================================================
   FLOAT
   ========================================================= */

.float-dashboard{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    padding:16px 19px;
}

.float-dash{
    border:1px solid var(--ws-border);
    border-radius:9px;
    padding:13px;
    background:#fbfcfd;
}

.float-dash span{
    display:block;
    font-size:11px;
    margin-bottom:4px;
}

.float-dash b{
    display:block;
    font-size:16px;
    color:var(--ws-navy);
}

.float-dash small{
    display:block;
    color:#929baa;
    margin-top:4px;
    font-size:10px;
}

.total-row{
    padding:14px 19px;
    border-top:1px solid var(--ws-border);
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.total-row strong{
    color:var(--ws-primary-dark);
    font-size:17px;
}

/* =========================================================
   TABLES
   ========================================================= */

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

table{
    width:100%;
    border-collapse:collapse;
    min-width:650px;
}

th{
    background:#fafbfc;
    color:#7b8798;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
    padding:12px 15px;
    text-align:left;
    border-bottom:1px solid var(--ws-border);
    white-space:nowrap;
}

td{
    padding:13px 15px;
    border-bottom:1px solid #edf0f3;
    color:#435064;
    font-size:12px;
    vertical-align:middle;
}

tbody tr:hover{
    background:#fbfdfc;
}

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

.type-badge,
.ws-status{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:25px;
    padding:4px 8px;
    border-radius:6px;
    font-size:10px;
    font-weight:800;
    text-transform:capitalize;
}

.type-badge.deposit{
    background:#e8f7f1;
    color:#087f5b;
}

.type-badge.withdrawal{
    background:#fff0f1;
    color:#c92a3a;
}

.ws-status.active,
.ws-status.success{
    background:#e8f7f1;
    color:#087f5b;
}

.ws-status.expired,
.ws-status.danger{
    background:#fff0f1;
    color:#c92a3a;
}

.ws-status.pending,
.ws-status.warning{
    background:#fff7df;
    color:#9a6500;
}

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

form{
    max-width:100%;
}

label{
    display:block;
    margin:0 0 6px;
    color:#465266;
    font-size:11px;
    font-weight:800;
}

input,
select,
textarea{
    width:100%;
    border:1px solid #dce1e8;
    border-radius:8px;
    background:#fff;
    color:var(--ws-text);
    padding:10px 12px;
    outline:none;
    transition:border-color .15s ease,box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus{
    border-color:#8bcdb8;
    box-shadow:0 0 0 3px rgba(8,127,91,.08);
}

textarea{
    resize:vertical;
}

.two{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:13px;
}

.inline-form{
    display:flex;
    align-items:center;
    gap:6px;
}

.full{
    width:100%;
    margin-top:12px;
}

.filters{
    padding:14px;
    margin-bottom:18px;
    display:flex;
    align-items:center;
    gap:10px;
}

.filters input{
    flex:1;
}

/* =========================================================
   ALERTS / MESSAGES
   ========================================================= */

.toast,
.warningbox,
.errorbox{
    border-radius:9px;
    padding:12px 14px;
    margin-bottom:16px;
    font-size:12px;
    font-weight:600;
}

.toast{
    background:#e8f7f1;
    color:#056044;
    border:1px solid #bde5d5;
}

.warningbox{
    background:#fff7df;
    color:#805700;
    border:1px solid #f0d98c;
}

.errorbox{
    background:#fff0f1;
    color:#a92132;
    border:1px solid #f2c1c7;
}

.alert-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    padding:19px;
}

.alert-grid > div{
    border:1px solid var(--ws-border);
    border-radius:9px;
    padding:14px;
    background:#fafbfc;
}

.alert-grid b{
    color:var(--ws-navy);
    font-size:12px;
}

.alert-grid p{
    margin:5px 0 0;
    color:var(--ws-muted);
    font-size:11px;
}

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

.mini-chart{
    height:220px;
    display:flex;
    align-items:flex-end;
    gap:10px;
    padding:22px 18px 14px;
}

.chart-col{
    flex:1;
    height:100%;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    align-items:center;
    gap:7px;
}

.chart-bars{
    width:100%;
    height:175px;
    display:flex;
    align-items:flex-end;
    justify-content:center;
    gap:3px;
}

.chart-bars i{
    width:10px;
    min-height:4px;
    border-radius:3px 3px 0 0;
    background:var(--ws-primary);
}

.chart-bars i.withdraw{
    background:#dce3ea;
}

.chart-col small{
    color:#8993a2;
    font-size:9px;
}

/* =========================================================
   SUBSCRIPTION
   ========================================================= */

.subscription-card{
    padding:18px 20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-top:18px;
}

.subscription-card h3{
    margin:3px 0;
}

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

.empty{
    padding:35px 15px!important;
    text-align:center;
    color:#929baa;
}

/* =========================================================
   MOBILE MENU
   ========================================================= */

.menu{
    display:none;
    width:40px;
    height:40px;
    border:1px solid var(--ws-border);
    background:#fff;
    border-radius:8px;
    align-items:center;
    justify-content:center;
}

.ws-mobile-nav,
.mobile-nav{
    display:none;
}

/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media(max-width:1250px){

    .ws-stat-grid,
    .cards{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }

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

}

/* =========================================================
   RESPONSIVE - MOBILE
   ========================================================= */

@media(max-width:900px){

    :root{
        --ws-sidebar:250px;
    }

    .ws-sidebar,
    .sidebar{
        transform:translateX(-105%);
        transition:transform .2s ease;
        box-shadow:12px 0 35px rgba(0,0,0,.12);
    }

    body.nav-open .ws-sidebar,
    body.nav-open .sidebar{
        transform:translateX(0);
    }

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

    .menu{
        display:flex;
    }

    .ws-navbar,
    .topbar{
        padding:0 14px;
        min-height:62px;
        gap:10px;
    }

    .ws-global-search,
    .search{
        flex:1;
        min-width:0;
        width:auto;
    }

    .ws-navbar-user-info,
    .ws-navbar-user > div:not(.ws-navbar-user-avatar),
    .lang{
        display:none;
    }

    .ws-navbar-user{
        border-left:0;
        padding-left:0;
    }

    .ws-content,
    .content{
        padding:19px 14px 88px;
    }

    .ws-page-header,
    .page-head{
        flex-direction:column;
        margin-bottom:18px;
    }

    .ws-page-title,
    .page-head h1{
        font-size:24px;
    }

    .ws-actions,
    .tx-actions{
        width:100%;
    }

    .ws-actions .ws-btn,
    .tx-actions .btn{
        flex:1;
    }

    .ws-stat-grid,
    .cards{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:10px;
    }

    .ws-stat,
    .stat{
        padding:14px;
    }

    .ws-stat b,
    .stat b{
        font-size:18px;
    }

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

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

    .subscription-card{
        flex-direction:column;
        align-items:flex-start;
    }

    .subscription-card .btn{
        width:100%;
    }

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

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

    .inline-form{
        flex-wrap:wrap;
    }

    .ws-mobile-nav,
    .mobile-nav{
        position:fixed;
        display:flex;
        left:0;
        right:0;
        bottom:0;
        height:64px;
        background:#fff;
        border-top:1px solid var(--ws-border);
        z-index:1200;
        box-shadow:0 -5px 20px rgba(23,32,51,.08);
        align-items:center;
        justify-content:space-around;
        padding:5px 5px;
    }

    .ws-mobile-nav a,
    .mobile-nav a{
        min-width:58px;
        height:54px;
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:2px;
        color:#7a8595;
        font-size:9px;
        font-weight:700;
        border-radius:8px;
    }

    .ws-mobile-nav a.active,
    .mobile-nav a.active{
        color:var(--ws-primary);
        background:var(--ws-primary-light);
    }

    .ws-mobile-nav svg,
    .mobile-nav svg{
        width:19px;
        height:19px;
    }

}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media(max-width:520px){

    .ws-stat-grid,
    .cards{
        grid-template-columns:1fr 1fr;
    }

    .ws-stat small,
    .stat small{
        font-size:10px;
    }

    .ws-stat b,
    .stat b{
        font-size:16px;
    }

    .ws-page-title,
    .page-head h1{
        font-size:21px;
    }

    .mini-chart{
        padding-left:8px;
        padding-right:8px;
    }

}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

:focus-visible{
    outline:3px solid rgba(8,127,91,.22);
    outline-offset:2px;
}

/* =========================================================
   OLD COMPONENT COMPATIBILITY
   ========================================================= */

.panel{
    overflow:hidden;
}

.panel > h3{
    padding:19px 19px 0;
}

.stat{
    min-height:130px;
}

.page-head{
    align-items:center;
}

.btn{
    white-space:nowrap;
}

a{
    transition:color .15s ease;
}

/* Prevent unstyled SVGs from affecting layout */
svg{
    max-width:100%;
}

/* Offline indicator */
#offlineBar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    z-index:9999;
    padding:8px;
    text-align:center;
    background:#9a6500;
    color:#fff;
    font-size:11px;
    font-weight:700;
}

.offline{
    display:none;
}
