
/* ============================================================
   VEER SMM - USER PANEL STYLES
   Part 1: Base Theme + Layout
   ============================================================ */

:root {
    --saffron: #FF9933;
    --saffron-dark: #E88520;
    --green: #138808;
    --green-dark: #0F6B06;
    --navy: #000080;

    --bg: #0f172a;
    --bg-2: #1e293b;
    --bg-3: #334155;
    --bg-4: #273549;

    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --text-muted: #64748b;

    --accent: #38bdf8;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.2);

    --sidebar-w: 260px;
    --header-h: 64px;
}

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

html, body { overflow-x: hidden; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.panel-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.panel-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-2);
    border-right: 1px solid var(--bg-3);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--bg-3);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-brand img { height: 40px; width: auto; }

.sidebar-user {
    padding: 18px 20px;
    border-bottom: 1px solid var(--bg-3);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--saffron), var(--green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
    font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-balance {
    color: var(--success); font-size: 12px; font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 0;
    overflow-y: auto;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    position: relative;
}
.sidebar-nav a:hover { background: var(--bg-3); color: var(--text); }
.sidebar-nav a.active {
    background: rgba(56,189,248,0.1);
    color: var(--accent);
    border-left-color: var(--accent);
}
.sidebar-nav a .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-nav a .icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    opacity: 0.85;
    transition: all 0.15s;
}
.sidebar-nav a:hover .icon img {
    opacity: 1;
    transform: scale(1.08);
}
.sidebar-nav a.active .icon img {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(56,189,248,0.5));
}
.sidebar-nav .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}
.sidebar-divider {
    height: 1px;
    background: var(--bg-3);
    margin: 10px 20px;
}
.sidebar-logout {
    padding: 16px 20px;
    border-top: 1px solid var(--bg-3);
}
.sidebar-logout a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 0;
}
.sidebar-logout a:hover { color: #ef4444; }
.sidebar-logout a .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-logout a .icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    opacity: 0.85;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
    display: none;
}
.sidebar-backdrop.active { display: block; }

/* Main */
.panel-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    min-width: 0;
}

/* Header */
.panel-header {
    height: var(--header-h);
    background: var(--bg-2);
    border-bottom: 1px solid var(--bg-3);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-hamburger {
    background: none; border: none; color: var(--text);
    font-size: 22px; cursor: pointer; padding: 8px;
    display: none;
}
.header-title { font-size: 17px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 14px; }
.header-balance {
    background: rgba(34,197,94,0.15);
    color: #86efac;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}
.header-user {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-dim);
}
.header-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--saffron), var(--green));
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 13px; color: #fff;
    text-transform: uppercase;
}

/* Theme toggle button */
.header-theme-toggle {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(148,163,184,0.15);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}
.header-theme-toggle:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
    border-color: rgba(56,189,248,0.4);
    box-shadow: 0 0 20px rgba(56,189,248,0.2);
}
.header-theme-toggle.theme-btn-active {
    background: rgba(255,153,51,0.25);
    border-color: rgba(255,153,51,0.6);
    transform: scale(1.15) rotate(20deg);
    box-shadow: 0 0 20px rgba(255,153,51,0.5);
}

/* Content */
.panel-content {
    padding: 28px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
}
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.page-head p { color: var(--text-dim); font-size: 14px; }
/* ============================================================
   PART 2: COMPONENTS
   ============================================================ */

/* Cards */
.card {
    background: var(--bg-2);
    border: 1px solid var(--bg-3);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    overflow: hidden;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--bg-3);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.stat-card .icon { font-size: 26px; margin-bottom: 12px; }
.stat-card .label {
    color: var(--text-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    word-break: break-all;
}
.stat-card.green .value { color: var(--success); }
.stat-card.orange .value { color: var(--saffron); }
.stat-card.red .value { color: var(--danger); }

/* Stat icon (image version) */
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255,153,51,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 8px;
}
.stat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(255,153,51,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(255,153,51,0.45); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--bg); }
.btn-ghost { background: var(--bg-3); color: var(--text); }
.btn-ghost:hover { background: var(--bg-4); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 2px;
    filter: brightness(1.05);
}

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.2px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--bg-3);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 6px; }

