/* ============================================================
   LMS — FULL DESIGN SYSTEM
   Fonts: Poppins (headings) + DM Sans (body)
   Color: Deep Indigo / Violet / Cyan
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap");

/* ─── CSS Custom Properties ─────────────────────────────── */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --purple: #8b5cf6;

  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #1e1b4b;
  --bg-sidebar-2: #312e81;
  --bg-input: #f8fafc;
  --bg-hover: rgba(99, 102, 241, 0.06);
  --bg-active: rgba(99, 102, 241, 0.12);

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-primary: #ffffff;
  --text-sidebar: rgba(255, 255, 255, 0.75);
  --text-sidebar-active: #ffffff;

  --border: #e2e8f0;
  --border-focus: #6366f1;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.35);
  --shadow-card: 0 2px 12px rgba(99, 102, 241, 0.08);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --sidebar-width: 260px;
  --navbar-height: 64px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
.dark {
  --bg: #070714;
  --bg-card: #0f0f23;
  --bg-sidebar: #080817;
  --bg-sidebar-2: #0f0e27;
  --bg-input: #141428;
  --bg-hover: rgba(99, 102, 241, 0.1);
  --bg-active: rgba(99, 102, 241, 0.2);

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --border: #1e293b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 2px 12px rgba(99, 102, 241, 0.15);
}

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

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family:
    "DM Sans",
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition:
    background var(--transition-slow),
    color var(--transition-slow);
  overflow-x: hidden;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

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

img {
  max-width: 100%;
  height: auto;
}
code,
pre {
  font-family: "JetBrains Mono", monospace;
}

/* ─── Custom Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── Layout ────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

.page-content {
  flex: 1;
  padding: 28px 32px;
  margin-top: var(--navbar-height);
}

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(
    180deg,
    var(--bg-sidebar) 0%,
    var(--bg-sidebar-2) 100%
  );
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition:
    width var(--transition-slow),
    transform var(--transition-slow);
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      ellipse at 30% 20%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 70% 80%,
      rgba(139, 92, 246, 0.1) 0%,
      transparent 60%
    );
  pointer-events: none;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* User info in sidebar */
.sidebar-user {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-section-label {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.35),
    rgba(139, 92, 246, 0.2)
  );
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 0 3px 3px 0;
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.nav-item:hover .nav-item-icon,
.nav-item.active .nav-item-icon {
  opacity: 1;
}

.nav-item-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Navbar ────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--navbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  z-index: 90;
  transition:
    left var(--transition-slow),
    background var(--transition-slow);
  backdrop-filter: blur(12px);
}

.navbar-title {
  flex: 1;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.navbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.navbar-breadcrumb .separator {
  opacity: 0.4;
}
.navbar-breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}

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

.navbar-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.navbar-btn:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* User dropdown */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
}

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

.user-menu-name {
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.dropdown-header-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.dropdown-header-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* ─── Theme Toggle ──────────────────────────────────────── */
.theme-toggle {
  position: relative;
  width: 38px;
  height: 38px;
}

.theme-toggle-sun,
.theme-toggle-moon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.dark .theme-toggle-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
.dark .theme-toggle-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}
.theme-toggle-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
.theme-toggle-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition:
    box-shadow var(--transition),
    transform var(--transition),
    background var(--transition-slow);
  overflow: hidden;
}

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

