/* ============================================
   EDUGEST PRO — MAIN STYLESHEET
   ============================================ */

:root {
  --primary: #4361ee;
  --primary-dark: #2d4bcc;
  --primary-light: #eef0fd;
  --secondary: #7209b7;
  --accent: #f72585;
  --success: #2ec4b6;
  --warning: #ff9f1c;
  --danger: #e63946;
  --info: #4cc9f0;

  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface2: #f8faff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --sidebar-bg: #1e1b4b;
  --sidebar-text: #c7d2fe;
  --sidebar-hover: rgba(99,102,241,0.2);
  --sidebar-active: #4361ee;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;

  --topbar-h: 64px;
  --mobile-nav-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(67,97,238,0.08);
  --shadow-lg: 0 8px 40px rgba(67,97,238,0.15);
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface2: #16213e;
  --border: #2d2d4e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============ LOGIN PAGE ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
}
.login-bg {
  position: absolute; inset: 0; overflow: hidden;
}
.shape {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.3;
}
.shape-1 { width: 500px; height: 500px; background: #7c3aed; top: -100px; right: -100px; }
.shape-2 { width: 400px; height: 400px; background: #2563eb; bottom: -80px; left: -80px; }
.shape-3 { width: 300px; height: 300px; background: #f72585; top: 50%; left: 50%; transform: translate(-50%,-50%); }

.login-container {
  position: relative; z-index: 10;
  width: 100%; max-width: 440px;
  padding: 20px;
  animation: fadeInUp 0.6s ease;
}
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(30px); }
  to { opacity:1; transform: translateY(0); }
}
.login-logo { text-align: center; margin-bottom: 32px; color: white; }
.logo-icon {
  width: 72px; height: 72px; background: linear-gradient(135deg,#7c3aed,#4361ee);
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 32px; color: white;
  box-shadow: 0 10px 30px rgba(124,58,237,0.4);
}
.login-logo h1 { font-family: 'Poppins', sans-serif; font-size: 32px; font-weight: 800; }
.login-logo h1 span { color: #f72585; }
.login-logo p { opacity: 0.7; margin-top: 4px; }

.login-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
[data-theme="dark"] .login-card { background: rgba(30,27,75,0.95); }
.login-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 24px; color: var(--text); }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 8px;
}
.form-group label i { margin-right: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text);
  background: var(--surface2);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.15);
}
.input-password { position: relative; }
.input-password input { padding-right: 46px; }
.btn-toggle-pwd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px;
}

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; transition: all var(--transition); cursor: pointer; border: none; }
.btn i { font-size: 13px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(67,97,238,0.4); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 2px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { opacity: 0.9; }
.btn-info { background: var(--info); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn-outline-primary { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }

.btn-login { padding: 14px; font-size: 16px; letter-spacing: 0.5px; margin-top: 8px; }

.login-demo { margin-top: 20px; text-align: center; }
.login-demo p { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.demo-accounts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.demo-accounts button {
  padding: 6px 14px; font-size: 12px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary); font-weight: 600;
  transition: all var(--transition);
}
.demo-accounts button:hover { background: var(--primary); color: white; }

/* ============ ALERTS ============ */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; font-weight: 500; }
.alert-danger { background: #fff0f0; color: var(--danger); border: 1px solid #ffd0d0; }
.alert-success { background: #f0fdf9; color: var(--success); border: 1px solid #b3eed8; }
.alert-warning { background: #fff9f0; color: var(--warning); border: 1px solid #ffe0a0; }
.alert-info { background: #f0faff; color: var(--info); border: 1px solid #b3e6fa; }

/* ============ MAIN APP LAYOUT ============ */
.main-app {
  display: flex; min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .sidebar-footer .school-year-badge span,
.sidebar.collapsed .btn-logout span { display: none; }
.sidebar.collapsed .sidebar-user { padding: 12px; justify-content: center; }
.sidebar.collapsed .nav-item a { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-group-title { display: none; }

.sidebar-header {
  padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon-sm {
  width: 36px; height: 36px; background: linear-gradient(135deg,#7c3aed,#4361ee);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white; flex-shrink: 0;
}
.sidebar-logo-text { display: flex; flex-direction: column; }
.logo-name { font-family: 'Poppins', sans-serif; font-weight: 800; color: white; font-size: 16px; line-height: 1; }
.logo-pro { font-size: 10px; color: #f72585; font-weight: 700; letter-spacing: 2px; }
.sidebar-toggle {
  color: var(--sidebar-text); font-size: 16px; padding: 6px;
  border-radius: 6px; transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--sidebar-hover); }

.sidebar-user {
  padding: 16px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.user-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg,var(--primary),var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: white; flex-shrink: 0;
}
.user-avatar-sm {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg,var(--primary),var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white; flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-name { display: block; color: white; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-role {
  display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: rgba(99,102,241,0.3); color: #a5b4fc; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-group { margin-bottom: 8px; }
.nav-group-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3); padding: 8px 8px 4px;
  text-transform: uppercase;
}
.nav-item a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-text); font-size: 13px; font-weight: 500;
  transition: all var(--transition); position: relative;
}
.nav-item a:hover { background: var(--sidebar-hover); color: white; }
.nav-item a.active {
  background: var(--sidebar-active);
  color: white;
  box-shadow: 0 4px 15px rgba(67,97,238,0.4);
}
.nav-item a i { width: 20px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-arrow { font-size: 10px; transition: transform var(--transition); }
.nav-item.open .nav-arrow { transform: rotate(90deg); }
.nav-submenu {
  padding-left: 32px; overflow: hidden;
  max-height: 0; transition: max-height 0.3s ease;
}
.nav-submenu.open { max-height: 500px; }
.nav-submenu a { padding: 8px 12px; font-size: 12px; }
.nav-badge {
  background: var(--accent); color: white; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.school-year-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--sidebar-text); margin-bottom: 10px;
  background: rgba(255,255,255,0.05); padding: 8px 12px; border-radius: 8px;
}
.btn-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px; border-radius: 10px;
  color: #f87171; font-size: 13px; font-weight: 500;
  transition: background var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,0.15); }

/* ============ CONTENT WRAPPER ============ */
.content-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.sidebar.collapsed ~ .content-wrapper { margin-left: var(--sidebar-collapsed); }

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 90;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.btn-menu-toggle { font-size: 20px; color: var(--text-muted); display: none; padding: 8px; }
.breadcrumb { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.breadcrumb i { color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px; min-width: 200px;
}
.topbar-search i { color: var(--text-muted); font-size: 13px; }
.topbar-search input { background: none; border: none; outline: none; font-size: 13px; color: var(--text); width: 100%; }
.topbar-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted); position: relative;
  transition: all var(--transition);
}
.topbar-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.badge-notif {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: white;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all var(--transition); position: relative;
}
.topbar-user:hover { border-color: var(--primary); }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px;
  min-width: 180px; box-shadow: var(--shadow-lg); z-index: 200;
}
.user-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; font-size: 13px;
  transition: background var(--transition);
}
.user-dropdown a:hover { background: var(--bg); }
.user-dropdown a.text-danger { color: var(--danger); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* ============ NOTIFICATIONS PANEL ============ */
.notif-panel {
  position: fixed; top: var(--topbar-h); right: 0;
  width: 340px; background: var(--surface);
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 150;
  max-height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column;
  border-radius: 0 0 0 var(--radius);
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
  from { opacity:0; transform: translateX(20px); }
  to { opacity:1; transform: translateX(0); }
}
.notif-header {
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.notif-header h4 { font-size: 15px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.notif-header button { font-size: 12px; color: var(--primary); font-weight: 600; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; gap: 12px; align-items: flex-start;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg); }
.notif-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.notif-item .notif-text { font-size: 13px; }
.notif-item .notif-text strong { display: block; font-weight: 600; margin-bottom: 2px; }
.notif-item .notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============ PAGE CONTENT ============ */
.page-content { flex: 1; padding: 24px; overflow-y: auto; }

/* ============ PAGE HEADER ============ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.page-title { display: flex; align-items: center; gap: 12px; }
.page-title-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.page-title h2 { font-size: 22px; font-weight: 700; }
.page-title p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ STATS CARDS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.secondary::before { background: var(--secondary); }
.stat-card.info::before { background: var(--info); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-card.primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.success .stat-icon { background: #e6faf8; color: var(--success); }
.stat-card.warning .stat-icon { background: #fff3e0; color: var(--warning); }
.stat-card.danger .stat-icon { background: #fff0f0; color: var(--danger); }
.stat-card.secondary .stat-icon { background: #f3e8ff; color: var(--secondary); }
.stat-card.info .stat-icon { background: #e8f9ff; color: var(--info); }
.stat-body { flex: 1; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-change { font-size: 11px; margin-top: 4px; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============ CARDS ============ */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface2); }

/* ============ GRID ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ============ TABLE ============ */
.table-container { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  background: var(--bg); padding: 12px 14px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table .actions { display: flex; gap: 6px; }

/* ============ BADGES ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #e6faf8; color: var(--success); }
.badge-warning { background: #fff3e0; color: var(--warning); }
.badge-danger { background: #fff0f0; color: var(--danger); }
.badge-secondary { background: #f3e8ff; color: var(--secondary); }
.badge-info { background: #e8f9ff; color: var(--info); }
.badge-gray { background: var(--bg); color: var(--text-muted); }

/* ============ FILTERS BAR ============ */
.filters-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px; background: var(--surface);
  padding: 14px 20px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.filter-group select,
.filter-group input { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); outline: none; }
.filter-group select:focus, .filter-group input:focus { border-color: var(--primary); }
.filter-search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
}
.filter-search i { color: var(--text-muted); font-size: 13px; }
.filter-search input { border: none; background: none; outline: none; font-size: 13px; color: var(--text); width: 100%; }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal {
  background: var(--surface); border-radius: 20px;
  width: 100%; max-width: 560px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.25);
  animation: scaleIn 0.3s cubic-bezier(.34,1.56,.64,1);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }
@keyframes scaleIn {
  from { opacity:0; transform: scale(0.9); }
  to { opacity:1; transform: scale(1); }
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-header h3 i { color: var(--primary); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--danger); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0;
}

/* ============ FORM GRID ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin-bottom: 24px; }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ============ TABS ============ */
.tabs-header {
  display: flex; gap: 4px; border-bottom: 2px solid var(--border);
  margin-bottom: 24px; overflow-x: auto;
}
.tab-btn {
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; white-space: nowrap; transition: all var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============ CHARTS ============ */
.chart-wrapper { position: relative; }
.chart-wrapper canvas { max-width: 100%; }

/* ============ TIMELINE ============ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -20px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--surface); background: var(--primary);
}
.timeline-content { font-size: 13px; }
.timeline-content strong { display: block; font-weight: 600; margin-bottom: 2px; }
.timeline-time { font-size: 11px; color: var(--text-muted); }

/* ============ PROGRESS ============ */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

/* ============ AVATAR GROUP ============ */
.avatar-group { display: flex; }
.avatar-group .user-avatar { margin-left: -8px; border: 2px solid var(--surface); width: 32px; height: 32px; font-size: 12px; }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 56px; opacity: 0.2; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ============ LOADING ============ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ TOAST ============ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); min-width: 280px;
  animation: slideInToast 0.4s cubic-bezier(.34,1.56,.64,1);
  font-size: 13px; font-weight: 500;
}
@keyframes slideInToast {
  from { opacity:0; transform: translateX(100%); }
  to { opacity:1; transform: translateX(0); }
}
.toast.removing { animation: slideOutToast 0.3s ease forwards; }
@keyframes slideOutToast {
  to { opacity:0; transform: translateX(100%); }
}
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }
.toast-close { margin-left: auto; color: var(--text-muted); font-size: 14px; }

