:root{
    --bg:#050507;
    --card:rgba(255,255,255,.06);
    --card2:rgba(255,255,255,.03);
    --text:#ffffff;
    --muted:#9ca3af;
    --border:rgba(255,255,255,.12);
    --input:rgba(255,255,255,.07);

    --primary:#ef233c;
    --primary-glow:#ff003c;
    --primary-dark:#991b1b;

    --green:#16c784;
    --blue:#3694ff;
    --warning:#ffb020;
    --danger:#ff5b7f;

    --shadow:0 20px 60px rgba(0,0,0,.45);
}

/* LIGHT MODE */
html[data-theme="light"]{
    --bg:#f5f7fb;
    --card:#ffffff;
    --card2:#f8fafc;
    --text:#111827;
    --muted:#64748b;
    --border:#e2e8f0;
    --input:#ffffff;

    --primary:#ef233c;
    --primary-glow:#ff003c;
    --primary-dark:#991b1b;

    --shadow:0 20px 60px rgba(15,23,42,.12);
}

/* RESET */
*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    min-height:100%;
}

body{
    min-height:100vh;
    background:
        radial-gradient(circle at top left, rgba(239,35,60,.22), transparent 32%),
        radial-gradient(circle at bottom right, rgba(255,0,60,.18), transparent 34%),
        var(--bg);
    color:var(--text);
    font-family:Inter,Segoe UI,Arial,sans-serif;
}

html[data-theme="light"] body{
    background:
        radial-gradient(circle at top left, rgba(239,35,60,.10), transparent 32%),
        radial-gradient(circle at bottom right, rgba(239,35,60,.08), transparent 34%),
        var(--bg);
}

a{
    color:#f87171;
    text-decoration:none;
}

/* ORBS */
.bg-orb{
    position:fixed;
    border-radius:50%;
    filter:blur(90px);
    opacity:.25;
    z-index:-1;
}

.orb-a{
    width:300px;
    height:300px;
    background:var(--primary);
    top:-100px;
    left:-80px;
}

.orb-b{
    width:360px;
    height:360px;
    background:var(--primary-glow);
    right:-120px;
    bottom:-120px;
}

/* AUTH */
.auth-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:26px;
}

.auth-card{
    width:100%;
    max-width:470px;
    background:linear-gradient(180deg,var(--card),var(--card2));
    border:1px solid var(--border);
    border-radius:30px;
    padding:34px;
    box-shadow:var(--shadow),0 0 35px rgba(239,35,60,.18);
    backdrop-filter:blur(18px);
}

html[data-theme="light"] .auth-card{
    backdrop-filter:none;
}

/* LOGO */
.logo-img{
    width:40px;
    height:40px;
    object-fit:contain;
}

.logo-row{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:20px;
}

.logo-row h1,
.logo-row h2{
    margin:0;
    font-size:28px;
}

.logo-row p{
    margin:4px 0 0;
    color:var(--muted);
}

.logo-row.mini h2{
    font-size:20px;
}

.logo-badge{
    width:50px;
    height:50px;
    border-radius:17px;
    display:grid;
    place-items:center;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    color:#fff;
    overflow:hidden;
    box-shadow:0 0 35px rgba(239,35,60,.45);
}

/* FORM */
.form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}

.field{
    margin-top:14px;
}

label{
    display:block;
    font-size:13px;
    color:var(--primary);
    font-weight:800;
    margin-bottom:7px;
}

.input{
    width:100%;
    height:46px;
    border-radius:15px;
    border:1px solid var(--border);
    background:var(--input);
    color:var(--text);
    padding:0 14px;
    outline:none;
}

.input:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(239,35,60,.18);
}

.textarea{
    height:120px;
    padding:14px;
    resize:vertical;
}

/* BUTTONS */
.theme-btn{
    border:1px solid var(--border);
    background:var(--input);
    color:var(--text);
    padding:10px 14px;
    border-radius:14px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    cursor:pointer;
    font-weight:800;
}

.theme-btn:hover{
    border-color:var(--primary);
    color:#f87171;
}

