/* ═══════════════════════════════════════════════════════════════════════════
   GYM MANAGEMENT SYSTEM - UNIFIED PROFESSIONAL STYLES
   Modern, Responsive, RTL Support, Dark/Light Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Variables - Dark Theme (Default) ─── */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --bg-sidebar: #0f0f0f;
    
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #888888;
    
    --accent: #D4AF37;
    --accent-hover: #e5c349;
    --accent-dark: #b8962e;
    
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --border-color: #2a2a2a;
    --border-light: #333333;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --topbar-height: 64px;
    --radius: 10px;
    --radius-lg: 14px;
    
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Tajawal', 'Almarai', sans-serif;
}

/* ─── Light Theme ─── */
body.light-theme {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f0;
    --bg-sidebar: #ffffff;

    --text-primary: #1a1a1a;
    --text-secondary: #333333;
    --text-muted: #666666;
    
    --border-color: #e0e0e0;
    --border-light: #d0d0d0;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
}

/* ─── Light Theme Sidebar Specific Styles ─── */
body.light-theme .sidebar {
    background: var(--bg-sidebar);
    border-left-color: var(--border-color);
}

body.light-theme .sidebar-header {
    border-bottom-color: var(--border-color);
}

body.light-theme .sidebar .admin-info p {
    color: var(--text-secondary);
}

body.light-theme .sidebar-nav a {
    color: var(--text-muted);
}

body.light-theme .sidebar-nav a:hover,
body.light-theme .sidebar-nav li.active a {
    background: rgba(212, 175, 55, 0.15);
    color: var(--text-primary);
}

body.light-theme .sidebar-nav li.active a {
    background: var(--accent);
    color: #000;
}

body.light-theme .sidebar-group {
    border-top-color: var(--border-color);
}

body.light-theme .sidebar-accordion {
    background: var(--bg-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.light-theme .sidebar-footer {
    border-top-color: var(--border-color);
}

body.light-theme .sidebar-footer a {
    color: var(--text-muted);
}

body.light-theme .sidebar-footer a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ─── App Layout ─── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition), width var(--transition);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .admin-info p,
.sidebar.collapsed .admin-info small,
.sidebar.collapsed .gym-logo h1 {
    display: none;
}

.sidebar.collapsed .gym-logo { justify-content: center; }
.sidebar.collapsed .admin-avatar { margin: 0 auto; }
.sidebar.collapsed .sidebar-nav a { justify-content: center; padding: 14px; }
.sidebar.collapsed .sidebar-nav a i { margin: 0; font-size: 20px; }

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.gym-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.gym-logo i {
    font-size: 28px;
    color: var(--accent);
}

.gym-logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.admin-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.admin-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.admin-avatar i { color: #000; font-size: 20px; }
.admin-info p { color: var(--text-secondary); font-size: 0.9rem; margin: 0; }
.admin-info p span { color: var(--accent); font-weight: 600; }
.admin-info small { color: var(--accent); font-size: 0.75rem; margin-top: 4px; }

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav ul { display: flex; flex-direction: column; gap: 4px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
    background: rgba(212, 175, 55, 0.15);
    color: var(--text-primary);
}

.sidebar-nav li.active a { background: var(--accent); color: #000; }
.sidebar-nav li.active a i { color: #000; }

.sidebar-group {
    margin: 12px 0 4px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.sidebar-accordion {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: all var(--transition);
}

.sidebar-accordion:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent);
}

.accordion-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.accordion-caret {
    transition: transform var(--transition);
}
.sidebar-accordion.open .accordion-caret { transform: rotate(180deg); }

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.sidebar-footer a i { width: 18px; text-align: center; }
.sidebar-footer a:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-footer .logout-btn:hover { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-primary);
    transition: margin var(--transition);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
    box-sizing: border-box;
}

.sidebar.collapsed ~ .main-content,
.main-content.expanded {
    margin-right: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
    max-width: calc(100% - var(--sidebar-collapsed));
}

/* ─── LTR Sidebar & Main Content ─── */
[dir="ltr"] .sidebar {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border-color);
}

[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
}

[dir="ltr"] .sidebar.collapsed ~ .main-content,
[dir="ltr"] .main-content.expanded {
    margin-right: 0;
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
    max-width: calc(100% - var(--sidebar-collapsed));
}

/* ─── Topbar ─── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-card);
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1200;
    flex-wrap: wrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-right h2 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.topbar-right h2 i { color: var(--accent); }

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Toggle Button */
.toggle-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}

.toggle-sidebar-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Language Switch */
.lang-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.lang-switch:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.lang-switch span {
    display: inline-block;
}

