﻿/* ============================================
   ByteBunny Admin Panel v6 — Styles
   Professional Cosmic Purple/Pink/Cyan Palette
   ============================================ */
:root {
    --ap-bg: #0a0005;
    --ap-surface: #0f0409;
    --ap-surface2: #180a10;
    --ap-surface3: #221218;
    --ap-border: rgba(220, 38, 38, 0.12);
    --ap-glass: rgba(255, 255, 255, 0.04);
    --ap-glass-border: rgba(255, 255, 255, 0.08);
    --ap-text: #f5f0f0;
    --ap-muted: #b8a0a5;
    --ap-dim: #785a60;
    --ap-primary: #dc2626;
    --ap-secondary: #9f1239;
    --ap-accent: #f43f5e;
    --ap-gradient: linear-gradient(135deg, #dc2626, #9f1239);
    --ap-gradient2: linear-gradient(135deg, #dc2626, #f43f5e);
    --ap-blue: #3b82f6;
    --ap-green: #22c55e;
    --ap-orange: #f59e0b;
    --ap-red: #ef4444;
    --ap-purple: #ef4444;
    --ap-teal: #14b8a6;
    --ap-pink: #9f1239;
    --ap-cyan: #f43f5e;
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius: 14px;
    --glow-sm: 0 0 15px rgba(220, 38, 38, 0.15);
    --glow-md: 0 0 30px rgba(220, 38, 38, 0.2);
    --glow-lg: 0 8px 40px rgba(220, 38, 38, 0.25);
    --transition-fast: .2s cubic-bezier(.4,0,.2,1);
    --transition-smooth: .35s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--ap-bg);
    color: var(--ap-text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--ap-purple); text-decoration: none; transition: color .2s; }
a:hover { color: var(--ap-pink); }
button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(220, 38, 38, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(220, 38, 38, 0.4); }

/* ===== Access Denied ===== */
.access-denied {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 2rem;
    background: radial-gradient(ellipse at 50% 20%, rgba(220,38,38,.12) 0%, transparent 60%);
}
.ad-card {
    text-align: center; background: var(--ap-glass);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ap-glass-border); border-radius: var(--radius);
    padding: 3rem 2.5rem; max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.ad-card i { font-size: 3.5rem; background: var(--ap-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 1.25rem; display: block; }
.ad-card h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.ad-card p  { color: var(--ap-muted); margin-bottom: 1.75rem; }

/* ===== Buttons ===== */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--ap-gradient); color: #fff; border: none; border-radius: 8px;
    padding: 0.6rem 1.25rem; font-weight: 600; font-size: 0.875rem;
    transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(220,38,38,.35); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

.btn-outline {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: transparent; color: var(--ap-text);
    border: 1px solid var(--ap-glass-border); border-radius: 8px;
    padding: 0.4rem 0.9rem; font-size: 0.8rem; font-weight: 500;
    transition: background .2s, border-color .2s;
}
.btn-outline:hover { background: rgba(220,38,38,.1); border-color: rgba(220,38,38,.3); }

.btn-danger {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--ap-red); color: #fff; border: none; border-radius: 8px;
    padding: 0.4rem 0.9rem; font-size: 0.8rem; font-weight: 600;
    transition: opacity .2s, transform .2s;
}
.btn-danger:hover { opacity: .85; transform: translateY(-1px); }

/* ===== Layout ===== */
.hidden { display: none !important; }

.admin-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    min-height: 100vh;
}

/* Topbar */
.admin-topbar {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    background: rgba(7, 11, 36, 0.8);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ap-border);
    z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-toggle { display: none; background: none; border: none; color: var(--ap-text); font-size: 1.2rem; }
