*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Inter,sans-serif;
}

/* =========================================
   BODY
========================================= */

body{

    min-height:100vh;

    display:flex;

    overflow:hidden;

    background:
    radial-gradient(circle at top left,#1d4ed8,#020617 35%),
    #020617;

    color:white;

    transition:0.25s;
}

/* =========================================
   SIDEBAR
========================================= */

.sidebar{

    width:84px;

    height:100vh;

    background:
    rgba(15,23,42,0.82);

    backdrop-filter:blur(20px);

    border-right:
    1px solid rgba(255,255,255,0.06);

    padding:16px 12px;

    display:flex;

    flex-direction:column;

    justify-content:space-between;

    transition:0.28s ease;
}

.sidebar.expanded{

    width:240px;
}

.menu{

    display:flex;

    flex-direction:column;

    gap:14px;

    margin-top:20px;
}

.menu button,
.logout-btn{

    width:56px;

    height:56px;

    border:none;

    border-radius:18px;

    background:
    rgba(255,255,255,0.05);

    color:#cbd5e1;

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    transition:0.22s;

    overflow:hidden;
}

.menu button:hover,
.logout-btn:hover{

    background:
    rgba(255,255,255,0.1);
}

.sidebar.expanded .menu button,
.sidebar.expanded .logout-btn{

    width:100%;

    justify-content:flex-start;

    padding:0 18px;
}

.icon{

    display:flex;

    align-items:center;

    justify-content:center;

    min-width:20px;
}

.text{

    display:none;

    margin-left:14px;

    font-size:14px;

    white-space:nowrap;
}

.sidebar.expanded .text{

    display:block;
}

.logo{

    font-size:26px;

    font-weight:800;

    letter-spacing:-1px;

    white-space:nowrap;
}

.logo span{

    color:#3b82f6;
}

/* =========================================
   MAIN CONTENT
========================================= */

.main-content{

    flex:1;

    overflow:auto;

    padding:42px;
}

.topbar{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:34px;
}

.topbar h1{

    font-size:50px;

    font-weight:800;

    letter-spacing:-2px;
}

.topbar p{

    margin-top:8px;

    color:#94a3b8;
}

.theme-toggle{

    width:52px;

    height:52px;

    border-radius:16px;

    background:
    rgba(255,255,255,0.06);

    display:flex;

    justify-content:center;

    align-items:center;

    cursor:pointer;

    transition:0.22s;
}

.theme-toggle:hover{

    background:
    rgba(255,255,255,0.12);

    transform:translateY(-2px);
}

/* =========================================
   WALLET HERO
========================================= */

.wallet-hero{

    position:relative;

    overflow:hidden;

    background:
    linear-gradient(
        135deg,
        rgba(37,99,235,0.95),
        rgba(29,78,216,0.92),
        rgba(15,23,42,0.96)
    );

    border:
    1px solid rgba(255,255,255,0.06);

    border-radius:32px;

    padding:38px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:28px;

    box-shadow:
    0 18px 50px rgba(0,0,0,0.28);

    backdrop-filter:blur(20px);
}

.wallet-hero::before{

    content:"";

    position:absolute;

    width:320px;

    height:320px;

    right:-120px;

    top:-120px;

    background:
    radial-gradient(
        circle,
        rgba(255,255,255,0.08),
        transparent 70%
    );
}

.wallet-label{

    font-size:13px;

    letter-spacing:2px;

    text-transform:uppercase;

    opacity:0.72;
}

.wallet-balance{

    font-size:58px;

    font-weight:800;

    margin-top:14px;

    letter-spacing:-2px;
}

.wallet-sub{

    margin-top:12px;

    color:rgba(255,255,255,0.72);
}

.recharge-btn{

    position:relative;

    z-index:2;

    height:58px;

    border:none;

    border-radius:18px;

    padding:0 28px;

    background:white;

    color:#2563eb;

    font-size:15px;

    font-weight:700;

    cursor:pointer;

    transition:0.22s;

    box-shadow:
    0 10px 28px rgba(0,0,0,0.18);
}

.recharge-btn:hover{

    transform:translateY(-3px);
}

/* =========================================
   STATS
========================================= */

.wallet-stats{

    display:grid;

    grid-template-columns:
    repeat(auto-fit,minmax(240px,1fr));

    gap:22px;

    margin-bottom:28px;
}

.wallet-stat-card{

    background:
    rgba(15,23,42,0.62);

    border:
    1px solid rgba(255,255,255,0.06);

    border-radius:28px;

    padding:28px;

    backdrop-filter:blur(18px);

    transition:0.22s;
}

.wallet-stat-card:hover{

    transform:translateY(-4px);

    border-color:
    rgba(59,130,246,0.25);
}

.wallet-stat-title{

    color:#94a3b8;

    font-size:14px;

    margin-bottom:16px;
}

.wallet-stat-value{

    font-size:40px;

    font-weight:800;

    letter-spacing:-1px;
}

.wallet-stat-value.red{

    color:#ef4444;
}

/* =========================================
   CARD
========================================= */

.card{

    background:
    rgba(15,23,42,0.6);

    border:
    1px solid rgba(255,255,255,0.06);

    border-radius:30px;

    overflow:hidden;

    backdrop-filter:blur(20px);
}

/* =========================================
   TABLE
========================================= */

.wallet-table-header{

    padding:26px 28px 0;
}

.api-table{

    width:100%;

    border-collapse:collapse;
}

.api-table th{

    text-align:left;

    padding:22px 24px;

    background:
    rgba(255,255,255,0.03);

    color:#94a3b8;

    font-size:14px;

    font-weight:600;
}

.api-table td{

    padding:22px 24px;

    border-top:
    1px solid rgba(255,255,255,0.05);

    font-size:15px;
}

.api-table tr{

    transition:0.2s;
}

.api-table tr:hover{

    background:
    rgba(255,255,255,0.03);
}

.green-text{

    color:#22c55e;

    font-weight:700;
}

.red-text{

    color:#ef4444;

    font-weight:700;
}

/* LIGHT MODE FIX */

body.light-mode td.green-text{

    color:#16a34a !important;

    font-weight:700 !important;
}

body.light-mode td.red-text{

    color:#dc2626 !important;

    font-weight:700 !important;
}

.status{

    display:inline-flex;

    align-items:center;

    justify-content:center;

    width:auto;
    min-width:92px;
    height:28px;

    padding:0 12px;

    border-radius:999px;

    background:
    rgba(34,197,94,0.14);

    color:#22c55e;

    font-size:12px;

    font-weight:800;
    line-height:1;
    text-transform:uppercase;
    letter-spacing:0;
    vertical-align:middle;
}

.status.success{
    background:rgba(34,197,94,0.14);
    color:#86efac;
}

.status.pending{
    background:rgba(245,158,11,0.14);
    color:#fcd34d;
}

.status.failed{
    background:rgba(239,68,68,0.14);
    color:#fca5a5;
}

/* =========================================
   MODAL
========================================= */

.modal-overlay{

    position:fixed;

    inset:0;

    background:
    rgba(0,0,0,0.65);

    backdrop-filter:blur(8px);

    display:none;

    justify-content:center;

    align-items:center;

    z-index:1000;
}

.modal{

    width:760px;

    max-width:92vw;
    max-height:92vh;

    background:
    linear-gradient(
        180deg,
        rgba(15,23,42,0.98),
        rgba(2,6,23,0.98)
    );

    border:
    1px solid rgba(255,255,255,0.08);

    border-radius:30px;

    overflow:hidden;
    display:flex;
    flex-direction:column;
}

.modal-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:22px 28px;

    border-bottom:
    1px solid rgba(255,255,255,0.05);
}

