/* ============================================================
   EduOS Design System — Clean & Professional
   ============================================================ */

/* Light Theme */
:root {
  --bg-body: #f0f2f5;
  --bg-card: #ffffff;
  --bg-sidebar: #1e293b;
  --bg-header: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-input: #ffffff;

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #3b82f6;

  --border: #e2e8f0;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --success: #22c55e;
  --success-bg: #f0fdf4;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

  --radius: 8px;
  --radius-lg: 12px;

  --sidebar-w: 260px;
  --header-h: 60px;
}

/* Dark Theme */
.dark, [data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #0f172a;
  --bg-header: #1e293b;
  --bg-hover: #334155;
  --bg-input: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  --border: #334155;

  --primary-light: rgba(99,102,241,0.15);
  --success-bg: rgba(34,197,94,0.1);
  --danger-bg: rgba(239,68,68,0.1);
  --warning-bg: rgba(245,158,11,0.1);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

/* Legacy alias for old login views */
:root, .dark, [data-theme="dark"] {
  --card-bg: var(--bg-card);
  --card-shadow: var(--shadow);
  --input-text: var(--text-primary);
  --input-border: var(--border);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.edu-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.edu-sidebar-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.edu-sidebar-brand .brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.edu-sidebar-brand .brand-text {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edu-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.edu-sidebar-scroll::-webkit-scrollbar { width: 4px; }
.edu-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.edu-nav-group { margin-bottom: 4px; }

.edu-nav-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  padding: 12px 10px 6px;
}

.edu-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.edu-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
}

.edu-nav-item.active {
  background: var(--primary);
  color: #fff;
}

.edu-nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
}

.edu-nav-item .edu-nav-label { flex: 1; }

.edu-nav-item .edu-nav-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  min-width: 18px;
  text-align: center;
}

/* Sidebar overlay for mobile */
.edu-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ============================================================
   HEADER
   ============================================================ */
.edu-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--header-h);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.edu-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.edu-mobile-search-btn { display: none; }

.edu-header-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.edu-header-search {
  position: relative;
  max-width: 360px;
  width: 100%;
}

.edu-header-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s;
}

.edu-header-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.edu-header-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.edu-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.edu-header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s;
  position: relative;
}

.edu-header-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.edu-header-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-header);
}

.edu-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-primary);
  transition: all 0.15s;
}

.edu-user-menu:hover { background: var(--bg-hover); }

.edu-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.edu-user-info { text-align: left; line-height: 1.2; }
.edu-user-info .name { font-size: 13px; font-weight: 600; }
.edu-user-info .role { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.edu-main {
  margin-top: var(--header-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--header-h));
  padding: 24px;
  transition: margin-left 0.3s ease;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.edu-dashboard { max-width: 1200px; }

.edu-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.edu-dashboard-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.edu-dashboard-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.edu-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stats Grid */
.edu-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.edu-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.edu-stat-card:hover { box-shadow: var(--shadow-md); }

.edu-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.edu-stat-body { flex: 1; min-width: 0; }

.edu-stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.edu-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.edu-stat-trend {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: var(--text-muted);
  flex-shrink: 0;
}

.edu-stat-trend.up { color: var(--success); }
.edu-stat-trend.down { color: var(--danger); }

/* Cards */
.edu-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.edu-card:hover { box-shadow: var(--shadow-md); }

.edu-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.edu-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.edu-card-action {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-link);
  text-decoration: none;
}

.edu-card-action:hover { text-decoration: underline; }

.edu-card-body { padding: 16px; }
.edu-card-body.px-0 { padding-left: 0; padding-right: 0; }

/* Grid layouts */
.edu-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* List items */
.edu-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s;
  gap: 10px;
}

.edu-list-item:hover { background: var(--bg-hover); }
.edu-list-item:last-child { border-bottom: none; }

.edu-list-item-start {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.edu-list-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.edu-list-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Avatars */
.edu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: var(--primary);
}

.edu-avatar-sm { width: 28px; height: 28px; font-size: 11px; }