/* ─── Notifications ─── */
.notifications { 
    position: relative; 
    z-index: 1500;
}

.notif-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}

.notif-btn:hover { background: var(--bg-card); }

.notif-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

[dir="ltr"] .notif-badge {
    left: auto;
    right: -4px;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    width: 340px;
    min-width: 300px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1500;
}

/* RTL positioning (Arabic) */
[dir="rtl"] .notif-dropdown {
    right: 0;
    left: auto;
}

/* LTR positioning (English) */
[dir="ltr"] .notif-dropdown {
    right: auto;
    left: 0;
}

.notif-dropdown.open { display: block; animation: fadeIn 0.2s ease; }

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
}

.notif-item:hover { background: var(--bg-hover); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(212, 175, 55, 0.1); border-right: 3px solid var(--accent); }
[dir="ltr"] .notif-item.unread { border-right: none; border-left: 3px solid var(--accent); }
.notif-item strong { display: block; font-size: 0.9rem; margin-bottom: 4px; }
.notif-item p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.notif-item small { font-size: 0.75rem; color: var(--text-muted); }

.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notifications-list {
    max-height: 520px;
    overflow-y: auto;
    padding: 8px 4px;
}

.list-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border var(--transition), box-shadow var(--transition);
}

.list-item.unread {
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.list-item-subtitle { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.list-item-meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; color: var(--text-muted); font-size: 0.85rem; }
.list-item-action { flex-shrink: 0; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Page Content ─── */
.page-content {
    padding: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ─── Cards Grid ─── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* LTR Cards Grid Fix */
[dir="ltr"] .cards-grid {
    direction: ltr;
}

[dir="ltr"] .cards-grid > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* ─── Stat Card ─── */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

[dir="ltr"] .stat-card::before {
    right: auto;
    left: 0;
}

.stat-card.danger::before { background: var(--danger); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }

.stat-card-icon {
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-card-icon i { font-size: 22px; color: var(--accent); }
.stat-card.danger .stat-card-icon { background: rgba(239, 68, 68, 0.15); }
.stat-card.danger .stat-card-icon i { color: var(--danger); }
.stat-card.success .stat-card-icon { background: rgba(34, 197, 94, 0.15); }
.stat-card.success .stat-card-icon i { color: var(--success); }

.stat-card-title { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }
.stat-card-value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.stat-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}
.stat-card-link:hover { gap: 10px; }

/* ─── Content Card ─── */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.content-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.content-card-header h3 i { color: var(--accent); }

.content-card-body { 
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

/* LTR Content Card Fix */
[dir="ltr"] .content-card {
    text-align: left;
}

[dir="ltr"] .content-card-header {
    flex-direction: row;
}

[dir="ltr"] .content-card-header h3 {
    text-align: left;
}

[dir="ltr"] .content-card-header h3 i {
    margin-right: 8px;
    margin-left: 0;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #000;
}
.btn-primary:hover { box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4); }

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-card); border-color: var(--accent); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Tables ─── */
.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    min-width: max-content;
}

.table-wrapper th,
.table-wrapper td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

[dir="ltr"] .table-wrapper {
    direction: ltr;
}

[dir="ltr"] .table-wrapper table {
    direction: ltr;
}

[dir="ltr"] .table-wrapper th,
[dir="ltr"] .table-wrapper td {
    text-align: left;
}

.table-wrapper th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-wrapper tbody tr { transition: background var(--transition); }
.table-wrapper tbody tr:hover { background: var(--bg-hover); }
.table-wrapper tbody tr:last-child td { border-bottom: none; }

/* ─── Forms ─── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

[dir="ltr"] .form-grid {
    direction: ltr;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

[dir="ltr"] .form-group {
    text-align: left;
}

[dir="ltr"] .form-group label {
    text-align: left;
}

[dir="ltr"] .form-group label i {
    margin-right: 6px;
    margin-left: 0;
}

.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-control::placeholder { color: var(--text-muted); opacity: 0.6; }

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 36px;
}

[dir="ltr"] select.form-control {
    background-position: right 14px center;
    padding-left: 14px;
    padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

/* ─── Search & Filters ─── */
.filters-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filters-bar .form-control { flex: 1; min-width: 200px; }

/* ─── Alerts ─── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success { background: rgba(34, 197, 94, 0.15); border: 1px solid var(--success); color: var(--success); }
.alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--danger); color: var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--warning); color: var(--warning); }
.alert-info { background: rgba(59, 130, 246, 0.15); border: 1px solid var(--info); color: var(--info); }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-primary { background: rgba(212, 175, 55, 0.15); color: var(--accent); }

/* ─── Quick Actions ─── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.quick-actions .btn {
    padding: 16px;
    flex-direction: column;
    gap: 8px;
}

.quick-actions .btn i { font-size: 20px; }

/* ─── Image Container ─── */
.image-banner {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/7;
    max-height: 350px;
}

.image-banner img { width: 100%; height: 100%; object-fit: cover; }

.image-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}