.modal-header h2{

    font-size:28px;
    line-height:1.1;
}

.close-btn{

    width:42px;

    height:42px;

    border:none;

    border-radius:14px;

    background:
    rgba(255,255,255,0.05);

    color:white;

    cursor:pointer;
}

.modal-body{

    padding:24px 28px;

    display:flex;

    flex-direction:column;

    gap:14px;
    overflow:auto;
    flex:1;
}

.recharge-modal .modal-body input{

    width:100%;

    height:64px;
    min-height:64px;

    border:1px solid rgba(148,163,184,0.08);

    outline:none;

    border-radius:22px;

    padding:0 22px;

    background:
    rgba(15,23,42,0.78);

    color:white;

    font-size:18px;
    font-weight:700;
    line-height:1.2;
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.03);
}

.recharge-modal .modal-body input::placeholder{
    color:rgba(203,213,225,0.58);
    font-weight:600;
}

.recharge-modal .modal-body input:focus{
    border-color:rgba(59,130,246,0.42);
    background:rgba(15,23,42,0.92);
    box-shadow:
        0 0 0 4px rgba(59,130,246,0.12),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.recharge-modal .modal-body input.quotation-locked-input{
    cursor:not-allowed;
    color:#bbf7d0;
    border-color:rgba(52,211,153,0.48);
    background:linear-gradient(135deg, rgba(6,95,70,0.34), rgba(15,23,42,0.92));
    box-shadow:inset 0 0 0 1px rgba(52,211,153,0.12);
}

.recharge-modal .modal-body input.quotation-locked-input:focus{
    border-color:rgba(52,211,153,0.72);
    background:linear-gradient(135deg, rgba(6,95,70,0.34), rgba(15,23,42,0.92));
    box-shadow:0 0 0 4px rgba(16,185,129,0.14);
}

.form-section-title{
    display:grid;
    gap:4px;
    color:#e2e8f0;
    font-size:14px;
    font-weight:800;
    margin-top:4px;
}

.form-section-title span{
    color:#94a3b8;
    font-size:12px;
    font-weight:600;
    line-height:1.5;
}

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

.billing-grid input{
    grid-column:span 6;
}

.billing-grid input.billing-wide{
      grid-column:1 / -1;
}

#minimumRechargeText{
    margin:0;
    line-height:1.45;
    color:#7f8da5 !important;
    font-size:15px !important;
    font-weight:600;
}

