/* 
==================== LEGAL AI AUTOMATION PLATFORM ====================
نظام إدارة قانوني متكامل - التصميم الرئيسي
RTL Support - Arabic UI
==================== */

/* ==================== CSS Variables ==================== */
:root {
    /* Premium Light Mode - Monochromatic Red & Grey Palette */
    --primary-color: #FF2E63;
    --primary-light: #FF6B8A;
    --primary-dark: #E62958;
    --secondary-color: #4B5563;
    --secondary-light: #6B7280;
    --accent-color: #FF2E63;
    --danger-color: #FF2E63;
    --warning-color: #FF6B8A;
    --info-color: #6B7280;
    --success-color: #10B981;
    
    /* Premium Light Backgrounds - Clean White & Light Grey */
    --bg-color: #FFFFFF;
    --bg-dark: #F9FAFB;
    --bg-card: rgba(255, 255, 255, 0.95);
    --sidebar-bg: rgba(255, 255, 255, 0.98);
    --sidebar-hover: rgba(249, 250, 251, 0.8);
    
    /* High Contrast Typography for Light Mode */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #4B5563;
    --text-white: #FFFFFF;
    
    /* Elegant Light Borders */
    --border-color: rgba(209, 213, 219, 1);
    --border-light: rgba(229, 231, 235, 1);
    --border-accent: rgba(255, 46, 99, 0.3);
    --border-radius: 16px;
    --border-radius-lg: 24px;
    
    /* Soft Shadows for Light Mode */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, 0.15);
    --shadow-accent: 0 0 20px rgba(255, 46, 99, 0.08);
    --shadow-glow: 0 0 15px rgba(255, 46, 99, 0.06);
    --shadow-red-glow: 0 0 18px rgba(255, 46, 99, 0.1);
    
    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Inter', 'Roboto', 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    background: #FFFFFF;
    background-image: 
        radial-gradient(at 10% 10%, rgba(255, 46, 99, 0.02) 0%, transparent 50%),
        radial-gradient(at 90% 90%, rgba(255, 46, 99, 0.02) 0%, transparent 50%),
        linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 50%, #F3F4F6 100%);
    direction: rtl;
    text-align: right;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 46, 99, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 46, 99, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundPulse 25s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    outline: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

/* ==================== Custom Scrollbar ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 114, 128, 0.3) var(--bg-dark);
}

/* ==================== Typography ==================== */
h1 { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
h2 { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
h3 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
h4 { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }
h5 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
h6 { font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); }

.text-primary { color: var(--primary-color); font-weight: 600; }
.text-secondary { color: var(--text-secondary); font-weight: 500; }
.text-muted { color: var(--text-muted); font-weight: 500; }
.text-success { color: var(--success-color); font-weight: 600; }
.text-danger { color: var(--danger-color); font-weight: 600; }
.text-warning { color: var(--warning-color); font-weight: 600; }

/* ==================== Layout ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.main-content.sidebar-collapsed {
    margin-right: var(--sidebar-collapsed);
}

.page-content {
    padding: 24px;
    margin-top: var(--header-height);
    position: relative;
    z-index: 2;
}

/* ==================== Sidebar ==================== */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-primary);
    z-index: 1000;
    transition: var(--transition);
    overflow-x: hidden;
    border-left: 1px solid var(--border-color);
    box-shadow: 
        -4px 0 24px rgba(0, 0, 0, 0.08), 
        inset -1px 0 0 rgba(255, 46, 99, 0.05);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(249, 250, 251, 0.6);
    backdrop-filter: blur(10px);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo i {
    font-size: 32px;
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px rgba(255, 46, 99, 0.3));
}

.sidebar-logo h2 {
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.sidebar.collapsed .sidebar-logo h2,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .menu-badge,
.sidebar.collapsed .user-info {
    display: none;
}

.sidebar-toggle {
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.1), rgba(255, 46, 99, 0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 46, 99, 0.2);
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.15), rgba(255, 46, 99, 0.08));
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(255, 46, 99, 0.2), 0 0 30px rgba(255, 46, 99, 0.1);
    transform: scale(1.1) rotate(90deg);
}

