:root {
    /* --- CORE PALETTE: DARK GRAY & BLACK --- */
    --bg-dark: #121212;
    --bg-darker: #0a0a0a;
    --bg-card: #1e1e1e;
    --border-color: rgba(255, 255, 255, 0.12);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-light: #888888;
    --text-muted: #666666;
    
    --bg-elevated: #252525;
    --header-border: rgba(255, 255, 255, 0.12);
    --header-text: #e0e0e0;
    --header-link-color: #a0a0a0;

    --sidebar-bg: #1a1a1a;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-link-color: #b0b0b0;

    --accent-start: #00bcd4;
    --accent-end: #4dd0e1;
    --accent-gradient: linear-gradient(90deg, rgba(0, 188, 212, 0.15), rgba(77, 208, 225, 0.1));
    --accent: #00bcd4;
    --accent-light: #4dd0e1;

    --money-color: #4dd0e1;
    --money-shadow: rgba(0, 0, 0, 0.5);
    --success: #00c853;
    --danger: #ff5252;
    --warning: #ffab40;
    --info: #00b0ff;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
    --small-link-bg: rgba(255, 255, 255, 0.03);
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
} 

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

html {
    scroll-behavior: smooth;
}

body.vibrant, body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
    letter-spacing: 0.2px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

main.content {
    flex: 1 1 auto;
}

/* ===== Text helpers ===== */
.text-muted { color: var(--text-muted) !important; }
.text-accent { color: var(--accent) !important; }
.text-light { color: var(--text-light) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.accent-amount { color: var(--accent); font-size: 24px; font-weight: 700; transition: color 180ms ease; }

/* Reusable centered empty-state helper */
.empty-state { 
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 40px;
    min-height: 30vh;
    flex-direction: column;
    font-size: 1.05rem;
}
.empty-state.empty-state-lg { min-height: 40vh; font-size: 1.1rem; }

.accent-amount,
.topbar .top-right .balance {
    color: var(--accent-light);
}

.product-description { color: var(--text-muted); line-height: 1.6; }
.text-danger { color: var(--danger) !important; }

/* Small helper for margin if needed */
.mb-3 { margin-bottom: 15px; }

/* ===== Cards / inputs / gradient helpers ===== */
:root {
    --card-bg: #1e1e1e;
    --card-border: rgba(255, 255, 255, 0.12);
    --input-bg: #2d2d2d;
    --input-border: #404040;
    --btn-bg: var(--accent);
    --btn-text: #121212;
    --gradient-text-color: #e0e0e0;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 18px;
}

.card .monospace-input,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select, .form-group textarea,
.key-details-grid input[type="text"], .key-details-grid input[type="number"] {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
}

.gradient-card { color: var(--gradient-text-color); }

/* Revenue card tweaks */
.gradient-card h3 { color: var(--text-primary); margin: 0 0 6px 0; font-weight: 700; }
.gradient-card .revenue-amount { font-size: 28px; font-weight: 600; margin: 10px 0; color: var(--money-color); transition: color 180ms ease, font-weight 180ms ease; }
.gradient-card .revenue-desc { color: var(--text-secondary); opacity: 0.95; margin: 0; }

/* Generic money styling */
.money, .revenue-amount { color: var(--accent-light); font-weight: 600; text-shadow: 0 1px 0 var(--money-shadow); transition: color 180ms ease; }

/* Soften gradients */
.gradient-card.gradient-green { background: linear-gradient(135deg, rgba(0, 200, 83, 0.15) 0%, rgba(56, 233, 123, 0.1) 100%); }
.gradient-card.gradient-blue { background: linear-gradient(135deg, rgba(0, 176, 255, 0.12) 0%, rgba(102, 126, 234, 0.08) 100%); }

.topbar .top-right .balance,
.money { color: var(--accent-light); font-weight: 700; text-shadow: 0 1px 0 var(--money-shadow); }

/* Footer */
.site-footer {
    padding: 18px 0;
    background: var(--bg-darker);
    color: var(--text-primary);
    z-index: 1;
    border-top: 1px solid var(--border-color);
}
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

@media (min-width: 901px) {
    .sidebar ~ .site-footer {
        margin-left: 240px;
        padding-left: 18px;
    }
}
.site-footer .container { max-width: 1200px; margin: 0 auto; }

.gradient-card.gradient-blue { background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.08) 100%); }
.gradient-card.gradient-pink { background: linear-gradient(135deg, rgba(240, 147, 251, 0.12) 0%, rgba(245, 87, 108, 0.08) 100%); }
.gradient-card.gradient-cyan { background: linear-gradient(135deg, rgba(79, 172, 254, 0.12) 0%, rgba(0, 242, 254, 0.08) 100%); }
.gradient-card.gradient-green { background: linear-gradient(135deg, rgba(67, 233, 123, 0.12) 0%, rgba(56, 249, 215, 0.08) 100%); }

