/* =============================================
   منصة وتد الوقفية - التصميم الرئيسي
   =============================================
   الهوية: كحلي داكن + ذهبي
   نظام ألوان مرن: 4 أساسية + 4 ثانوية
   ============================================= */

/* =============================================
   استيراد خط تجوال (Tajawal)
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

/* =============================================
   نظام الألوان — غيّر هذه المتغيرات فقط لتحديث الهوية البصرية
   ============================================= */
:root {
    /* ─── الألوان الأساسية (Primary) ─── */
    --p1: #0B1F3A;           /* كحلي داكن — اللون الرئيسي */
    --p2: #C9A84C;           /* ذهبي — لون التمييز */
    --p3: #122D4F;           /* كحلي متوسط — تدرج */
    --p4: #E2D5A8;           /* ذهبي فاتح — خلفيات خفيفة */

    /* ─── الألوان الثانوية (Secondary) — جاهزة للتفعيل ─── */
    --s1: #7C3AED;           /* بنفسجي */
    --s2: #D97706;           /* برتقالي */
    --s3: #2563EB;           /* أزرق */
    --s4: #16A34A;           /* أخضر */

    /* ─── ألوان الحالات ─── */
    --success: #059669;
    --success-bg: #D1FAE5;
    --warning: #D97706;
    --warning-bg: #FEF3C7;
    --info: #2563EB;
    --info-bg: #DBEAFE;
    --danger: #DC2626;
    --danger-bg: #FEE2E2;

    /* ─── ألوان الاعتمادات ─── */
    --approved: #059669;
    --approved-bg: #D1FAE5;
    --conditional: #D97706;
    --conditional-bg: #FEF3C7;
    --revision: #2563EB;
    --revision-bg: #DBEAFE;
    --rejected: #DC2626;
    --rejected-bg: #FEE2E2;

    /* ─── ألوان الاستعجال ─── */
    --urgent: #DC2626;
    --normal: #2563EB;
    --deferrable: #9CA3AF;

    /* ─── ألوان الأهمية ─── */
    --high: #DC2626;
    --medium: #D97706;
    --low: #9CA3AF;

    /* ─── ألوان السطح ─── */
    --bg-body: #F0F2F5;
    --bg-card: #FFFFFF;
    --bg-sidebar: var(--p1);
    --bg-sidebar-hover: rgba(201, 168, 76, 0.08);
    --bg-sidebar-active: rgba(201, 168, 76, 0.15);
    --bg-header: #FFFFFF;
    --bg-table-head: #F8F9FB;
    --bg-table-hover: #FAFBFC;
    --bg-input: #FFFFFF;
    --bg-modal: rgba(11, 31, 58, 0.6);

    /* ─── ألوان النصوص ─── */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-white: #FFFFFF;
    --text-sidebar: rgba(255, 255, 255, 0.75);
    --text-sidebar-section: rgba(201, 168, 76, 0.7);
    --text-gold: var(--p2);
    --text-link: var(--p1);

    /* ─── الحدود والظلال ─── */
    --border-light: #E5E7EB;
    --border-input: #D1D5DB;
    --border-focus: var(--p2);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.1);

    /* ─── الأشكال ─── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* ─── الأبعاد ─── */
    --sidebar-width: 270px;
    --header-height: 64px;

    /* ─── الحركة ─── */
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;
}

/* =============================================
   إعادة التعيين
   ============================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    direction: rtl;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

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

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

::selection {
    background: var(--p2);
    color: var(--p1);
}

/* سكرول بار مخصص */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =============================================
   صفحة تسجيل الدخول
   ============================================= */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--p1) 0%, var(--p3) 50%, #1a3a5c 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.15) 0%, transparent 70%);
    top: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.1) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    border-radius: 50%;
}

.login-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    border-top: 4px solid var(--p2);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--p1);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

/* =============================================
   النماذج (Forms)
   ============================================= */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    direction: rtl;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--p2);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* =============================================
   الأزرار
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    white-space: nowrap;
    line-height: 1.5;
}

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

.btn-primary {
    background: var(--p1);
    color: var(--text-white);
    width: 100%;
}

.btn-primary:hover {
    background: var(--p3);
    box-shadow: 0 4px 12px rgba(11, 31, 58, 0.3);
}

.btn-gold {
    background: linear-gradient(135deg, var(--p2) 0%, #B8963F 100%);
    color: var(--p1);
    font-weight: 700;
}

.btn-gold:hover {
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--success);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #B91C1C;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-input);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--p2);
    color: var(--p2);
    background: rgba(201, 168, 76, 0.05);
}

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

.btn-xs {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

/* =============================================
   الرسائل والتنبيهات
   ============================================= */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: var(--success-bg);
    color: #065F46;
    border-right: 4px solid var(--success);
}

.alert-error {
    background-color: var(--danger-bg);
    color: #991B1B;
    border-right: 4px solid var(--danger);
}

.alert-warning {
    background-color: var(--warning-bg);
    color: #92400E;
    border-right: 4px solid var(--warning);
}

.alert-info {
    background-color: var(--info-bg);
    color: #1E40AF;
    border-right: 4px solid var(--info);
}

/* =============================================
   الهيكل العام
   ============================================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* =============================================
   الشريط الجانبي
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--p1) 0%, #091729 100%);
    color: var(--text-white);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: all var(--transition-slow);
    border-left: 1px solid rgba(201, 168, 76, 0.1);
}

/* سكرول بار الشريط الجانبي */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.2); border-radius: 3px; }

.sidebar-header {
    padding: 28px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    background: rgba(201, 168, 76, 0.03);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--p2);
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.sidebar-header p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-nav .nav-section {
    padding: 18px 24px 8px;
    font-size: 0.7rem;
    color: var(--text-sidebar-section);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 11px 24px;
    color: var(--text-sidebar);
    transition: all var(--transition);
    gap: 12px;
    border-right: 3px solid transparent;
    margin: 1px 0;
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-nav a:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-white);
    border-right-color: rgba(201, 168, 76, 0.3);
}