/* Badges */
.edu-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.edu-badge-success { background: var(--success-bg); color: #15803d; }
.edu-badge-warning { background: var(--warning-bg); color: #92400e; }
.edu-badge-danger { background: var(--danger-bg); color: #991b1b; }
.edu-badge-info { background: var(--primary-light); color: var(--primary); }
.edu-badge-ghost { background: var(--bg-hover); color: var(--text-muted); }

.dark .edu-badge-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.dark .edu-badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.dark .edu-badge-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.dark .edu-badge-info { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.dark .edu-badge-ghost { background: #334155; color: #94a3b8; }

/* Buttons */
.edu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}

.edu-btn-sm { padding: 4px 10px; font-size: 12px; }
.edu-btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.edu-btn-primary:hover { background: var(--primary-hover); opacity: 0.95; }
.edu-btn-outline { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.edu-btn-outline:hover { background: var(--bg-hover); }

/* Quick Actions */
.edu-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.edu-quick-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

.edu-quick-action-item:hover {
  border-color: var(--qa-color, var(--primary));
  color: var(--qa-color, var(--primary));
  background: var(--primary-light);
}

.edu-quick-action-item i {
  font-size: 18px;
  color: var(--qa-color, var(--text-muted));
}

/* Notification Dropdown */
.edu-notif-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 360px;
  max-height: 440px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}

.edu-notif-dropdown.open { display: block; }

.edu-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.edu-notif-header h4 { font-size: 14px; font-weight: 600; margin: 0; }
.edu-notif-header a { font-size: 12px; color: var(--text-link); }

.edu-notif-list { overflow-y: auto; max-height: 360px; }

.edu-notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.edu-notif-item:hover { background: var(--bg-hover); }
.edu-notif-item.unread { background: var(--primary-light); }

.edu-notif-item .notif-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}

.edu-notif-item .notif-content { flex: 1; min-width: 0; }
.edu-notif-item .notif-content .title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.edu-notif-item .notif-content .body {
  font-size: 12px;
  color: var(--text-secondary);
}
.edu-notif-item .notif-content .time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.edu-notif-empty { padding: 24px; text-align: center; color: var(--text-muted); }
.edu-notif-empty i { font-size: 28px; margin-bottom: 8px; display: block; }

/* Search Overlay */
.edu-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.edu-search-overlay.open { display: flex; }

.edu-search-modal {
  width: 560px;
  max-width: 90vw;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.edu-search-modal input {
  width: 100%;
  padding: 16px 20px;
  border: none;
  font-size: 16px;
  color: var(--text-primary);
  background: transparent;
}

.edu-search-modal input:focus { outline: none; }

.edu-search-results {
  max-height: 360px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

/* Flash Messages */
.edu-flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.edu-flash.success { background: var(--success-bg); color: #15803d; border: 1px solid rgba(34,197,94,0.2); }
.edu-flash.error { background: var(--danger-bg); color: #991b1b; border: 1px solid rgba(239,68,68,0.2); }
.dark .edu-flash.success { color: #4ade80; }
.dark .edu-flash.error { color: #f87171; }

.edu-flash i { font-size: 14px; }

/* Footer */
.edu-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-left: var(--sidebar-w);
}

/* Empty state */
.edu-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.edu-empty i { font-size: 40px; margin-bottom: 12px; display: block; color: var(--border); }
.edu-empty h4 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin: 0 0 4px; }
.edu-empty p { font-size: 13px; margin: 0; }

/* Skeleton loading */
.edu-skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: edu-shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes edu-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.edu-skeleton-sm { height: 14px; width: 60%; }
.edu-skeleton-md { height: 20px; width: 80%; }
.edu-skeleton-lg { height: 36px; width: 40%; }
.edu-skeleton-card { height: 120px; width: 100%; }
.edu-skeleton-circle { width: 42px; height: 42px; border-radius: 50%; }

/* Card Grid */
.edu-card-grid {
  display: grid;
  gap: 16px;
}
.edu-card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.edu-card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.edu-card-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Theme toggle (legacy support) */
.theme-toggle {
  position: relative;
  width: 40px; height: 20px;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background 0.3s;
  flex-shrink: 0;
}
.theme-toggle .dot {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.dark .theme-toggle .dot { transform: translateX(20px); }

/* Preloader */
#preloader { display: none; }
.announcement-bar { display: none; }

/* Body scroll lock when sidebar open on mobile */
.edu-body-scroll-lock {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Legacy dark mode Tailwind overrides */
.dark .bg-white { background-color: var(--bg-card) !important; }
.dark .bg-gray-50 { background-color: var(--bg-body) !important; }
.dark .text-gray-900 { color: var(--text-primary) !important; }
.dark .text-gray-600 { color: var(--text-secondary) !important; }
.dark .text-gray-500 { color: var(--text-muted) !important; }
.dark .border-gray-200 { border-color: var(--border) !important; }
.dark .shadow-sm { box-shadow: var(--shadow) !important; }

/* Dark mode overrides for CRUD/admin page Tailwind classes */
/* Text — fixes invisible text on dark cards */
.dark .text-gray-700,
.dark .text-gray-800 { color: var(--text-primary) !important; }
.dark .text-gray-400,
.dark .text-gray-300 { color: var(--text-muted) !important; }
.dark .text-gray-200,
.dark .text-gray-100 { color: var(--text-muted) !important; }
.dark .text-indigo-600,
.dark .text-indigo-500,
.dark .text-indigo-400 { color: var(--primary) !important; }
.dark .text-blue-600,
.dark .text-blue-500,
.dark .text-blue-400 { color: #60a5fa !important; }
.dark .text-green-500,
.dark .text-green-600 { color: #4ade80 !important; }
.dark .text-red-500,
.dark .text-red-600 { color: #f87171 !important; }
.dark .text-purple-500,
.dark .text-purple-600 { color: #c084fc !important; }
.dark .text-yellow-500,
.dark .text-yellow-600 { color: #fbbf24 !important; }
.dark .text-amber-500,
.dark .text-amber-600 { color: #fbbf24 !important; }
.dark .text-teal-500,
.dark .text-teal-600 { color: #2dd4bf !important; }
.dark .text-orange-500,
.dark .text-orange-600 { color: #fb923c !important; }
.dark .text-pink-500,
.dark .text-pink-600 { color: #f472b6 !important; }
.dark .text-cyan-500,
.dark .text-cyan-600 { color: #22d3ee !important; }

/* Backgrounds — fixes light patches on dark pages */
.dark .bg-gray-100 { background-color: var(--bg-hover) !important; }
.dark .bg-gray-200,
.dark .bg-gray-300 { background-color: var(--border) !important; }
.dark .bg-gray-700,
.dark .bg-gray-800 { background-color: var(--bg-hover) !important; }

/* Borders — fixes light borders on dark cards */
.dark .border-gray-100,
.dark .border-gray-300,
.dark .border-gray-400 { border-color: var(--border) !important; }

/* Hover states for table rows, cancel buttons, etc. */
.dark .hover\:bg-gray-50:hover,
.dark .hover\:bg-gray-100:hover,
.dark .hover\:bg-gray-200:hover { background-color: var(--bg-hover) !important; }

/* Colored status badges — dim for dark mode */
.dark .text-green-700,
.dark .text-green-800 { color: #4ade80 !important; }
.dark .text-red-700,
.dark .text-red-800 { color: #f87171 !important; }
.dark .text-blue-700,
.dark .text-blue-800 { color: #60a5fa !important; }
.dark .text-yellow-700,
.dark .text-yellow-800 { color: #fbbf24 !important; }
.dark .text-purple-700,
.dark .text-purple-800 { color: #c084fc !important; }
.dark .text-indigo-700,
.dark .text-indigo-800 { color: #a5b4fc !important; }
.dark .text-orange-700,
.dark .text-orange-800 { color: #fb923c !important; }
.dark .text-teal-700,
.dark .text-teal-800 { color: #2dd4bf !important; }

/* Colored badge backgrounds — dim for dark mode */
.dark .bg-green-100 { background-color: rgba(34,197,94,0.15) !important; }
.dark .bg-red-100 { background-color: rgba(239,68,68,0.15) !important; }
.dark .bg-blue-100 { background-color: rgba(59,130,246,0.15) !important; }
.dark .bg-yellow-100 { background-color: rgba(245,158,11,0.15) !important; }
.dark .bg-purple-100 { background-color: rgba(168,85,247,0.15) !important; }
.dark .bg-indigo-100 { background-color: rgba(99,102,241,0.15) !important; }
.dark .bg-orange-100 { background-color: rgba(249,115,22,0.15) !important; }
.dark .bg-teal-100 { background-color: rgba(45,212,191,0.15) !important; }
.dark .bg-pink-100 { background-color: rgba(236,72,153,0.15) !important; }

/* Tinted card backgrounds — dim for dark mode */
.dark .bg-green-50 { background-color: rgba(34,197,94,0.06) !important; }
.dark .bg-red-50 { background-color: rgba(239,68,68,0.06) !important; }
.dark .bg-blue-50 { background-color: rgba(59,130,246,0.06) !important; }
.dark .bg-yellow-50 { background-color: rgba(245,158,11,0.06) !important; }
.dark .bg-purple-50 { background-color: rgba(168,85,247,0.06) !important; }
.dark .bg-indigo-50 { background-color: rgba(99,102,241,0.06) !important; }
.dark .bg-orange-50 { background-color: rgba(249,115,22,0.06) !important; }
.dark .bg-teal-50 { background-color: rgba(45,212,191,0.06) !important; }
.dark .bg-amber-50 { background-color: rgba(251,191,36,0.06) !important; }
.dark .bg-pink-50 { background-color: rgba(236,72,153,0.06) !important; }
.dark .bg-cyan-50 { background-color: rgba(34,211,238,0.06) !important; }

/* Gray background variant overrides */
.dark .bg-gray-400,
.dark .bg-gray-500 { background-color: var(--text-muted) !important; }

/* Colored-500 backgrounds for status dots/icons — keep visible in dark mode */
.dark .bg-indigo-500 { background-color: #6366f1 !important; }
.dark .bg-blue-500 { background-color: #3b82f6 !important; }
.dark .bg-green-500 { background-color: #22c55e !important; }
.dark .bg-red-500 { background-color: #ef4444 !important; }
.dark .bg-purple-500 { background-color: #a855f7 !important; }
.dark .bg-yellow-500 { background-color: #eab308 !important; }
.dark .bg-orange-500 { background-color: #f97316 !important; }
.dark .bg-amber-500 { background-color: #f59e0b !important; }
.dark .bg-teal-500 { background-color: #14b8a6 !important; }
.dark .bg-pink-500 { background-color: #ec4899 !important; }
.dark .bg-cyan-500 { background-color: #06b6d4 !important; }

/* Sidebar hover/active sidebar items for dark mode */
.dark .hover\:bg-indigo-50:hover { background-color: rgba(99,102,241,0.1) !important; }
.dark .hover\:bg-blue-50:hover { background-color: rgba(59,130,246,0.1) !important; }

/* Primary action buttons — slight dim for dark mode */
.dark .bg-indigo-600,
.dark .bg-indigo-700 { background-color: #4f46e5 !important; }
.dark .bg-blue-600,
.dark .bg-blue-700 { background-color: #2563eb !important; }
.dark .bg-green-600,
.dark .bg-green-700 { background-color: #16a34a !important; }
.dark .bg-red-600,
.dark .bg-red-700 { background-color: #dc2626 !important; }

/* Shadow overrides for all shadow levels */
.dark .shadow,
.dark .shadow-md,
.dark .shadow-lg { box-shadow: var(--shadow) !important; }

/* Table striped rows */
.dark .even\:bg-gray-50:nth-child(even) { background-color: var(--bg-hover) !important; }

/* Divider/rule color */
.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: var(--border) !important; }

/* Dark mode form inputs — fix white backgrounds on all text boxes */
.dark input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.dark textarea,
.dark select {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
}
.dark input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus,
.dark textarea:focus,
.dark select:focus {
    border-color: var(--primary) !important;
    outline: none;
}

/* Role-specific brand icon colors */
.edu-theme-super-admin .edu-sidebar-brand .brand-icon { background: linear-gradient(135deg,#7c3aed,#3b82f6); }
.edu-theme-org-admin .edu-sidebar-brand .brand-icon { background: linear-gradient(135deg,#2563eb,#06b6d4); }
.edu-theme-teacher .edu-sidebar-brand .brand-icon { background: linear-gradient(135deg,#10b981,#06b6d4); }
.edu-theme-student .edu-sidebar-brand .brand-icon { background: linear-gradient(135deg,#3b82f6,#8b5cf6); }
.edu-theme-parent .edu-sidebar-brand .brand-icon { background: linear-gradient(135deg,#a855f7,#ec4899); }

/* ============================================================
   RESPONSIVE DESIGN SYSTEM
   ============================================================ */

/* Base responsive utilities */
.edu-container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.edu-container-sm { max-width: 800px; }
.edu-container-lg { max-width: 1400px; }
.edu-container-fluid { max-width: 100%; }

/* Responsive typography */
h1, .h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h2, .h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3, .h3 { font-size: clamp(1.1rem, 2.5vw, 1.375rem); }
h4, .h4 { font-size: clamp(1rem, 2vw, 1.15rem); }

.edu-dashboard-title { font-size: clamp(1.125rem, 3vw, 1.5rem); }

/* Responsive images */
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Minimum touch target */
.edu-btn, 
.edu-nav-item,
.edu-quick-action-item,
.edu-header-btn,
.edu-user-menu,
.theme-toggle,
button, 
a.edu-btn,
a.nav-link {
  min-height: 44px;
  min-width: 44px;
}

.edu-btn-sm { min-height: 36px; min-width: 36px; }
.edu-btn { min-height: 44px; }

/* X-Small devices (≤480px) */
@media (max-width: 480px) {
  .edu-main { padding: 12px; }
  .edu-stats-grid { grid-template-columns: 1fr; }
  .edu-dashboard-header { flex-direction: column; align-items: flex-start; }
  .edu-card-header { flex-direction: column; align-items: flex-start; }
  .edu-card-body { padding: 12px; }
  .edu-grid-2 { grid-template-columns: 1fr; }
  .edu-card-grid-2, .edu-card-grid-3, .edu-card-grid-4 { grid-template-columns: 1fr; }
  .edu-quick-actions { grid-template-columns: repeat(2, 1fr); }
  .edu-stats-grid { gap: 10px; }
  .edu-stat-card { padding: 12px; }
  .edu-stat-value { font-size: 20px; }
  .edu-stat-icon { width: 36px; height: 36px; font-size: 14px; }
  .edu-notif-dropdown { width: calc(100vw - 24px); right: -60px; }
  .edu-header-search { max-width: 120px; }
  .edu-header-search input { font-size: 12px; padding: 0 8px 0 30px; height: 32px; }
  .edu-header-actions { width: 100%; }
  .edu-header-actions .edu-btn { flex: 1; justify-content: center; }
  .edu-list-item { padding: 8px 12px; flex-wrap: wrap; }
  .edu-quick-action-item { padding: 10px 6px; font-size: 10px; }
  .edu-quick-action-item i { font-size: 16px; }
}

/* Small devices (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .edu-main { padding: 16px; }
  .edu-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid-2 { grid-template-columns: 1fr; }
  .edu-card-grid-2 { grid-template-columns: 1fr; }
  .edu-card-grid-3, .edu-card-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .edu-quick-actions { grid-template-columns: repeat(3, 1fr); }
  .edu-stats-grid { gap: 12px; }
}

/* Medium devices (768px - 991px) — Tablets */
@media (min-width: 768px) and (max-width: 991px) {
  .edu-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-card-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .edu-card-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .edu-quick-actions { grid-template-columns: repeat(3, 1fr); }
  .edu-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Large devices (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .edu-card-grid-4 { grid-template-columns: repeat(3, 1fr); }
  .edu-stats-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* Extra large devices (1200px+) */
@media (min-width: 1200px) {
  .edu-stats-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* All mobile devices (≤767px) — Shared styles */
@media (max-width: 767px) {
  /* Sidebar */
  .edu-sidebar {
    transform: translateX(-100%);
    width: 280px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
  }
  .edu-sidebar.open { transform: translateX(0); }
  .edu-sidebar-overlay.open { display: block; }
  .edu-sidebar-overlay { z-index: 100; }
  
  /* Header */
  .edu-header { left: 0; padding: 0 10px; gap: 4px; }
  .edu-header-hamburger { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; }
  .edu-header-search { display: none; }
  .edu-mobile-search-btn { display: flex; align-items: center; justify-content: center; }
  .edu-user-info { display: none; }
  
  /* Main content */
  .edu-main { margin-left: 0; padding: 16px; }
  
  /* Footer */
  .edu-footer { margin-left: 0; padding: 12px 16px; }
  
  /* Dropdowns */
  .edu-user-menu .fa-chevron-down { display: none; }
  
  /* Notification dropdown mobile */
  .edu-notif-dropdown {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - var(--header-h) - 20px);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  /* User menu mobile */
  #eduUserMenu.edu-notif-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 60vh;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  }
  #eduUserMenu.edu-notif-dropdown.open { display: block; }
  
  /* Search */
  .edu-search-modal { max-width: 96vw; width: 100%; }
  .edu-search-modal input { padding: 12px 16px; font-size: 14px; }
  
  /* Dashboard header */
  .edu-dashboard-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  
  /* Nav items */
  .edu-nav-item { padding: 10px 12px; min-height: 44px; }
  .edu-nav-group-title { padding: 10px 12px 4px; }
  
  /* Stat cards */
  .edu-stat-card { padding: 12px; }
  .edu-stat-value { font-size: 20px; }
  .edu-stat-icon { width: 36px; height: 36px; font-size: 14px; }
}

/* All tablets (768px - 1024px) */
@media (max-width: 1024px) {
  .edu-card-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .edu-card-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Sidebar hidden toggle (for pages where sidebar is absent) */
.edu-sidebar.hidden { transform: translateX(-100%); }
.edu-sidebar.hidden + .edu-header { left: 0; }
.edu-sidebar.hidden + .edu-header + .edu-main { margin-left: 0; }
.edu-sidebar.hidden ~ .edu-footer { margin-left: 0; }

/* ============================================================
   RESPONSIVE TABLES
   ============================================================ */
.edu-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

.edu-table-responsive table { min-width: 600px; }

/* Card-style tables for very small screens */
@media (max-width: 600px) {
  .edu-table-cardify table,
  .edu-table-cardify thead,
  .edu-table-cardify tbody,
  .edu-table-cardify th,
  .edu-table-cardify td,
  .edu-table-cardify tr {
    display: block;
  }
  .edu-table-cardify thead { display: none; }
  .edu-table-cardify tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
  }
  .edu-table-cardify td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border: none;
    font-size: 13px;
  }
  .edu-table-cardify td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    margin-right: 8px;
  }
  .edu-table-cardify td:not(:last-child) {
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================================
   RESPONSIVE FORMS
   ============================================================ */
@media (max-width: 600px) {
  .edu-form-grid {
    grid-template-columns: 1fr !important;
  }
  .edu-form-group {
    margin-bottom: 12px;
  }
  input, select, textarea {
    font-size: 16px !important; /* Prevent iOS zoom */
  }
  .edu-form-actions {
    flex-direction: column;
    gap: 8px;
  }
  .edu-form-actions .edu-btn,
  .edu-form-actions a,
  .edu-form-actions button {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   RESPONSIVE MODALS
   ============================================================ */
@media (max-width: 600px) {
  .edu-modal-content {
    margin: 10px;
    padding: 20px;
    max-height: calc(100vh - 20px);
    border-radius: 12px;
  }
  .edu-modal-header {
    padding: 14px 16px;
  }
  .edu-modal-body {
    padding: 14px 16px;
  }
  .edu-modal-footer {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
  }
  .edu-modal-footer .edu-btn { width: 100%; justify-content: center; }
}

/* ============================================================
   RESPONSIVE CARDS
   ============================================================ */
@media (max-width: 480px) {
  .edu-card { margin-bottom: 12px; }
  .edu-card-body { padding: 12px; }
  .edu-card-header { padding: 12px; }
  .edu-card-title { font-size: 13px; }
}

/* Responsive admin page common patterns - reduce spacing on mobile */
@media (max-width: 600px) {
  .p-8 { padding: 16px !important; }
  .p-6 { padding: 14px !important; }
  .px-6 { padding-left: 14px !important; padding-right: 14px !important; }
  .px-8 { padding-left: 16px !important; padding-right: 16px !important; }
  .py-3 { padding-top: 10px !important; padding-bottom: 10px !important; }
  .gap-6 { gap: 12px !important; }
  .text-2xl { font-size: 1.25rem !important; }
  .mb-6 { margin-bottom: 16px !important; }
  .mb-8 { margin-bottom: 20px !important; }
  .space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem !important; }
}

/* ============================================================
   RESPONSIVE PAGINATION
   ============================================================ */
@media (max-width: 600px) {
  .edu-pagination {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  .edu-pagination-info { font-size: 12px; }
  .edu-pagination-links { flex-wrap: wrap; justify-content: center; gap: 4px; }
}

/* ============================================================
   RESPONSIVE FOOTER
   ============================================================ */
@media (max-width: 600px) {
  .edu-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  .edu-footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
}

/* ============================================================
   RESPONSIVE SKELETON LOADING
   ============================================================ */
@media (max-width: 600px) {
  .edu-skeleton-sm { width: 40%; }
  .edu-skeleton-md { width: 60%; }
  .edu-skeleton-lg { width: 30%; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .edu-sidebar,
  .edu-header,
  .edu-footer,
  .edu-sidebar-overlay {
    display: none !important;
  }
  .edu-main {
    margin: 0 !important;
    padding: 0 !important;
  }
  body { background: #fff; color: #000; }
}

/* ============================================================
   SAFARI / IOS FIXES
   ============================================================ */
@supports (-webkit-touch-callout: none) {
  .edu-sidebar-scroll {
    -webkit-overflow-scrolling: touch;
  }
  .edu-notif-list {
    -webkit-overflow-scrolling: touch;
  }
  input, textarea, select {
    font-size: 16px;
  }
}

/* ============================================================
   RESPONSIVE LANDING PAGE SPECIFIC
   ============================================================ */
@media (max-width: 768px) {
  .dashboard-mockup {
    min-height: auto !important;
    margin-top: 20px !important;
  }
  .dashboard-card {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin-bottom: 8px;
    width: 100%;
  }
  .dashboard-card.floating {
    animation: none !important;
  }
  .dashboard-mockup > .dashboard-card {
    display: none; /* Hide floating overlay cards on mobile, show inline */
  }
  .tenant-children {
    grid-template-columns: 1fr !important;
  }
  .hero-glow {
    width: 250px !important;
    height: 250px !important;
  }
  .pricing-card {
    padding: 24px 20px !important;
  }
  .pricing-card .price {
    font-size: 32px !important;
  }
  .feature-card {
    padding: 20px 16px !important;
  }
  .testimonial-card {
    padding: 20px !important;
  }
  .mockup-container {
    aspect-ratio: auto !important;
    min-height: 200px;
    padding: 14px !important;
  }
  .mockup-container .fa-3x { font-size: 2em; }
  .stat-number {
    font-size: clamp(1.8rem, 6vw, 2.5rem) !important;
  }
  .gradient-btn, .gradient-btn-secondary {
    padding: 12px 20px !important;
    font-size: 13px !important;
  }
  footer .grid {
    gap: 24px !important;
  }
}

@media (max-width: 480px) {
  nav .flex.items-center.gap-8 { display: none; }
  .max-w-7xl.mx-auto.px-4.sm\\:px-6 .grid.grid-cols-2.md\\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  .grid-cols-2.sm\\:grid-cols-3.md\\:grid-cols-4.lg\\:grid-cols-5 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .grid.md\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  .grid.md\\:grid-cols-2.lg\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  .grid.grid-cols-2.md\\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ============================================================
   DARK MODE RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 600px) {
  .dark .edu-notif-dropdown,
  .dark #eduUserMenu.edu-notif-dropdown {
    border-color: var(--border);
    background: var(--bg-card);
  }
}

/* ============================================================
   ACCESSIBILITY - FOCUS STATES
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.edu-btn:focus-visible,
.edu-nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   SIDEBAR RESPONSIVE IMPROVEMENTS
   ============================================================ */
@media (max-width: 767px) {
  .edu-sidebar-scroll {
    padding-bottom: 80px;
  }
  .edu-sidebar-brand .brand-text {
    font-size: 14px;
  }
  .edu-sidebar-brand {
    padding: 0 14px;
  }
  .edu-nav-group {
    margin-bottom: 2px;
  }
}

/* ============================================================
   HEADER RESPONSIVE IMPROVEMENTS
   ============================================================ */
@media (max-width: 767px) {
  .edu-header-left {
    gap: 6px;
  }
  .edu-header-right {
    gap: 2px;
  }
  .edu-header-btn {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
  .edu-user-menu {
    padding: 2px 4px;
  }
  .edu-user-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}

/* ============================================================
   RESPONSIVE DROPDOWNS
   ============================================================ */
@media (max-width: 480px) {
  .edu-notif-header {
    padding: 10px 14px;
  }
  .edu-notif-header h4 { font-size: 13px; }
  .edu-notif-item {
    padding: 8px 14px;
  }
  .edu-notif-item .notif-icon {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .edu-notif-item .notif-content .title { font-size: 12px; }
  .edu-notif-item .notif-content .body { font-size: 11px; }
  .edu-notif-item .notif-content .time { font-size: 10px; }
}

/* ============================================================
   RESPONSIVE FLASH MESSAGES
   ============================================================ */
@media (max-width: 480px) {
  .edu-flash {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ============================================================
   RESPONSIVE EMPTY STATE
   ============================================================ */
@media (max-width: 480px) {
  .edu-empty {
    padding: 24px 16px;
  }
  .edu-empty i { font-size: 30px; }
  .edu-empty h4 { font-size: 14px; }
  .edu-empty p { font-size: 12px; }
}

/* ============================================================
   RESPONSIVE THEME TOGGLE
   ============================================================ */
@media (max-width: 767px) {
  .theme-toggle {
    width: 36px;
    height: 18px;
  }
  .theme-toggle .dot {
    width: 14px;
    height: 14px;
    font-size: 7px;
  }
  .dark .theme-toggle .dot { transform: translateX(18px); }
}

/* ============================================================
   ULTRA-WIDE SCREENS (1920px+)
   ============================================================ */
@media (min-width: 1920px) {
  .edu-main {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: calc(var(--sidebar-w) + 24px);
    padding-right: 24px;
  }
  .edu-dashboard { max-width: 1400px; }
}

/* ============================================================
   HEIGHT-BASED BREAKPOINTS (Short screens)
   ============================================================ */
@media (max-height: 600px) {
  .edu-sidebar-scroll {
    padding-top: 4px;
  }
  .edu-nav-item {
    padding: 5px 10px;
  }
  .edu-nav-group-title {
    padding: 6px 10px 3px;
    font-size: 9px;
  }
  .edu-sidebar-brand {
    height: 48px;
  }
}
