/* ========================================
   LogiflowPro Admin - Premium Rich Design
   Dark & Light Theme
   ======================================== */

/* ========================================
   CSS Variables
   ======================================== */
:root,
[data-theme="light"] {
    /* Brand */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --primary-rgb: 79, 70, 229;
    
    /* Accents */
    --success: #059669;
    --success-soft: #d1fae5;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --info: #0891b2;
    --info-soft: #cffafe;
    
    /* Sidebar */
    --sidebar-bg: #1e1b4b;
    --sidebar-bg-2: #312e81;
    --sidebar-text: #c7d2fe;
    --sidebar-text-muted: #818cf8;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(255, 255, 255, 0.12);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    
    /* Layout */
    --body-bg: #f8fafc;
    --content-bg: #ffffff;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    
    /* Text */
    --text-dark: #0f172a;
    --text-base: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* Borders */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
    
    /* Sizes */
    --sidebar-w: 280px;
    --header-h: 70px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

[data-theme="dark"] {
    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --primary-soft: #1e1b4b;
    
    --success: #34d399;
    --success-soft: #064e3b;
    --warning: #fbbf24;
    --warning-soft: #78350f;
    --danger: #f87171;
    --danger-soft: #7f1d1d;
    --info: #22d3ee;
    --info-soft: #164e63;
    
    --sidebar-bg: #0f0d1a;
    --sidebar-bg-2: #1a1625;
    --sidebar-text: #e0e7ff;
    --sidebar-text-muted: #a5b4fc;
    
    --body-bg: #0f172a;
    --content-bg: #1e293b;
    --header-bg: #1e293b;
    --card-bg: #1e293b;
    
    --text-dark: #f8fafc;
    --text-base: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    
    --border: #334155;
    --border-light: #1e293b;
    
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.35), 0 4px 6px -2px rgba(0,0,0,0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.4), 0 10px 10px -5px rgba(0,0,0,0.2);
}

/* ========================================
   Base
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--body-bg);
    color: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body[data-rtl="true"] {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

a { 
    color: inherit; 
    text-decoration: none; 
}

/* ========================================
   Layout
   ======================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin 0.3s ease;
}

[dir="rtl"] .admin-main {
    margin-left: 0;
    margin-right: var(--sidebar-w);
}

/* ========================================
   Sidebar
   ======================================== */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

[dir="rtl"] .admin-sidebar {
    left: auto;
    right: 0;
}

/* Brand */
.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.brand-logo {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.375rem;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.375rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.brand-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sidebar-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 1.5rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--sidebar-hover);
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all 0.2s;
}

[dir="rtl"] .sidebar-close {
    right: auto;
    left: 1rem;
}

.sidebar-close:hover {
    background: var(--sidebar-active);
}

/* Menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 4px;
}

.menu-group {
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.menu-label {
    display: block;
    padding: 0 0.75rem;
    margin-bottom: 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sidebar-text-muted);
}

.menu-list {
    list-style: none;
}

.menu-item {
    margin-bottom: 0.25rem;
}

.menu-item > .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.menu-item > .nav-link:hover {
    background: var(--sidebar-hover);
}

.menu-item.active > .nav-link {
    background: var(--sidebar-active);
    color: #fff;
}

.nav-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-hover);
    border-radius: var(--radius-sm);
    font-size: 1.125rem;
    transition: all 0.2s;
}

.menu-item.active .nav-icon {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

.nav-text {
    flex: 1;
}

.nav-badge {
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, var(--danger) 0%, #f97316 100%);
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
}

.nav-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
    color: var(--sidebar-text-muted);
}

.has-sub.open > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

[dir="rtl"] .nav-arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .has-sub.open > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

/* Submenu */
.sub-menu {
    max-height: 0;
    overflow: hidden;
    list-style: none;
    padding-left: 3.5rem;
    transition: max-height 0.3s ease;
}

[dir="rtl"] .sub-menu {
    padding-left: 0;
    padding-right: 3.5rem;
}

.has-sub.open .sub-menu {
    max-height: 500px;
}

.sub-menu li {
    margin: 0.125rem 0;
}

.sub-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--sidebar-text-muted);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all 0.2s;
}