/* ============ MOBILE NAV ============ */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--surface); border-top: 1px solid var(--border);
  z-index: 100; box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.mobile-nav-items { display: flex; height: 100%; }
.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-muted); font-size: 10px; font-weight: 600;
  transition: color var(--transition); padding: 8px 4px;
}
.mobile-nav-item i { font-size: 18px; }
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item.active i { animation: popIn 0.3s cubic-bezier(.34,1.56,.64,1); }
@keyframes popIn { from { transform: scale(0.7); } to { transform: scale(1); } }

/* ============ OVERLAY ============ */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 99; display: none;
  backdrop-filter: blur(2px);
}

/* ============ PRINT RECEIPT ============ */
@media print {
  .sidebar, .topbar, .mobile-nav, .notif-panel, .toast-container, .page-header .page-actions, .filters-bar, .btn-print-close { display: none !important; }
  .content-wrapper { margin-left: 0 !important; }
  .receipt { box-shadow: none !important; border: 1px solid #ddd; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .content-wrapper { margin-left: 0 !important; padding-bottom: var(--mobile-nav-h); }
  .mobile-nav { display: flex; }
  .btn-menu-toggle { display: flex; }
  .topbar-search { display: none; }
  .page-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .modal { max-width: 100%; margin: 0; border-radius: 20px 20px 0 0; align-self: flex-end; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 12px; }
}

/* ============ SPECIFIC COMPONENTS ============ */

/* Config card */
.config-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 20px; transition: all var(--transition); cursor: pointer; display: flex; gap: 16px; align-items: flex-start;
}
.config-card:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.config-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.config-card-body h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.config-card-body p { font-size: 12px; color: var(--text-muted); }