.btn{
    border:0;
    border-radius:15px;
    padding:12px 18px;
    background:linear-gradient(135deg,#ef233c,#991b1b);
    color:#fff;
    font-weight:900;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    cursor:pointer;
    box-shadow:0 0 35px rgba(239,35,60,.45);
}

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

.btn.small{
    padding:9px 12px;
    font-size:12px;
    border-radius:12px;
}

.btn.green{
    background:linear-gradient(135deg,var(--green),#31df9b);
    box-shadow:none;
}

.btn.blue{
    background:linear-gradient(135deg,var(--blue),#58b8ff);
    box-shadow:none;
}

.danger-btn,
.side-link.danger{
    background:#2a1118!important;
    color:#ff7a9d!important;
    box-shadow:none;
}

html[data-theme="light"] .danger-btn,
html[data-theme="light"] .side-link.danger{
    background:#fee2e2!important;
    color:#b91c1c!important;
}

/* TEXT */
.muted{
    color:var(--muted);
}

.center{
    text-align:center;
}

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

/* LAYOUT */
.layout{
    display:flex;
    min-height:100vh;
    background:transparent;
}

.sidebar{
    width:280px;
    padding:22px;
    background:rgba(0,0,0,.55);
    border-right:1px solid var(--border);
    backdrop-filter:blur(18px);
    position:sticky;
    top:0;
    height:100vh;
    flex-shrink:0;
}

html[data-theme="light"] .sidebar{
    background:rgba(255,255,255,.92);
    backdrop-filter:none;
}

.side-link{
    width:100%;
    display:flex;
    align-items:center;
    gap:10px;
    margin:8px 0;
    padding:13px 14px;
    border-radius:15px;
    border:1px solid transparent;
    background:transparent;
    color:var(--muted);
    font-weight:800;
    cursor:pointer;
}

.side-link.active,
.side-link:hover{
    background:var(--card);
    color:var(--text);
    border-color:var(--border);
}

.content{
    flex:1;
    padding:26px;
    overflow:auto;
    min-width:0;
}

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:20px;
}

.topbar h1{
    margin:0;
    font-size:32px;
}

/* STATS */
.stats{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
    margin-bottom:20px;
}

.stat{
    padding:20px;
}

.stat h3{
    font-size:28px;
    margin:10px 0 4px;
}

.stat p{
    margin:0;
    color:var(--muted);
}

/* PANELS / CARDS */
.stat,
.panel,
.item-card,
.message{
    background:linear-gradient(180deg,var(--card),var(--card2));
    border:1px solid var(--border);
    border-radius:24px;
    box-shadow:var(--shadow);
    backdrop-filter:blur(18px);
}

html[data-theme="light"] .stat,
html[data-theme="light"] .panel,
html[data-theme="light"] .item-card,
html[data-theme="light"] .message{
    background:linear-gradient(180deg,#ffffff,#f8fafc);
    backdrop-filter:none;
}

.panel{
    padding:22px;
}

.tab{
    display:none;
}

.tab.active{
    display:block;
}

.section-title{
    display:flex;
    align-items:center;
    gap:10px;
    margin:0 0 18px;
}

/* ITEMS */
.item-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:16px;
    margin-bottom:22px;
}

.item-card{
    padding:16px;
}

.item-img{
    width:100%;
    height:150px;
    border-radius:18px;
    object-fit:cover;
    background:linear-gradient(135deg,rgba(239,35,60,.22),rgba(255,0,60,.18));
    display:grid;
    place-items:center;
    color:var(--muted);
}

.item-card h3{
    margin:14px 0 4px;
}

.price{
    color:var(--primary);
    font-weight:900;
}

/* QTY */
.qty{
    display:flex;
    gap:8px;
    margin-top:10px;
}

.qty button{
    width:38px;
    border:0;
    border-radius:12px;
    background:var(--card2);
    color:var(--text);
    font-size:20px;
    cursor:pointer;
}

.qty input{
    width:70px;
    text-align:center;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--input);
    color:var(--text);
}

html[data-theme="light"] .qty button{
    background:#f1f5f9;
    color:#111827;
}

.item-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
    gap:12px;
    margin-bottom:18px;
}

.item-card{
    padding:12px;
    border-radius:18px;
}

/* smaller item image */
.item-img{
    width:100%;
    height:110px;
    border-radius:14px;
    object-fit:cover;
}

