/**
 * ====================================================
 * DUY NAM LC - ULTRA MODERN SAAS DESIGN SYSTEM v4.0
 * 100% Complete UI Overhaul: Colors, Layouts, Buttons & Glassmorphism
 * ====================================================
 */

:root {
    --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    --sidebar-width: 280px;
    --header-height: 76px;
    --bottom-nav-height: 70px;
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Ultra Neon & Modern Accents */
    --primary: #06b6d4;
    --primary-hover: #0891b2;
    --primary-light: rgba(6, 182, 212, 0.14);
    --primary-glow: rgba(6, 182, 212, 0.38);

    --primary-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #06b6d4 100%);
    --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --amber-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    --rose-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);

    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.14);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.14);
    --danger: #f43f5e;
    --danger-light: rgba(244, 63, 94, 0.14);
    --info: #38bdf8;
    --info-light: rgba(56, 189, 248, 0.14);
}

[data-theme="dark"], :root {
    color-scheme: dark;
    --bg-body: #030712;
    --bg-mesh-1: rgba(6, 182, 212, 0.16);
    --bg-mesh-2: rgba(99, 102, 241, 0.15);
    --bg-mesh-3: rgba(16, 185, 129, 0.08);
    --bg-surface: #0b1120;
    --bg-card: rgba(13, 20, 36, 0.78);
    --bg-card-hover: rgba(19, 29, 51, 0.92);
    --bg-card-solid: #0f172a;
    --bg-sidebar: rgba(8, 13, 25, 0.88);
    --bg-header: rgba(8, 13, 25, 0.78);
    --bg-bottom-nav: rgba(8, 13, 25, 0.94);
    --bg-input: rgba(7, 11, 22, 0.85);
    --bg-modal: #0d1527;

    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(6, 182, 212, 0.35);
    --border-highlight: rgba(6, 182, 212, 0.55);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 32px -4px rgba(0, 0, 0, 0.55), 0 4px 12px -2px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 54px -6px rgba(0, 0, 0, 0.75), 0 0 35px rgba(6, 182, 212, 0.12);
}

[data-theme="light"] {
    color-scheme: light;
    --bg-body: #f1f5f9;
    --bg-mesh-1: rgba(6, 182, 212, 0.1);
    --bg-mesh-2: rgba(99, 102, 241, 0.08);
    --bg-mesh-3: rgba(16, 185, 129, 0.05);
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: #ffffff;
    --bg-card-solid: #ffffff;
    --bg-sidebar: rgba(255, 255, 255, 0.96);
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-bottom-nav: rgba(255, 255, 255, 0.96);
    --bg-input: #f8fafc;
    --bg-modal: #ffffff;

    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(6, 182, 212, 0.45);
    --border-highlight: rgba(6, 182, 212, 0.6);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-white: #0f172a;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 28px -4px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 44px -6px rgba(15, 23, 42, 0.14);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    background-image:
        radial-gradient(circle at 8% 12%, var(--bg-mesh-1) 0px, transparent 45%),
        radial-gradient(circle at 92% 88%, var(--bg-mesh-2) 0px, transparent 48%),
        radial-gradient(circle at 50% 45%, var(--bg-mesh-3) 0px, transparent 55%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.55;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ================= FLOATING MODERN SHELL LAYOUT ================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 8px 22px var(--primary-glow);
    transition: var(--transition-bounce);
    position: relative;
}

.brand-icon::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.brand-icon:hover {
    transform: rotate(-6deg) scale(1.08);
}

.brand-title {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #38bdf8 55%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-title {
    background: linear-gradient(135deg, #0f172a 0%, #0284c7 60%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-top: 1px;
}

.sidebar-close-btn {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.sidebar-close-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 16px 14px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-link i {
    font-size: 1.12rem;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.nav-link:hover i {
    color: var(--primary);
    transform: scale(1.12);
}

.nav-link.active {
    color: #ffffff;
    background: var(--primary-gradient);
    box-shadow: 0 10px 25px -4px var(--primary-glow);
    border-color: rgba(255, 255, 255, 0.22);
    font-weight: 700;
}

.nav-link.active i {
    color: #ffffff;
    transform: scale(1.08);
}

.sidebar-footer {
    margin: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ================= MAIN CONTENT & TOPBAR ================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

.topbar {
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle-btn {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: var(--transition);
}

.menu-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.page-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #34d399;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.65; }
}

.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition-bounce);
}

.theme-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-light);
    transform: rotate(18deg) scale(1.06);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 6px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.content-body {
    flex: 1;
    padding: 32px;
    max-width: 1540px;
    width: 100%;
    margin: 0 auto;
}

/* ================= HERO BENTO STAT CARDS ================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--primary-light);
    filter: blur(28px);
    pointer-events: none;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::after {
    transform: scale(1.35);
}

.stat-card.primary::before { background: var(--primary-gradient); }
.stat-card.success::before { background: var(--emerald-gradient); }
.stat-card.warning::before { background: var(--amber-gradient); }
.stat-card.danger::before { background: var(--rose-gradient); }
.stat-card.info::before { background: var(--accent-gradient); }

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--transition-bounce);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card:hover .stat-icon {
    transform: scale(1.12) rotate(6deg);
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.info { background: var(--info-light); color: var(--info); }

.stat-value {
    font-size: 2.35rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    line-height: 1.05;
    margin-bottom: 10px;
}

.stat-subtext {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* ================= MODERN GLASS CONTAINER CARDS ================= */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 28px;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
    padding: 20px 26px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.04) 0%, transparent 100%);
}