.card-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.dark .card-glass {
  background: rgba(15, 15, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 20px 24px;
}
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

/* ─── Stat Cards ────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--stat-color, var(--primary));
  opacity: 0.05;
  transform: translate(30px, -30px);
}

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

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--stat-bg, rgba(99, 102, 241, 0.12));
  color: var(--stat-color, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.4rem;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-trend {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-family: "DM Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition);
}
.btn:hover::after {
  background: rgba(255, 255, 255, 0.08);
}
.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  gap: 6px;
}
.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}
.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}
.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
  padding: 5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Loading spinner in button */
.btn-loading .btn-text {
  opacity: 0;
}
.btn-loading::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-label .required {
  color: var(--danger);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background: var(--bg-card);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Input with icon */
.input-group {
  position: relative;
}
.input-group .form-control {
  padding-left: 42px;
}
.input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.input-group .input-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
}
.input-group .input-icon-right:hover {
  color: var(--primary);
}
.input-group .form-control.has-right {
  padding-right: 42px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding: 0 38px 0 14px;
  cursor: pointer;
  min-height: 42px;
  height: 42px;
  line-height: 1.35;
  appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

select.form-control:hover {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  background-color: var(--bg-card);
}

select.form-control:active {
  border-color: var(--primary);
}

select.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background-color: var(--bg-card);
}

select.form-control option {
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  line-height: 1.45;
  background: var(--bg-card);
  color: var(--text);
}

select.form-control option:checked {
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
}

.dark select.form-control {
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ─── Filter / toolbar selects (fixed reusable — All Batches style) ─ */
.filter-group,
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.select-filter,
.filter-select,
select.form-select,
.table-controls > select.form-control,
.table-controls-right > select.form-control,
.lms-assign-table-controls > select.form-control,
.lms-timetable-table-controls > select.form-control,
.apps-filters > select.form-control,
.topic-filter-bar > select.form-control,
.asn-filter-bar > select.form-control,
.ann-filter-row > select.form-control,
.att-toolbar > select.form-control,
.pr-toolbar select.form-control,
select.form-control#b-course,
select.form-control#filter-batch,
select.form-control#filter-course,
select.form-control#filter-role,
select.form-control#filter-status,
select.form-control#filter-verified,
select.form-control#filter-type,
select.form-control#filter-priority,
select.form-control#stFilter {
  flex: 0 0 auto !important;
  min-width: 220px !important;
  width: 220px !important;
  max-width: 260px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 38px 0 14px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

.select-filter option,
.filter-select option,
select.form-select option,
.table-controls > select.form-control option,
.lms-assign-table-controls > select.form-control option,
.apps-filters > select.form-control option {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Per-page control — slightly narrower, same height */
.select-filter--perpage,
select.form-control#per-page,
select.form-control#att-per-page,
select.form-control#att-records-per-page,
select.form-control#att-mark-per-page {
  min-width: 120px !important;
  width: 120px !important;
  max-width: 140px !important;
}

/* Custom batch picker — match native All Batches select */
.lms-program-combo--toolbar.lms-program-combo {
  flex: 0 0 auto !important;
  min-width: 220px !important;
  width: 220px !important;
  max-width: 260px !important;
}

.table-controls .lms-program-combo--toolbar .lms-program-combo-trigger,
.apps-filters .lms-program-combo--toolbar .lms-program-combo-trigger,
.users-table-controls .lms-program-combo--toolbar .lms-program-combo-trigger {
  min-height: 46px !important;
  height: 46px !important;
  padding: 0 40px 0 38px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
}

.lms-program-combo--toolbar .lms-program-combo-panel {
  max-width: 260px;
  min-width: 220px;
}

.att-admin-filter-grid select.select-filter,
.att-admin-filter-grid select.form-control {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Toggle switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
  cursor: pointer;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Tables ────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-family: "Poppins", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}

thead th.sortable {
  cursor: pointer;
  transition: color var(--transition);
}
thead th.sortable:hover {
  color: var(--primary);
}
thead th.sort-asc::after {
  content: " ▲";
  font-size: 0.65rem;
}
thead th.sort-desc::after {
  content: " ▼";
  font-size: 0.65rem;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition:
    background var(--transition),
    transform var(--transition);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05);
}

tbody tr.selected {
  background: var(--bg-active);
}

td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

.table-checkbox {
  width: 40px;
  text-align: center;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Action icon buttons */
.action-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.action-btn-view {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent);
}
.action-btn-edit {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}
.action-btn-delete {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}
.action-btn-grade {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.action-btn:hover {
  transform: scale(1.15);
  opacity: 0.9;
}

/* ─── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
.badge-secondary {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}
.badge-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}
.badge-pulse .badge-dot {
  animation: pulseDot 1.5s ease infinite;
}

.dark .badge-success {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}
.dark .badge-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}
.dark .badge-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}
.dark .badge-info {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}
.dark .badge-secondary {
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
}
.dark .badge-purple {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
}

/* ─── Modals ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-lg {
  max-width: 720px;
}
.modal-xl {
  max-width: 900px;
}
.modal-sm {
  max-width: 420px;
}

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

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

.modal-icon-primary {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}
.modal-icon-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}
.modal-icon-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}
.modal-icon-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.modal-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}
.modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.02);
}

/* Any <form> directly inside a .modal gets flex layout so footer is always visible */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ─── Toast Notifications ───────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  pointer-events: all;
  position: relative;
  overflow: hidden;
  transform: translateX(120%);
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s;
  opacity: 0;
  min-width: 280px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast.hide {
  transform: translateX(120%);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s;
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}
.toast-info .toast-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.3;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.toast-close {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition);
  font-size: 0.9rem;
}
.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 3px 0 0;
  animation: toastProgress linear forwards;
}

