/* ================================================
   Admin Panel — Dark Premium Theme
   ================================================ */

:root {
    --primary-color: #0a0a0f;
    --primary-light: #12121a;
    --surface: #161620;
    --surface-light: #1c1c28;
    --surface-hover: #242430;

    --accent-color: #6c63ff;
    --accent-hover: #8b84ff;
    --accent-dark: #5a52e0;
    --accent-glow: rgba(108, 99, 255, 0.15);

    --secondary: #00d4aa;
    --purple: #a777e3;

    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;

    --text-main: #e0e0e8;
    --text-muted: #6b6b80;
    --text-heading: #ffffff;

    --bg-body: #08080d;
    --bg-card: rgba(255, 255, 255, 0.025);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(108, 99, 255, 0.25);

    --sidebar-width: 260px;
    --header-height: 65px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);

    --font-family: 'Cairo', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    direction: rtl;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 212, 170, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.008) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.008) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text-heading); margin: 0; }
a { text-decoration: none; color: inherit; transition: all 0.2s; }
p { line-height: 1.6; color: var(--text-muted); }

/* ========== SIDEBAR ========== */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--primary-light);
    border-left: 1px solid var(--border-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand span {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    padding: 15px 12px;
    flex: 1;
    overflow-y: auto;
}

.nav-label {
    padding: 10px 15px;
    font-size: 11px;
    color: #4a4a60;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.nav-item { margin-bottom: 3px; }

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    gap: 10px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: white;
    transform: translateX(-3px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.nav-link i { font-size: 16px; width: 22px; text-align: center; font-style: normal; }

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
}

/* ========== MAIN CONTENT ========== */
.admin-main {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.admin-header {
    height: var(--header-height);
    background: rgba(18, 18, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.breadcrumb { font-size: 13px; color: var(--text-muted); display: flex; gap: 5px; }
.header-actions { display: flex; align-items: center; gap: 12px; }

.user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}

.page-content { padding: 25px; }

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 22px;
    border: 1px solid var(--border-color);
    margin-bottom: 22px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.card-title { font-size: 17px; margin: 0; }

/* ========== GRIDS ========== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

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

.form-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-control::placeholder { color: rgba(255, 255, 255, 0.2); }

select.form-control {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 35px;
}

select.form-control option { background: #1a1a28; color: var(--text-main); }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    gap: 8px;
    font-family: var(--font-family);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.35);
}

.btn-danger { background: var(--danger-color); color: white; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }

.btn-success { background: var(--success-color); color: white; }
.btn-success:hover { background: #059669; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    color: white;
}

/* ========== TABLES ========== */
.table-responsive { overflow-x: auto; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; }

.table th {
    text-align: right;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-main);
    font-size: 14px;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, 0.015); }

/* ========== BADGES ========== */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.badge-info { background: rgba(108, 99, 255, 0.12); color: #a5a0ff; }

/* ========== STAT CARDS ========== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 25px; }

.stat-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(20px);
    opacity: 0.25;
}

.stat-card-purple::before { background: var(--accent-color); }
.stat-card-green::before { background: var(--success-color); }
.stat-card-blue::before { background: var(--secondary); }
.stat-card-orange::before { background: var(--warning-color); }

.stat-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-icon-purple { background: rgba(108, 99, 255, 0.12); }
.stat-icon-green { background: rgba(16, 185, 129, 0.12); }
.stat-icon-blue { background: rgba(0, 212, 170, 0.12); }
.stat-icon-orange { background: rgba(245, 158, 11, 0.12); }

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; }
.stat-number { font-size: 28px; font-weight: 900; color: #fff; line-height: 1; }

/* ========== ALERT ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ========== LOGIN PAGE ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #08080d 0%, #12121a 100%);
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    color: var(--text-main);
}

/* ========== WELCOME BANNER ========== */
.dashboard-welcome {
    position: relative;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(0, 212, 170, 0.05));
    border: 1px solid rgba(108, 99, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 25px 30px;
    margin-bottom: 25px;
    overflow: hidden;
}

.dashboard-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ========== QUICK ACTIONS ========== */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.quick-link {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600; font-size: 13px;
    transition: all 0.25s;
}

.quick-link:hover {
    background: rgba(108, 99, 255, 0.08);
    border-color: rgba(108, 99, 255, 0.2);
    color: #fff;
    transform: translateX(-3px);
}

.quick-link .q-icon {
    width: 32px; height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out forwards; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }
::selection { background: var(--accent-color); color: white; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .stat-cards { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .admin-sidebar { transform: translateX(100%); }
    .admin-main { margin-right: 0; }
    .sidebar-open .admin-sidebar { transform: translateX(0); }
    .page-content { padding: 18px 12px; }
    .quick-grid { grid-template-columns: 1fr; }
}