.topbar-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ap-text); }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; }
.brand-text { font-weight: 700; font-size: 1.05rem; }
.brand-tag {
    background: var(--ap-gradient); color: #fff; font-size: 0.6rem; font-weight: 700;
    padding: 0.2rem 0.5rem; border-radius: 4px; vertical-align: middle;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.topbar-link {
    background: none; border: none; color: var(--ap-muted);
    font-size: 1rem; padding: 0.45rem; border-radius: 8px;
    transition: color .2s, background .2s; position: relative;
}
.topbar-link:hover { color: var(--ap-text); background: rgba(220,38,38,.1); }
.notif-dot {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px; background: var(--ap-red);
    border-radius: 50%; border: 2px solid var(--ap-surface);
}

/* Sidebar */
.admin-sidebar {
    background: var(--ap-surface);
    border-right: 1px solid var(--ap-border);
    padding: 1rem 0.85rem;
    overflow-y: auto;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-section-label {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--ap-dim);
    padding: 1rem 1rem 0.4rem; margin-top: 0.25rem;
}
.sidebar-section-label:first-child { margin-top: 0; padding-top: 0.5rem; }

.side-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.55rem 1rem; border-radius: 10px;
    color: var(--ap-muted); font-weight: 500; font-size: 0.85rem;
    transition: all .25s ease; position: relative;
    border: 1px solid transparent;
}
.side-link i { width: 18px; text-align: center; font-size: 0.85rem; }
.side-link:hover { color: var(--ap-text); background: rgba(220,38,38,.08); }
.side-link.active {
    color: #fff; background: rgba(220,38,38,.12);
    border-color: rgba(220,38,38,.25);
    box-shadow: 0 0 20px rgba(220,38,38,.1);
}
.side-link.active::before {
    content: ''; position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--ap-gradient);
    border-radius: 0 3px 3px 0;
}

/* Main */
.admin-main {
    padding: 1.75rem; overflow-y: auto;
    max-height: calc(100vh - var(--topbar-h));
    background: radial-gradient(ellipse at 30% 0%, rgba(220,38,38,.05) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 100%, rgba(159,18,57,.04) 0%, transparent 50%);
}
.admin-section { display: none; animation: fadeSection .4s ease; }
.admin-section.active { display: block; }
@keyframes fadeSection { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Page Header ===== */
.page-title { font-size: 1.65rem; font-weight: 700; margin-bottom: 1.25rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.page-header .page-title { margin-bottom: 0; }
.page-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: var(--ap-glass); backdrop-filter: blur(8px);
    border: 1px solid var(--ap-glass-border); border-radius: var(--radius);
    padding: 1.15rem 1.25rem; display: flex; align-items: center; gap: 1rem;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(220,38,38,.2);
    box-shadow: 0 8px 30px rgba(220,38,38,.1);
}
.sc-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.bg-blue   { background: rgba(59,130,246,.12); color: var(--ap-blue); }
.bg-green  { background: rgba(34,197,94,.12);  color: var(--ap-green); }
.bg-orange { background: rgba(245,158,11,.12); color: var(--ap-orange); }
.bg-red    { background: rgba(239,68,68,.12);  color: var(--ap-red); }
.bg-purple { background: rgba(239,68,68,.12); color: var(--ap-purple); }
.bg-teal   { background: rgba(20,184,166,.12); color: var(--ap-teal); }
.bg-pink   { background: rgba(159,18,57,.12); color: var(--ap-pink); }
.bg-cyan   { background: rgba(244,63,94,.12);  color: var(--ap-cyan); }

.sc-body { display: flex; flex-direction: column; }
.sc-value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.sc-label { font-size: 0.75rem; color: var(--ap-muted); margin-top: 2px; }

/* ===== Dashboard Grid ===== */
.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}

/* Mini chart */
.chart-placeholder { padding: 1rem 0 0; }
.mini-chart {
    display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 0 0.5rem;
}
.chart-bar {
    flex: 1; background: rgba(220,38,38,.2); border-radius: 6px 6px 0 0;
    transition: background .3s, box-shadow .3s; min-width: 0;
}
.chart-bar:hover, .chart-bar.active {
    background: var(--ap-gradient);
    box-shadow: 0 0 12px rgba(220,38,38,.3);
}
.chart-labels {
    display: flex; justify-content: space-between; padding: 0.5rem 0.5rem 0;
    font-size: 0.7rem; color: var(--ap-dim);
}

/* Sparkline */
.sparkline { padding: 1rem 0; }
.sparkline svg { width: 100%; height: 60px; }

/* Traffic list */
.traffic-list { display: flex; flex-direction: column; gap: 0.85rem; padding-top: 0.5rem; }
.traffic-item { display: flex; align-items: center; gap: 0.75rem; }
.traffic-label { font-size: 0.82rem; color: var(--ap-muted); min-width: 60px; }
.traffic-bar { flex: 1; height: 8px; background: var(--ap-surface2); border-radius: 4px; overflow: hidden; }
.traffic-fill { height: 100%; background: var(--ap-gradient); border-radius: 4px; transition: width .6s ease; }
.traffic-pct { font-size: 0.8rem; font-weight: 600; min-width: 35px; text-align: right; }