.sub-menu a::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sidebar-border);
    transition: all 0.2s;
}

[dir="rtl"] .sub-menu a::before {
    left: auto;
    right: -1rem;
}

.sub-menu a:hover,
.sub-menu li.active a {
    color: #fff;
}

.sub-menu li.active a::before,
.sub-menu a:hover::before {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6);
}

/* Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sidebar-border);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--sidebar-hover);
    border-radius: var(--radius);
}

.user-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--sidebar-bg);
    border-radius: 50%;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--sidebar-text-muted);
}

.logout-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* ========================================
   Header
   ======================================== */
.admin-header {
    position: sticky;
    top: 0;
    height: var(--header-h);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
    gap: 1rem;
}

.header-start {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: var(--content-bg);
    border-radius: var(--radius-sm);
    color: var(--text-base);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.header-breadcrumb .breadcrumb {
    font-size: 0.875rem;
}

.header-breadcrumb .breadcrumb-item a {
    color: var(--text-muted);
}

.header-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary);
}

.header-breadcrumb .breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 600;
}

.header-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Search */
.header-search {
    margin-right: 0.5rem;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

[dir="rtl"] .search-box i {
    left: auto;
    right: 1rem;
}

.search-box input {
    width: 100%;
    height: 42px;
    padding: 0 4rem 0 2.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--content-bg);
    color: var(--text-base);
    font-size: 0.875rem;
    transition: all 0.2s;
}

[dir="rtl"] .search-box input {
    padding: 0 2.75rem 0 4rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box kbd {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.2rem 0.5rem;
    background: var(--border-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.6875rem;
    font-family: inherit;
    color: var(--text-muted);
}

[dir="rtl"] .search-box kbd {
    right: auto;
    left: 0.75rem;
}

/* Theme Switch */
.theme-switch {
    position: relative;
}

.theme-input {
    opacity: 0;
    position: absolute;
}

.theme-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 64px;
    height: 34px;
    padding: 0 6px;
    background: var(--border-light);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.theme-label i {
    font-size: 0.875rem;
    z-index: 1;
    transition: color 0.3s;
}

.sun-icon { color: var(--warning); }
.moon-icon { color: var(--text-muted); }

.toggle-ball {
    position: absolute;
    left: 4px;
    width: 26px;
    height: 26px;
    background: var(--content-bg);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

.theme-input:checked + .theme-label {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.theme-input:checked + .theme-label .toggle-ball {
    transform: translateX(30px);
}

.theme-input:checked + .theme-label .sun-icon {
    color: var(--text-muted);
}

.theme-input:checked + .theme-label .moon-icon {
    color: var(--primary);
}

/* Header Buttons */
.header-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: var(--content-bg);
    border-radius: var(--radius-sm);
    color: var(--text-base);
    font-size: 1.125rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border: 2px solid var(--content-bg);
    border-radius: 50%;
}

/* Profile Button */
.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem;
    padding-right: 0.875rem;
    border: 1px solid var(--border);
    background: var(--content-bg);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

[dir="rtl"] .profile-btn {
    padding-right: 0.375rem;
    padding-left: 0.875rem;
}

.profile-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.profile-btn .profile-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.profile-btn .profile-info {
    text-align: left;
}

[dir="rtl"] .profile-btn .profile-info {
    text-align: right;
}

.profile-btn .profile-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
}

.profile-btn .profile-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-btn i {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   Dropdowns
   ======================================== */
.dropdown-rich {
    min-width: 220px;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    margin-top: 0.5rem;
}

.dropdown-header-custom {
    padding: 0.625rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dropdown-rich .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-base);
    transition: all 0.15s;
}

.dropdown-rich .dropdown-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.dropdown-rich .dropdown-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 500;
}

.dropdown-rich .dropdown-item i {
    font-size: 1rem;
    width: 20px;
}

.dropdown-rich .dropdown-item.text-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.dropdown-rich .dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border);
}

.flag { font-size: 1.25rem; }

/* Profile Dropdown */
.dropdown-profile {
    width: 260px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 100%);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.profile-header .profile-avatar-lg {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
}

.profile-header h6 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-dark);
}

.profile-header p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Notifications Dropdown */
.dropdown-notifications {
    width: 360px;
    padding: 0;
}