.image-banner-overlay h4 { font-size: 1.5rem; color: var(--accent); margin-bottom: 8px; }
.image-banner-overlay p { color: rgba(255,255,255,0.8); margin-bottom: 16px; }

/* ─── Pagination ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.pagination a:hover { background: var(--bg-hover); border-color: var(--accent); }
.pagination a.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 64px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h4 { margin-bottom: 8px; color: var(--text-primary); }

/* ─── Loading ─── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Mobile Overlay ─── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ─── Responsive Design ─── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.open { transform: translateX(0); }
    
    .main-content { margin-right: 0; }
    
    .toggle-sidebar-btn { display: flex; }
    
    /* LTR Mobile Sidebar */
    [dir="ltr"] .sidebar {
        transform: translateX(-100%);
    }
    
    [dir="ltr"] .sidebar.open { transform: translateX(0); }
    
    [dir="ltr"] .main-content { margin-left: 0; }
}

@media (max-width: 768px) {
    .page-content { padding: 16px; }
    
    .topbar { padding: 12px 16px; }
    
    .cards-grid { grid-template-columns: 1fr; }
    
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    
    .table-wrapper { overflow-x: auto; }
    .table-wrapper table { min-width: 600px; }
    
    .notif-dropdown { 
        width: calc(100vw - 32px); 
        max-height: 320px;
    }
    
    /* Mobile RTL positioning */
    [dir="rtl"] .notif-dropdown {
        right: 16px !important;
        left: auto !important;
    }
    
    /* Mobile LTR positioning */
    [dir="ltr"] .notif-dropdown {
        left: 16px !important;
        right: auto !important;
    }
    
    .form-grid { grid-template-columns: 1fr; }
    
    .filters-bar { flex-direction: column; }
    .filters-bar .form-control { width: 100%; }
}

@media (max-width: 480px) {
    .page-content { padding: 12px; }
    
    .stat-card { padding: 16px; }
    .stat-card-value { font-size: 1.5rem; }
    
    .btn { padding: 10px 14px; font-size: 0.85rem; }
    
    .quick-actions { grid-template-columns: 1fr; }
    .quick-actions .btn { flex-direction: row; }
    
    .image-banner { aspect-ratio: 16/9; }
    .image-banner-overlay { padding: 16px; }
    .image-banner-overlay h4 { font-size: 1.2rem; }
}

/* ─── Print Styles ─── */
@media print {
    .sidebar, .topbar, .btn, .quick-actions, .toggle-sidebar-btn { display: none !important; }
    .main-content { margin: 0; }
    .page-content { padding: 0; }
}

/* ─── Utilities ─── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.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; }
.hidden { display: none !important; }

/* ─── Enhanced Notifications ─── */
.notifications-wrapper {
    position: relative;
}

.notif-dropdown.enhanced {
    width: 380px;
    max-height: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1500;
}

/* Enhanced dropdown positioning for RTL/LTR */
[dir="rtl"] .notif-dropdown.enhanced {
    right: 0;
    left: auto;
}

[dir="ltr"] .notif-dropdown.enhanced {
    right: auto;
    left: 0;
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.notif-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-header h4 i {
    color: var(--accent);
}

.notif-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
}

.mark-all-read-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.mark-all-read-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.notif-body {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px 0;
}

.notif-body::-webkit-scrollbar {
    width: 6px;
}

.notif-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.notif-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.notif-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition);
    position: relative;
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item.unread {
    background: rgba(212, 175, 55, 0.08);
    border-right: 3px solid var(--accent);
}