/* Alerts */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-error { background: rgba(239,68,68,0.15); color: #fecaca; border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: rgba(34,197,94,0.15); color: #bbf7d0; border: 1px solid rgba(34,197,94,0.3); }
.alert-info { background: rgba(56,189,248,0.15); color: #bae6fd; border: 1px solid rgba(56,189,248,0.3); }
.alert-warning { background: rgba(245,158,11,0.15); color: #fed7aa; border: 1px solid rgba(245,158,11,0.3); }

/* Tables */
.table-wrap {
    background: var(--bg-2);
    border: 1px solid var(--bg-3);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.data-table th, table.data-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--bg-3);
    white-space: nowrap;
}
table.data-table th {
    background: var(--bg);
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--bg-4); }
table.data-table td.wrap-cell { white-space: normal; max-width: 240px; word-break: break-word; }

/* Status badges */
.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status.pending { background: #78350f; color: #fed7aa; }
.status.processing { background: #1e3a8a; color: #bfdbfe; }
.status.in_progress { background: #1e3a8a; color: #bfdbfe; }
.status.completed { background: #14532d; color: #bbf7d0; }
.status.partial { background: #78350f; color: #fed7aa; }
.status.canceled { background: #7f1d1d; color: #fecaca; }
.status.error { background: #7f1d1d; color: #fecaca; }
.status.active { background: #14532d; color: #bbf7d0; }
.status.banned { background: #7f1d1d; color: #fecaca; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state img { max-width: 180px; margin: 0 auto 20px; opacity: 0.85; }
.empty-state h3 { font-size: 17px; margin-bottom: 8px; }
.empty-state p { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; }

/* Pager */
.pager {
    margin-top: 20px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.pager a, .pager span {
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--bg-2);
    color: var(--text-dim);
    font-size: 12px;
    border: 1px solid var(--bg-3);
}
.pager a:hover { background: var(--bg-3); color: var(--accent); }
.pager .current {
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    border-color: var(--accent);
}

/* Filter chips */
.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.filter-chips a {
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-2);
    border: 1px solid var(--bg-3);
    transition: all 0.15s;
}
.filter-chips a:hover { color: var(--accent); border-color: var(--accent); }
.filter-chips a.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* Search row */
.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.search-row input {
    flex: 1;
    padding: 11px 14px;
    background: var(--bg-2);
    border: 1px solid var(--bg-3);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}
.search-row input:focus { outline: none; border-color: var(--accent); }
.search-row button {
    padding: 11px 22px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

/* Cancel link (used in orders) */
.cancel-link {
    display: inline-block;
    margin-top: 4px;
    color: #ef4444;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 4px;
    transition: all 0.15s;
}
.cancel-link:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* ============================================================
   RESPONSIVE - TABLET
   ============================================================ */
@media (max-width: 900px) {
    .panel-sidebar { transform: translateX(-100%); }
    .panel-sidebar.open { transform: translateX(0); }
    .panel-main { margin-left: 0; }
    .header-hamburger { display: block; }
    .header-user-name { display: none; }
    .panel-content { padding: 18px; }
    .page-head h1 { font-size: 20px; }
}

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
@media (max-width: 640px) {
    .panel-header {
        padding: 0 14px;
        height: 56px;
    }
    .header-title { font-size: 15px; }
    .header-balance { padding: 6px 10px; font-size: 12px; }
    .header-user-avatar { width: 28px; height: 28px; font-size: 11px; }
    .header-theme-toggle { width: 34px; height: 34px; font-size: 16px; }

    .panel-content { padding: 14px; }

    .page-head { margin-bottom: 16px; }
    .page-head h1 { font-size: 18px; line-height: 1.3; }
    .page-head p { font-size: 13px; }

    .stat-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat-card {
        padding: 16px;
        display: flex;
        align-items: center;
        gap: 14px;
        border-radius: 12px;
    }
    .stat-icon {
        width: 46px;
        height: 46px;
    }
    .stat-card > div:not(.stat-icon) { flex: 1; }
    .stat-card .label { margin-bottom: 2px; font-size: 11px; }
    .stat-card .value { font-size: 19px; }

    .card {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 14px;
    }
    .card-title { font-size: 15px; margin-bottom: 14px; }

    .card > div[style*="display:flex"] {
        flex-direction: column;
    }
    .card .btn {
        width: 100%;
        justify-content: center;
        padding: 13px;
    }

    .form-input, .form-select, .form-textarea {
        padding: 15px 14px;
        font-size: 16px;
    }
    .form-group { margin-bottom: 16px; }

    table.data-table th, table.data-table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .btn { padding: 11px 16px; font-size: 14px; }
    .btn-lg { padding: 14px 20px; font-size: 15px; }

    .empty-state { padding: 40px 16px; }
    .empty-state img { max-width: 140px; }
    .empty-state h3 { font-size: 16px; }

    .search-row { flex-direction: column; }
    .search-row button { width: 100%; }
}

@media (max-width: 380px) {
    .header-balance { display: none; }
    .stat-card .value { font-size: 17px; }
    .page-head h1 { font-size: 16px; }
}
/* ============================================================
   PART 3: LIGHT THEME
   ============================================================ */

html[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-2: #ffffff;
    --bg-3: #e2e8f0;
    --bg-4: #f8fafc;

    --text: #0f172a;
    --text-dim: #475569;
    --text-muted: #94a3b8;

    --accent: #0284c7;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #ea580c;
}

/* Body */
html[data-theme="light"] body {
    background: var(--bg);
    color: var(--text);
}

/* Sidebar */
html[data-theme="light"] .panel-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--bg-3);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .sidebar-user {
    background: #f8fafc;
}
html[data-theme="light"] .sidebar-user-name { color: var(--text); }
html[data-theme="light"] .sidebar-user-balance { color: var(--success); }
html[data-theme="light"] .sidebar-nav a { color: #475569; }
html[data-theme="light"] .sidebar-nav a:hover {
    background: #f1f5f9;
    color: var(--text);
}
html[data-theme="light"] .sidebar-nav a.active {
    background: rgba(2, 132, 199, 0.08);
    color: var(--accent);
    border-left-color: var(--accent);
}
html[data-theme="light"] .sidebar-nav a .icon img { opacity: 0.75; }
html[data-theme="light"] .sidebar-nav a.active .icon img {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(2, 132, 199, 0.4));
}
html[data-theme="light"] .sidebar-logout a { color: #dc2626; }
html[data-theme="light"] .badge-count { background: #dc2626; color: #fff; }

/* Header */
html[data-theme="light"] .panel-header {
    background: #ffffff;
    border-bottom: 1px solid var(--bg-3);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .header-title,
html[data-theme="light"] .header-hamburger { color: var(--text); }
html[data-theme="light"] .header-balance {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.2);
}
html[data-theme="light"] .header-user { color: var(--text-dim); }
html[data-theme="light"] .header-theme-toggle {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text);
}
html[data-theme="light"] .header-theme-toggle:hover {
    background: #e2e8f0;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(2, 132, 199, 0.2);
}

/* Cards */
html[data-theme="light"] .card {
    background: #ffffff;
    border: 1px solid var(--bg-3);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}
html[data-theme="light"] .card-title { color: var(--text); }

/* Stat cards */
html[data-theme="light"] .stat-card {
    background: #ffffff;
    border: 1px solid var(--bg-3);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .stat-card:hover {
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.12);
    border-color: rgba(2, 132, 199, 0.3);
}
html[data-theme="light"] .stat-card .label { color: #64748b; }
html[data-theme="light"] .stat-icon {
    background: #f1f5f9;
    border: 1px solid var(--bg-3);
}

/* Buttons */
html[data-theme="light"] .btn-outline {
    color: var(--accent);
    border-color: var(--accent);
}
html[data-theme="light"] .btn-outline:hover {
    background: var(--accent);
    color: #fff;
}
html[data-theme="light"] .btn-ghost {
    background: #e2e8f0;
    color: var(--text);
}
html[data-theme="light"] .btn-ghost:hover { background: #cbd5e1; }

/* Forms */
html[data-theme="light"] .form-input,
html[data-theme="light"] .form-select,
html[data-theme="light"] .form-textarea {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text);
}
html[data-theme="light"] .form-input::placeholder { color: #94a3b8; }
html[data-theme="light"] .form-input:focus,
html[data-theme="light"] .form-select:focus,
html[data-theme="light"] .form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}
html[data-theme="light"] .form-group label { color: #334155; }
html[data-theme="light"] .form-hint { color: #64748b; }

/* Alerts */
html[data-theme="light"] .alert-error {
    background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5;
}
html[data-theme="light"] .alert-success {
    background: #dcfce7; color: #166534; border: 1px solid #86efac;
}
html[data-theme="light"] .alert-info {
    background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd;
}
html[data-theme="light"] .alert-warning {
    background: #fed7aa; color: #92400e; border: 1px solid #fdba74;
}

/* Tables */
html[data-theme="light"] .table-wrap {
    background: #ffffff;
    border: 1px solid var(--bg-3);
}
html[data-theme="light"] table.data-table { background: #ffffff; }
html[data-theme="light"] table.data-table th {
    background: #f8fafc;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}
html[data-theme="light"] table.data-table td {
    color: var(--text);
    border-bottom: 1px solid #f1f5f9;
}
html[data-theme="light"] table.data-table tr:hover td { background: #f8fafc; }
html[data-theme="light"] table.data-table td a { color: var(--accent); }

/* Status badges */
html[data-theme="light"] .status.pending { background: #fef3c7; color: #92400e; }
html[data-theme="light"] .status.processing,
html[data-theme="light"] .status.in_progress { background: #dbeafe; color: #1e40af; }
html[data-theme="light"] .status.completed { background: #dcfce7; color: #166534; }
html[data-theme="light"] .status.partial { background: #fef3c7; color: #92400e; }
html[data-theme="light"] .status.canceled,
html[data-theme="light"] .status.error { background: #fee2e2; color: #991b1b; }
html[data-theme="light"] .status.active { background: #dcfce7; color: #166534; }

/* Page head */
html[data-theme="light"] .page-head h1 { color: var(--text); }
html[data-theme="light"] .page-head p { color: #64748b; }

/* Filter chips */
html[data-theme="light"] .filter-chips a,
html[data-theme="light"] .update-filters a {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
}
html[data-theme="light"] .filter-chips a:hover,
html[data-theme="light"] .update-filters a:hover {
    color: var(--accent);
    border-color: var(--accent);
}
html[data-theme="light"] .filter-chips a.active,
html[data-theme="light"] .update-filters a.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Empty states */
html[data-theme="light"] .empty-state h3 { color: var(--text); }
html[data-theme="light"] .empty-state p { color: #64748b; }

/* Pager */
html[data-theme="light"] .pager a,
html[data-theme="light"] .pager span {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
}
html[data-theme="light"] .pager a:hover { background: #f1f5f9; }
html[data-theme="light"] .pager .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Search row */
html[data-theme="light"] .search-row input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text);
}

/* Backdrop */
html[data-theme="light"] .sidebar-backdrop {
    background: rgba(15, 23, 42, 0.4);
}

/* Scrollbar */
html[data-theme="light"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="light"] ::-webkit-scrollbar-track { background: #f1f5f9; }
html[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Smooth transitions on theme switch */
html { transition: background-color 0.25s ease; }
body,
.panel-sidebar,
.panel-header,
.card,
.stat-card,
.sidebar-nav a,
table.data-table,
table.data-table th,
table.data-table td,
.form-input,
.form-select,
.form-textarea,
.btn {
    transition: background-color 0.25s ease,
                color 0.25s ease,
                border-color 0.25s ease;
}
/* ============================================================
   AVATAR SYSTEM
   ============================================================ */

/* Sidebar avatar (image) */
.sidebar-avatar-img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 153, 51, 0.4);
    background: #0f172a;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 153, 51, 0.2);
}

/* Sidebar user ID (badge below username) */
.sidebar-user-id {
    font-size: 10px;
    color: #64748b;
    font-family: monospace;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 2px 0;
}

/* Header avatar (image) */
.header-user-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 153, 51, 0.4);
    background: #0f172a;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 153, 51, 0.25);
    transition: transform 0.2s ease;
}
.header-user-avatar-img:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(255, 153, 51, 0.4);
}

/* Light theme adjustments */
html[data-theme="light"] .sidebar-avatar-img,
html[data-theme="light"] .header-user-avatar-img {
    border-color: rgba(255, 153, 51, 0.6);
    box-shadow: 0 2px 8px rgba(255, 153, 51, 0.15);
}

/* Mobile */
@media (max-width: 640px) {
    .sidebar-avatar-img {
        width: 40px;
        height: 40px;
    }
    .header-user-avatar-img {
        width: 30px;
        height: 30px;
    }
    .sidebar-user-id {
        font-size: 9px;
    }
}
/* ============================================================
   UNIVERSAL LOADING OVERLAY
   ============================================================ */

#globalLoader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
#globalLoader.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

.loader-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.25s ease;
}

html[data-theme="light"] .loader-backdrop {
    background: rgba(241, 245, 249, 0.9);
}

.loader-box {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 50px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(255, 153, 51, 0.15);
    animation: loaderPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] .loader-box {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(2, 132, 199, 0.2);
    box-shadow: 
        0 20px 60px rgba(15, 23, 42, 0.15),
        0 0 60px rgba(255, 153, 51, 0.1);
}

.loader-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    animation: loaderSpin 1.4s ease-in-out infinite;
    filter: drop-shadow(0 4px 20px rgba(255, 153, 51, 0.5));
}

.loader-text {
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    text-align: center;
    max-width: 280px;
}

html[data-theme="light"] .loader-text {
    color: #0f172a;
}

.loader-text::after {
    content: '';
    display: inline-block;
    animation: dots 1.4s infinite;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes loaderPop {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes loaderSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50%      { transform: rotate(180deg) scale(1.08); }
}

@keyframes dots {
    0%, 20%   { content: ''; }
    40%       { content: '.'; }
    60%       { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Loading state on the loader itself (safe fallback) */
.loader-icon {
    background: transparent;
    border-radius: 12px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .loader-box {
        padding: 32px 40px;
        border-radius: 16px;
    }
    .loader-icon {
        width: 64px;
        height: 64px;
    }
    .loader-text {
        font-size: 12px;
    }
}
/* ============================================================
   SVG ICON SYSTEM
   ============================================================ */

.svg-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    object-fit: contain;
    transition: all 0.15s ease;
}

/* Default SVG color for dark theme (SVGs with currentColor won't need this) */
html[data-theme="dark"] .svg-icon {
    filter: brightness(0) saturate(100%) invert(88%) sepia(8%) saturate(657%) hue-rotate(180deg) brightness(93%) contrast(92%);
}

/* Hover states inside buttons/links */
.btn:hover .svg-icon,
a:hover .svg-icon {
    transform: scale(1.05);
}

/* Sidebar SVG icons */
.sidebar-nav a .icon .svg-icon {
    width: 22px;
    height: 22px;
    opacity: 0.8;
}
.sidebar-nav a:hover .icon .svg-icon,
.sidebar-nav a.active .icon .svg-icon {
    opacity: 1;
}

/* Light theme icon color */
html[data-theme="light"] .svg-icon {
    filter: brightness(0) saturate(100%) invert(30%) sepia(10%) saturate(800%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Colored icons (keep original colors) */
.svg-icon.no-filter {
    filter: none !important;
}

/* Header icon sizing */
.header-theme-toggle .svg-icon {
    width: 20px;
    height: 20px;
}

/* Dashboard stat card icons */
.stat-icon .svg-icon {
    width: 32px;
    height: 32px;
}

/* Inline action icons in buttons */
.btn .svg-icon {
    width: 18px;
    height: 18px;
    margin-right: 4px;
}

/* Small icons (in tables, badges) */
.svg-icon-sm {
    width: 14px !important;
    height: 14px !important;
}

/* Search icon in input fields */
.search-row .svg-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.5;
}

/* === VEER SMM THEME START === */
/* Auto-generated: 2026-10-07 04:26:21 | Preset: teal-modern */

:root {
    --saffron: #14b8a6;
    --saffron-dark: #14b8a6;
    --green: #0d9488;
    --green-dark: #0d9488;
    --accent: #2dd4bf;
    --bg: #041a18;
    --bg-2: #0a2a28;
    --text: #ccfbf1;
    --text-dim: #5eead4;
    --text-muted: #5eead4;
}

body {
    background-color: #041a18;
}

/* === VEER SMM THEME END === */
