/* GameVault Admin — matches main site identity (Cairo, violet, glass) */
:root {
    --adm-bg: #f4f2ff;
    --adm-card: rgba(255, 255, 255, 0.82);
    --adm-border: rgba(139, 92, 246, 0.12);
    --adm-text: #0f172a;
    --adm-muted: #64748b;
    --adm-brand: #8b5cf6;
    --adm-glow: rgba(139, 92, 246, 0.25);
    --adm-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.dark {
    --adm-bg: #08080f;
    --adm-card: rgba(22, 22, 42, 0.92);
    --adm-border: rgba(255, 255, 255, 0.08);
    --adm-text: #f1f5f9;
    --adm-muted: #94a3b8;
}

body.admin-body {
    font-family: 'Cairo', system-ui, sans-serif;
    background: var(--adm-bg);
    color: var(--adm-text);
}

.admin-mesh {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 55% at 85% 10%, rgba(139, 92, 246, 0.1), transparent 55%),
        radial-gradient(ellipse 50% 45% at 5% 90%, rgba(6, 182, 212, 0.07), transparent);
}

.admin-sidebar {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-inline-end: 1px solid var(--adm-border);
    box-shadow: 4px 0 32px rgba(139, 92, 246, 0.06);
}
.dark .admin-sidebar {
    background: rgba(12, 12, 22, 0.95);
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.35);
}

[dir="rtl"] .admin-sidebar {
    box-shadow: -4px 0 32px rgba(139, 92, 246, 0.06);
}
.dark [dir="rtl"] .admin-sidebar {
    box-shadow: -4px 0 40px rgba(0, 0, 0, 0.35);
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.85rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--adm-muted);
    text-decoration: none;
    transition: all 0.25s var(--adm-ease);
}
.admin-sidebar-link:hover {
    color: #7c3aed;
    background: rgba(139, 92, 246, 0.08);
    transform: translateX(2px);
}
[dir="rtl"] .admin-sidebar-link:hover { transform: translateX(-2px); }
.admin-sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 6px 24px var(--adm-glow);
}
.admin-sidebar-link.active i { color: #fff; }

.admin-card {
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: 1.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.3s var(--adm-ease), box-shadow 0.3s var(--adm-ease);
}
.admin-card:hover {
    border-color: rgba(139, 92, 246, 0.22);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
}

.admin-stat { position: relative; overflow: hidden; }
.admin-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--stat-color, #8b5cf6), transparent);
    opacity: 0.75;
}

.admin-header {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--adm-border);
}
.dark .admin-header {
    background: rgba(8, 8, 15, 0.88);
}

.admin-main { background: transparent; }

.admin-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--adm-muted);
    font-weight: 700;
}
.admin-table tr {
    border-bottom: 1px solid var(--adm-border);
    transition: background 0.2s ease;
}
.admin-table tbody tr:hover { background: rgba(139, 92, 246, 0.05); }

.admin-btn,
.bg-indigo-600 {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 0.85rem;
    font-size: 0.875rem;
    font-weight: 800;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
    color: #fff !important;
    text-decoration: none;
    border: none;
    box-shadow: 0 6px 24px var(--adm-glow);
    transition: all 0.25s var(--adm-ease);
    cursor: pointer;
}
.admin-btn:hover,
.bg-indigo-600:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(139, 92, 246, 0.4);
}

.admin-input,
.bg-admin-card input[type="text"],
.bg-admin-card input[type="email"],
.bg-admin-card input[type="password"],
.bg-admin-card input[type="number"],
.bg-admin-card select,
.bg-admin-card textarea {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--adm-border);
    color: var(--adm-text);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dark .admin-input,
.dark .bg-admin-card input,
.dark .bg-admin-card select,
.dark .bg-admin-card textarea {
    background: rgba(255, 255, 255, 0.04);
}
.admin-input:focus,
.bg-admin-card input:focus,
.bg-admin-card select:focus,
.bg-admin-card textarea:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

/* Map legacy Tailwind utility colors to site theme */
.admin-shell .text-white { color: var(--adm-text) !important; }
.dark .admin-shell .text-white { color: #f8fafc !important; }
.admin-shell .text-slate-400,
.admin-shell .text-slate-500 { color: var(--adm-muted) !important; }
.admin-shell .text-indigo-400 { color: #7c3aed !important; }
.dark .admin-shell .text-indigo-400 { color: #a78bfa !important; }
.admin-shell .text-indigo-400:hover,
.admin-shell .hover\:text-indigo-300:hover { color: #6d28d9 !important; }
.admin-shell .font-black.text-white,
.admin-shell .admin-stat .text-2xl { color: var(--adm-text) !important; }
.dark .admin-shell .font-black.text-white,
.dark .admin-shell .admin-stat .text-2xl { color: #fff !important; }

.bg-admin-card { background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: 1.25rem; }
.border-admin-border { border-color: var(--adm-border) !important; }
.bg-admin-bg { background: var(--adm-bg); }
.bg-admin-hover { background: rgba(139, 92, 246, 0.06); }
.dark .bg-admin-hover { background: rgba(255, 255, 255, 0.04); }

.admin-sidebar .text-white { color: var(--adm-text) !important; }
.dark .admin-sidebar .text-white { color: #fff !important; }
.admin-sidebar .border-white\/5 { border-color: var(--adm-border) !important; }
.admin-sidebar .bg-white\/5 { background: rgba(139, 92, 246, 0.06) !important; }
.dark .admin-sidebar .bg-white\/5 { background: rgba(255, 255, 255, 0.05) !important; }

.admin-theme-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    border: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, 0.6);
    color: #7c3aed;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.dark .admin-theme-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #a78bfa;
}
.admin-theme-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
}

@media (max-width: 1023px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.35s var(--adm-ease);
    }
    [dir="rtl"] .admin-sidebar { transform: translateX(100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-inline-start: 0 !important; }
}

.admin-main { margin-inline-start: 16rem; }
@media (max-width: 1023px) {
    .admin-main { margin-inline-start: 0; }
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.25); border-radius: 3px; }