/* Countries */
.countries-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; padding-top: 0.5rem;
}
.country-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.85rem; border-radius: 8px;
    background: var(--ap-surface2); border: 1px solid var(--ap-glass-border);
    transition: border-color .2s;
}
.country-item:hover { border-color: rgba(220,38,38,.2); }
.country-flag { font-size: 1.2rem; }
.country-name { flex: 1; font-size: 0.85rem; }
.country-pct { font-weight: 700; font-size: 0.85rem; color: var(--ap-purple); }

/* Quick actions */
.quick-actions-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; padding-top: 0.5rem;
}
.qa-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1.25rem 0.5rem; background: var(--ap-surface2);
    border: 1px solid var(--ap-glass-border); border-radius: var(--radius);
    color: var(--ap-text); font-size: 0.8rem; font-weight: 500;
    transition: all .25s;
}
.qa-btn i { font-size: 1.25rem; color: var(--ap-purple); }
.qa-btn:hover {
    transform: translateY(-3px); border-color: rgba(220,38,38,.25);
    box-shadow: 0 6px 20px rgba(220,38,38,.12);
}

/* ===== Card ===== */
.card {
    background: var(--ap-glass); backdrop-filter: blur(8px);
    border: 1px solid var(--ap-glass-border); border-radius: var(--radius);
    padding: 1.25rem; transition: border-color .25s;
}
.card:hover { border-color: rgba(220,38,38,.15); }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.card-title i { margin-right: 0.5rem; }
.card-desc { color: var(--ap-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.mt { margin-top: 1.5rem; }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
    text-align: left; padding: 0.75rem 0.85rem;
    font-weight: 600; color: var(--ap-muted);
    border-bottom: 1px solid var(--ap-border);
    white-space: nowrap; font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.data-table td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
    vertical-align: middle;
}
.data-table tbody tr { transition: background .2s; }
.data-table tbody tr:hover { background: rgba(220,38,38,.05); }
.data-table .actions { display: flex; gap: 0.4rem; }

/* ===== Badges ===== */
.badge {
    display: inline-block; padding: 0.22rem 0.65rem;
    border-radius: 20px; font-size: 0.7rem; font-weight: 600; text-transform: capitalize;
}
.badge-active, .badge-completed, .badge-resolved { background: rgba(34,197,94,.12); color: var(--ap-green); }
.badge-expired, .badge-cancelled, .badge-closed, .badge-inactive { background: rgba(156,163,194,.1); color: var(--ap-muted); }
.badge-suspended, .badge-pending, .badge-in_progress { background: rgba(245,158,11,.12); color: var(--ap-orange); }
.badge-revoked, .badge-refunded  { background: rgba(239,68,68,.12); color: var(--ap-red); }
.badge-open  { background: rgba(59,130,246,.12); color: var(--ap-blue); }
.badge-admin { background: rgba(220,38,38,.15); color: var(--ap-purple); }
.badge-user  { background: rgba(156,163,194,.1); color: var(--ap-muted); }
.badge-high  { background: rgba(239,68,68,.12); color: var(--ap-red); }
.badge-medium { background: rgba(245,158,11,.12); color: var(--ap-orange); }
.badge-low   { background: rgba(34,197,94,.12); color: var(--ap-green); }
.badge-info  { background: rgba(244,63,94,.12); color: var(--ap-accent); }

/* ===== IP Whitelist & Audit Log ===== */
#ipWhitelistCard .data-table td code { padding: .15rem .4rem; background: var(--ap-surface2); border-radius: 4px; }
.audit-entry:last-child { border-bottom: none; }
.audit-entry:hover { background: rgba(220,38,38,.04); }

/* ===== Search / Filter ===== */
.search-box {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--ap-surface2); border: 1px solid var(--ap-glass-border);
    border-radius: 10px; padding: 0 0.85rem; transition: border-color .2s;
}
.search-box:focus-within { border-color: rgba(220,38,38,.35); }
.search-box i { color: var(--ap-dim); font-size: 0.85rem; }
.search-box input {
    background: transparent; border: none; outline: none;
    color: var(--ap-text); font-size: 0.85rem; padding: 0.5rem 0; width: 170px;
}
.search-box input::placeholder { color: var(--ap-dim); }
.select-filter {
    background: var(--ap-surface2); border: 1px solid var(--ap-glass-border);
    border-radius: 10px; color: var(--ap-text);
    padding: 0.5rem 0.85rem; font-size: 0.85rem; outline: none; transition: border-color .2s;
}
.select-filter:focus { border-color: rgba(220,38,38,.35); }
.select-filter option { background: var(--ap-surface); }