.recharge-modal .modal-body{
    max-height:none;
}

.recharge-summary{
    display:grid;
    gap:8px;
    padding:16px;
    border:1px solid rgba(255,255,255,0.08);
    border-radius:18px;
    background:rgba(255,255,255,0.04);
}

.recharge-summary div{
    display:flex;
    justify-content:space-between;
    gap:16px;
    color:#cbd5e1;
    font-size:14px;
}

.recharge-summary strong{
    color:white;
}

.recharge-summary .summary-total{
    margin-top:8px;
    padding-top:10px;
    border-top:1px solid rgba(255,255,255,0.08);
    font-size:16px;
}

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

.invoice-actions button{
    border:1px solid rgba(59,130,246,0.25);
    border-radius:999px;
    padding:8px 10px;
    background:rgba(59,130,246,0.12);
    color:#bfdbfe;
    cursor:pointer;
    font-size:12px;
    font-weight:700;
}

.api-table td strong{
    display:block;
}

.api-table td span:not(.status){
    display:block;
    margin-top:4px;
    color:#94a3b8;
    font-size:12px;
}

.save-btn{

    width:100%;
    height:54px;

    border:none;

    border-radius:18px;

    background:
    linear-gradient(
        135deg,
        #2563eb,
        #3b82f6
    );

    color:white;

    font-size:18px;

    font-weight:700;

    cursor:pointer;

    transition:0.22s;
}

.save-btn:hover{

    transform:translateY(-2px);
}

/* =========================================
   LIGHT MODE
========================================= */

body.light-mode{

    background:#f4f7fb;

    color:#0f172a;
}

body.light-mode .sidebar{

    background:
    rgba(255,255,255,0.92);

    border-right:
    1px solid #e2e8f0;
}

body.light-mode .menu button,
body.light-mode .logout-btn{

    background:white;

    border:
    1px solid #e2e8f0;

    color:#334155;
}

body.light-mode .topbar p{

    color:#64748b;
}

body.light-mode .theme-toggle{

    background:white;

    border:
    1px solid #e2e8f0;

    color:#0f172a;
}

body.light-mode .wallet-hero{

    background:
    linear-gradient(
        135deg,
        #ffffff,
        #f8fbff
    );

    border:
    1px solid #dbeafe;

    box-shadow:
    0 12px 35px rgba(15,23,42,0.06);

    color:#0f172a;
}

body.light-mode .wallet-hero::before{

    background:
    radial-gradient(
        circle,
        rgba(37,99,235,0.08),
        transparent 70%
    );
}

body.light-mode .wallet-label{

    color:#64748b;

    opacity:1;
}