.toast-success .toast-progress {
  background: var(--success);
}
.toast-error .toast-progress {
  background: var(--danger);
}
.toast-warning .toast-progress {
  background: var(--warning);
}
.toast-info .toast-progress {
  background: var(--info);
}

.toast-border {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.toast-success .toast-border {
  background: var(--success);
}
.toast-error .toast-border {
  background: var(--danger);
}
.toast-warning .toast-border {
  background: var(--warning);
}
.toast-info .toast-border {
  background: var(--info);
}

/* ─── Page Controls / Table Header ─────────────────────── */
.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.table-controls-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  min-width: 260px;
}

.search-box input {
  padding-left: 38px;
  padding-right: 14px;
}

.search-box-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Admin users — course / batch columns */
.users-admin-table .users-table-col-course {
  min-width: 6.5rem;
}
.users-admin-table .users-table-col-batch {
  min-width: 5.5rem;
}
.users-admin-table .users-table-course-cell,
.users-admin-table .users-table-batch-cell {
  max-width: 14rem;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-secondary);
}
.users-admin-table .users-table-batch-cell {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.users-table-course-text {
  font-weight: 600;
  color: var(--text-secondary);
}
.users-table-batch-text {
  font-weight: 500;
  color: var(--text-muted);
}
@media (max-width: 900px) {
  .users-admin-table .users-table-course-cell,
  .users-admin-table .users-table-batch-cell {
    max-width: 10rem;
  }
}

/* Bulk action bar */
.bulk-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.bulk-action-bar.visible {
  transform: translateX(-50%) translateY(0);
}

.bulk-action-count {
  font-weight: 700;
  font-size: 0.875rem;
}

.bulk-action-sep {
  opacity: 0.3;
}

.bulk-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: inherit;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.bulk-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.bulk-btn-danger {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}
.bulk-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ─── Pagination ────────────────────────────────────────── */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  padding: 0 8px;
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-hover);
}
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.page-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
}

/* ─── Empty States ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 300px;
  margin: 0 auto 20px;
}

/* ─── Skeleton Loader ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    var(--bg) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-title {
  height: 22px;
  width: 60%;
}
.skeleton-avatar {
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

/* ─── Avatar ────────────────────────────────────────────── */
.avatar-wrapper {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.avatar-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* ─── Due Date Badges ───────────────────────────────────── */
.due-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.due-overdue {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.due-soon {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}
.due-near {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
}
.due-ok {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

/* ─── Cursor Effects ────────────────────────────────────── */
#cursor-outer {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.07) 0%,
    transparent 70%
  );
  transition:
    transform 0.15s ease,
    background 0.3s ease;
  mix-blend-mode: multiply;
}

.dark #cursor-outer {
  mix-blend-mode: screen;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.12) 0%,
    transparent 70%
  );
}

#cursor-inner {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  background: var(--primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
  transition:
    width 0.2s,
    height 0.2s,
    background 0.2s;
}

.cursor-on-interactive #cursor-inner {
  width: 20px;
  height: 20px;
  background: var(--accent);
  mix-blend-mode: multiply;
}

/* ─── Auth Pages ────────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

.auth-left {
  flex: 1;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 20% 30%,
      rgba(99, 102, 241, 0.4) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 70%,
      rgba(139, 92, 246, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 90%,
      rgba(6, 182, 212, 0.2) 0%,
      transparent 50%
    );
  animation: auroraShift 8s ease infinite alternate;
}

.auth-right {
  width: 480px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  margin-bottom: 24px;
}

.auth-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 36px;
}

.auth-form {
  width: 100%;
}

.auth-features {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.9);
}

.auth-features h2 {
  font-family: "Poppins", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.25;
}

.auth-features p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 40px;
  line-height: 1.6;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.auth-feature-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

/* Password strength */
.password-strength {
  margin-top: 8px;
}
.strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 4px;
}
.strength-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition:
    width 0.3s,
    background 0.3s;
}
.strength-text {
  font-size: 0.75rem;
  font-weight: 600;
}

