/* ═══════════════════════════════════════════════════════════════════
   QARREB ADMIN - Super Admin Panel Theme
   Dark Slate + Vibrant Purple (control center aesthetic)
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* Brand */
    --adm-primary: #1E293B;
    --adm-primary-hover: #0F172A;
    --adm-primary-light: #F1F5F9;

    --adm-secondary: #7C3AED;
    --adm-secondary-hover: #6D28D9;
    --adm-secondary-light: #EDE9FE;

    --adm-accent: #F59E0B;

    /* Status */
    --adm-success: #059669;
    --adm-success-light: #D1FAE5;
    --adm-danger: #DC2626;
    --adm-danger-light: #FEE2E2;
    --adm-warning: #F59E0B;
    --adm-warning-light: #FEF3C7;
    --adm-info: #0EA5E9;
    --adm-info-light: #E0F2FE;

    /* Backgrounds */
    --adm-bg-main: #F8FAFC;
    --adm-bg-card: #FFFFFF;
    --adm-bg-section: #F1F5F9;
    --adm-bg-sidebar: #0F172A;
    --adm-bg-sidebar-hover: #1E293B;
    --adm-bg-sidebar-active: rgba(124, 58, 237, 0.2);

    /* Text */
    --adm-text-primary: #0F172A;
    --adm-text-secondary: #334155;
    --adm-text-muted: #64748B;
    --adm-text-on-sidebar: rgba(255, 255, 255, 0.85);
    --adm-text-on-sidebar-muted: rgba(255, 255, 255, 0.5);

    /* Borders */
    --adm-border: #E2E8F0;
    --adm-border-light: #F1F5F9;

    /* Shadows */
    --adm-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --adm-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --adm-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -1px rgba(15, 23, 42, 0.05);
    --adm-shadow-purple: 0 4px 14px rgba(124, 58, 237, 0.25);

    /* Layout */
    --adm-sidebar-width: 260px;
    --adm-topbar-height: 64px;

    /* Radius */
    --adm-radius-sm: 6px;
    --adm-radius: 8px;
    --adm-radius-md: 10px;
    --adm-radius-lg: 14px;

    /* Transition */
    --adm-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'Cairo', -apple-system, sans-serif;
    background: var(--adm-bg-main);
    color: var(--adm-text-primary);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body[dir="rtl"] {
    font-family: 'Cairo', 'Inter', sans-serif;
}

/* ─────────────────────────────────────────────────────────
   Layout
   ───────────────────────────────────────────────────────── */
.adm-app { min-height: 100vh; display: flex; }

.adm-sidebar {
    width: var(--adm-sidebar-width);
    background: var(--adm-bg-sidebar);
    color: var(--adm-text-on-sidebar);
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1030;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.15);
}

body[dir="rtl"] .adm-sidebar {
    box-shadow: -4px 0 20px rgba(15, 23, 42, 0.15);
}

.adm-sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.adm-sidebar-brand .brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--adm-secondary), var(--adm-secondary-hover));
    border-radius: var(--adm-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    box-shadow: var(--adm-shadow-purple);
}

.adm-sidebar-brand .brand-name {
    font-weight: 700;
    color: white;
    font-size: 1rem;
}

.adm-sidebar-brand .brand-tagline {
    font-size: 0.7rem;
    color: var(--adm-text-on-sidebar-muted);
}

.adm-sidebar-section {
    padding: 1rem 0.75rem;
}

.adm-sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--adm-text-on-sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.adm-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--adm-radius);
    color: var(--adm-text-on-sidebar);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--adm-transition);
    margin-bottom: 0.125rem;
    position: relative;
    text-decoration: none;
}

.adm-sidebar-link:hover {
    background: var(--adm-bg-sidebar-hover);
    color: white;
}

.adm-sidebar-link.active {
    background: var(--adm-bg-sidebar-active);
    color: white;
    font-weight: 600;
}

.adm-sidebar-link.active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--adm-secondary);
    border-radius: 0 var(--adm-radius-sm) var(--adm-radius-sm) 0;
}

body[dir="rtl"] .adm-sidebar-link.active::before {
    inset-inline-start: auto;
    inset-inline-end: 0;
    border-radius: var(--adm-radius-sm) 0 0 var(--adm-radius-sm);
}

.adm-sidebar-link i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.adm-sidebar-link .badge {
    margin-inline-start: auto;
    background: var(--adm-secondary);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-weight: 700;
}

/* Main content */
.adm-main {
    flex: 1;
    margin-inline-start: var(--adm-sidebar-width);
}

body[dir="rtl"] .adm-main {
    margin-inline-start: 0;
    margin-inline-end: var(--adm-sidebar-width);
}

/* Topbar */
.adm-topbar {
    height: var(--adm-topbar-height);
    background: white;
    border-bottom: 1px solid var(--adm-border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.adm-content { padding: 1.5rem; }

.adm-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.adm-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.adm-page-subtitle {
    font-size: 0.875rem;
    color: var(--adm-text-muted);
    margin-top: 0.25rem;
}

/* ─────────────────────────────────────────────────────────
   Cards & Stat cards (similar to Qarreb but with accent)
   ───────────────────────────────────────────────────────── */
.card, .adm-card {
    background: var(--adm-bg-card);
    border: 1px solid var(--adm-border-light);
    border-radius: var(--adm-radius-md);
    box-shadow: var(--adm-shadow);
}

.card-header, .adm-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--adm-border-light);
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-body, .adm-card-body { padding: 1.25rem; }

.adm-stat-card {
    background: var(--adm-bg-card);
    border: 1px solid var(--adm-border-light);
    border-radius: var(--adm-radius-md);
    padding: 1.25rem;
    transition: var(--adm-transition);
    position: relative;
    overflow: hidden;
}

.adm-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 4px;
    height: 100%;
    background: var(--adm-secondary);
}