.notif-icon {
    width: 36px;
    height: 36px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon i {
    color: var(--accent);
    font-size: 14px;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.notif-body-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notif-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.unread-indicator {
    color: var(--accent);
    font-size: 8px;
}

.mark-read-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mark-read-btn:hover {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.notif-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.notif-empty h5 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.notif-empty p {
    font-size: 0.85rem;
    margin: 0;
}

.notif-footer {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.view-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.view-all-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* ─── Notification Toasts ─── */
.notification-toasts {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 350px;
}

[dir="ltr"] .notification-toasts {
    right: auto;
    left: 20px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

.toast.success::before { background: var(--success); }
.toast.error::before { background: var(--danger); }
.toast.warning::before { background: var(--warning); }

.toast-icon {
    width: 32px;
    height: 32px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon i {
    color: var(--accent);
    font-size: 14px;
}

.toast.success .toast-icon {
    background: rgba(34, 197, 94, 0.15);
}

.toast.success .toast-icon i {
    color: var(--success);
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
}

.toast.error .toast-icon i {
    color: var(--danger);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-body {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─── Enhanced Sidebar Scrolling ─── */
.sidebar {
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Smooth scrolling behavior */
.sidebar-nav {
    scroll-behavior: smooth;
}

/* Enhanced hover effects for sidebar items */
.sidebar-nav a {
    position: relative;
    overflow: hidden;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: right 0.5s ease;
}

.sidebar-nav a:hover::before {
    right: 100%;
}

/* Active item enhancement */
.sidebar-nav li.active a {
    position: relative;
    overflow: hidden;
}

.sidebar-nav li.active a::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: #000;
    border-radius: 0 3px 3px 0;
}

/* Mobile enhancements */
@media (max-width: 768px) {
    .notification-toasts {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notif-dropdown.enhanced {
        width: calc(100vw - 20px);
        max-width: 380px;
    }
    
    /* Enhanced mobile positioning */
    [dir="rtl"] .notif-dropdown.enhanced {
        right: 10px !important;
        left: auto !important;
    }
    
    [dir="ltr"] .notif-dropdown.enhanced {
        left: 10px !important;
        right: auto !important;
    }
    
    .toast {
        padding: 12px;
    }
}

/* ─── Notification Animation Utilities ─── */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ─── Notification Badge Pulse Animation ─── */
.notif-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ─── Enhanced Focus States ─── */
.notif-btn:focus,
.mark-all-read-btn:focus,
.mark-read-btn:focus,
.view-all-btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/* ─── Integrated Sidebar Notifications ─── */
.sidebar-notifications {
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.sidebar-section-header {
    margin-bottom: 8px;
}

.sidebar-accordion {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: all var(--transition);
    cursor: pointer;
}

.sidebar-accordion:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent);
}

.accordion-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.accordion-label i {
    color: var(--accent);
    width: 16px;
    text-align: center;
}

.sidebar-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.accordion-caret {
    transition: transform var(--transition);
    color: var(--text-muted);
    font-size: 12px;
}

.sidebar-accordion.open .accordion-caret {
    transform: rotate(180deg);
}

.sidebar-notifications-list {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 0 4px;
}

.sidebar-notifications-list.open {
    display: flex;
}

.sidebar-notifications-list::-webkit-scrollbar {
    width: 4px;
}

.sidebar-notifications-list::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-notifications-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.sidebar-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
}

.sidebar-notification-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.sidebar-notification-item.unread {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--accent);
}

.notification-icon {
    width: 24px;
    height: 24px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-icon i {
    color: var(--accent);
    font-size: 10px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-body {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.unread-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 8px;
}

.sidebar-notifications-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.view-all-notifications,
.mark-all-read-sidebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.view-all-notifications:hover,
.mark-all-read-sidebar:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.view-all-notifications i,
.mark-all-read-sidebar i {
    font-size: 10px;
}

.sidebar-notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 10px;
    text-align: center;
    color: var(--text-muted);
}

.sidebar-notification-empty i {
    font-size: 24px;
    opacity: 0.5;
}

.sidebar-notification-empty span {
    font-size: 0.8rem;
}

/* ─── Collapsed Sidebar Notifications ─── */
.sidebar.collapsed .sidebar-notifications {
    display: none;
}

.sidebar.collapsed .sidebar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 10;
}

/* ─── Mobile Responsive ─── */
@media (max-width: 768px) {
    .sidebar-notifications-list {
        max-height: 200px;
    }
    
    .sidebar-notification-item {
        padding: 6px 8px;
    }
    
    .notification-title {
        font-size: 0.75rem;
    }
    
    .notification-body {
        font-size: 0.7rem;
    }
    
    .notification-time {
        font-size: 0.65rem;
    }
}

/* ─── Animation for new notifications ─── */
@keyframes notificationPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.sidebar-notification-item.new-notification {
    animation: notificationPulse 0.5s ease;
}

/* ─── Notification badge pulse ─── */
.sidebar-badge {
    animation: pulse 2s infinite;
}

/* ─── Smooth transitions ─── */
.sidebar-notifications-list {
    transition: all var(--transition);
}

.sidebar-notification-item {
    transition: all var(--transition);
}
/* ─── Inline Notifications (Next to Page Title) ─── */
.notifications-inline {
    margin-left: 16px;
    margin-right: 16px;
    position: relative;
    z-index: 1500;
}

[dir="rtl"] .notifications-inline {
    margin-left: 16px;
    margin-right: 0;
}

[dir="ltr"] .notifications-inline {
    margin-right: 16px;
    margin-left: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.topbar-right h2 {
    margin: 0;
    flex-shrink: 0;
}

/* Adjust notification dropdown positioning for inline notifications */
.notifications-inline .notif-dropdown {
    top: calc(100% + 12px);
}

/* RTL positioning for inline notifications */
[dir="rtl"] .notifications-inline .notif-dropdown {
    right: 0;
    left: auto;
}

/* LTR positioning for inline notifications */
[dir="ltr"] .notifications-inline .notif-dropdown {
    left: 0;
    right: auto;
}

/* Mobile adjustments for inline notifications */
@media (max-width: 768px) {
    .notifications-inline {
        margin-left: 8px;
        margin-right: 8px;
    }
    
    .topbar-right {
        gap: 8px;
    }
    
    .topbar-right h2 {
        font-size: 1rem;
    }
    
    .notifications-inline .notif-dropdown {
        width: calc(100vw - 20px);
        max-width: 320px;
    }
}

/* Ensure proper spacing in topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-card);
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1200;
    flex-wrap: nowrap;
}

@media (max-width: 480px) {
    .topbar {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .notifications-inline {
        margin-left: 4px;
        margin-right: 4px;
    }
}
/* ─── Fix Notification Dropdown Layering ─── */
.notif-dropdown {
    position: absolute !important;
    z-index: 1500 !important;
}

.notif-dropdown.enhanced {
    z-index: 1500 !important;
}

.notifications-inline .notif-dropdown {
    z-index: 1500 !important;
}

/* Ensure notifications appear above sidebar */
.notifications,
.notifications-inline {
    z-index: 1500 !important;
}

/* Force notification dropdown to be on top */
.notif-dropdown.open {
    z-index: 1500 !important;
    position: absolute !important;
}

/* Additional layering fixes */
.topbar .notifications {
    z-index: 1500 !important;
}

.topbar .notifications .notif-dropdown {
    z-index: 1500 !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Sidebar Dropdown/Accordion Fix
   ═══════════════════════════════════════════════════════════════════════ */

/* Sidebar Group Styling */
.sidebar-group {
    margin: 4px 0;
}

/* Accordion Button Styling */
.sidebar-accordion {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    outline: none;
}

.sidebar-accordion:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent);
    color: var(--text-primary);
}

.sidebar-accordion.open {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* Accordion Label */
.accordion-label {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.accordion-label i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Accordion Caret */
.accordion-caret {
    transition: transform var(--transition);
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.sidebar-accordion.open .accordion-caret {
    transform: rotate(180deg);
    color: var(--accent);
}

/* Submenu Styling */
.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-left: 8px;
    border-left: 2px solid rgba(212, 175, 55, 0.2);
}

.sidebar-submenu.open {
    display: flex;
}

.sidebar-submenu li {
    margin: 0;
}

.sidebar-submenu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 400;
    transition: all var(--transition);
    margin-left: 16px;
}

.sidebar-submenu a:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--text-primary);
}

.sidebar-submenu a i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.sidebar-submenu li.active a {
    background: var(--accent);
    color: #000;
    font-weight: 600;
}

/* RTL Support */
[dir="rtl"] .sidebar-submenu {
    padding-left: 0;
    padding-right: 8px;
    border-left: none;
    border-right: 2px solid rgba(212, 175, 55, 0.2);
}

[dir="rtl"] .sidebar-submenu a {
    margin-left: 0;
    margin-right: 16px;
}

/* Collapsed Sidebar */
.sidebar.collapsed .sidebar-accordion .sidebar-text {
    display: none;
}

.sidebar.collapsed .accordion-caret {
    display: none;
}

.sidebar.collapsed .sidebar-submenu {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar-accordion {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .sidebar-submenu a {
        padding: 8px 12px;
        font-size: 0.8rem;
        margin-left: 12px;
    }
    
    [dir="rtl"] .sidebar-submenu a {
        margin-left: 0;
        margin-right: 12px;
    }
}

/* Animation for smooth opening/closing */
.sidebar-submenu {
    overflow: hidden;
    transition: all 0.3s ease;
    max-height: 0;
}

.sidebar-submenu.open {
    max-height: 500px;
}