/* ─── Dashboard ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-left {
}

.page-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── File Upload ───────────────────────────────────────── */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  background: var(--bg);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.file-drop-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}
.file-drop-zone-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.file-drop-zone-text strong {
  color: var(--primary);
}

.file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.file-item:hover {
  border-color: var(--primary);
}

.file-item-info {
  flex: 1;
  min-width: 0;
}
.file-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Animations ────────────────────────────────────────── */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.7);
  }
}

@keyframes toastProgress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

@keyframes auroraShift {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
  }
}

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

@keyframes clickBurst {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

/* Page fade in */
.page-content {
  animation: fadeIn 0.4s ease;
}

/* Stagger children */
.stagger > * {
  animation: slideUp 0.4s ease backwards;
}
.stagger > *:nth-child(1) {
  animation-delay: 0.05s;
}
.stagger > *:nth-child(2) {
  animation-delay: 0.1s;
}
.stagger > *:nth-child(3) {
  animation-delay: 0.15s;
}
.stagger > *:nth-child(4) {
  animation-delay: 0.2s;
}
.stagger > *:nth-child(5) {
  animation-delay: 0.25s;
}
.stagger > *:nth-child(6) {
  animation-delay: 0.3s;
}

/* ─── Misc Utilities ────────────────────────────────────── */
.text-muted {
  color: var(--text-muted);
}
.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);
}

.d-flex {
  display: flex;
}
.align-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.gap-4 {
  gap: 16px;
}

.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}
.mb-6 {
  margin-bottom: 24px;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1280px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 72px;
  }
  .sidebar-brand-text,
  .sidebar-user-info,
  .nav-item span,
  .sidebar-section-label {
    display: none;
  }
  .sidebar-brand {
    padding: 16px 14px;
    justify-content: center;
  }
  .sidebar-user {
    padding: 12px 14px;
    justify-content: center;
  }
  .nav-item {
    padding: 12px;
    justify-content: center;
  }
  .nav-item-badge {
    position: absolute;
    top: 6px;
    right: 6px;
  }
  .sidebar-footer .btn span {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    width: 260px;
  }

  .sidebar.mobile-open .sidebar-brand-text,
  .sidebar.mobile-open .sidebar-user-info,
  .sidebar.mobile-open .nav-item span,
  .sidebar.mobile-open .sidebar-section-label {
    display: flex;
  }

  .sidebar.mobile-open .sidebar-brand {
    padding: 20px 20px 16px;
    justify-content: flex-start;
  }
  .sidebar.mobile-open .sidebar-user {
    padding: 16px 20px;
    justify-content: flex-start;
  }
  .sidebar.mobile-open .nav-item {
    padding: 10px 12px;
    justify-content: flex-start;
  }

  .main-content {
    margin-left: 0;
  }
  .navbar {
    left: 0;
  }

  .page-content {
    padding: 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .auth-left {
    display: none;
  }
  .auth-right {
    width: 100%;
    padding: 40px 24px;
  }

  .modal {
    max-height: 100vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  #cursor-inner,
  #cursor-outer {
    display: none;
  }

  .table-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    min-width: auto;
  }
  .table-controls-right {
    margin-left: 0;
  }
  .select-filter,
  .filter-select,
  .table-controls > select.form-control,
  .table-controls-right > select.form-control,
  .lms-assign-table-controls > select.form-control,
  .lms-timetable-table-controls > select.form-control,
  .apps-filters > select.form-control,
  .topic-filter-bar > select.form-control,
  .asn-filter-bar > select.form-control,
  .ann-filter-row > select.form-control,
  .att-toolbar > select.form-control,
  .pr-toolbar select.form-control,
  select.form-control#b-course,
  select.form-control#filter-batch,
  select.form-control#filter-course,
  .lms-program-combo--toolbar.lms-program-combo {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

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

@media (max-width: 768px) {
  .sidebar-overlay.visible {
    display: block;
  }
}

/* ─── Chart containers ─────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ─── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: "DM Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--primary);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ─── Alerts ────────────────────────────────────────────── */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #059669;
}
.alert-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: #d97706;
}
.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: #2563eb;
}

/* ─── Progress bars ─────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Notifications dropdown ────────────────────────────── */
.notifications-panel {
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.notification-item:hover {
  background: var(--bg-hover);
}
.notification-item.unread {
  background: var(--bg-active);
}

.notification-text {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.notification-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