.card-title {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title i {
    color: var(--primary);
    background: var(--primary-light);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.card-body {
    padding: 26px;
}

.card-footer {
    padding: 18px 26px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
}

/* ================= ULTRA MODERN BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 8px 22px -4px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn-primary:hover {
    color: #ffffff;
    box-shadow: 0 12px 28px -2px rgba(6, 182, 212, 0.55);
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--emerald-gradient);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-success:hover {
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--rose-gradient);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-danger:hover {
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(244, 63, 94, 0.5);
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--amber-gradient);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-warning:hover {
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ================= FORM CONTROLS ================= */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background-color: var(--bg-surface);
}

.form-select {
    width: 100%;
    padding: 12px 42px 12px 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2306b6d4' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 10px;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-select option,
select option {
    background-color: #0b1120;
    color: #f8fafc;
    padding: 12px 14px;
    font-size: 0.92rem;
    font-weight: 600;
}

[data-theme="light"] .form-select option,
[data-theme="light"] select option {
    background-color: #ffffff;
    color: #0f172a;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ================= MODERN DATA TABLE ================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.88rem;
}

.custom-table th {
    padding: 16px 20px;
    font-size: 0.73rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background: rgba(6, 182, 212, 0.03);
    white-space: nowrap;
}

.custom-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
    transition: var(--transition);
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:hover td {
    background: rgba(6, 182, 212, 0.04);
}

/* Key Code Monospace Display with Cyber Glow */
.key-code-display {
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.28);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.04em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.key-code-display:hover {
    border-color: var(--primary);
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.25);
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* ================= STATUS BADGES ================= */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.status-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.badge-active {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-unused {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-expired {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-banned {
    background: rgba(244, 63, 94, 0.14);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-plan-pro {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    color: #38bdf8;
    border: 1px solid rgba(6, 182, 212, 0.45);
    font-weight: 800;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.18);
}

.badge-plan-admin {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25) 0%, rgba(245, 158, 11, 0.22) 100%);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.55);
    font-weight: 800;
    box-shadow: 0 0 14px rgba(244, 63, 94, 0.28);
}

.badge-plan-basic {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-weight: 800;
}

/* ================= MOBILE CARDS VIEW ================= */
.mobile-cards-view {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.mobile-data-card {
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.mobile-data-card:hover {
    border-color: var(--border-hover);
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.87rem;
    padding: 4px 0;
}

.mobile-card-label {
    color: var(--text-muted);
    font-weight: 600;
}

.mobile-card-value {
    color: var(--text-primary);
    font-weight: 700;
    text-align: right;
}

.mobile-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ================= TOOLBAR & SEARCH ================= */
.toolbar-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 260px;
    max-width: 440px;
}

.search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 0.95rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 11px 18px 11px 44px;
    border-radius: var(--radius-full);
    background-color: var(--bg-input);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background-color: var(--bg-surface);
}

/* ================= MODAL DIALOGS ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 7, 18, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease-out;
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 22px 26px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08) 0%, transparent 100%);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 26px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 18px 26px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.14);
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    pointer-events: auto;
    animation: slideLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ================= BOTTOM NAVIGATION (MOBILE) ================= */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-bottom-nav);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-color);
    z-index: 80;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 0 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    height: 100%;
    transition: var(--transition);
}

.bottom-nav-item i {
    font-size: 1.22rem;
    transition: var(--transition);
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active i {
    transform: translateY(-3px);
    filter: drop-shadow(0 4px 8px var(--primary-glow));
}

/* ================= SIDEBAR OVERLAY ================= */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(6px);
    z-index: 95;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

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

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

@keyframes slideLeft {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ================= RESPONSIVE MEDIA QUERIES ================= */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close-btn {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .menu-toggle-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .content-body {
        padding: 18px;
        padding-bottom: calc(var(--bottom-nav-height) + 26px);
    }

    .topbar {
        padding: 0 18px;
    }

    .user-name, .live-status-pill {
        display: none;
    }

    .bottom-nav {
        display: grid;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .table-responsive {
        display: none;
    }

    .mobile-cards-view {
        display: flex;
    }

    .toolbar-grid {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .search-input-wrapper {
        max-width: 100%;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
}

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