/* ===== Pagination ===== */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 0.35rem; padding-top: 1rem;
}
.pagination button {
    background: var(--ap-surface2); border: 1px solid var(--ap-glass-border);
    color: var(--ap-muted); border-radius: 8px;
    padding: 0.35rem 0.7rem; font-size: 0.8rem; transition: all .2s;
}
.pagination button:hover { background: rgba(220,38,38,.1); color: var(--ap-text); border-color: rgba(220,38,38,.25); }
.pagination button.active { background: var(--ap-gradient); border-color: transparent; color: #fff; }
.pagination button:disabled { opacity: .35; cursor: default; }

/* ===== Activity List ===== */
.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
.act-row {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.65rem 0; border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: 0.85rem; transition: background .2s;
}
.act-row:last-child { border-bottom: none; }
.act-row:hover { background: rgba(220,38,38,.04); border-radius: 6px; padding-left: 0.5rem; }
.act-row .act-user { font-weight: 600; color: var(--ap-purple); white-space: nowrap; min-width: 100px; }
.act-row .act-action { color: var(--ap-text); flex: 1; }
.act-row .act-time  { color: var(--ap-dim); font-size: 0.75rem; white-space: nowrap; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(3, 0, 20, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; animation: modalFadeIn .25s ease;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--ap-surface); border: 1px solid var(--ap-border);
    border-radius: var(--radius); width: 100%; max-width: 540px;
    max-height: 85vh; overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(220,38,38,.1);
    animation: modalSlideIn .3s ease;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--ap-border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--ap-muted); font-size: 1rem; padding: 0.3rem; border-radius: 6px; transition: background .2s, color .2s; }
.modal-close:hover { color: var(--ap-text); background: rgba(255,255,255,.06); }
.modal-body { padding: 1.25rem; }
.modal-footer {
    padding: 0.85rem 1.25rem; border-top: 1px solid var(--ap-border);
    display: flex; justify-content: flex-end; gap: 0.5rem;
}

/* Form elements */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--ap-muted); margin-bottom: 0.35rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; background: var(--ap-surface2);
    border: 1px solid var(--ap-glass-border); border-radius: 10px;
    color: var(--ap-text); padding: 0.55rem 0.85rem;
    font-size: 0.875rem; outline: none; font-family: inherit;
    transition: border-color .25s, box-shadow .25s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: rgba(220,38,38,.4); box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select option { background: var(--ap-surface); }

/* ===== Toast ===== */
.toast-container {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--ap-surface); border: 1px solid var(--ap-glass-border);
    border-radius: 10px; padding: 0.75rem 1.1rem;
    font-size: 0.85rem; box-shadow: 0 12px 30px rgba(0,0,0,.4);
    animation: toastIn .3s ease;
}
.toast.success { border-left: 3px solid var(--ap-green); }
.toast.error   { border-left: 3px solid var(--ap-red); }
.toast.info    { border-left: 3px solid var(--ap-blue); }
.toast .toast-close { background: none; border: none; color: var(--ap-muted); margin-left: auto; padding: 0 0.25rem; font-size: 0.8rem; transition: color .2s; }
.toast .toast-close:hover { color: var(--ap-text); }
.toast.removing { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ===== Site Settings ===== */
.setting-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 0; border-bottom: 1px solid rgba(255,255,255,.04); gap: 1rem;
}
.setting-row:last-child { border-bottom: none; }
.setting-label { color: var(--ap-text); font-weight: 500; white-space: nowrap; font-size: 0.9rem; }

.setting-input {
    flex: 1; max-width: 400px; background: var(--ap-surface2);
    border: 1px solid var(--ap-glass-border); border-radius: 10px;
    color: var(--ap-text); padding: 0.5rem 0.85rem;
    font-size: 0.875rem; font-family: inherit; outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.setting-input:focus { border-color: rgba(220,38,38,.4); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.setting-input option { background: var(--ap-surface); }

.toggle-switch { position: relative; width: 46px; height: 24px; display: inline-block; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--ap-surface2); border: 1px solid var(--ap-glass-border);
    border-radius: 24px; cursor: pointer; transition: background .3s, border-color .3s;
}
.toggle-slider::before {
    content: ''; position: absolute;
    left: 3px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px;
    background: var(--ap-muted); border-radius: 50%;
    transition: transform .3s, background .3s;
}
.toggle-switch input:checked + .toggle-slider {
    background: rgba(220,38,38,.2); border-color: rgba(220,38,38,.4);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateY(-50%) translateX(20px);
    background: var(--ap-purple); box-shadow: 0 0 8px rgba(220,38,38,.4);
}

.announcement-preview {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--ap-surface2); border: 1px solid var(--ap-glass-border);
    border-radius: 8px; padding: 0.65rem 1rem; font-size: 0.85rem;
}
.settings-actions {
    display: flex; align-items: center; gap: 1rem;
    margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--ap-border);
}
.settings-status { font-size: 0.85rem; color: var(--ap-muted); font-style: italic; }