/* Status badge with dot */
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-success { background: var(--success); }
.dot-danger { background: var(--danger); }
.dot-warning { background: var(--warning); }
.dot-info { background: var(--info); }

/* Year card */
.year-card {
  background: var(--surface); border-radius: var(--radius);
  border: 2px solid var(--border); padding: 20px;
  transition: all var(--transition);
}
.year-card.active { border-color: var(--success); }
.year-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.year-card-title { font-size: 16px; font-weight: 700; }
.year-card-body { font-size: 13px; color: var(--text-muted); }
.year-card-footer { margin-top: 16px; display: flex; gap: 8px; }

/* Emploi du temps grid */
.schedule-grid { overflow-x: auto; }
.schedule-table { border-collapse: collapse; min-width: 700px; width: 100%; }
.schedule-table th { background: var(--primary); color: white; padding: 10px 12px; font-size: 12px; font-weight: 700; text-align: center; }
.schedule-table td { border: 1px solid var(--border); padding: 0; vertical-align: top; min-width: 100px; height: 60px; }
.schedule-table .time-col { background: var(--bg); font-size: 11px; font-weight: 700; color: var(--text-muted); text-align: center; padding: 8px; width: 70px; }
.schedule-slot {
  padding: 6px 8px; height: 100%; font-size: 11px; line-height: 1.4;
  border-radius: 4px; margin: 2px; display: flex; flex-direction: column; justify-content: center;
}
.slot-maths { background: #dbeafe; color: #1e40af; }
.slot-francais { background: #dcfce7; color: #166534; }
.slot-sciences { background: #fef9c3; color: #854d0e; }
.slot-histoire { background: #fce7f3; color: #9d174d; }
.slot-sport { background: #ffedd5; color: #9a3412; }
.slot-vide { background: transparent; }

/* Receipt */
.receipt {
  background: white; max-width: 400px; margin: 0 auto;
  padding: 32px; border-radius: 16px; box-shadow: var(--shadow-lg);
  font-family: 'Inter', monospace;
}
.receipt-header { text-align: center; border-bottom: 2px dashed #ddd; padding-bottom: 20px; margin-bottom: 20px; }
.receipt-logo { font-size: 28px; font-weight: 800; color: var(--primary); font-family: 'Poppins', sans-serif; }
.receipt-logo span { color: var(--accent); }
.receipt-school { font-size: 12px; color: #666; margin-top: 4px; }
.receipt-title { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 8px; text-transform: uppercase; letter-spacing: 1px; }
.receipt-num { font-size: 12px; color: #999; margin-top: 4px; }
.receipt-body { font-size: 13px; }
.receipt-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.receipt-row:last-child { border: none; }
.receipt-row.total { font-weight: 800; font-size: 15px; border-top: 2px dashed #ddd; padding-top: 12px; color: var(--primary); }
.receipt-footer { text-align: center; margin-top: 20px; padding-top: 20px; border-top: 2px dashed #ddd; font-size: 11px; color: #999; }
.receipt-footer .signature { font-size: 12px; color: var(--text); font-weight: 600; margin-top: 32px; }

/* Dashboard widgets */
.widget-list { display: flex; flex-direction: column; gap: 0; }
.widget-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.widget-item:last-child { border: none; }
.widget-item-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.widget-item-body { flex: 1; }
.widget-item-body strong { display: block; font-size: 13px; font-weight: 600; }
.widget-item-body span { font-size: 12px; color: var(--text-muted); }
.widget-item-value { font-size: 13px; font-weight: 700; }

/* Calendar mini */
.mini-calendar { font-size: 13px; }
.mini-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 700; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mini-cal-day-name { font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 4px 0; }
.mini-cal-day { padding: 6px; border-radius: 8px; cursor: pointer; transition: all var(--transition); font-size: 12px; }
.mini-cal-day:hover { background: var(--primary-light); color: var(--primary); }
.mini-cal-day.today { background: var(--primary); color: white; font-weight: 700; }
.mini-cal-day.has-event { position: relative; }
.mini-cal-day.has-event::after { content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.mini-cal-day.other-month { color: var(--text-light); }

/* Attendance */
.attendance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; }
.att-day {
  aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; cursor: pointer; transition: all var(--transition);
}
.att-present { background: #e6faf8; color: var(--success); }
.att-absent { background: #fff0f0; color: var(--danger); }
.att-late { background: #fff3e0; color: var(--warning); }
.att-holiday { background: var(--bg); color: var(--text-muted); }

/* Donut legend */
.chart-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Whatsapp button */
.btn-whatsapp { background: #25d366; color: white; }
.btn-whatsapp:hover { background: #1da851; }
.btn-sms { background: var(--info); color: white; }
.btn-email { background: var(--secondary); color: white; }

/* ============ EMPLOI DU TEMPS ADVANCED ============ */
.edt-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.edt-tab { padding: 10px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-muted); background: var(--surface); border: 2px solid var(--border); transition: all var(--transition); display: flex; align-items: center; gap: 8px; }
.edt-tab:hover { border-color: var(--primary); color: var(--primary); }
.edt-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.schedule-wrapper { overflow-x: auto; }
.schedule-table { border-collapse: collapse; min-width: 600px; width: 100%; }
.schedule-table .time-header { width: 70px; background: var(--bg); padding: 12px 8px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-align: center; border: 1px solid var(--border); }
.schedule-table .day-header { background: var(--primary); color: white; padding: 10px 8px; font-size: 12px; font-weight: 700; text-align: center; border: 1px solid rgba(255,255,255,0.2); min-width: 100px; }
.day-name { font-size: 13px; font-weight: 700; }
.day-hours { font-size: 10px; opacity: 0.75; margin-top: 2px; }
.time-row td { border: 1px solid var(--border); padding: 0; height: 46px; }
.time-row.half-hour td { height: 30px; }
.time-col { background: var(--bg) !important; text-align: center; width: 70px; vertical-align: middle; }
.time-label { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.schedule-cell { vertical-align: top; position: relative; cursor: default; }
.schedule-cell.empty { cursor: pointer; }
.schedule-cell.empty:hover { background: var(--primary-light); }
.empty-slot-hint { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--primary); opacity: 0; font-size: 18px; transition: opacity 0.2s; }
.schedule-cell.empty:hover .empty-slot-hint { opacity: 0.5; }
.schedule-slot { margin: 2px; border-radius: 6px; padding: 4px 8px; font-size: 11px; line-height: 1.3; overflow: hidden; cursor: pointer; transition: all 0.2s; position: relative; }
.schedule-slot:hover { filter: brightness(0.9); }
.slot-matiere { font-weight: 700; font-size: 11px; }
.slot-info { opacity: 0.85; font-size: 10px; margin-top: 2px; }
.slot-salle { opacity: 0.75; font-size: 10px; }
.slot-time { opacity: 0.7; font-size: 10px; }
.slot-actions { position: absolute; top: 2px; right: 2px; }
.slot-delete { background: rgba(0,0,0,0.3); color: white; border-radius: 4px; width: 18px; height: 18px; font-size: 10px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.schedule-slot:hover .slot-delete { opacity: 1; }
.matiere-bars { display: flex; flex-direction: column; gap: 10px; }
.matiere-bar-row { display: flex; align-items: center; gap: 12px; }
.matiere-bar-label { width: 150px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.matiere-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.matiere-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.matiere-bar-value { width: 90px; font-size: 11px; color: var(--text-muted); text-align: right; flex-shrink: 0; }

/* ============ PAIEMENTS ADVANCED ============ */
.type-paiement-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.type-pay-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1.5px solid; background: transparent; }
.chip-amount { background: currentColor; color: white; padding: 1px 6px; border-radius: 10px; font-size: 10px; }
.type-pay-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; border: 1px solid; }
.type-paiement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.type-pay-option { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; transition: all var(--transition); font-size: 12px; font-weight: 600; }
.type-pay-option:hover { border-color: var(--primary); background: var(--primary-light); }
.type-pay-option.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.table-footer { padding: 12px 20px; background: var(--surface2); border-top: 1px solid var(--border); }
.table-footer-content { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }

/* ============ BULLETINS ============ */
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; font-size: 13px; }
.rank-1 { background: #FFD700; color: #7a5900; }
.rank-2 { background: #C0C0C0; color: #555; }
.rank-3 { background: #CD7F32; color: #5a2d00; }
.rank-other { background: var(--bg); color: var(--text-muted); }
.moyenne-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-weight: 800; font-size: 14px; color: white; }
.btn-note-edit, .btn-note-add { background: none; border: none; color: var(--text-light); font-size: 10px; padding: 2px; cursor: pointer; opacity: 0; transition: opacity 0.2s; }
td:hover .btn-note-edit, td:hover .btn-note-add { opacity: 1; }

/* ============ SALAIRES ============ */
.employes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.employe-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); transition: all var(--transition); }
.employe-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.employe-avatar { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg,var(--primary),var(--secondary)); color: white; font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.employe-info { flex: 1; }
.employe-nom { font-weight: 700; font-size: 14px; }
.employe-role { font-size: 11px; color: var(--text-muted); margin: 2px 0 6px; }
.employe-sal { font-size: 12px; }
.employe-last { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.employe-actions { display: flex; gap: 6px; flex-direction: column; }

/* ============ FICHE ÉLÈVE ============ */
.fiche-tabs { display: flex; border-bottom: 2px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.fiche-tab { padding: 12px 20px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all var(--transition); display: flex; align-items: center; gap: 6px; }
.fiche-tab:hover { color: var(--primary); }
.fiche-tab.active { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.stat-mini { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); }
.stat-mini-label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.stat-mini-val { font-size: 15px; font-weight: 700; margin-top: 2px; }

/* ============ ICONE PICKER ============ */
.icone-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.icone-option { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); cursor: pointer; font-size: 16px; transition: all var(--transition); }
.icone-option:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.icone-option.selected { border-color: var(--primary); background: var(--primary); color: white; }

/* ============ NOTIFICATIONS PAGE ============ */
.notif-item-page { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.notif-item-page:hover { background: var(--bg); }
.notif-item-page.unread { background: var(--primary-light); }
.notif-icon-sm { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.notif-icon-sm.warning { background: var(--warning); }
.notif-icon-sm.success { background: var(--success); }
.notif-icon-sm.danger { background: var(--danger); }
.notif-icon-sm.info { background: var(--info); }
.notif-content { flex: 1; }
.notif-content strong { display: block; font-weight: 700; font-size: 14px; }
.notif-content p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.notif-content .notif-time { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }

/* ============ RTL ARABIC SUPPORT ============ */
[data-lang="ar"] { direction: rtl; }
[data-lang="ar"] .sidebar { left: auto; right: 0; transform: translateX(100%); }
[data-lang="ar"] .sidebar.mobile-open { transform: translateX(0); }
[data-lang="ar"] .content-wrapper { margin-left: 0; margin-right: var(--sidebar-width); }
[data-lang="ar"] .sidebar.collapsed ~ .content-wrapper { margin-left: 0; margin-right: var(--sidebar-collapsed); }
@media (min-width: 769px) {
  [data-lang="ar"] .sidebar { transform: translateX(0); }
}
.lang-btn.active { background: var(--primary) !important; color: white !important; border-color: var(--primary) !important; }

/* ============ BG-ALT ============ */
.bg-alt { background: var(--surface2); }
input[readonly] { background: var(--surface2) !important; }
