/* ============================================================
   Amoozyar Dashboard - Modern, Clean & Responsive UI
   ============================================================ */

/* ---------- Font Faces ---------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../../fonts/Vazir.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../../fonts/Vazir-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../../fonts/Vazir-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- CSS Variables ---------- */
:root {
  /* Colors */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-soft: #eff6ff;

  --success: #10b981;
  --success-light: #d1fae5;
  --success-soft: #ecfdf5;

  --danger: #ef4444;
  --danger-light: #fee2e2;
  --danger-soft: #fef2f2;

  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --warning-soft: #fffbeb;

  --info: #0ea5e9;
  --info-light: #e0f2fe;
  --info-soft: #f0f9ff;

  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --purple-soft: #f5f3ff;

  --teal: #14b8a6;
  --teal-light: #ccfbf1;
  --teal-soft: #f0fdfa;

  --rose: #f43f5e;
  --rose-light: #ffe4e6;
  --rose-soft: #fff1f2;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --bg: var(--gray-50);
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --text-main: var(--gray-800);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --border: var(--gray-200);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Layout */
  --sidebar-width: 270px;
  --header-height: 64px;
  --input-height: 42px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Font */
  --font-family: 'Vazirmatn', 'Tahoma', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  top: -40px;
  right: 0;
  background: var(--primary);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: 9999;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
  font-size: 0.85rem;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: none;
}

/* ---------- Layout ---------- */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-brand i {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-3);
}

.nav-group {
  margin-bottom: var(--space-5);
}

.nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 var(--space-4) var(--space-2);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-1);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  background: var(--gray-100);
  color: var(--text-main);
}

.nav-link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary-light);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.nav-link.active:hover {
  background: #dbeafe;
}