.adm-stat-card.success::before { background: var(--adm-success); }
.adm-stat-card.warning::before { background: var(--adm-warning); }
.adm-stat-card.danger::before  { background: var(--adm-danger); }
.adm-stat-card.info::before    { background: var(--adm-info); }

.adm-stat-card:hover {
    box-shadow: var(--adm-shadow-md);
    transform: translateY(-2px);
}

.adm-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--adm-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--adm-secondary-light);
    color: var(--adm-secondary);
}

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

.adm-stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--adm-text-muted);
    margin-bottom: 0.25rem;
}

.adm-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--adm-text-primary);
    line-height: 1.1;
}

/* ─────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────── */
.btn {
    font-weight: 600;
    border-radius: var(--adm-radius);
    padding: 0.5rem 1.125rem;
    transition: var(--adm-transition);
    border: none;
    font-size: 0.875rem;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary {
    background: var(--adm-secondary);
    color: white;
}

.btn-primary:hover {
    background: var(--adm-secondary-hover);
    color: white;
    box-shadow: var(--adm-shadow-purple);
    transform: translateY(-1px);
}

.btn-dark {
    background: var(--adm-primary);
    color: white;
}

.btn-dark:hover {
    background: var(--adm-primary-hover);
    color: white;
}

.btn-success { background: var(--adm-success); color: white; }
.btn-danger  { background: var(--adm-danger); color: white; }
.btn-warning { background: var(--adm-warning); color: white; }

.btn-outline-primary {
    background: white;
    color: var(--adm-secondary);
    border: 1.5px solid var(--adm-secondary);
}

.btn-outline-primary:hover {
    background: var(--adm-secondary);
    color: white;
}

.btn-light {
    background: var(--adm-bg-section);
    color: var(--adm-text-primary);
    border: 1px solid var(--adm-border);
}

.btn-light:hover {
    background: var(--adm-border-light);
}

.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }

/* ─────────────────────────────────────────────────────────
   Tables
   ───────────────────────────────────────────────────────── */
.adm-table-wrapper, .table-wrapper {
    background: white;
    border-radius: var(--adm-radius-md);
    overflow: hidden;
    border: 1px solid var(--adm-border-light);
}

.table {
    width: 100%;
    margin: 0;
}

.table thead {
    background: var(--adm-bg-section);
}

.table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--adm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--adm-border);
    text-align: start;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--adm-border-light);
    font-size: 0.875rem;
    color: var(--adm-text-secondary);
    vertical-align: middle;
}

.table tbody tr:hover { background: var(--adm-bg-section); }
.table tbody tr:last-child td { border-bottom: none; }

/* ─────────────────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────────────────── */
.form-control, .form-select {
    border: 1.5px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    background: white;
    transition: var(--adm-transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--adm-secondary);
    box-shadow: 0 0 0 3px var(--adm-secondary-light);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--adm-text-primary);
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
}

.form-check-input:checked {
    background-color: var(--adm-secondary);
    border-color: var(--adm-secondary);
}

.form-check-input:focus {
    border-color: var(--adm-secondary);
    box-shadow: 0 0 0 3px var(--adm-secondary-light);
}

/* ─────────────────────────────────────────────────────────
   Badges
   ───────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-success { background: var(--adm-success-light); color: var(--adm-success); }
.badge-danger  { background: var(--adm-danger-light);  color: var(--adm-danger); }
.badge-warning { background: var(--adm-warning-light); color: #92400E; }
.badge-info    { background: var(--adm-info-light);    color: var(--adm-info); }
.badge-primary { background: var(--adm-secondary-light); color: var(--adm-secondary); }
.badge-light   { background: var(--adm-bg-section); color: var(--adm-text-secondary); }
.badge-dark    { background: var(--adm-primary); color: white; }

/* Special: Tishtari highlight */
.badge-tishtari {
    background: linear-gradient(135deg, #5B21B6, #EC4899);
    color: white;
}

/* ─────────────────────────────────────────────────────────
   Alerts
   ───────────────────────────────────────────────────────── */
.alert {
    border-radius: var(--adm-radius);
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
}

.alert-success { background: var(--adm-success-light); color: #064E3B; }
.alert-danger  { background: var(--adm-danger-light);  color: #991B1B; }
.alert-warning { background: var(--adm-warning-light); color: #92400E; }
.alert-info    { background: var(--adm-info-light);    color: #075985; }

/* ─────────────────────────────────────────────────────────
   Auth
   ───────────────────────────────────────────────────────── */
.adm-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--adm-primary) 0%, #312E81 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.adm-auth-page::before {
    content: '';
    position: absolute;
    top: 10%;
    inset-inline-end: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.4) 0%, transparent 70%);
    border-radius: 50%;
}

.adm-auth-card {
    background: white;
    border-radius: var(--adm-radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* ─────────────────────────────────────────────────────────
   Mobile
   ───────────────────────────────────────────────────────── */
.adm-sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--adm-text-primary);
    font-size: 1.25rem;
    padding: 0.5rem;
}

@media (max-width: 991.98px) {
    .adm-sidebar-toggle { display: inline-flex; }
    .adm-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    body[dir="rtl"] .adm-sidebar { transform: translateX(100%); }
    .adm-sidebar.open { transform: translateX(0); }
    .adm-main { margin-inline-start: 0 !important; margin-inline-end: 0 !important; }
}

/* ─────────────────────────────────────────────────────────
   Sidebar scrollbar
   ───────────────────────────────────────────────────────── */
.adm-sidebar::-webkit-scrollbar { width: 6px; }
.adm-sidebar::-webkit-scrollbar-track { background: transparent; }
.adm-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.adm-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