/* The info-card */
.info-card { background: var(--bg-card); padding: 20px; border-radius: 10px; margin: 20px 0; color: var(--text-primary); border: 1px solid var(--border-color); }
.info-card .alert { margin-bottom: 10px; }
.info-card .accent-amount { margin-top: 8px; }

/* Small helpers for buttons */
.btn { transition: transform 160ms ease; }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }

/* Utility helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.card-pad { padding: 20px; border-radius: 10px; }
.btn-fullwidth { width: 100%; padding: 12px; }
.info-box { background: rgba(0, 188, 212, 0.08); padding: 15px; border-radius: 6px; }
.warning-box { background: rgba(255, 171, 64, 0.08); padding: 15px; border-radius: 6px; }
.container-narrow { max-width: 500px; margin: 50px auto; }
.mt-20 { margin-top: 20px; }
.mt-15 { margin-top: 15px; }
.text-center { text-align: center; }
.max-w-300 { max-width: 300px; }

/* Small spacing helpers */
.mb-4 { margin-bottom: 14px; }
.mb-3 { margin-bottom: 12px; }

/* HUD / small badges */
.hwid-badge { font-family: monospace; font-size: 11px; background: var(--card-bg); padding: 2px 4px; border-radius: 2px; color: var(--text-primary); display: inline-block; }
.fw-600 { font-weight: 600; }

/* Button variants */
.btn-info { background: var(--info); color: #fff; border-radius: 8px; padding: 10px 12px; }
.btn-info:hover { opacity: 0.95; }

/* Status badge helper */
.status-badge { padding: 3px 8px; border-radius: 3px; font-size: 12px; display: inline-block; }

/* Spacing helpers */
.mb-30 { margin-bottom: 30px; }
.mt-30 { margin-top: 30px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-8 { margin-top: 8px; }

/* Image helpers */
.img-full { width: 100%; border-radius: 10px; }

/* Product display helpers */
.display-price { font-size: 36px; margin: 20px 0; }

/* Inline group for small flex rows */
.inline-group { display: flex; gap: 8px; }

/* Option label style */
.option-label { background: rgba(255, 255, 255, 0.03); padding: 10px 12px; border-radius: 8px; display: flex; gap: 8px; align-items: center; cursor: pointer; }

/* Additional utilities */
.btn-lg { padding: 15px; font-size: 16px; }

.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; gap: 8px; }
.hide { display: none; }
.mt-4 { margin-top: 4px; }
.mt-14 { margin-top: 14px; }
.mb-8 { margin-bottom: 8px; }
.mb-20 { margin-bottom: 20px; }
.w-100 { width: 100%; }
.container-sm { max-width: 500px; margin: 50px auto; }
.page-indicator { padding: 6px 12px; color: var(--text-light); }
.small { font-size: 0.9rem; color: var(--text-secondary); }

/* Modal size helper */
.modal-lg { max-width: 800px; }

/* Table helpers */
.full-table { width: 100%; border-collapse: collapse; }
.table-row { text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.table-row--thin { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }

/* Container helpers */
.container-md { max-width: 720px; margin-top: 16px; }

/* Small spacing helpers */
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mb-40 { margin-bottom: 40px; }
.gap-10 { gap: 10px; }
.mt-28 { margin-top: 28px; }

/* Promo preview helper */
.promo-popup.promo-preview { max-width: 640px; margin: 0 auto; text-align: center; }
.promo-msg { font-weight: 700; color: var(--text-primary); }

/* Preview banner helper */
.site-banner.preview-banner { position: relative; transform: none; opacity: 1; pointer-events: auto; display: block; max-width: 720px; }
.banner-content { color: var(--text-primary); font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-12 { margin-top: 12px; }

/* Rounded helper */
.rounded { border-radius: 10px; }

/* Small select padding */
.select-sm { padding: 5px; }

/* Alerts reuse */
.alert-info, .alert-warning { border-left-width: 4px; border-left-style: solid; padding-left: 14px; }

h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 28px;
    line-height: 1.05;
    color: var(--text-primary);
}

h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
}

.btn { transition: transform var(--transition-fast) cubic-bezier(0.2, 0, 0, 1), box-shadow var(--transition-fast) cubic-bezier(0.2, 0, 0, 1); will-change: transform, box-shadow; }

.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }

.fade-in { animation: fadeInUp 500ms var(--transition-smooth) both; }

@keyframes fadeInUp { 
    from { opacity: 0; transform: translateY(8px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
} 

/* ===== HOMEPAGE HERO ===== */
.hero {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 24px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-inner {
    max-width: 1100px;
    width: 100%;
}

.hero-content h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.lead {
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    flex-wrap: nowrap;
}

.hero-actions .btn {
    min-width: 140px;
}

@media (max-width: 420px) {
    .hero-actions { flex-wrap: wrap; gap: 10px; }
    .hero-actions .btn { flex: 1 1 auto; }
}

/* SEARCH */
.search-bar { margin-bottom: 20px; }

.search-input {
    width: 100%;
    max-width: 420px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
} 

/* PRODUCT GRID */
.product-listing {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-listing .empty-state {
    grid-column: 1 / -1;
    text-align: center;
}

/* Admin modal & forms tweaks */
.modal .modal-content { padding: 18px; border-radius: 12px; background: var(--bg-card); }
.form-group input[type="text"], .form-group input[type="number"], .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-primary); }
.btn-sm { padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--text-primary); }
#durationsList > div { background: rgba(255, 255, 255, 0.02); padding: 6px; border-radius: 8px; }
#durationsList input { background: transparent; border: none; color: var(--text-primary); }
@media (max-width: 700px) {
    .modal .modal-content { max-width: 100%; margin: 10px; }
    .modal .modal-content .form-group { width: 100%; }
    #durationsEditor { padding: 8px; }
}

.product-card { position: relative; overflow: hidden; border-radius: 12px; background: var(--bg-card); padding-bottom: 8px; transition: all var(--transition-base); will-change: transform, box-shadow; border: 1px solid var(--border-color); }
.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.3));
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
    will-change: opacity;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 188, 212, 0.3);
}
.product-card:hover::after { opacity: 1; }

.product-card .product-image { transition: transform var(--transition-smooth); will-change: transform; }
.product-card:hover .product-image { transform: scale(1.04); } 

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

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

/* ===== HEADER ===== */
header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--header-border);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--header-text);
}

/* Logged-in topbar */
.topbar {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--header-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    z-index: 60;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.logo::before {
    content: '';
}

nav {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background var(--transition-fast), color var(--transition-fast);
    will-change: background, color;
}

@media (max-width: 520px) {
    .logo { font-size: 16px; }
    nav a { font-size: 12px; padding: 6px 6px; }

    .topbar .top-right { gap: 8px; }
    .topbar .top-right .balance { display: none; }
    .topbar .top-right .username { font-size: 13px; }

    .header-user-info {
        gap: 8px;
        flex-wrap: wrap;
    }
    .user-name { font-size: 12px; }
    .user-balance { font-size: 11px; display: none; }
    .btn-logout { padding: 5px 10px; font-size: 11px; }
    .btn-topup { padding: 6px 12px; font-size: 11px; }

    .sidebar-toggle { display: none; }

    .product-card img { height: 140px; }

    .main-content { margin: 20px auto; padding: 0 12px; }
}

.topbar {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    z-index: 60;
}

.topbar-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* Header user info styling */
.header-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
}

.user-name {
    color: var(--header-text);
    font-weight: 600;
    font-size: 14px;
}

.user-balance {
    color: var(--header-link-color);
    font-size: 13px;
}

.user-balance strong {
    color: var(--accent-light);
    font-weight: 700;
}

.btn-logout {
    padding: 6px 14px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    will-change: background, transform;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-topup {
    padding: 7px 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #121212;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    will-change: transform, box-shadow;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-topup:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.35);
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
}

.btn-topup:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.2);
}

.btn-topup:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.topbar .logo { color: var(--header-text); font-weight: 700; }
.topbar .top-right .small-link { color: var(--header-link-color); }
.topbar .top-right .username { color: var(--header-link-color); }
.topbar .top-right .balance { color: var(--money-color); }
header .header-content nav a { color: var(--header-link-color); }