.nav-link .badge {
  margin-right: auto;
  margin-left: 0;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.sidebar-footer i {
  color: var(--primary);
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--header-height);
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ---------- Page Content ---------- */
.page-content {
  flex: 1;
  padding: var(--space-6);
  max-width: 1600px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.page-header h1,
.page-header .page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.page-header .btn {
  flex-shrink: 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.page-actions > .btn-primary,
.page-actions > .btn-success {
  order: -1;
}

.page-actions-secondary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .page-actions {
    width: 100%;
  }
  .page-actions .btn,
  .page-actions-secondary .btn {
    flex: 1 1 calc(50% - var(--space-2));
    justify-content: center;
  }
}

/* ---------- Cards & Panels ---------- */
.card,
.glass-panel,
.glass-ui,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.glass-panel,
.glass-ui,
.card {
  padding: var(--space-6);
}

.card-hover:hover,
.glass-panel:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.panel-title i {
  color: var(--primary);
  margin-left: var(--space-2);
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  min-width: 0;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  flex-shrink: 0;
}

.stat-info {
  min-width: 0;
}

.stat-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-info p {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-blue .stat-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-green .stat-icon { background: linear-gradient(135deg, #34d399, #10b981); }
.stat-red .stat-icon { background: linear-gradient(135deg, #f87171, #ef4444); }
.stat-orange .stat-icon { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.stat-cyan .stat-icon { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.stat-purple .stat-icon { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.stat-teal .stat-icon { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }
.stat-rose .stat-icon { background: linear-gradient(135deg, #fb7185, #f43f5e); }
.stat-emerald .stat-icon { background: linear-gradient(135deg, #34d399, #059669); }
.stat-warning .stat-icon { background: linear-gradient(135deg, #fbbf24, #d97706); }
.stat-indigo .stat-icon { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.stat-violet .stat-icon { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

/* ---------- Buttons ---------- */
.btn,
button[type="submit"],
button[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: var(--input-height);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  background: var(--primary);
  color: white;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

a.btn:not([class*="btn-outline"]):not([class*="btn-ghost"]),
a.btn:not([class*="btn-outline"]):not([class*="btn-ghost"]):hover,
a.btn:not([class*="btn-outline"]):not([class*="btn-ghost"]):focus,
a.btn:not([class*="btn-outline"]):not([class*="btn-ghost"]):active,
a.btn:not([class*="btn-outline"]):not([class*="btn-ghost"]):visited,
a.btn-primary,
a.btn-primary:hover,
a.btn-primary:focus,
a.btn-primary:active,
a.btn-primary:visited,
a.btn-success,
a.btn-success:hover,
a.btn-success:focus,
a.btn-success:active,
a.btn-success:visited,
a.btn-danger,
a.btn-danger:hover,
a.btn-danger:focus,
a.btn-danger:active,
a.btn-danger:visited,
a.btn-secondary,
a.btn-secondary:hover,
a.btn-secondary:focus,
a.btn-secondary:active,
a.btn-secondary:visited,
a.btn-info,
a.btn-info:hover,
a.btn-info:focus,
a.btn-info:active,
a.btn-info:visited {
  text-decoration: none;
  color: white;
}

a.btn-warning,
a.btn-warning:hover,
a.btn-warning:focus,
a.btn-warning:active,
a.btn-warning:visited {
  color: #78350f;
}

a.btn-warning:hover,
a.btn-warning:focus,
a.btn-warning:active {
  color: white;
}

.btn:disabled,
.btn.is-disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none !important;
}

.btn:hover:not(:disabled),
button[type="submit"]:hover:not(:disabled),
button[type="button"]:hover:not(:disabled) {
  box-shadow: var(--shadow-sm);
}

.btn:focus-visible,
button[type="submit"]:focus-visible,
button[type="button"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.btn:active:not(:disabled),
button[type="submit"]:active:not(:disabled),
button[type="button"]:active:not(:disabled) {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-sm {
  height: 34px;
  padding: 0 var(--space-3);
  font-size: 0.8rem;
}

.btn-lg {
  height: 48px;
  padding: 0 var(--space-6);
  font-size: 0.95rem;
}

/* Solid variants */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

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

.btn-success:hover:not(:disabled) {
  background: #059669;
  border-color: #059669;
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-success:focus-visible {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

.btn-danger:focus-visible {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #78350f;
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
  border-color: #d97706;
  color: white;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.btn-warning:focus-visible {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
  background: var(--gray-600);
  border-color: var(--gray-600);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #475569;
  border-color: #475569;
  color: white;
  box-shadow: 0 4px 10px rgba(100, 116, 139, 0.25);
}

.btn-secondary:focus-visible {
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.3);
}

.btn-info {
  background: var(--info);
  border-color: var(--info);
  color: white;
}

.btn-info:hover:not(:disabled) {
  background: #0284c7;
  border-color: #0284c7;
  color: white;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.25);
}

.btn-info:focus-visible {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3);
}

/* Outline variants */
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

a.btn-outline,
a.btn-outline:focus,
a.btn-outline:active,
a.btn-outline:visited {
  color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--text-main);
  box-shadow: none;
}

a.btn-outline:hover {
  color: var(--text-main);
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

a.btn-outline-primary,
a.btn-outline-primary:focus,
a.btn-outline-primary:active,
a.btn-outline-primary:visited {
  color: var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

a.btn-outline-primary:hover {
  color: white;
}

.btn-outline-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.btn-outline-success {
  background: transparent;
  border-color: var(--success);
  color: var(--success);
}

a.btn-outline-success,
a.btn-outline-success:focus,
a.btn-outline-success:active,
a.btn-outline-success:visited {
  color: var(--success);
}

.btn-outline-success:hover:not(:disabled) {
  background: var(--success);
  border-color: var(--success);
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

a.btn-outline-success:hover {
  color: white;
}

.btn-outline-success:focus-visible {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.btn-outline-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

a.btn-outline-danger,
a.btn-outline-danger:focus,
a.btn-outline-danger:active,
a.btn-outline-danger:visited {
  color: var(--danger);
}

.btn-outline-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

a.btn-outline-danger:hover {
  color: white;
}

.btn-outline-danger:focus-visible {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.btn-outline-warning {
  background: transparent;
  border-color: var(--warning);
  color: var(--warning);
}

a.btn-outline-warning,
a.btn-outline-warning:focus,
a.btn-outline-warning:active,
a.btn-outline-warning:visited {
  color: var(--warning);
}

.btn-outline-warning:hover:not(:disabled) {
  background: var(--warning);
  border-color: var(--warning);
  color: #78350f;
}

a.btn-outline-warning:hover {
  color: #78350f;
}

.btn-outline-warning:focus-visible {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.btn-outline-info {
  background: transparent;
  border-color: var(--info);
  color: var(--info);
}

a.btn-outline-info,
a.btn-outline-info:focus,
a.btn-outline-info:active,
a.btn-outline-info:visited {
  color: var(--info);
}

.btn-outline-info:hover:not(:disabled) {
  background: var(--info);
  border-color: var(--info);
  color: white;
}

a.btn-outline-info:hover {
  color: white;
}

.btn-outline-info:focus-visible {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3);
}

/* Text-danger/success on outline buttons (legacy fallback) */
.btn-outline.text-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn-outline.text-success:hover:not(:disabled) {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

a.btn-ghost,
a.btn-ghost:hover,
a.btn-ghost:focus,
a.btn-ghost:active {
  color: var(--text-secondary);
  text-decoration: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--text-main);
}

a.btn-ghost:hover,
a.btn-ghost:focus,
a.btn-ghost:active {
  color: var(--text-main);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-block {
  width: 100%;
}

/* Button groups */
.btn-group {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Loading spinner */
.btn.is-loading,
.btn.is-loading:hover {
  color: transparent !important;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}

.btn.is-loading.btn-outline::after,
.btn.is-loading.btn-outline-primary::after,
.btn.is-loading.btn-outline-success::after,
.btn.is-loading.btn-outline-danger::after,
.btn.is-loading.btn-outline-warning::after,
.btn.is-loading.btn-outline-info::after,
.btn.is-loading.btn-ghost::after {
  border-color: rgba(100, 116, 139, 0.4);
  border-right-color: transparent;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-group label,
.form-label,
label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.8rem;
}

.form-group label .text-danger,
.form-label .text-danger {
  color: var(--danger);
}

.form-group.has-error label {
  color: var(--danger);
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea,
.form-group.has-error .form-control {
  border-color: var(--danger);
}

.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus,
.form-group.has-error .form-control:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group .text-danger {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.required::after {
  content: ' *';
  color: var(--danger);
}

input,
select,
textarea,
.form-control {
  width: 100%;
  height: var(--input-height);
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
}

textarea,
textarea.form-control {
  height: auto;
  min-height: 90px;
  padding: var(--space-3);
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  margin-left: var(--space-2);
}

input[type="file"],
input[type="file"].form-control {
  height: auto;
  padding: var(--space-2);
}

.form-text,
.help-text,
small {
  display: block;
  margin-top: var(--space-1);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-5);
}

.form-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.form-inline {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.form-inline .form-group {
  margin-bottom: 0;
  min-width: 160px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

legend {
  padding: 0 var(--space-3);
  font-weight: 700;
  font-size: 0.9rem;
}

/* ---------- Tables ---------- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.modern-table th,
.modern-table td {
  padding: var(--space-3) var(--space-4);
  text-align: right;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.modern-table th {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--gray-50);
  white-space: nowrap;
}

.modern-table tbody tr {
  transition: background-color var(--transition-fast);
}

.modern-table tbody tr:hover td {
  background: var(--gray-50);
}

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

.modern-table td.actions {
  text-align: left;
  min-width: 220px;
}

.modern-table td.actions .btn {
  margin-left: var(--space-1);
  margin-bottom: var(--space-1);
}

.modern-table td.actions .btn:last-child {
  margin-left: 0;
}

@media (max-width: 768px) {
  .modern-table td.actions {
    min-width: auto;
  }
  .modern-table td.actions .btn {
    margin-bottom: var(--space-2);
  }
}

.modern-table .status-badge {
  font-size: 0.7rem;
}

/* ---------- Status Badges ---------- */
.status-badge,
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.bg-present,
.badge-success {
  background: var(--success-light);
  color: #065f46;
}

.bg-absent,
.badge-danger {
  background: var(--danger-light);
  color: #991b1b;
}

.bg-late,
.badge-warning {
  background: var(--warning-light);
  color: #92400e;
}

.badge-info {
  background: var(--info-light);
  color: #075985;
}

.badge-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-purple {
  background: var(--purple-light);
  color: #5b21b6;
}

/* ---------- Alerts ---------- */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  border: 1px solid transparent;
  font-size: 0.85rem;
}

.alert-success {
  background: var(--success-soft);
  border-color: var(--success-light);
  color: #065f46;
}

.alert-danger {
  background: var(--danger-soft);
  border-color: var(--danger-light);
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-soft);
  border-color: var(--warning-light);
  color: #92400e;
}

.alert-info {
  background: var(--info-soft);
  border-color: var(--info-light);
  color: #075985;
}

.alert ul {
  margin-top: var(--space-2);
  margin-right: var(--space-5);
}

.alert-dismissible {
  position: relative;
  padding-left: 2.5rem;
}

.alert-close {
  position: absolute;
  top: 50%;
  left: var(--space-3);
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.alert-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

/* ---------- Dashboard Grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  align-items: stretch;
}

.dashboard-grid > .glass-panel,
.dashboard-grid > .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dashboard-grid > .glass-panel > .panel-header,
.dashboard-grid > .card > .panel-header {
  flex-shrink: 0;
}

.dashboard-grid > .glass-panel > .table-responsive,
.dashboard-grid > .glass-panel > .chart-container,
.dashboard-grid > .glass-panel > .empty-state,
.dashboard-grid > .card > .table-responsive,
.dashboard-grid > .card > .chart-container,
.dashboard-grid > .card > .empty-state {
  flex: 1 1 auto;
}

/* ---------- Dashboard Welcome ---------- */
.dashboard-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 100%);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-xl);
}

.welcome-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-1);
}

.welcome-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- Section Title ---------- */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: var(--space-6) 0 var(--space-4);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-secondary);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  margin: var(--space-2);
}

.empty-state i {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: var(--space-4);
  display: inline-block;
}

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state .btn {
  margin-top: var(--space-2);
}

/* ---------- Chart Container ---------- */
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Quick Actions ---------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-3);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  min-width: 0;
}

.action-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
}

.action-btn i {
  font-size: 1.4rem;
  color: var(--primary);
}

.action-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ---------- Modal ---------- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: var(--space-4);
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--text-main);
}

/* ---------- Drag & Drop Upload ---------- */
.drag-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.drag-area:hover,
.drag-area.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.drag-area i {
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
}

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--gray-100) 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-10) var(--space-8);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-header .login-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: var(--space-4);
}

.login-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-1);
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Hamburger Menu ---------- */
.hamburger {
  display: none;
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 1100;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-main);
  box-shadow: var(--shadow-md);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 950;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ---------- Grid System ---------- */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(var(--space-3) * -1);
}

.col,
.col-1,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9,
.col-10,
.col-11,
.col-12,
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-11,
.col-md-12,
.col-lg-1,
.col-lg-2,
.col-lg-3,
.col-lg-4,
.col-lg-5,
.col-lg-6,
.col-lg-7,
.col-lg-8,
.col-lg-9,
.col-lg-10,
.col-lg-11,
.col-lg-12 {
  padding: 0 var(--space-3);
  width: 100%;
}

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

.g-1 { gap: var(--space-1); }
.g-2 { gap: var(--space-2); }
.g-3 { gap: var(--space-4); }
.g-4 { gap: var(--space-6); }
.g-5 { gap: var(--space-8); }

/* ---------- Utility Classes ---------- */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-secondary); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-end { text-align: left; }
.text-start { text-align: right; }

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

.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.justify-content-start { justify-content: flex-start; }
.justify-content-end { justify-content: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }

.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.align-items-center { align-items: center; }
.align-items-baseline { align-items: baseline; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-4); }
.mt-4 { margin-top: var(--space-6); }
.mt-5 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-4); }
.mb-4 { margin-bottom: var(--space-6); }
.mb-5 { margin-bottom: var(--space-8); }
.mb-6 { margin-bottom: var(--space-10); }

.ms-1 { margin-left: var(--space-1); }
.ms-2 { margin-left: var(--space-2); }
.ms-3 { margin-left: var(--space-4); }

.me-1 { margin-right: var(--space-1); }
.me-2 { margin-right: var(--space-2); }
.me-3 { margin-right: var(--space-4); }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-4); }
.p-4 { padding: var(--space-6); }
.p-5 { padding: var(--space-8); }

.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-4 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-4 { padding-left: var(--space-6); padding-right: var(--space-6); }

.rounded { border-radius: var(--radius-md); }
.border { border: 1px solid var(--border); }
.border-0 { border: none; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.pagination-info {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------- Table Search & Sort ---------- */
.table-search-input {
  width: 100%;
  max-width: 280px;
  height: var(--input-height);
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: var(--space-4);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.table-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modern-table thead th {
  cursor: default;
  user-select: none;
  position: relative;
}

.modern-table thead th.sort-asc::after,
.modern-table thead th.sort-desc::after {
  content: '';
  display: inline-block;
  margin-right: var(--space-2);
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.7rem;
  color: var(--primary);
}

.modern-table thead th.sort-asc::after {
  content: '\f0d8';
}

.modern-table thead th.sort-desc::after {
  content: '\f0d7';
}

.modern-table tbody tr.table-no-result td {
  border-bottom: none;
}

/* ---------- Bulk Selection ---------- */
.bulk-select-all,
.bulk-select-item {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

/* ---------- Schedule Calendar ---------- */
.schedule-calendar {
  table-layout: fixed;
  min-width: 800px;
}

.schedule-calendar thead th {
  text-align: center;
  width: 13%;
}

.schedule-calendar .bell-cell {
  text-align: center;
  background: var(--surface);
  vertical-align: middle;
}

.schedule-calendar .bell-cell small {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.schedule-calendar .calendar-cell {
  vertical-align: top;
  min-height: 80px;
  padding: var(--space-2);
}

.schedule-calendar .schedule-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.schedule-calendar .schedule-item {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  font-size: 0.8rem;
}

.schedule-calendar .course-name {
  font-weight: 600;
  color: var(--primary);
}

.schedule-calendar .teacher-name,
.schedule-calendar .class-name {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.schedule-calendar .empty-slot {
  color: var(--text-muted);
  display: block;
  text-align: center;
}

/* ---------- CKEditor fix ---------- */
.django-ckeditor-widget,
.cke_editor_id_content,
.cke {
  width: 100% !important;
}

/* ---------- Status Select (attendance) ---------- */
.status-select {
  min-width: 100px;
  width: 100%;
}

.attendance-input,
.attendance-file {
  width: 100%;
  min-width: 100px;
  max-width: 160px;
  height: 36px;
  padding: 0 var(--space-2);
  font-size: 0.8rem;
}

.attendance-file {
  height: auto;
  padding: var(--space-1);
}

.attendance-check {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ---------- Compact Table ---------- */
.table-compact th,
.table-compact td {
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
}

/* ---------- Select2 overrides ---------- */
.select2-container .select2-selection--single {
  height: var(--input-height) !important;
  display: flex !important;
  align-items: center !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: var(--input-height) !important;
  padding-right: var(--space-3) !important;
  padding-left: var(--space-3) !important;
  color: var(--text-main) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: var(--input-height) !important;
  top: 0 !important;
}

.select2-dropdown {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-lg);
}

.select2-results__option {
  padding: var(--space-2) var(--space-3) !important;
  font-size: 0.85rem;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--primary) !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.select2-search--dropdown .select2-search__field {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  height: 36px;
  padding: 0 var(--space-3);
}

.select2-container--open {
  z-index: 9999 !important;
}

/* ---------- Print styles ---------- */
@media print {
  .sidebar,
  .top-header,
  .hamburger,
  .btn {
    display: none !important;
  }

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

  .page-content {
    padding: 0;
  }

  .glass-panel,
  .card {
    box-shadow: none;
    border: 1px solid var(--border);
  }
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
  .col-md { flex: 1 0 0%; }
  .col-md-auto { flex: 0 0 auto; width: auto; }
  .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }

  .text-md-end { text-align: left; }
  .text-md-start { text-align: right; }
  .d-md-flex { display: flex; }
  .d-md-block { display: block; }
  .d-md-none { display: none; }
}

@media (min-width: 1024px) {
  .col-lg { flex: 1 0 0%; }
  .col-lg-auto { flex: 0 0 auto; width: auto; }
  .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 1024px) {
  .page-content {
    padding: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .sidebar {
    transform: translateX(100%);
    box-shadow: var(--shadow-xl);
  }

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

  .sidebar-overlay {
    display: block;
  }

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

  .top-header {
    padding-left: 60px;
  }

  .user-name {
    display: none;
  }

  .page-content {
    padding: var(--space-4);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header .btn {
    width: 100%;
  }

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

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

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-inline,
  .form-row {
    flex-direction: column;
  }

  .form-inline .form-group,
  .form-row .form-group {
    width: 100%;
    min-width: auto;
  }

  .glass-panel .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .glass-panel .panel-header .btn {
    width: 100%;
  }

  .modern-table {
    min-width: 500px;
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .header-title {
    font-size: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header .btn {
    width: 100%;
  }
}