/* User Profile in Sidebar */
.sidebar-user {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.05) 0%, rgba(255, 46, 99, 0.02) 100%);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(255, 46, 99, 0.05);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF2E63 0%, #FF6B8A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    border: 2px solid rgba(255, 46, 99, 0.3);
    box-shadow: 
        0 4px 20px rgba(255, 46, 99, 0.3),
        0 0 30px rgba(255, 46, 99, 0.2),
        inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-info span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 16px 0;
    overflow-y: auto;
    height: calc(100vh - 200px);
}

.menu-category {
    padding: 10px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 700;
}

.sidebar.collapsed .menu-category {
    display: none;
}

.menu-item {
    margin: 4px 12px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 2px solid transparent;
    margin: 3px 12px;
    position: relative;
}

.menu-link:hover {
    background: var(--sidebar-hover);
    color: var(--primary-color);
    border-left-color: rgba(255, 46, 99, 0.5);
    transform: translateX(-2px);
}

.menu-link.active {
    background: linear-gradient(90deg, rgba(255, 46, 99, 0.1) 0%, rgba(255, 46, 99, 0.05) 100%);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 46, 99, 0.1);
}

.menu-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
}

.menu-badge {
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ==================== Header ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: var(--sidebar-width);
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 999;
    transition: var(--transition);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

.header.sidebar-collapsed {
    right: var(--sidebar-collapsed);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb i {
    font-size: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    width: 320px;
    padding: 12px 45px 12px 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: var(--primary-color);
    background: var(--bg-color);
    box-shadow: 
        0 0 0 4px rgba(255, 46, 99, 0.1), 
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 0 40px rgba(255, 46, 99, 0.1);
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Header Icons */
.header-icon {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-icon:hover {
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.1), rgba(255, 46, 99, 0.05));
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 
        0 4px 20px rgba(255, 46, 99, 0.2),
        0 0 30px rgba(255, 46, 99, 0.1);
    transform: translateY(-3px) scale(1.05);
}

.header-icon .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.card:hover {
    border-color: rgba(255, 46, 99, 0.3);
    box-shadow: 
        var(--shadow-md), 
        0 0 30px rgba(255, 46, 99, 0.1);
    transform: translateY(-2px);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(249, 250, 251, 0.8);
}

.card-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    letter-spacing: 0.3px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

/* ==================== Stats Cards ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    background-image: linear-gradient(135deg, rgba(255, 46, 99, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow), 0 0 0 1px var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.08) 0%, rgba(255, 46, 99, 0.02) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 46, 99, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.stat-card:hover::before,
.stat-card:hover::after {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 0 70px rgba(255, 46, 99, 0.2),
        inset 0 0 40px rgba(255, 46, 99, 0.05);
    border-color: rgba(255, 46, 99, 0.4);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    backdrop-filter: blur(10px);
}

.stat-icon.clients {
    background: rgba(99, 102, 241, 0.08);
    color: #6366F1;
    border-color: rgba(99, 102, 241, 0.2);
}

.stat-icon.cases {
    background: rgba(139, 92, 246, 0.08);
    color: #8B5CF6;
    border-color: rgba(139, 92, 246, 0.2);
}

.stat-icon.appointments {
    background: rgba(255, 46, 99, 0.08);
    color: #FF2E63;
    border-color: rgba(255, 46, 99, 0.2);
}

.stat-icon.revenue {
    background: rgba(16, 185, 129, 0.08);
    color: #10B981;
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.stat-content h4 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-content span {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.stat-change {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up {
    color: #10B981;
}

.stat-change.down {
    color: var(--danger-color);
}

/* ==================== Tables ==================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.05), rgba(255, 46, 99, 0.02));
    backdrop-filter: blur(20px);
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(255, 46, 99, 0.04) 0%, rgba(255, 46, 99, 0.02) 100%);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(255, 46, 99, 0.08);
}

.data-table tbody td {
    font-size: 14px;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.table-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 33, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.table-action-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 212, 255, 0.15));
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3), 0 0 24px rgba(0, 212, 255, 0.2);
    transform: scale(1.1);
}

.table-action-btn.edit:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 212, 255, 0.15));
    border-color: #00d4ff;
    color: #00d4ff;
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3), 0 0 24px rgba(0, 212, 255, 0.2);
}

.table-action-btn.delete:hover {
    background: rgba(255, 46, 99, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(255, 46, 99, 0.2);
}

.table-action-btn.view:hover {
    background: rgba(107, 114, 128, 0.2);
    border-color: #9CA3AF;
    color: #9CA3AF;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #FF2E63 0%, #E62958 100%);
    color: white;
    border: 1px solid rgba(255, 46, 99, 0.3);
    box-shadow: 0 4px 16px rgba(255, 46, 99, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FF4775 0%, #FF2E63 100%);
    border-color: rgba(255, 46, 99, 0.5);
    box-shadow: 0 8px 24px rgba(255, 46, 99, 0.35);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(243, 244, 246, 0.9);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(229, 231, 235, 1);
    color: var(--text-primary);
    border-color: rgba(209, 213, 219, 1);
    transform: translateY(-2px);
}

.btn-success {
    background: rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(10px);
    color: #10B981;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--primary-color);
    color: white;
    border: 1px solid rgba(255, 46, 99, 0.5);
    box-shadow: 0 4px 16px rgba(255, 46, 99, 0.25);
}

.btn-danger:hover {
    background: var(--primary-dark);
    border-color: rgba(255, 46, 99, 0.7);
    box-shadow: 0 8px 24px rgba(255, 46, 99, 0.35);
    transform: translateY(-2px);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.1);
    backdrop-filter: blur(10px);
    color: #F59E0B;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(249, 250, 251, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.3s;
    cursor: pointer;
}

.btn-icon:hover {
    background: rgba(243, 244, 246, 1);
    border-color: var(--border-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-icon.btn-danger {
    color: var(--primary-color);
    border-color: rgba(255, 46, 99, 0.2);
}

.btn-icon.btn-danger:hover {
    background: rgba(255, 46, 99, 0.15);
    border-color: rgba(255, 46, 99, 0.4);
    color: var(--primary-color);
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.form-label.required::after {
    content: '*';
    color: var(--danger-color);
    margin-right: 4px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-control:focus {
    border-color: rgba(255, 46, 99, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 46, 99, 0.1);
    background: var(--bg-color);
}

.form-control.error {
    border-color: var(--danger-color);
}

.form-error {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 4px;
}

.form-hint {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-left: 40px;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.form-check-input:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== Status Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(10px);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
    backdrop-filter: blur(10px);
}

.badge-danger {
    background: rgba(255, 46, 99, 0.1);
    color: #E62958;
    border: 1px solid rgba(255, 46, 99, 0.3);
    backdrop-filter: blur(10px);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
    border: 1px solid rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(10px);
}

.badge-primary {
    background: rgba(255, 46, 99, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(255, 46, 99, 0.3);
    backdrop-filter: blur(10px);
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 46, 99, 0.1);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(249, 250, 251, 0.6);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(243, 244, 246, 0.8);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.9), rgba(220, 38, 38, 0.9));
    color: white;
    box-shadow: 0 4px 16px rgba(255, 46, 99, 0.3), 0 0 24px rgba(255, 46, 99, 0.2);
    transform: scale(1.1) rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    gap: 12px;
}

/* ==================== Alerts ==================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10B981;
    backdrop-filter: blur(10px);
}

.alert-danger {
    background: rgba(255, 46, 99, 0.1);
    border: 1px solid rgba(255, 46, 99, 0.3);
    color: #E62958;
    backdrop-filter: blur(10px);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #F59E0B;
    backdrop-filter: blur(10px);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3B82F6;
    backdrop-filter: blur(10px);
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination-btn:hover,
.pagination-btn.active {
    background: linear-gradient(135deg, #FF2E63 0%, #E62958 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 46, 99, 0.3);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== Tabs ==================== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== Loading ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== Login Page ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    background-image: 
        radial-gradient(at 20% 20%, rgba(255, 46, 99, 0.02) 0%, transparent 50%),
        radial-gradient(at 80% 80%, rgba(255, 46, 99, 0.02) 0%, transparent 50%),
        linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 50%, #F3F4F6 100%);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 46, 99, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 46, 99, 0.03) 0%, transparent 50%);
    pointer-events: none;
    animation: loginPulse 20s ease-in-out infinite;
}

@keyframes loginPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    box-shadow: 
        0 32px 80px rgba(0, 0, 0, 0.12), 
        0 0 40px rgba(255, 46, 99, 0.08);
    width: 100%;
    max-width: 480px;
    padding: 48px;
    margin: 20px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(255, 46, 99, 0.3));
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 8px;
}

.login-links {
    text-align: center;
    margin-top: 24px;
}

.login-links a {
    color: var(--primary-color);
    font-size: 14px;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .header {
        right: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-left .page-title h1 {
        font-size: 1.1rem;
    }
    
    .search-box {
        display: none;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
    
    .breadcrumb {
        display: none;
    }
}

/* ==================== Utilities ==================== */
.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.rounded { border-radius: var(--border-radius); }
.shadow { box-shadow: var(--shadow); }

/* ==================== AI-THEMED ENHANCEMENTS ==================== */

/* Glowing text effect for headings */
h1, h2, h3 {
    text-shadow: none;
}

/* Card hover effect */
.card:hover {
    border-color: rgba(185, 28, 28, 0.3);
}

/* Page content background */
.page-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.01) 2px,
            rgba(255, 255, 255, 0.01) 4px
        );
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* ==================== تحسينات الوضوح والقراءة ==================== */