body.light-mode .wallet-balance{

    color:#0f172a;
}

body.light-mode .wallet-sub{

    color:#64748b;
}

body.light-mode .recharge-btn{

    background:
    linear-gradient(
        135deg,
        #2563eb,
        #3b82f6
    );

    color:white;

    box-shadow:
    0 10px 24px rgba(37,99,235,0.18);
}

body.light-mode .recharge-btn:hover{

    box-shadow:
    0 16px 35px rgba(37,99,235,0.22);
}

body.light-mode .wallet-stat-card{

    background:white;

    border:
    1px solid #e2e8f0;
}

body.light-mode .wallet-stat-title{

    color:#64748b;
}

body.light-mode .wallet-stat-value{

    color:#0f172a;
}

body.light-mode .wallet-stat-value.red{

    color:#dc2626;
}

body.light-mode .wallet-stat-value.green{

    color:#16a34a;
}

body.light-mode .card{

    background:white;

    border:
    1px solid #e2e8f0;
}

body.light-mode .api-table th{

    background:#f8fafc;

    color:#64748b;
}

body.light-mode .api-table td{

    color:#0f172a;

    border-top:
    1px solid #eef2f7;
}

body.light-mode .api-table tr:hover{

    background:#f8fafc;
}

body.light-mode .modal{

    background:white;

    border:
    1px solid #e2e8f0;
}

body.light-mode .modal-header{

    border-bottom:
    1px solid #eef2f7;
}

body.light-mode .modal-header h2{

    color:#0f172a;
}

body.light-mode .close-btn{

    background:#f1f5f9;

    color:#0f172a;
}

body.light-mode .recharge-modal .modal-body input{

    background:#f8fafc;

    color:#0f172a;

    border:
    1px solid #e2e8f0;
}

body.light-mode .recharge-modal .modal-body input.quotation-locked-input{
    color:#065f46;
    border-color:rgba(5,150,105,0.42);
    background:#ecfdf5;
}

body.light-mode .recharge-modal .modal-body input::placeholder{
    color:#64748b;
}

.modal-footer{
    padding:18px 28px 24px;
    border-top:1px solid rgba(255,255,255,0.06);
    background:rgba(2,6,23,0.84);
}

body.light-mode .modal-footer{
    background:#ffffff;
    border-top:1px solid #eef2f7;
}

body.light-mode .form-section-title{
    color:#0f172a;
}

body.light-mode .form-section-title span{
    color:#64748b;
}

body.light-mode .recharge-summary{
    background:#f8fafc;
    border-color:#e2e8f0;
}

body.light-mode .recharge-summary div{
    color:#475569;
}

body.light-mode .recharge-summary strong{
    color:#0f172a;
}

body.light-mode .invoice-actions button{
    background:#eff6ff;
    color:#1d4ed8;
}



/* =========================================
   RESPONSIVE
========================================= */

@media(max-width:900px){

    body{

        display:block;

        overflow:auto;
    }

    .sidebar{

        width:100%;

        height:auto;

        flex-direction:row;

        overflow-x:auto;

        padding:12px;
    }

    .sidebar.expanded{

        width:100%;
    }

    .menu{

        flex-direction:row;

        margin-top:0;
    }

    .menu button,
    .logout-btn{

        flex:0 0 56px;
    }

    .text{

        display:none !important;
    }

    .main-content{

        padding:26px 18px;
    }

    .wallet-hero{

        flex-direction:column;

        align-items:flex-start;

        gap:24px;
    }

    .recharge-btn{

        width:100%;
    }

    .wallet-balance{

        font-size:42px;
    }

    .api-table{

        min-width:960px;
    }

    .card{

        overflow:auto;
    }
}

@media(max-width:560px){

    .topbar{

        flex-direction:column;

        align-items:flex-start;

        gap:16px;
    }

    .topbar h1{

        font-size:38px;
    }

    .wallet-hero{

        padding:28px;
    }

    .wallet-balance{

        font-size:36px;
    }

    .wallet-stat-card{

        padding:24px;
    }

    .wallet-stat-value{

        font-size:32px;
    }
}

@media(max-width:640px){

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

    .billing-grid input,
    .billing-grid input.billing-wide{
          grid-column:auto;
      }
}