/* ===== Settings Tabs ===== */
.settings-tabs {
    display: flex; gap: 0.35rem; border-bottom: 1px solid var(--ap-border);
    padding-bottom: 0; margin-bottom: 0; overflow-x: auto;
}
.stab {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.65rem 1.1rem; background: none; border: none;
    color: var(--ap-muted); font-size: 0.85rem; font-weight: 500;
    border-bottom: 2px solid transparent; border-radius: 0;
    transition: color .2s, border-color .2s; white-space: nowrap;
}
.stab:hover { color: var(--ap-text); }
.stab.active { color: var(--ap-text); border-bottom-color: var(--ap-purple); }
.stab i { font-size: 0.8rem; }

.settings-tab-content { display: none; }
.settings-tab-content.active { display: block; }

/* ===== Color Picker Grid ===== */
.color-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; padding-top: 0.5rem;
}
.color-pick { display: flex; flex-direction: column; gap: 0.5rem; }
.color-pick label { font-size: 0.8rem; font-weight: 500; color: var(--ap-muted); }
.color-swatch {
    width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
    border: 2px solid var(--ap-glass-border);
    transition: transform .2s, box-shadow .2s;
}
.color-swatch:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0,0,0,.3); }

/* ===== System Health ===== */
.health-grid { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.25rem; }
.health-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.85rem; border-radius: 8px;
    background: var(--ap-surface2); border: 1px solid var(--ap-glass-border);
    transition: border-color .2s;
}
.health-item:hover { border-color: rgba(220,38,38,.2); }
.health-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.health-dot.green { background: var(--ap-green); box-shadow: 0 0 6px rgba(34,197,94,.4); }
.health-dot.orange { background: var(--ap-orange); box-shadow: 0 0 6px rgba(245,158,11,.4); }
.health-dot.red { background: var(--ap-red); box-shadow: 0 0 6px rgba(239,68,68,.4); }
.health-name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.health-status { font-size: 0.8rem; color: var(--ap-green); font-weight: 500; }

.env-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.5rem; padding-top: 0.25rem;
}
.env-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 0.85rem; border-radius: 8px;
    background: var(--ap-surface2); border: 1px solid var(--ap-glass-border);
}
.env-label { font-size: 0.82rem; color: var(--ap-muted); }
.env-value { font-size: 0.82rem; font-weight: 600; font-family: 'JetBrains Mono', monospace; }