header .logo { color: var(--header-text); font-weight: 700; }

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--header-link-color);
    font-size: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.small-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

/* Sidebar */
aside.sidebar {
    width: 240px;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-link-color);
    padding: 18px 12px;
    overflow-y: auto;
    z-index: 105;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border-right: 1px solid var(--sidebar-border);
    will-change: transform;
}

aside.sidebar nav a:hover {
    background: var(--sidebar-hover-bg);
    transform: translateX(4px);
    transition: all var(--transition-fast);
    will-change: background, transform;
}

aside.sidebar .sidebar-logo {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--sidebar-link-color);
    text-align: left;
    padding-left: 4px;
    transition: color var(--transition-fast);
}

aside.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-link-color);
    text-decoration: none;
    padding: 10px 8px 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    min-height: 40px;
    transition: background var(--transition-fast), transform var(--transition-fast);
    will-change: background, transform;
}

aside.sidebar nav a.active,
aside.sidebar nav a:focus {
    background: rgba(0, 188, 212, 0.15);
    box-shadow: inset 4px 0 0 var(--accent);
    outline: none;
    color: var(--accent-light);
}

aside.sidebar nav a:focus {
    box-shadow: inset 4px 0 0 var(--accent), 0 0 0 3px rgba(0, 188, 212, 0.1);
}

aside.sidebar nav hr {
    border: none;
    border-top: 1px solid var(--sidebar-border);
    margin: 0;
    height: 1px;
}

@media (max-width: 900px) {
    aside.sidebar { transform: translateX(-100%); }
    aside.sidebar.open { transform: translateX(0); }
}

aside.sidebar .sidebar-inner {
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 6px 0 8px;
    width: 100%;
}

aside.sidebar .sidebar-logo {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--sidebar-link-color);
    text-align: left;
    padding-left: 4px;
}

aside.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

aside.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-link-color);
    text-decoration: none;
    padding: 10px 8px 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    min-height: 40px;
    transition: background 0.18s ease, transform 0.12s ease;
}

aside.sidebar nav a.nav-link {
    font-weight: 700;
    padding-left: 14px;
    color: var(--sidebar-link-color);
}

/* Header user area */
.topbar .top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar .top-right .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar .top-right .balance {
    color: var(--accent-light);
    font-weight: 700;
    font-size: 14px;
}
.small-link.logout-link {
    padding: 6px 10px;
    background: var(--small-link-bg);
    border-radius: 8px;
}