/* تحسين وضوح النصوص في جميع العناوين */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
}

/* تحسين وضوح النصوص في الفقرات */
p, span, div {
    color: var(--text-primary);
}

/* تحسين وضوح Labels في الرسوم البيانية */
text, tspan, .chart-label, .axis-label, .legend-item {
    fill: #111827 !important;
    color: #111827 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}

/* تحسين وضوح أسماء الأشهر والبيانات */
.chart-text, .bar-label, .pie-label {
    fill: #111827 !important;
    color: #111827 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}

/* تحسين وضوح الأرقام والقيم */
.stat-value, .chart-value, .data-label {
    color: #111827 !important;
    font-weight: 800 !important;
    font-size: 15px !important;
}

/* تحسين وضوح عناوين الأقسام */
.section-title, .card-title, .page-title h1 {
    color: #111827 !important;
    font-weight: 800 !important;
}

/* تحسين وضوح النصوص الثانوية */
.text-secondary, .secondary-text {
    color: #374151 !important;
    font-weight: 600 !important;
}

/* تحسين وضوح Legend في الرسوم */
.legend, .legend-label, .legend-text, legend {
    color: #111827 !important;
    font-weight: 700 !important;
    font-size: 13px !important;
}

/* تحسين وضوح عناوين الكروت مثل "أنواع القضايا" */
.card-header h3, .card-header .card-title, .card-title {
    color: #111827 !important;
    font-weight: 800 !important;
    font-size: 17px !important;
}

/* تحسين وضوح أسماء الأنواع تحت الرسوم */
svg text, canvas text {
    fill: #111827 !important;
    font-weight: 700 !important;
    font-size: 13px !important;
}

/* تحسين محاور الرسوم البيانية */
.axis, .axis-line, .grid-line {
    stroke: #4B5563 !important;
    stroke-width: 2px !important;
}

/* تحسين الألوان في الرسوم البيانية */
.chart-bar-active, .bar-active {
    opacity: 1 !important;
}

.chart-bar-inactive, .bar-inactive {
    opacity: 0.9 !important;
}