/* Tools grid */
.tools-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; padding-top: 0.5rem;
}
.tool-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1.25rem 0.75rem; background: var(--ap-surface2);
    border: 1px solid var(--ap-glass-border); border-radius: var(--radius);
    color: var(--ap-text); font-size: 0.8rem; font-weight: 500;
    transition: all .25s;
}
.tool-btn i { font-size: 1.2rem; color: var(--ap-accent); }
.tool-btn:hover {
    transform: translateY(-3px); border-color: rgba(244,63,94,.25);
    box-shadow: 0 6px 20px rgba(244,63,94,.12);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .admin-wrapper { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed; left: -270px; top: var(--topbar-h); bottom: 0;
        width: var(--sidebar-w); z-index: 20;
        transition: left .3s ease; box-shadow: 4px 0 20px rgba(0,0,0,.4);
    }
    .admin-sidebar.open { left: 0; }
    .sidebar-toggle { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header { flex-direction: column; align-items: flex-start; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .admin-main { padding: 1rem; }
    .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .color-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .setting-row { flex-direction: column; align-items: flex-start; }
    .setting-input { max-width: 100%; width: 100%; }
    .settings-tabs { gap: 0; }
    .stab { padding: 0.55rem 0.75rem; font-size: 0.78rem; }
}

/* ============================================
   PROFESSIONAL ENHANCEMENTS v6
   ============================================ */

/* --- Enhanced Topbar --- */
.admin-topbar {
    background: rgba(7, 11, 36, 0.85);
    border-bottom: 1px solid rgba(220,38,38,.15);
    box-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.admin-topbar::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(220,38,38,.4), rgba(159,18,57,.3), transparent);
}
.brand-tag {
    background: var(--ap-gradient);
    box-shadow: 0 0 12px rgba(220,38,38,.3);
    animation: tagPulse 3s ease-in-out infinite;
}
@keyframes tagPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(220,38,38,.3); }
    50% { box-shadow: 0 0 20px rgba(220,38,38,.5); }
}
.topbar-link { transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast); }
.topbar-link:hover { transform: translateY(-1px); }
.notif-dot { animation: notifPulse 2s ease infinite; }
@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* --- Enhanced Sidebar --- */
.admin-sidebar {
    background: linear-gradient(180deg, var(--ap-surface) 0%, rgba(15,5,10,.95) 100%);
    border-right: 1px solid rgba(220,38,38,.1);
    box-shadow: 2px 0 30px rgba(0,0,0,.2);
}
.admin-sidebar::before {
    content: '';
    position: absolute; top: 0; right: 0; width: 1px; height: 100%;
    background: linear-gradient(180deg, rgba(220,38,38,.3), transparent 30%, transparent 70%, rgba(159,18,57,.2));
    pointer-events: none;
}
.side-link {
    transition: all var(--transition-smooth);
    position: relative; overflow: hidden;
}
.side-link::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(220,38,38,.06), transparent);
    transform: translateX(-100%);
    transition: transform .5s ease;
}
.side-link:hover::after { transform: translateX(100%); }
.side-link.active {
    background: linear-gradient(90deg, rgba(220,38,38,.15), rgba(220,38,38,.05));
    border-color: rgba(220,38,38,.3);
    box-shadow: 0 0 25px rgba(220,38,38,.1), inset 0 0 20px rgba(220,38,38,.05);
}
.side-link.active::before {
    width: 3px; height: 70%;
    background: var(--ap-gradient);
    box-shadow: 0 0 10px rgba(220,38,38,.5);
    border-radius: 0 4px 4px 0;
}

/* --- Enhanced Section Transitions --- */
@keyframes fadeSection {
    from { opacity: 0; transform: translateY(12px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.admin-section.active { animation: fadeSection .45s cubic-bezier(.4,0,.2,1); }

/* --- Enhanced Cards --- */
.card {
    background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth), transform var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(220,38,38,.2), transparent);
    opacity: 0; transition: opacity var(--transition-smooth);
}
.card:hover::before { opacity: 1; }
.card:hover {
    border-color: rgba(220,38,38,.2);
    box-shadow: 0 8px 35px rgba(220,38,38,.12), 0 0 0 1px rgba(220,38,38,.05);
    transform: translateY(-2px);
}
.card-title {
    background: linear-gradient(135deg, var(--ap-text), var(--ap-muted));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.card-title i {
    -webkit-text-fill-color: var(--ap-purple);
    margin-right: 0.5rem;
}

/* --- Enhanced Stat Cards --- */
.stat-card {
    background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    transition: all var(--transition-smooth);
    position: relative; overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute; top: -50%; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(220,38,38,.06) 0%, transparent 70%);
    transition: opacity var(--transition-smooth);
    opacity: 0;
}
.stat-card:hover::after { opacity: 1; }
.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(220,38,38,.25);
    box-shadow: var(--glow-md);
}
.sc-value {
    background: linear-gradient(135deg, var(--ap-text), rgba(239,68,68,.8));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.sc-icon {
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.stat-card:hover .sc-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

/* --- Enhanced Table --- */
.data-table th {
    background: rgba(220,38,38,.04);
    position: relative;
}
.data-table th::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(220,38,38,.2), transparent);
}
.data-table tbody tr {
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}
.data-table tbody tr:hover {
    background: rgba(220,38,38,.06);
    box-shadow: inset 3px 0 0 var(--ap-primary);
}
.data-table td { transition: color var(--transition-fast); }
.data-table tbody tr:hover td { color: var(--ap-text); }