/* smaller title */
.item-card h3{
    margin:10px 0 3px;
    font-size:15px;
}

/* smaller price */
.price{
    font-size:14px;
}

/* smaller qty controls */
.qty{
    display:flex;
    gap:6px;
    margin-top:6px;
}

.qty button{
    width:30px;
    height:30px;
    font-size:16px;
}

.qty input{
    width:50px;
    height:30px;
    font-size:13px;
}

/* IMAGES */
.preview,
.thumb{
    width:90px;
    height:90px;
    border-radius:14px;
    object-fit:cover;
    border:1px solid var(--border);
    margin-top:10px;
}

/* TABLE FIX */
.table-wrap{
    width:100%;
    overflow:auto;
    background:var(--card);
    border:1px solid var(--border);
    border-radius:20px;
}

.table{
    width:100%;
    border-collapse:collapse;
    min-width:850px;
    background:transparent;
    color:var(--text);
}

.table th,
.table td{
    padding:13px;
    border-bottom:1px solid var(--border);
    text-align:left;
    vertical-align:top;
    background:transparent;
    color:var(--text);
}

.table th{
    font-weight:900;
}

html[data-theme="light"] .table-wrap{
    background:#ffffff;
}

html[data-theme="light"] .table,
html[data-theme="light"] .table th,
html[data-theme="light"] .table td{
    color:#111827;
    background:transparent;
}

/* BADGES */
.badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    background:var(--card2);
    border:1px solid var(--border);
    font-size:12px;
    font-weight:900;
}

html[data-theme="light"] .badge{
    background:#f1f5f9;
    color:#111827;
}

.badge.pending{
    color:var(--warning);
}

.badge.processing{
    color:var(--primary);
}

.badge.completed{
    color:var(--green);
}

.badge.rejected{
    color:var(--danger);
}

/* STACKS */
.stack{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.row{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:10px;
}

.message{
    padding:16px;
    margin-bottom:12px;
}

.message p{
    margin:0 0 8px;
}

.message span{
    font-size:12px;
    color:var(--muted);
}
.payment-box{
    margin:14px 0 18px;
    padding:18px;
    border-radius:20px;
    background:linear-gradient(180deg,var(--card),var(--card2));
    border:1px solid var(--border);
    box-shadow:var(--shadow);
}

.payment-box h3{
    margin:0 0 10px;
    color:var(--primary);
}

.payment-box p{
    margin:6px 0;
    color:var(--text);
}

.payment-box hr{
    border:0;
    border-top:1px solid var(--border);
    margin:16px 0;
}

.payment-box{
    margin:14px 0 18px;
    padding:18px;
    border-radius:20px;
    background:linear-gradient(180deg,var(--card),var(--card2));
    border:1px solid var(--border);
    box-shadow:var(--shadow);
}

.payment-box h3{
    margin:0 0 10px;
    color:var(--primary);
}

.payment-box p{
    margin:6px 0;
    color:var(--text);
}

.payment-box hr{
    border:0;
    border-top:1px solid var(--border);
    margin:16px 0;
}
/* ADMIN / DASHBOARD BACKGROUND FIX */
.admin-header,
.admin-hero,
.dashboard-header,
.main-area,
.admin-page{
    background:transparent!important;
}

html[data-theme="light"] .admin-header,
html[data-theme="light"] .admin-hero,
html[data-theme="light"] .dashboard-header,
html[data-theme="light"] .main-area,
html[data-theme="light"] .admin-page{
    background:transparent!important;
}

/* LIGHT TEXT FIX */
html[data-theme="light"] .muted,
html[data-theme="light"] .hint,
html[data-theme="light"] .logo-row p,
html[data-theme="light"] .stat p,
html[data-theme="light"] .message span{
    color:#64748b;
}

/* RESPONSIVE */
@media(max-width:900px){
    .layout{
        display:block;
    }

    .sidebar{
        width:auto;
        height:auto;
        position:relative;
    }

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

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

@media(max-width:600px){
    .form-grid,
    .stats{
        grid-template-columns:1fr;
    }

    .auth-card{
        padding:24px;
    }

    .content{
        padding:16px;
    }
}