.sidebar-nav a.active {
    background: var(--bg-sidebar-active);
    color: var(--p2);
    border-right-color: var(--p2);
    font-weight: 600;
}

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar-nav a.active .nav-icon,
.sidebar-nav a:hover .nav-icon {
    opacity: 1;
}

/* =============================================
   الشريط العلوي
   ============================================= */
.header {
    position: fixed;
    top: 0;
    right: var(--sidebar-width);
    left: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 99;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow: visible;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info .user-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.user-info .user-role {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--p1);
}

/* شارة الإشعارات */
.notification-badge {
    background: linear-gradient(135deg, var(--p2), #B8963F);
    color: var(--p1);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}

.notification-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.4);
}

/* =============================================
   المحتوى الرئيسي
   ============================================= */
.main-content {
    margin-right: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 28px;
    min-height: calc(100vh - var(--header-height));
}

/* =============================================
   البطاقات (Cards)
   ============================================= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 22px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

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

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--p1);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =============================================
   شبكة الإحصائيات
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    transition: height var(--transition);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: rgba(11, 31, 58, 0.08);
    color: var(--p1);
}

.stat-card:has(.stat-icon.primary)::before { background: var(--p1); }

.stat-icon.success {
    background: rgba(5, 150, 105, 0.08);
    color: var(--success);
}

.stat-card:has(.stat-icon.success)::before { background: var(--success); }

.stat-icon.warning {
    background: rgba(217, 119, 6, 0.08);
    color: var(--warning);
}

.stat-card:has(.stat-icon.warning)::before { background: var(--warning); }

.stat-icon.danger {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
}

.stat-card:has(.stat-icon.danger)::before { background: var(--danger); }

.stat-icon.gold {
    background: rgba(201, 168, 76, 0.12);
    color: var(--p2);
}

.stat-card:has(.stat-icon.gold)::before { background: var(--p2); }

.stat-info h3 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* =============================================
   الجداول
   ============================================= */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 13px 16px;
    text-align: right;
    font-size: 0.88rem;
}

table th {
    background-color: var(--bg-table-head);
    font-weight: 700;
    color: var(--p1);
    font-size: 0.82rem;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

table td {
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

table tr {
    transition: background var(--transition);
}

table tr:hover {
    background-color: var(--bg-table-hover);
}

table tr:last-child td {
    border-bottom: none;
}

/* =============================================
   الحالات (Badges)
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-approved { background-color: var(--success-bg); color: #065F46; }
.badge-conditional { background-color: var(--warning-bg); color: #92400E; }
.badge-revision { background-color: var(--info-bg); color: #1E40AF; }
.badge-rejected { background-color: var(--danger-bg); color: #991B1B; }
.badge-pending { background-color: #F3F4F6; color: #4B5563; }

.badge-urgent { background-color: var(--danger-bg); color: #991B1B; }
.badge-normal { background-color: var(--info-bg); color: #1E40AF; }
.badge-deferrable { background-color: #F3F4F6; color: #6B7280; }

.badge-gold {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.08));
    color: #8B7028;
    border: 1px solid rgba(201, 168, 76, 0.25);
}

/* =============================================
   النوافذ المنبثقة (Modals)
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-modal);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    border-top: 4px solid var(--p2);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--p1);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

/* =============================================
   قائمة فارغة
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 700;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =============================================
   شريط التقدم
   ============================================= */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-fill.gold { background: linear-gradient(90deg, var(--p2), #B8963F); }
.progress-fill.success { background: var(--success); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.info { background: var(--info); }

/* =============================================
   التبويبات (Tabs)
   ============================================= */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--p1);
}

.tab.active {
    color: var(--p1);
    border-bottom-color: var(--p2);
}

/* =============================================
   فلاتر البحث
   ============================================= */
.filters-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    align-items: center;
}

.filters-bar select,
.filters-bar input {
    padding: 9px 14px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: all var(--transition);
    min-width: 160px;
}

.filters-bar select:focus,
.filters-bar input:focus {
    outline: none;
    border-color: var(--p2);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

/* =============================================
   أقسام الصفحة
   ============================================= */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--p1);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--border-light));
    margin-right: 12px;
}

/* =============================================
   عناصر مساعدة
   ============================================= */
.text-gold { color: var(--p2); }
.text-navy { color: var(--p1); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-left { text-align: left; }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }

/* =============================================
   صفحة الدخول — خروج
   ============================================= */
.header-actions {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header .btn-switch-account {
    background: transparent;
    color: var(--p2);
    border: 1.5px solid var(--p2);
    font-size: 0.8rem;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}

.header .btn-switch-account:hover {
    background: var(--p2);
    color: white;
}

.header .btn-switch-account svg {
    flex-shrink: 0;
}

.header .btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
    font-size: 0.8rem;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
    text-decoration: none;
}

.header .btn-danger svg {
    flex-shrink: 0;
}

.header .btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* =============================================
   تجاوب الشاشات الصغيرة
   ============================================= */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(100%);
        width: 270px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .header {
        right: 0;
        padding: 0 16px;
    }

    .main-content {
        margin-right: 0;
        padding: 20px 16px;
    }

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

    .filters-bar {
        flex-direction: column;
    }

    .filters-bar select,
    .filters-bar input {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
        margin: 0 16px;
    }

    .card {
        padding: 18px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-info h3 {
        font-size: 1.4rem;
    }
}

/* =============================================
   طباعة
   ============================================= */
@media print {
    .sidebar,
    .header,
    .btn {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