/* --- Enhanced Buttons --- */
.btn-primary {
    position: relative; overflow: hidden;
    box-shadow: 0 2px 12px rgba(220,38,38,.25);
    transition: all var(--transition-smooth);
}
.btn-primary::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
    transition: left .5s ease;
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(220,38,38,.4);
    transform: translateY(-2px);
}
.btn-outline {
    transition: all var(--transition-fast);
    border-color: rgba(220,38,38,.2);
}
.btn-outline:hover {
    background: rgba(220,38,38,.1);
    border-color: rgba(220,38,38,.4);
    box-shadow: 0 0 15px rgba(220,38,38,.15);
    transform: translateY(-1px);
}

/* --- Enhanced Modal --- */
.modal-overlay {
    background: rgba(3, 0, 20, 0.75);
}
.modal {
    background: linear-gradient(135deg, var(--ap-surface), rgba(24,10,16,.98));
    border: 1px solid rgba(220,38,38,.15);
    box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(220,38,38,.12), 0 0 1px rgba(220,38,38,.3);
}
.modal::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--ap-gradient);
    border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header {
    background: rgba(220,38,38,.04);
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Enhanced Toast --- */
.toast {
    background: linear-gradient(135deg, var(--ap-surface), rgba(24,10,16,.98));
    box-shadow: 0 15px 40px rgba(0,0,0,.5), 0 0 30px rgba(220,38,38,.08);
    border: 1px solid rgba(255,255,255,.06);
}
.toast.success { border-left: 3px solid var(--ap-green); box-shadow: 0 15px 40px rgba(0,0,0,.5), 0 0 20px rgba(34,197,94,.1); }
.toast.error   { border-left: 3px solid var(--ap-red); box-shadow: 0 15px 40px rgba(0,0,0,.5), 0 0 20px rgba(239,68,68,.1); }
.toast.info    { border-left: 3px solid var(--ap-blue); box-shadow: 0 15px 40px rgba(0,0,0,.5), 0 0 20px rgba(59,130,246,.1); }

/* --- Enhanced Form Inputs --- */
.setting-input {
    transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth), background var(--transition-smooth);
}
.setting-input:focus {
    border-color: rgba(220,38,38,.5);
    box-shadow: 0 0 0 3px rgba(220,38,38,.12), 0 0 20px rgba(220,38,38,.08);
    background: rgba(24,10,16,.6);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: rgba(220,38,38,.5);
    box-shadow: 0 0 0 3px rgba(220,38,38,.12), 0 0 20px rgba(220,38,38,.08);
    background: rgba(24,10,16,.6);
}

/* --- Enhanced Toggle Switch --- */
.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, rgba(220,38,38,.25), rgba(159,18,57,.15));
    border-color: rgba(220,38,38,.5);
}
.toggle-switch input:checked + .toggle-slider::before {
    background: linear-gradient(135deg, var(--ap-primary), var(--ap-secondary));
    box-shadow: 0 0 12px rgba(220,38,38,.5), 0 0 4px rgba(159,18,57,.3);
}

/* --- Enhanced Badges --- */
.badge {
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    letter-spacing: 0.02em;
}
.badge:hover { transform: scale(1.05); }

/* --- Enhanced Search Box --- */
.search-box {
    transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}
.search-box:focus-within {
    border-color: rgba(220,38,38,.4);
    box-shadow: 0 0 0 3px rgba(220,38,38,.08), 0 0 15px rgba(220,38,38,.06);
}

/* --- Enhanced Pagination --- */
.pagination button {
    transition: all var(--transition-fast);
}
.pagination button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220,38,38,.15);
}
.pagination button.active {
    box-shadow: 0 4px 15px rgba(220,38,38,.3);
}

/* --- Enhanced Quick Actions --- */
.qa-btn {
    transition: all var(--transition-smooth);
    position: relative; overflow: hidden;
}
.qa-btn::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at center, rgba(220,38,38,.08) 0%, transparent 70%);
    opacity: 0; transition: opacity var(--transition-smooth);
}
.qa-btn:hover::after { opacity: 1; }
.qa-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--glow-sm);
}
.qa-btn i { transition: transform var(--transition-fast); }
.qa-btn:hover i { transform: scale(1.15); }

/* --- Enhanced Tool Buttons --- */
.tool-btn {
    transition: all var(--transition-smooth);
    position: relative; overflow: hidden;
}
.tool-btn::after {
    content: '';
    position: absolute; bottom: -2px; left: 20%; right: 20%;
    height: 2px; border-radius: 2px;
    background: var(--ap-gradient2);
    opacity: 0; transition: opacity var(--transition-smooth);
}
.tool-btn:hover::after { opacity: 1; }
.tool-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(244,63,94,.15);
}