.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.notification-head h6 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-dark);
}

.badge-count {
    padding: 0.25rem 0.625rem;
    background: var(--primary);
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--primary-soft);
}

.notification-item.unread {
    background: rgba(var(--primary-rgb), 0.04);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notif-icon.success { background: var(--success-soft); color: var(--success); }
.notif-icon.warning { background: var(--warning-soft); color: var(--warning); }
.notif-icon.info { background: var(--info-soft); color: var(--info); }
.notif-icon.danger { background: var(--danger-soft); color: var(--danger); }

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-content p {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.notif-content span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-empty {
    padding: 2rem;
    text-align: center;
}

.notification-empty i {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.notification-empty p {
    margin: 0;
    color: var(--text-muted);
}

.notification-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: var(--border-light);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    transition: background 0.2s;
}

.notification-footer:hover {
    background: var(--primary-soft);
}

/* ========================================
   Content
   ======================================== */
.admin-content {
    flex: 1;
    padding: 1.5rem;
}

/* Alerts */
.alert-custom {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.alert-custom.alert-success {
    background: var(--success-soft);
    color: var(--success);
}

.alert-custom.alert-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.alert-custom.alert-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.alert-custom.alert-info {
    background: var(--info-soft);
    color: var(--info);
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-text {
    flex: 1;
}

.alert-text strong {
    display: block;
    margin-bottom: 0.125rem;
}

.alert-text span,
.alert-text ul {
    font-size: 0.875rem;
    opacity: 0.9;
}

.alert-custom .btn-close {
    filter: none;
    opacity: 0.6;
}

.alert-custom .btn-close:hover {
    opacity: 1;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1.25rem 1.5rem;
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--border-light);
    border-top: 1px solid var(--border);
}

/* ========================================
   Tables
   ======================================== */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-base);
}

.table thead th {
    padding: 0.875rem 1rem;
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--primary-soft);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.625rem 1.25rem;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.35);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

/* ========================================
   Forms
   ======================================== */
.form-control,
.form-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--content-bg);
    color: var(--text-base);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
}

.badge.bg-primary { background: var(--primary-soft) !important; color: var(--primary); }
.badge.bg-success { background: var(--success-soft) !important; color: var(--success); }
.badge.bg-warning { background: var(--warning-soft) !important; color: var(--warning); }
.badge.bg-danger { background: var(--danger-soft) !important; color: var(--danger); }
.badge.bg-info { background: var(--info-soft) !important; color: var(--info); }

/* ========================================
   Stats Cards
   ======================================== */
.stats-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stats-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stats-icon.primary { background: var(--primary-soft); color: var(--primary); }
.stats-icon.success { background: var(--success-soft); color: var(--success); }
.stats-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stats-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stats-icon.info { background: var(--info-soft); color: var(--info); }

.stats-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
}

.stats-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ========================================
   Sidebar Backdrop
   ======================================== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-backdrop.show {
    display: block;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1199.98px) {
    .search-box { width: 220px; }
}

@media (max-width: 991.98px) {
    .admin-main {
        margin-left: 0;
    }
    
    [dir="rtl"] .admin-main {
        margin-right: 0;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    [dir="rtl"] .admin-sidebar {
        transform: translateX(100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .header-search { display: none !important; }
    
    .admin-content { padding: 1rem; }
    
    .dropdown-notifications { width: 300px; }
    
    .header-inner { padding: 0 1rem; }
}

@media (max-width: 575.98px) {
    .header-btn,
    .menu-toggle {
        width: 38px;
        height: 38px;
    }
    
    .profile-btn { padding: 0.25rem; }
    
    .profile-btn .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .dropdown-notifications {
        width: 280px;
        right: -40px !important;
    }
    
    .theme-label {
        width: 54px;
        height: 30px;
    }
    
    .toggle-ball {
        width: 22px;
        height: 22px;
    }
    
    .theme-input:checked + .theme-label .toggle-ball {
        transform: translateX(24px);
    }
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ========================================
   Print
   ======================================== */
@media print {
    .admin-sidebar,
    .admin-header,
    .sidebar-backdrop {
        display: none !important;
    }
    
    .admin-main {
        margin: 0 !important;
    }
}