/* Demo preview gallery in admin */
.demo-preview { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.demo-preview img { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; display: block; }
.demo-preview button { box-shadow: none; }

/* Small status / badge */
.pill { padding: 6px 10px; border-radius: 8px; display: inline-block; font-weight: 700; font-size: 13px; }
.pill[data-status="pending"] { background: rgba(255, 171, 64, 0.15); color: #ffab40; }
.pill[data-status="approved"], .pill[data-status="completed"] { background: rgba(0, 200, 83, 0.15); color: #00c853; }
.pill[data-status="rejected"], .pill[data-status="cancelled"] { background: rgba(255, 82, 82, 0.15); color: #ff5252; }
.pill[data-status="default"] { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

@media (max-width: 520px) {
    .demo-preview img { width: 90px; height: 60px; }
    .pill { font-size: 12px; padding: 5px 8px; }
}

aside.sidebar nav a:hover {
    background: var(--sidebar-hover-bg);
    transform: translateX(6px);
}

aside.sidebar nav hr {
    border: none;
    border-top: 1px solid var(--sidebar-border);
    margin: 0;
    height: 1px;
}

/* Content shift when sidebar visible on desktop */
@media (min-width: 901px) {
    .content {
        margin-top: 60px;
        margin-left: 240px;
        padding: 32px;
    }

    .sidebar-toggle { display: none; }
}

/* Mobile: overlay when open */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99;
    opacity: 0;
    transition: opacity 200ms ease;
}

.sidebar-backdrop.visible {
    display: block;
    opacity: 1;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
}

nav a:hover {
    color: var(--accent-light);
    background: rgba(0, 188, 212, 0.1);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease, left 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 60%;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: calc(100vh - 160px);
}

h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 16px;
    letter-spacing: -0.5px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: var(--radius-sm);
}

h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #0097a7 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 188, 212, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.997);
}  

.btn-secondary {
    background: rgba(0, 188, 212, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-secondary:hover {
    background: rgba(0, 188, 212, 0.15);
    border-color: var(--accent-light);
}

.btn-danger {
    background: linear-gradient(135deg, #ff5252 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.45);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block { width: 100%; display: inline-block; }

.product-card img { width: 100%; height: 200px; object-fit: cover; border-top-left-radius: 12px; border-top-right-radius: 12px; }

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: #333;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

table thead {
    background: #2a2a2a;
    border-bottom: 2px solid var(--border-color);
}

table th {
    padding: 12px 14px;
    text-align: left;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 14px;
    vertical-align: middle;
}

table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.18s ease;
}

table tbody tr td:only-child {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px 14px;
} 

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

/* ===== ALERTS & TOASTS ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.alert-danger {
    background: rgba(255, 82, 82, 0.08);
    color: #ff8a80;
    border-left-color: var(--danger);
}

.alert-success {
    background: rgba(0, 200, 83, 0.08);
    color: #69f0ae;
    border-left-color: var(--success);
}

/* Toast container */
.toast-container {
    position: fixed;
    top: 72px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 4000;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 220px;
    max-width: 420px;
    background: #252525;
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transform-origin: top right;
    transition: transform 260ms cubic-bezier(0.22, 0.08, 0.2, 1), opacity 260ms ease;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
}

.toast .toast-body { flex: 1; font-size: 14px; color: var(--text-secondary); }
.toast .toast-close { background: transparent; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 6px; }

.toast.visible { opacity: 1; transform: translateY(0) scale(1); }
.toast.closing { opacity: 0; transform: translateY(-6px) scale(0.98); }

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }

@media (prefers-reduced-motion: reduce) {
    .toast, .fade-in { transition: none !important; animation: none !important; transform: none !important; }
}

@media (max-width: 520px) {
    .toast-container { right: 12px; left: auto; top: 72px; }
    .toast { width: auto; max-width: 320px; border-radius: 8px; padding: 14px; }

    .btn { padding: 12px 16px; font-size: 15px; }
    .hero-actions { gap: 8px; }

    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table th, table td { font-size: 13px; padding: 10px; }
}

@media (min-width: 1024px) {
    .content { padding: 36px; }
}

@media (max-width: 900px) {
    aside.sidebar {
        transform: translateX(-100%);
        transition: transform 300ms ease;
        position: fixed;
        z-index: 110;
        width: 80%;
        max-width: 320px;
        left: 0;
        top: 60px;
        bottom: 0;
    }

    aside.sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 20px;
    }

    .topbar {
        padding: 0 12px;
    }
}

.alert-info {
    background: rgba(0, 176, 255, 0.08);
    color: #80deea;
    border-left-color: var(--info);
}

.alert-warning {
    background: rgba(255, 171, 64, 0.08);
    color: #ffab40;
    border-left-color: var(--warning);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #252525;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 400px;
    max-width: 600px;
    padding: 0;
    animation: slideUpModal 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .modal-content {
        min-width: 90%;
    }
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.modal-close {
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: #2a2a2a;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: rgba(0, 188, 212, 0.3);
    box-shadow: 0 8px 32px rgba(0, 188, 212, 0.15);
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: rgba(0, 188, 212, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
} 

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-info, .product-card-body {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-card h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.product-price {
    font-size: 20px;
    color: var(--accent-light);
    font-weight: 700;
    margin: 12px 0;
}

.product-description {
    color: var(--text-secondary);
    font-size: 13px;
    flex-grow: 1;
    margin-bottom: 12px;
}

.product-info .btn {
    margin-top: auto;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 0;
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--text-secondary);
}

footer p {
    margin: 8px 0;
    font-size: 13px;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

footer a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* ===== GRID LAYOUT ===== */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-40 {
    margin-bottom: 40px;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

.opacity-50 {
    opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --container-padding: 16px;
    }

    .header-content {
        gap: 16px;
        flex-wrap: wrap;
    }

    nav {
        gap: 8px;
        font-size: 13px;
    }

    h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 20px;
    }

    .main-content {
        margin: 20px auto;
        padding: 0 16px;
    }

    table {
        font-size: 12px;
    }

    table th, table td {
        padding: 10px;
    }

    .product-card img {
        height: 150px;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .modal-content {
        min-width: 90%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 18px;
    }

    nav {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    nav a {
        font-size: 12px;
    }

    h1 {
        font-size: 20px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .modal-content {
        min-width: 95%;
    }
}