/* --- System Health Enhancements --- */
.health-dot.green { animation: dotPulse 2.5s ease-in-out infinite; }
@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(34,197,94,.4); }
    50% { box-shadow: 0 0 14px rgba(34,197,94,.6), 0 0 4px rgba(34,197,94,.8); }
}
.health-item {
    transition: all var(--transition-fast);
}
.health-item:hover {
    border-color: rgba(220,38,38,.25);
    background: rgba(220,38,38,.04);
    transform: translateX(4px);
}

/* --- Activity Row Enhancements --- */
.act-row {
    transition: all var(--transition-fast);
    border-radius: 8px;
    padding: 0.7rem 0.5rem;
}
.act-row:hover {
    background: rgba(220,38,38,.06);
    padding-left: 1rem;
    border-left: 2px solid rgba(220,38,38,.3);
}

/* --- Settings Tab Enhancements --- */
.settings-tabs {
    border-bottom: 1px solid rgba(220,38,38,.1);
    position: relative;
}
.stab {
    transition: all var(--transition-fast);
    position: relative;
}
.stab:hover { background: rgba(220,38,38,.06); border-radius: 8px 8px 0 0; }
.stab.active {
    border-bottom-color: transparent;
    background: rgba(220,38,38,.06);
    border-radius: 8px 8px 0 0;
}
.stab.active::after {
    content: '';
    position: absolute; bottom: -1px; left: 20%; right: 20%;
    height: 2px;
    background: var(--ap-gradient);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(220,38,38,.3);
}

/* --- Color Swatch Enhancements --- */
.color-swatch {
    box-shadow: 0 2px 8px rgba(0,0,0,.2), inset 0 0 0 1px rgba(255,255,255,.1);
}
.color-swatch:hover {
    transform: scale(1.15) rotate(3deg);
    box-shadow: 0 6px 20px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.2);
}

/* --- Save Button Status Animation --- */
.settings-status {
    transition: opacity var(--transition-fast);
}
.settings-actions .btn-primary i { transition: transform var(--transition-fast); }
.settings-actions .btn-primary:hover i { transform: scale(1.15); }

/* --- Announcement Preview Enhancement --- */
.announcement-preview {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,.2);
    padding: 0.75rem 1.1rem;
    animation: fadeSection .3s ease;
}

/* --- Loading Skeleton --- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* --- Page Title Enhancement --- */
.page-title {
    position: relative;
    display: inline-block;
}
.page-title::after {
    content: '';
    position: absolute; bottom: -6px; left: 0;
    width: 40px; height: 3px;
    background: var(--ap-gradient);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(220,38,38,.3);
}

/* --- Main Content Area Ambient Glow --- */
.admin-main {
    position: relative;
}
.admin-main::before {
    content: '';
    position: fixed; top: var(--topbar-h); right: 0;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(220,38,38,.04) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}
.admin-main::after {
    content: '';
    position: fixed; bottom: 0; left: var(--sidebar-w);
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(159,18,57,.03) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

/* --- Access Denied Enhancement --- */
.access-denied-card {
    box-shadow: 0 20px 60px rgba(0,0,0,.3), 0 0 40px rgba(220,38,38,.1);
}

/* --- Custom Scrollbar for Admin Main --- */
.admin-main::-webkit-scrollbar { width: 6px; }
.admin-main::-webkit-scrollbar-track { background: transparent; }
.admin-main::-webkit-scrollbar-thumb {
    background: rgba(220,38,38,.2);
    border-radius: 3px;
}
.admin-main::-webkit-scrollbar-thumb:hover { background: rgba(220,38,38,.4); }

/* --- Env Grid Enhancement --- */
.env-item {
    transition: all var(--transition-fast);
}
.env-item:hover {
    border-color: rgba(220,38,38,.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* --- Traffic Row Enhancement --- */
.traffic-row, .traffic-item {
    transition: all var(--transition-fast);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}
.traffic-row:hover, .traffic-item:hover {
    background: rgba(220,38,38,.04);
}

/* --- Country Row Enhancement --- */
.country-item:hover, .country-row:hover {
    background: rgba(220,38,38,.06);
    transform: translateY(-1px);
}

/* --- Responsive Enhancement --- */
@media (max-width: 900px) {
    .admin-main::before, .admin-main::after { display: none; }
    .admin-sidebar::before { display: none; }
}