@import url('https://fonts.googleapis.com/css2?family=Viga&display=swap');

/* ==========================================
   AURORA THEME — UNIFIED STYLESHEET
   Single source of truth. Light + Dark + Print + Responsive.
   ========================================== */

/* ==========================================
   DESIGN TOKENS
   ========================================== */
:root {
  /* Core palette — Aurora Blue */
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary-color: #22d3ee;
  --success-color: #2ecc71;
  --error-color: #ff6b6b;
  --warning: #feca57;
  --info: #54a0ff;

  /* Surfaces & text */
  --bg: #f5f8fe;
  --surface: #ffffff;
  --muted: #a8b0c0;
  --text: #1e2a4a;
  --text-color: #1e2a4a;
  --light-gray: rgba(59, 130, 246, 0.06);
  --medium-gray: #eaeef6;
  --dark-gray: #64708a;

  /* Semantic */
  --border-color: rgba(59, 130, 246, 0.12);
  --border-light: rgba(34, 211, 238, 0.15);
  --hover-overlay: rgba(59, 130, 246, 0.05);
  --focus-ring: rgba(59, 130, 246, 0.2);

  /* Spacing */
  --gap-xs: 0.4rem;
  --gap-sm: 0.8rem;
  --gap: 1.2rem;
  --gap-lg: 1.6rem;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1rem;
  --card-padding: 1.25rem;

  /* Typography */
  --font-sans: 'Inter var', 'Inter', 'Geist', 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  --viga: "Viga", "Inter var", "Inter", "Geist", "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --base-size: 13px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 0.875rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --line-height: 1.5;

  /* Elevation */
  --shadow-sm: 0 4px 12px rgba(30, 42, 74, 0.06);
  --shadow-md: 0 8px 24px rgba(30, 42, 74, 0.08);
  --shadow-lg: 0 16px 48px rgba(30, 42, 74, 0.12);

  /* Motion */
  --transition-fast: 0.2s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 5040;
  --z-popover: 5050;
  --z-tooltip: 5060;
  --z-toast: 5070;

  /* Bootstrap bridge */
  --bs-primary: #3b82f6;
  --bs-primary-rgb: 59, 130, 246;
  --bs-secondary: #22d3ee;
  --bs-secondary-rgb: 34, 211, 238;
  --bs-success: #2ecc71;
  --bs-success-rgb: 46, 204, 113;
  --bs-danger: #ff6b6b;
  --bs-danger-rgb: 255, 107, 107;
  --bs-warning: #feca57;
  --bs-warning-rgb: 254, 202, 87;
  --bs-info: #54a0ff;
  --bs-info-rgb: 84, 160, 255;
}

/* ==========================================
   DARK THEME OVERRIDES — Aurora Night (Blue)
   ========================================== */
html.dark {
  --primary-color: #60a5fa;
  --primary-dark: #3b82f6;
  --primary-light: #93c5fd;
  --secondary-color: #22d3ee;
  --success-color: #2ecc71;
  --error-color: #ff6b6b;
  --warning: #feca57;
  --info: #54a0ff;

  --bg: #0d1526;
  --surface: #14203a;
  --muted: #8a97b0;
  --text: #e6eeff;
  --text-color: #e6eeff;
  --light-gray: rgba(59, 130, 246, 0.12);
  --medium-gray: #243452;
  --dark-gray: #a8b0c0;

  --border-color: rgba(59, 130, 246, 0.2);
  --border-light: rgba(34, 211, 238, 0.25);
  --hover-overlay: rgba(59, 130, 246, 0.15);
  --focus-ring: rgba(59, 130, 246, 0.4);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);

  --bs-body-bg: #0d1526;
  --bs-body-color: #e6eeff;
  --bs-border-color: rgba(59, 130, 246, 0.2);

  color-scheme: dark;
}

/* ==========================================
   BASE RESET
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

html, body { height: 100%; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html, body {
  user-select: none;
  overflow-x: auto;
  overflow-y: auto;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-color);
  font-size: var(--base-size);
  font-weight: 400;
  line-height: var(--line-height);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.content,
.content-help,
.card,
input,
textarea,
select { user-select: text; }

html.dark .tooltip {
  --bs-tooltip-bg: var(--surface);
  --bs-tooltip-color: var(--text-color);
  --bs-tooltip-opacity: 1;
  --bs-tooltip-border-radius: 8px;
}

html.dark .tooltip .tooltip-arrow::before {
  border-top-color: var(--bs-tooltip-bg);
  border-bottom-color: var(--bs-tooltip-bg);
}

html.dark .tooltip-inner { background: var(--surface); color: var(--text-color); border: 1px solid var(--border-color); }

button:focus:not(.btn),
input:focus:not(.form-control),
select:focus:not(.form-select),
textarea:focus:not(.form-control) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
html.dark input::placeholder { color: var(--muted); }

html.dark body { background: var(--bg); color: var(--text-color); }
html.dark .content { background: var(--bg); }
html.dark .content-help { background: var(--bg); }

/* Dark mode table text fix */
html.dark table,
html.dark .table {
  color: var(--text);
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-color);
  --bs-table-striped-color: var(--text);
  --bs-table-hover-color: var(--text);
  --bs-table-active-color: var(--text);
}

html.dark table td,
html.dark table th,
html.dark .table td,
html.dark .table th {
  color: var(--text);
}

html.dark .table > :not(caption) > * > * {
  color: var(--text);
  background-color: transparent;
  border-color: var(--border-color);
}

/* Keep your header accent but ensure contrast */
html.dark table th,
html.dark .table th {
  background: #22223e;
  color: var(--primary-light);
}

/* ==========================================
   LAYOUT & CONTAINERS
   ========================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gap-lg);
}

.content {
  margin-left: 0;
  padding: 2rem;
  transition: var(--transition-slow) ease;
  font-size: var(--text-sm);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  min-height: calc(100vh - 60px);
  font-weight: 400;
}
.content-help {
  margin-left: 0;
  padding: 2rem;
  transition: var(--transition-slow) ease;
  font-size: var(--text-sm);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  min-height: calc(100vh - 60px);
  font-weight: 400;
}

/* ==========================================
   AUTHENTICATION
   ========================================== */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(125deg, #f4f2ff 0%, #e8e4ff 100%);
}
html.dark .auth-container {
  background: linear-gradient(125deg, #1a1830 0%, #241f45 100%);
}

.auth-wrapper {
  display: flex;
  max-width: 1000px;
  width: 100%;
  background: var(--surface);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(4px);
}
html.dark .auth-wrapper,
html.dark .auth-right { background: var(--surface); }

.auth-left {
  flex: 1;
  background: linear-gradient(145deg, #7c6df0, #5f4fd1);
  color: white;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.auth-left h1 { font-size: 28px; margin-bottom: 20px; font-weight: 600; }
.auth-left p  { font-size: 15px; line-height: 1.6; opacity: 0.9; }

.auth-right { flex: 1; padding: 48px 44px; }

.auth-logo { display: flex; justify-content: center; margin-bottom: 30px; }
.auth-logo img {
  max-width: 70px; height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.05));
}

.auth-title {
  text-align: center;
  margin-bottom: 32px;
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
}
html.dark .auth-title { color: var(--primary-light); }

.auth-form-group { margin-bottom: 24px; }
.auth-form-row { display: flex; gap: 20px; }
.auth-form-row .auth-form-group { flex: 1; }

.auth-label {
  display: block;
  margin-left: 12px;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.auth-input,
.auth-select {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg);
  border: 1.5px solid var(--medium-gray);
  border-radius: 24px;
  font-size: 14px;
  transition: all var(--transition-base);
  color: var(--text);
}
html.dark .auth-input,
html.dark .auth-select {
  background: #262647;
  border-color: rgba(124, 109, 240, 0.25);
  color: var(--text);
}
.auth-input:focus,
.auth-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(124, 109, 240, 0.1);
}
html.dark .auth-input:focus,
html.dark .auth-select:focus {
  background: #2d2d52;
  border-color: var(--primary-color);
}

.auth-password-container { position: relative; }
.auth-toggle-password {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark-gray);
}

.auth-error-message { color: var(--error-color); font-size: 13px; margin-top: 6px; display: none; }

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(105deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-top: 16px;
}
.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(124, 109, 240, 0.3);
}
.auth-submit-btn:disabled {
  background: var(--dark-gray);
  cursor: not-allowed;
  transform: none;
}
html.dark .auth-submit-btn:disabled { color: #14142b; }

.auth-login-link { text-align: center; margin-top: 28px; font-size: 14px; }
.auth-login-link a { color: var(--primary-color); text-decoration: none; font-weight: 500; }
.auth-login-link a:hover { text-decoration: underline; }

.auth-success-message {
  background-color: rgba(46, 204, 113, 0.1);
  color: var(--success-color);
  padding: 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  text-align: center;
  display: none;
}
html.dark .auth-success-message { background-color: rgba(46, 204, 113, 0.15); }





/* ==========================================
   NAVIGATION — SIDEBAR & TOPBAR
   ========================================== */
.sidebar,
.sidebar-help {
  height: 100vh;
  position: fixed;
  top: 0;
  z-index: var(--z-fixed);
  overflow-y: auto;
  background: linear-gradient(165deg, #1e2a4a 0%, #15203a 100%);
  color: #cdd6ea;
  border-right: 1px solid rgba(205, 214, 234, 0.08);
  transition: left var(--transition-slow) ease, box-shadow var(--transition-slow);
  padding-bottom: 2rem;
}

.sidebar {
  width: 260px;
  left: -260px;
}

.sidebar-help { width: 360px; left: -360px; }

html.dark .sidebar, html.dark .sidebar-help {
  background: linear-gradient(165deg, #0d1526 0%, #070c17 100%);
  border-right-color: rgba(205, 214, 234, 0.05);
}
.sidebar.show { left: 0; }
.sidebar-help.show { left: 0; }

.sidebar .logo, .sidebar-help .logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(205, 214, 234, 0.1);
  margin-bottom: 1rem;
}
.sidebar .logo img, .sidebar-help .logo img {
  height: 48px;
  max-width: 85%;
  object-fit: contain;
  -webkit-user-drag: none;
  pointer-events: none;
}
.logo-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  cursor: default;
  background: transparent;
  z-index: 2;
}

.sidebar ul, .sidebar-help ul { list-style: none; margin: 0; padding: 0 12px; }
.sidebar ul li, .sidebar-help ul li {
  padding: 0.75rem 1rem;
  margin: 6px 0;
  font-size: 0.9rem;
  font-weight: 450;
  color: inherit;
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  cursor: pointer;
  border-radius: 16px;
  transition: all var(--transition-base);
}
.sidebar ul li span, .sidebar-help ul li span { display: flex; align-items: center; gap: var(--gap); }
.sidebar ul li i, .sidebar-help ul li i { font-size: 1.2rem; width: 28px; }
.sidebar a:link, .sidebar a:visited, .sidebar-help a:link, .sidebar-help a:visited { color: inherit; text-decoration: none; width: 100%; }
.sidebar ul li:hover, .sidebar-help ul li:hover {
  background: rgba(59, 130, 246, 0.25);
  transform: translateX(4px);
}
.sidebar ul li.active, .sidebar-help ul li.active {
  background: rgba(59, 130, 246, 0.09);
  color: #d8e6ff;
  border-left: 7px solid var(--primary-color);
  border-radius: 2px;
}
html.dark .sidebar ul li.active, html.dark .sidebar-help ul li.active { color: #e6eeff; border-left-color: var(--primary-light); }

.submenu {
  display: none;
  list-style: none;
  padding-left: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  margin-top: 6px;
}
.submenu li {
  padding: 0.5rem 0;
  padding-left: 2rem;
  font-size: 0.8rem !important;
  color: rgba(205, 214, 234, 0.85);
}
.submenu li:hover { color: #fff; background: rgba(59, 130, 246, 0.2); }

.rotate { transition: transform var(--transition-base); font-size: var(--text-base); margin-left: auto; }
.rotate.down { transform: rotate(90deg); }

.sidebar::-webkit-scrollbar, .sidebar-help::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb, .sidebar-help::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.5);
  border-radius: 10px;
}




/* ==========================================
   TOPBAR
   ========================================== */
.slliq-title {
  font-family: var(--viga);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--primary-color) !important;
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border-color);
}
.topbar-help {
  height: 64px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border-color);
}
html.dark .topbar, html.dark .topbar-help {
  background: rgba(20, 32, 58, 0.92);
  border-bottom-color: var(--border-color);
}

.logo-img { height: 36px; width: auto; object-fit: contain; }

.profile-pic {
  height: 42px;
  width: 42px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border-light);
  padding: 1px;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(30, 42, 74, 0.05);
}
.profile-pic:hover {
  border-color: var(--primary-color);
  transform: scale(1.02);
}

/*
html.dark .profile-pic {
  border: 2px solid rgba(255, 255, 255, 0.5);
}
*/

.nav-icons { display: flex; align-items: center; gap: 1.2rem; }
.nav-icons i {
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text);
  transition: color var(--transition-fast);
}
.nav-icons i:hover { color: var(--primary-color); }
html.dark .nav-icons i { color: var(--text); }

.sidebar-toggle, .sidebar-help-toggle {
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
  display: block;
}
html.dark .sidebar-toggle, html.dark .sidebar-help-toggle { color: var(--primary-light); }

.nav-icons .dropdown-toggle::after { display: none !important; }

.dropdown-menu {
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  word-wrap: break-word;
  white-space: normal;
  border-radius: 24px;
  border: none;
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 0;
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
}
html.dark .dropdown-menu {
  background: rgba(20, 32, 58, 0.98);
  border: 1px solid var(--border-color);
}

.dropdown-item {
  white-space: normal;
  word-break: break-word;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: var(--gap-sm);
  line-height: var(--line-height);
  padding: 0.6rem 1rem;
  transition: background var(--transition-fast);
}
.dropdown-item:hover { background: var(--hover-overlay); }
html.dark .dropdown-item { color: var(--text); }
html.dark .dropdown-item:hover { background: var(--hover-overlay); }

.dropdown-item-text {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--muted);
  padding: 0.6rem 1rem;
}
html.dark .dropdown-item-text { color: var(--muted); }

.dropdown-divider { margin: 0.5rem 0; }
html.dark .dropdown-divider { border-top-color: var(--border-color); }

.profile-dropdown .dropdown-menu { width: 240px; }
.profile-dropdown .dropdown-item i {
  font-size: var(--text-base);
  color: var(--muted);
  width: 24px;
}
.profile-dropdown .dropdown-item:hover i { color: var(--primary-color); }




/* ==========================================
   THEME TOGGLE
   ========================================== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color, rgba(124,109,240,0.12));
  background: var(--surface, #fff);
  color: var(--text, #2d2b4a);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--primary-color, #7c6df0);
  color: var(--primary-color, #7c6df0);
  transform: scale(1.05);
}
html.dark .theme-toggle {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-color);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  border: none;
  border-radius: 40px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(124, 109, 240, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #6b5bdf 0%, #4f3fc1 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124, 109, 240, 0.4);
}
.btn-primary:active { transform: translateY(1px); }

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #27ae60 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(46, 204, 113, 0.3);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(46, 204, 113, 0.4); }

.btn-danger {
  background: linear-gradient(135deg, var(--error-color) 0%, #ee5a24 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255, 107, 107, 0.4); }

.btn-info {
  background: linear-gradient(135deg, var(--info) 0%, #2e86de 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(84, 160, 255, 0.3);
}
.btn-info:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(84, 160, 255, 0.4); }

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #f9ca24 100%);
  color: #2d2b4a;
  box-shadow: 0 4px 16px rgba(254, 202, 87, 0.3);
}
.btn-warning:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(254, 202, 87, 0.4); }

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #44bdae 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(78, 205, 196, 0.4); }

.btn:active { transform: translateY(1px); }

.btn-outline-primary {
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  background: transparent;
  border-radius: 40px;
}
.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 109, 240, 0.25);
}

.btn-outline-success {
  color: var(--success-color);
  border: 2px solid var(--success-color);
  background: transparent;
  border-radius: 40px;
}
.btn-outline-success:hover { background: var(--success-color); color: white; transform: translateY(-2px); }

.btn-outline-danger {
  color: var(--error-color);
  border: 2px solid var(--error-color);
  background: transparent;
  border-radius: 40px;
}
.btn-outline-danger:hover { background: var(--error-color); color: white; transform: translateY(-2px); }

.btn-glass {
  background: rgba(248, 249, 254, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(124, 109, 240, 0.2);
  color: var(--primary-color);
  font-weight: 600;
}
.btn-glass:hover {
  background: rgba(124, 109, 240, 0.85);
  border-color: rgba(124, 109, 240, 0.4);
  color: white;
  transform: translateY(-2px);
}
html.dark .btn-glass {
  background: rgba(30, 30, 58, 0.7);
  border-color: rgba(124, 109, 240, 0.3);
  color: var(--primary-light);
}
html.dark .btn-glass:hover { background: rgba(124, 109, 240, 0.85); color: white; }

/* Button animations */
.btn-flash { position: relative; overflow: hidden; }
.btn-flash::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: flash 2s infinite;
}
@keyframes flash {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), rgba(255,255,255,0.6), rgba(255,255,255,0.4), transparent);
  transform: rotate(25deg);
  animation: shine 3s infinite;
}
@keyframes shine {
  0% { left: -60%; }
  20% { left: 150%; }
  100% { left: 150%; }
}

/* ==========================================
   ALERTS
   ========================================== */
.alert-info {
  background-color: rgba(84, 160, 255, 0.08) !important;
  border: 1px solid rgba(84, 160, 255, 0.3) !important;
  border-radius: var(--radius-lg) !important;
}
.alert-success {
  background-color: rgba(46, 204, 113, 0.08) !important;
  border: 1px solid rgba(46, 204, 113, 0.3) !important;
  border-radius: var(--radius-lg) !important;
}
.alert-danger {
  background-color: rgba(255, 107, 107, 0.08) !important;
  border: 1px solid rgba(255, 107, 107, 0.3) !important;
  border-radius: var(--radius-lg) !important;
}
.alert-warning {
  background-color: rgba(254, 202, 87, 0.08) !important;
  border: 1px solid rgba(254, 202, 87, 0.3) !important;
  border-radius: var(--radius-lg) !important;
}

html.dark .alert-info    { background-color: rgba(84, 160, 255, 0.12) !important; color: var(--text); }
html.dark .alert-success { background-color: rgba(46, 204, 113, 0.12) !important; color: var(--text); }
html.dark .alert-danger  { background-color: rgba(255, 107, 107, 0.12) !important; color: var(--text); }
html.dark .alert-warning { background-color: rgba(254, 202, 87, 0.12) !important; color: var(--text); }

/* ==========================================
   BADGES
   ========================================== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 40px;
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge-pill { border-radius: 40px; }
.badge-muted { background: rgba(45, 43, 74, 0.06); color: var(--muted); }
html.dark .badge-muted { background: rgba(124, 109, 240, 0.15); color: var(--muted); }

.badge-primary { background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: white; }
.badge-success { background: linear-gradient(135deg, var(--success-color), #27ae60); color: white; }
.badge-danger  { background: linear-gradient(135deg, var(--error-color), #ee5a24); color: white; }
.badge-warning { background: linear-gradient(135deg, var(--warning), #f9ca24); color: #2d2b4a; }
.badge-info    { background: linear-gradient(135deg, var(--info), #2e86de); color: white; }
html.dark .badge-warning { color: #14142b; }

.status-badge { padding: 0.4em 0.8em; font-size: 0.7rem; font-weight: 600; border-radius: 30px; }
.status-active  { background-color: #e0f2e9; color: var(--success-color); }
.status-pending { background-color: #fef1df; color: var(--warning); }
html.dark .status-active  { background-color: rgba(46, 204, 113, 0.18); color: var(--success-color); }
html.dark .status-pending { background-color: rgba(254, 202, 87, 0.18); color: var(--warning); }

.role-badge {
  padding: 0.4em 0.8em;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 30px;
  background-color: var(--medium-gray);
  color: var(--text);
}

.badge-status { padding: 0.35rem 0.85rem; border-radius: 30px; font-size: var(--text-xs); font-weight: 600; }

/* ==========================================
   LINKS
   ========================================== */
a { color: var(--primary-color); transition: color 0.2s ease; }
a:hover { color: var(--primary-dark); }
html.dark a { color: var(--primary-light); }
html.dark a:hover { color: var(--primary-color); }

/* ==========================================
   FORMS
   ========================================== */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(124, 109, 240, 0.15);
}

.input-base,
.input-filled,
.input-underline,
.custom-textarea,
.custom-select,
input[type="date"],
.form-control[type="file"] {
  border-radius: 28px;
  border: 1.5px solid var(--medium-gray);
  padding: 0.75rem 1.25rem;
  transition: all var(--transition-base);
  font-size: var(--text-sm);
  background: var(--bg);
  color: var(--text);
}
html.dark .input-base,
html.dark .input-filled,
html.dark .custom-textarea,
html.dark .custom-select,
html.dark .form-control,
html.dark .form-select,
html.dark .form-control-custom,
html.dark input[type="date"],
html.dark input[type="number"],
html.dark .form-control[type="file"] {
  background: #262647;
  border-color: rgba(124, 109, 240, 0.2);
  color: var(--text);
}

.input-base:focus,
.input-filled:focus,
.custom-select:focus,
.custom-textarea:focus,
input[type="date"]:focus,
.form-control[type="file"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(124, 109, 240, 0.1);
  background-color: var(--surface);
}
html.dark .input-base:focus,
html.dark .input-filled:focus,
html.dark .custom-select:focus,
html.dark .custom-textarea:focus,
html.dark .form-control:focus,
html.dark .form-select:focus,
html.dark .form-control-custom:focus,
html.dark input[type="date"]:focus,
html.dark .form-control[type="file"]:focus {
  background: #2d2d52;
  border-color: var(--primary-color);
  color: var(--text);
}

html.dark .input-filled { background-color: #22223e; }

.input-underline {
  border: none;
  border-bottom: 2px solid var(--medium-gray);
  border-radius: 0;
  background: transparent;
  padding-left: 0;
}
.input-underline:focus { border-bottom-color: var(--primary-color); box-shadow: none; }
html.dark .input-underline { background: transparent; border-bottom-color: var(--medium-gray); }
html.dark .input-underline:focus { background: transparent; border-bottom-color: var(--primary-color); }

.input-rounded {
  border-radius: 40px;
  border: 1.5px solid var(--medium-gray);
  padding: 0.75rem 1.5rem;
  transition: var(--transition-base);
  background: var(--bg);
  color: var(--text);
}
.input-rounded:focus { border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(124, 109, 240, 0.1); }
html.dark .input-rounded {
  background: #262647;
  border-color: rgba(124, 109, 240, 0.2);
  color: var(--text);
}

textarea.custom-textarea { min-height: 100px; resize: vertical; border-radius: 24px; }

select.custom-select { background-color: var(--bg); cursor: pointer; color: var(--text); }
html.dark select.custom-select { color: var(--text); }
html.dark select.custom-select option { background: #262647; color: var(--text); }

.form-check-input { background-color: var(--surface); border-color: var(--medium-gray); }
html.dark .form-check-input {
  background-color: #2a2a4a;
  border-color: rgba(124, 109, 240, 0.3);
}
.form-check-input[type="radio"]:checked { background-color: var(--primary-color); border-color: var(--primary-color); }
.form-check-input[type="checkbox"]:checked { background-color: var(--success-color); border-color: var(--success-color); }

.form-check.form-switch .form-check-input {
  width: 2.8em;
  height: 1.4em;
  border: 1px solid var(--medium-gray);
}
.form-check.form-switch .form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-range::-webkit-slider-thumb { background: var(--primary-color); border: none; }
.form-range::-moz-range-thumb     { background: var(--primary-color); border: none; }

.form-control[type="file"] {
  border: 1.5px dashed #d0d0e0;
  padding: 0.75rem;
  border-radius: 28px;
  background: var(--bg);
  color: var(--text);
}
.form-control[type="file"]:hover { border-color: var(--primary-color); background: #f2f2fd; }
html.dark .form-control[type="file"] { border-color: rgba(124, 109, 240, 0.35); }
html.dark .form-control[type="file"]:hover { background: #2a2a4a; }

input[type="color"] {
  border: 2px solid var(--medium-gray);
  border-radius: 20px;
  width: 60px;
  height: 42px;
  cursor: pointer;
  transition: border-color var(--transition-base);
  background: var(--bg);
}
input[type="color"]:focus { border-color: var(--primary-color); }
html.dark input[type="color"] { background: #262647; border-color: rgba(124, 109, 240, 0.3); }

.form-control-custom {
  border-radius: 28px;
  padding: 0.75rem 1.25rem;
  border: 1.5px solid var(--medium-gray);
  transition: all var(--transition-base);
  font-size: var(--text-base);
  background: var(--bg);
  color: var(--text);
}
.form-control-custom:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(124, 109, 240, 0.1);
}

.form-label { font-weight: 500; color: var(--text); margin-bottom: 0.5rem; }
html.dark .form-label { color: var(--text); }

.input-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; display: block; }
.input-hint i { color: var(--primary-color); margin-right: 0.25rem; }
html.dark .input-hint,
html.dark .character-count { color: var(--muted); }
html.dark .input-hint i { color: var(--primary-color); }

.required-field::after { content: " *"; color: var(--error-color); }
.character-count { font-size: 0.75rem; color: var(--muted); text-align: right; margin-top: 0.25rem; }

.input-group-hint {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: var(--medium-gray);
  border: 1px solid #d0d0e0;
  color: var(--text);
  font-size: 0.875rem;
}
html.dark .input-group-hint {
  background: var(--medium-gray);
  border-color: rgba(124, 109, 240, 0.25);
  color: var(--text);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  z-index: 5;
}
.input-group { position: relative; }
.input-group .form-control { padding-left: 48px; }

/* ==========================================
   FORM SECTIONS & STEP INDICATOR
   ========================================== */
.form-section {
  background: var(--bg);
  border-radius: 28px;
  padding: 1.8rem;
  margin-bottom: 2rem;
  border-left: 5px solid var(--primary-color);
}
html.dark .form-section { background: var(--surface); }

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--medium-gray);
}
html.dark .section-header { border-bottom-color: var(--border-color); }

.section-icon {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.3rem;
}
.section-title { font-weight: 700; color: var(--primary-dark); margin: 0; }
html.dark .section-title { color: var(--primary-light); }
.section-description { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

.preview-card {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 28px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.preview-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.preview-content { font-size: 0.9rem; opacity: 0.9; }

.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 60px;
}
html.dark .step-indicator { background: var(--surface); border: 1px solid var(--border-color); }

.step { display: flex; align-items: center; flex: 1; }
.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--medium-gray);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 0.75rem;
  font-size: 0.9rem;
}
.step.active .step-number {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: white;
}
.step.completed .step-number { background: var(--success-color); color: white; }

.step-text { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.step.active .step-text { color: var(--primary-dark); font-weight: 600; }
.step.completed .step-text { color: var(--success-color); }
html.dark .step.active .step-text { color: var(--primary-light); }
html.dark .step-text { color: var(--muted); }

.step-connector { flex: 1; height: 2px; background: var(--medium-gray); margin: 0 1rem; }
.step.completed .step-connector { background: var(--success-color); }

.feature-highlight {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
  color: white;
  border-radius: 28px;
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: center;
}
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  width: 68px;
  height: 68px;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 1.8rem;
}
.feature-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.feature-description { font-size: 0.85rem; opacity: 0.9; }

/* ==========================================
   CARDS
   ========================================== */
.card {
  background: var(--surface);
  padding: var(--card-padding);
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
  height: auto !important;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(124, 109, 240, 0.05);
}
html.dark .card {
  background: var(--surface);
  border-color: var(--border-color);
  color: var(--text);
}
.card > * { flex-shrink: 1; min-height: 0; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.card-title { color: var(--primary-dark); font-weight: 600; }
html.dark .card-title { color: var(--primary-light); }

.dashboard {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dash-card {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(124, 109, 240, 0.08);
}
html.dark .dash-card {
  background: var(--surface);
  border-color: var(--border-color);
  color: var(--text);
}
.dash-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.dash-card .card-body { padding: 1.2rem; display: flex; align-items: center; gap: 1rem; }

.dash-icon {
  width: 54px;
  height: 54px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
}

.dash-card h6 {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.dash-card h5 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-dark);
}

.text-muted { color: var(--text-muted) !important; }

html.dark .dash-card h5 { color: var(--primary-light); }
.dash-card p { font-size: 0.7rem; color: var(--muted); margin-top: 0.2rem; }
html.dark .dash-card p { color: var(--muted); }

.card-progress { background: var(--medium-gray); height: 5px; border-radius: 5px; overflow: hidden; margin: 0 1rem 1rem; }
html.dark .card-progress { background: var(--medium-gray); }
.card-progress span {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
}

.search-card {
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  border: none;
  overflow: hidden;
  transition: all var(--transition-base);
  background: linear-gradient(125deg, #f8f9fe 0%, #f2f0ff 100%);
}
html.dark .search-card { background: linear-gradient(125deg, #1e1e3a 0%, #252548 100%); }
.search-card a:link, .search-card a:visited { color: inherit; text-decoration: none; }
.search-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(45, 43, 74, 0.12); }

.card-header-custom {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: white;
  padding: 1.5rem;
  border-bottom: none;
}
.card-header-custom h3 { margin: 0; font-weight: 600; display: flex; align-items: center; gap: var(--gap-sm); }
.card-header-custom h3 i { font-size: 1.6rem; }

.profile-card {
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
  border: none;
  overflow: hidden;
  transition: all var(--transition-base);
  height: 100%;
  background: var(--surface);
}
html.dark .profile-card,
html.dark .profile-sidebar-card,
html.dark .profile-tab-content-card { background: var(--surface); border-color: var(--border-color); color: var(--text); }
.profile-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.profile-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}
.profile-card .card-body { padding: 1.5rem; }

/* ==========================================
   TABLES
   ========================================== */
table { color: var(--text); width: 100%; border-collapse: collapse; margin-bottom: 0; }
table th, table td {
  padding: 0.9rem 0.75rem;
  text-align: left;
  border-top: 1px solid var(--border-color);
}
table th {
  border-top: none;
  font-weight: 600;
  background: var(--bg);
  color: var(--primary-dark);
}
html.dark table th {
  background: #22223e;
  color: var(--primary-light);
}
html.dark table th,
html.dark table td { border-top-color: var(--border-color); }

.table > :not(caption) > * > * { padding: 0.85rem 0.6rem; }

.upload-table input[type="number"] {
  width: 80px;
  padding: 0.4rem;
  text-align: center;
  border-radius: 20px;
  border: 1px solid var(--medium-gray);
  font-size: var(--text-sm);
  background: var(--bg);
  color: var(--text);
}
html.dark .upload-table input[type="number"] {
  background: #262647;
  border-color: rgba(124, 109, 240, 0.25);
  color: var(--text);
}
.upload-table tr:nth-child(even) input { border-color: var(--primary-color); }
.upload-table tr:nth-child(odd) input  { border-color: var(--success-color); }
.upload-table .upload-btn { text-align: right; margin-top: 1rem; }

html.dark .upload-table tr:nth-child(even) input { border-color: var(--primary-color); }
html.dark .upload-table tr:nth-child(odd) input  { border-color: var(--success-color); }

.table-plain { background-color: var(--surface); color: var(--text); }
.table-plain th, .table-plain td { border: 1px solid var(--border-color); }
html.dark .table-plain { background-color: var(--surface); color: var(--text); }
html.dark .table-plain th,
html.dark .table-plain td { border-color: var(--border-color); }

.table-striped-custom th, .table-striped-custom td { border: 1px solid var(--border-color); }
.table-striped-custom tbody tr:nth-child(odd) { background-color: var(--bg); }
html.dark .table-striped-custom th,
html.dark .table-striped-custom td { border-color: var(--border-color); }
html.dark .table-striped-custom tbody tr:nth-child(odd) { background-color: #22223e; }

.table-bordered-custom th, .table-bordered-custom td { border: 2px solid #d0d0e0; }
html.dark .table-bordered-custom th,
html.dark .table-bordered-custom td { border-color: rgba(124, 109, 240, 0.3); }

.table-hover-custom th, .table-hover-custom td { border: 1px solid var(--border-color); }
.table-hover-custom tbody tr:hover { background-color: var(--hover-overlay); cursor: pointer; }
html.dark .table-hover-custom tbody tr:hover,
html.dark .table-hover tbody tr:hover { background-color: var(--hover-overlay); }

.table-dark-custom { background-color: #2d2b4a; color: #fff; }
.table-dark-custom th, .table-dark-custom td { border: 1px solid #4a4868; }
.table-dark-custom tbody tr:nth-child(odd) { background-color: #3a3860; }
html.dark .table-dark-custom { background-color: #0f0e22; color: var(--text); }
html.dark .table-dark-custom th,
html.dark .table-dark-custom td { border-color: rgba(208, 206, 230, 0.15); }
html.dark .table-dark-custom tbody tr:nth-child(odd) { background-color: #1a1830; }

.table-colored { background-color: var(--medium-gray); color: var(--primary-dark); }
.table-colored th, .table-colored td { border: 1px solid #d0d0e0; }
html.dark .table-colored { background-color: var(--medium-gray); color: var(--primary-light); }
html.dark .table-colored th,
html.dark .table-colored td { border-color: rgba(124, 109, 240, 0.3); }

.table-gradient { color: #fff; background: linear-gradient(135deg, var(--primary-color), var(--primary-light)); }
.table-gradient th, .table-gradient td { border: 1px solid rgba(255, 255, 255, 0.2); }

.table-minimal { border: none; background-color: var(--surface); }
.table-minimal th { border-bottom: 2px solid var(--primary-color); color: var(--primary-color); font-weight: bold; }
.table-minimal td { border-bottom: 1px solid var(--border-color); }
html.dark .table-minimal { background-color: var(--surface); }
html.dark .table-minimal td { border-bottom-color: var(--border-color); }

.table-glass {
  backdrop-filter: blur(8px);
  background-color: rgba(248, 249, 254, 0.7);
  border-radius: var(--radius-sm);
}
.table-glass th, .table-glass td { border: 1px solid rgba(124, 109, 240, 0.2); }
html.dark .table-glass { background-color: rgba(30, 30, 58, 0.7); }

.table-shadow { background-color: var(--surface); box-shadow: var(--shadow-lg); border-radius: 24px; }
.table-shadow th, .table-shadow td { border: none; padding: 0.9rem 1rem; }
html.dark .table-shadow { background-color: var(--surface); }

/* ==========================================
   NOTIFIERS
   ========================================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: var(--z-toast); }

.notifier-container {
  position: fixed;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  padding: 0.9375rem;
  pointer-events: none;
  font-family: var(--font-sans);
}
.notifier-top-right    { top: 20px; right: 20px; align-items: flex-end; }
.notifier-bottom-right { bottom: 20px; right: 20px; align-items: flex-end; }
.notifier-top-left     { top: 20px; left: 20px; align-items: flex-start; }
.notifier-bottom-left  { bottom: 20px; left: 20px; align-items: flex-start; }

.notifier {
  min-width: 300px;
  max-width: 420px;
  background: #fffefc;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  overflow: hidden;
  padding: 0.8rem 1.2rem;
  border-left: 4px solid transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  pointer-events: all;
  animation: slideIn 0.4s ease forwards;
  opacity: 0;
  transform: translateX(30px);
}
html.dark .notifier { background: var(--surface); color: var(--text); border: 1px solid var(--border-color); opacity: 0.8; }

@keyframes slideIn {
  0%   { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
  0%   { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(30px); }
}

.notifier .icon { font-size: 1.5rem; flex-shrink: 0; }
.notifier .close-btn {
  margin-left: auto;
  cursor: pointer;
  font-weight: bold;
  color: var(--muted);
  transition: color var(--transition-base);
}
.notifier .close-btn:hover { color: var(--primary-color); }
html.dark .notifier .close-btn { color: var(--muted); }
html.dark .notifier .close-btn:hover { color: var(--primary-color); }

.notifier-success { border-left-color: var(--success-color); background: #edf7f2; }
.notifier-success .icon { color: var(--success-color); }
.notifier-error { border-left-color: var(--error-color); background: #fef3f1; }
.notifier-error .icon { color: var(--error-color); }
.notifier-warning { border-left-color: var(--warning); background: #fef8e8; }
.notifier-warning .icon { color: var(--warning); }
.notifier-info { border-left-color: var(--info); background: #eef6fc; }
.notifier-info .icon { color: var(--info); }

html.dark .notifier-success { background: rgba(46, 204, 113, 0.12); }
html.dark .notifier-error   { background: rgba(255, 107, 107, 0.12); }
html.dark .notifier-warning { background: rgba(254, 202, 87, 0.12); }
html.dark .notifier-info    { background: rgba(84, 160, 255, 0.12); }

/* ==========================================
   MODALS
   ========================================== */
.confirmation-modal {
  position: fixed;
  inset: 0;
  background: rgba(45, 43, 74, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  padding: 1rem;
}
html.dark .confirmation-modal { background: rgba(0, 0, 0, 0.7); }
.confirmation-modal.show { opacity: 1; pointer-events: all; }

.confirmation-content {
  background: #fffefc;
  border-radius: 32px;
  width: 90%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem 2rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  position: relative;
  text-align: center;
  animation: fadeInScale 0.3s ease forwards;
}
html.dark .confirmation-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-color);
}
.confirmation-content .confirmation-icon { font-size: 3.5rem; color: var(--warning); }

.confirmation-close {
  font-size: 1.5rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: color var(--transition-base);
  position: absolute;
  top: 18px;
  right: 18px;
}
.confirmation-close:hover { color: var(--primary-color); }
html.dark .confirmation-close { color: var(--muted); }
html.dark .confirmation-close:hover { color: var(--primary-color); }

.confirmation-body {
  margin-top: 1.25rem;
  font-size: var(--text-sm);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
html.dark .confirmation-body { color: var(--muted); }

.confirmation-message {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 8px;
}
.confirmation-message::-webkit-scrollbar { width: 6px; }
.confirmation-message::-webkit-scrollbar-thumb { background: #d0d0e0; border-radius: 6px; }
html.dark .confirmation-message::-webkit-scrollbar-thumb { background: var(--medium-gray); }

.confirmation-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: var(--gap);
  flex-shrink: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--medium-gray);
}
html.dark .confirmation-footer { border-top-color: var(--border-color); }

@keyframes fadeInScale {
  0%   { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

.modal-confirm .modal-content { border-radius: 32px; text-align: center; padding: 1.5rem; }
html.dark .modal-confirm .modal-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-color);
}
.modal-confirm .icon-box { font-size: 4rem; color: var(--warning); margin-bottom: 0.75rem; }

.confirmation-content.confirmation-md { max-width: 520px; }
.confirmation-content.confirmation-lg { max-width: 720px; }
.confirmation-md .confirmation-body { padding: 1.5rem; }
.confirmation-lg .confirmation-body { padding: 2rem; }

/* ==========================================
   PROFILE COMPONENTS
   ========================================== */
.profile-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: 32px;
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.profile-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.08)"/></svg>');
  background-size: cover;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
html.dark .profile-avatar { border-color: var(--surface); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }

.profile-avatar.profile-avatar-lg {
  width: 130px;
  height: 130px;
  border: 4px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  position: relative;
  z-index: 2;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(124, 109, 240, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.profile-stats {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin-top: 1.8rem;
  position: relative;
  z-index: 2;
}
.stat-item { padding: 0 1rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; display: block; }
.stat-label { font-size: var(--text-sm); opacity: 0.85; }

.info-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.info-item:last-child { border-bottom: none; }
.info-label { width: 140px; font-weight: 600; color: var(--text); font-size: 0.8rem; }
.info-value { flex: 1; color: var(--text); font-size: 0.85rem; }
html.dark .info-item { border-bottom-color: var(--border-color); }
html.dark .info-label { color: var(--muted); }
html.dark .info-value { color: var(--text); }

.action-list { list-style: none; padding: 0; margin: 0; }
.action-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--gap);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.action-item:last-child { border-bottom: none; }
.action-item:hover {
  background-color: var(--hover-overlay);
  padding-left: 0.75rem;
  border-radius: 20px;
}
.action-item i { width: 28px; text-align: center; color: var(--primary-color); }
html.dark .action-item { border-bottom-color: var(--border-color); color: var(--text); }
html.dark .action-item:hover { background-color: var(--hover-overlay); }
html.dark .action-item i { color: var(--primary-color); }

.profile-actions { display: flex; gap: var(--gap); margin-bottom: 1.8rem; flex-wrap: wrap; }

.skill-item { margin-bottom: 1rem; }
.skill-info { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }

.progress { height: 8px; border-radius: 10px; background: var(--medium-gray); }
html.dark .progress { background: var(--medium-gray); }
.progress-bar {
  background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
  border-radius: 10px;
}

.activity-timeline { position: relative; padding-left: 2rem; }
.activity-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(124, 109, 240, 0.2);
}
html.dark .activity-timeline::before { background: rgba(124, 109, 240, 0.3); }

.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px rgba(124, 109, 240, 0.3);
}
html.dark .timeline-item::before {
  background: var(--primary-color);
  border-color: var(--surface);
  box-shadow: 0 0 0 2px rgba(124, 109, 240, 0.4);
}
.timeline-date { font-size: var(--text-sm); color: var(--muted); margin-bottom: 0.25rem; }
.timeline-content { font-size: var(--text-sm); color: var(--text); }
html.dark .timeline-date { color: var(--muted); }
html.dark .timeline-content { color: var(--text); }

/* ==========================================
   PROFILE TABS / SUBJECTS / CLASSES (unified)
   ========================================== */
.profile-sidebar-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.profile-tab-nav { list-style: none; padding: 0; margin: 0; }
.profile-tab-nav li {
  border-left: 3px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.profile-tab-nav li.active { background: var(--hover-overlay); border-left-color: var(--primary-color); }
.profile-tab-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
}
.profile-tab-nav li a i { font-size: 1.25rem; width: 28px; color: var(--muted); }
.profile-tab-nav li a:hover { background: var(--hover-overlay); }
.profile-tab-nav li.active a { color: var(--primary-dark); }
.profile-tab-nav li.active a i { color: var(--primary-color); }
html.dark .profile-tab-nav li a { color: var(--text); }
html.dark .profile-tab-nav li a i { color: var(--muted); }
html.dark .profile-tab-nav li.active a { color: var(--primary-light); }
html.dark .profile-tab-nav li.active a i { color: var(--primary-color); }

.profile-tab-content-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  height: 100%;
  min-height: 480px;
}
.profile-tab-pane { display: none; }
.profile-tab-pane.active-pane { display: block; animation: fadeIn 0.25s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pane-action-btn { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); }
html.dark .pane-action-btn { border-top-color: var(--border-color); }

.subject-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 0.9rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.subject-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
html.dark .subject-card { background: #22223e; border-color: var(--border-color); color: var(--text); }
html.dark .subject-card:hover { border-color: rgba(124, 109, 240, 0.4); }

.class-group {
  margin-bottom: 1rem;
  background: var(--surface);
  padding: 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}
.class-group h6 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--primary-dark);
  border-left: 2px solid var(--primary-color);
  padding-left: 0.6rem;
}
html.dark .class-group h6 { color: var(--primary-light); }

.class-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
}
.class-item:last-child { border-bottom: none; }
.class-item:hover { background: var(--hover-overlay); }

.class-options { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.class-option { min-width: 160px; font-size: 0.8rem; }

.bulk-delete-bar {
  background: rgba(254, 202, 87, 0.12);
  border: 1px solid rgba(254, 202, 87, 0.35);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text);
}
html.dark .bulk-delete-bar { color: var(--text); }

.delete-checkbox { accent-color: var(--primary-color); width: 18px; height: 18px; cursor: pointer; }
.form-check-label { font-size: 0.8rem; color: var(--text); }
.btn-sm { font-size: 0.75rem; padding: 0.25rem 0.7rem; }

/* ==========================================
   SEARCH OVERLAY
   ========================================== */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 43, 74, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
html.dark .search-overlay { background: rgba(0, 0, 0, 0.85); }
.search-overlay.active { display: flex; opacity: 1; }

.search-container {
  background: var(--surface);
  border-radius: 48px;
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.92);
  transition: transform 0.3s ease;
  max-width: 650px;
  width: 90%;
  position: relative;
}
html.dark .search-container { background: var(--surface); color: var(--text); border: 1px solid var(--border-color); }
.search-overlay.active .search-container { transform: scale(1); }

.search-input-wrapper { position: relative; margin-bottom: 1.2rem; }

.search-input {
  width: 100%;
  padding: 1.1rem 1.8rem;
  padding-right: 60px;
  border: 2px solid var(--medium-gray);
  border-radius: 60px;
  font-size: 1.1rem;
  outline: none;
  transition: all 0.3s ease;
  background: var(--bg);
  color: var(--text);
}
.search-input:focus {
  border-color: var(--primary-color);
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(124, 109, 240, 0.15);
}
.search-input::placeholder { color: var(--muted); }
html.dark .search-input {
  background: #262647;
  border-color: var(--border-color);
  color: var(--text);
}
html.dark .search-input:focus { background: #2d2d52; border-color: var(--primary-color); }
html.dark .search-input::placeholder { color: var(--muted); }

.search-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.search-button:hover { background: var(--primary-dark); transform: translateY(-50%) scale(1.05); }
.search-button:active { transform: translateY(-50%) scale(0.96); }

.search-close {
  position: absolute;
  top: -2rem;
  right: -2rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.search-close:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
html.dark .search-close { color: var(--muted); }
html.dark .search-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.search-hint { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }
html.dark .search-hint { color: var(--muted); }

.search-results {
  margin-top: 1.2rem;
  max-height: 350px;
  overflow-y: auto;
  display: none;
  background: var(--bg);
  border-radius: 28px;
  padding: 1rem;
  border: 1px solid var(--border-color);
}
html.dark .search-results { background: #22223e; border-color: var(--border-color); }

.results-header { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
html.dark .results-header { border-bottom-color: var(--border-color); }
.results-header h4 { margin: 0; color: var(--primary-dark); font-size: 1rem; font-weight: 600; }
html.dark .results-header h4 { color: var(--primary-light); }

.results-list { display: flex; flex-direction: column; gap: 0.5rem; }

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  cursor: pointer;
}
.result-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(124, 109, 240, 0.1);
  transform: translateY(-2px);
}
html.dark .result-item { background: var(--surface); border-color: var(--border-color); }
html.dark .result-item:hover { border-color: var(--primary-color); }

.result-info { flex: 1; }
.result-name { font-weight: 500; color: var(--text); margin-bottom: 0.25rem; font-size: 15px; }
html.dark .result-name { color: var(--text); }
.result-meta { display: flex; gap: 0.75rem; align-items: center; }
.result-badge { padding: 0.25rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.5px; }
.staff-badge { background: rgba(124, 109, 240, 0.1); color: var(--primary-dark); }
.student-badge { background: rgba(46, 204, 113, 0.1); color: var(--success-color); }
html.dark .staff-badge { background: rgba(124, 109, 240, 0.2); color: var(--primary-light); }
html.dark .student-badge { background: rgba(46, 204, 113, 0.18); color: var(--success-color); }
.result-id { font-size: 0.8rem; color: var(--muted); }
html.dark .result-id { color: var(--muted); }

.result-select-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 1rem;
}
.result-select-btn:hover { background: var(--primary-dark); transform: scale(1.05); }

.no-results { text-align: center; padding: 2rem; color: var(--muted); font-style: italic; }
html.dark .no-results { color: var(--muted); }

.search-results::-webkit-scrollbar { width: 6px; }
.search-results::-webkit-scrollbar-track { background: var(--medium-gray); border-radius: 10px; }
html.dark .search-results::-webkit-scrollbar-track { background: var(--medium-gray); }
.search-results::-webkit-scrollbar-thumb { background: #d0d0e0; border-radius: 10px; }
html.dark .search-results::-webkit-scrollbar-thumb { background: rgba(124, 109, 240, 0.4); }
.search-results::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ==========================================
   CROP OVERLAY
   ========================================== */
.crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.crop-overlay.active { display: flex; opacity: 1; }

.crop-container {
  background: var(--surface);
  border-radius: 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 950px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.94);
  transition: transform 0.3s ease;
}
html.dark .crop-container { background: var(--surface); color: var(--text); border: 1px solid var(--border-color); }
.crop-overlay.active .crop-container { transform: scale(1); }

.crop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg);
  flex-shrink: 0;
}
html.dark .crop-header { background: #22223e; border-bottom-color: var(--border-color); }
.crop-header h5 { margin: 0; color: var(--primary-dark); font-weight: 600; }
html.dark .crop-header h5 { color: var(--primary-light); }
.crop-header h5 i { color: var(--primary-color); margin-right: 0.5rem; }
html.dark .crop-header h5 i { color: var(--primary-color); }

.crop-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.crop-close:hover { background: var(--medium-gray); color: var(--error-color); }
html.dark .crop-close { color: var(--muted); }
html.dark .crop-close:hover { background: var(--medium-gray); }

.crop-preview-area {
  display: flex;
  flex: 1;
  min-height: 420px;
  max-height: calc(90vh - 150px);
  overflow: hidden;
  position: relative;
}

.crop-main {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-right: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}
html.dark .crop-main { background: #1a1a35; border-right-color: var(--border-color); }

.crop-main-wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.crop-main img { max-width: 100%; max-height: 100%; display: block; border-radius: 16px; }

.crop-sidebar {
  width: 260px;
  padding: 1.5rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-left: 1px solid var(--border-color);
  flex-shrink: 0;
}
html.dark .crop-sidebar { background: var(--surface); border-left-color: var(--border-color); }

.preview-container { text-align: center; }
.preview-container h6 { margin: 0 0 1rem 0; color: var(--primary-dark); font-size: 0.9rem; font-weight: 600; }
html.dark .preview-container h6 { color: var(--primary-light); }

.preview-box {
  width: 150px;
  height: 150px;
  border: 2px dashed var(--medium-gray);
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
html.dark .preview-box { background: #22223e; border-color: var(--border-color); }
.preview-box img { max-width: 100%; max-height: 100%; display: block; }

.crop-controls { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.crop-controls .btn {
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  font-size: 1.1rem;
}

.crop-footer {
  padding: 1.2rem 2rem;
  border-top: 1px solid var(--border-color);
  display: flex !important;
  justify-content: flex-end;
  gap: 1rem;
  background: var(--bg);
  flex-shrink: 0;
  min-height: 85px;
  align-items: center;
}
html.dark .crop-footer { background: #22223e; border-top-color: var(--border-color); }
.crop-footer .btn { min-width: 110px; border-radius: 40px; }

.cropper-container { direction: ltr; font-size: 0; line-height: 0; position: relative; touch-action: none; user-select: none; }
.cropper-view-box, .cropper-face { border-radius: 50%; }
.cropper-view-box { outline: 2px solid var(--primary-color); outline-color: rgba(124, 109, 240, 0.75); }
html.dark .cropper-view-box { outline-color: rgba(155, 143, 245, 0.85); }
.cropper-line { background-color: var(--primary-color); }
.cropper-point { background-color: var(--primary-color); width: 8px; height: 8px; opacity: 0.75; }
.cropper-point.point-se { background-color: var(--success-color); }
html.dark .cropper-line,
html.dark .cropper-point { background-color: var(--primary-color); }

/* ==========================================
   REPORT CARD (screen)
   ========================================== */
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

.report-wrapper {
  width: 100%;
  padding: 20px 30px;
  background: var(--surface);
  color: var(--text) !important;
}
html.dark .report-wrapper { background: var(--surface); color: var(--text); }

.school-header { border-bottom: 3px solid var(--primary-color); padding-bottom: 12px; margin-bottom: 15px; }
.school-logo { width: 70px; height: 70px; object-fit: contain; }
.school-name { font-size: 19px; font-weight: 700; color: var(--primary-color); }
.school-address { font-size: 12px; color: var(--muted); }
html.dark .school-name { color: var(--primary-light); }
html.dark .school-address { color: var(--muted); }

.info-box { background: var(--bg); padding: 10px; border: 1px solid var(--border-color); }
html.dark .info-box { background: #22223e; border-color: var(--border-color); }
.info-box p { margin: 2px 0; font-size: 12px; }

.table { margin-top: 10px; }
.table thead { background: var(--primary-color); color: white; font-size: 11px; }
.table td { font-size: 11px; padding: 5px; }

.summary-box { border: 2px solid var(--primary-color); padding: 10px; font-size: 12px; margin-top: 10px; }
html.dark .summary-box { color: var(--text); }

.officials { margin-top: 20px; font-size: 12px; }
html.dark .officials { color: var(--text); }

.result-footer {
  display: none;
  position: fixed;
  width: 100%;
  text-align: center;
  bottom: 2mm;
  left: 12mm;
  right: 12mm;
}

/* ==========================================
   GUARDIAN CARDS (screen)
   ========================================== */
.guardian-list { display: flex; flex-direction: column; gap: 14px; }

.guardian-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
  transition: box-shadow .15s ease;
}
.guardian-card:hover { box-shadow: 0 2px 10px rgba(13, 110, 253, .08); }
.guardian-card.is-primary {
  border-left: 4px solid var(--primary-color);
  background: linear-gradient(180deg, rgba(124,109,240,0.04) 0%, var(--surface) 100%);
}
html.dark .guardian-card { background: var(--surface); border-color: var(--border-color); color: var(--text); }
html.dark .guardian-card.is-primary { background: linear-gradient(180deg, rgba(124,109,240,0.08) 0%, var(--surface) 100%); }

.guardian-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: 10px;
}
.guardian-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(124, 109, 240, 0.12);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.05rem;
  flex-shrink: 0;
}
html.dark .guardian-avatar { background: rgba(124, 109, 240, 0.2); color: var(--primary-light); }

.guardian-name { font-weight: 600; font-size: 1rem; color: var(--text); line-height: 1.25; }
.guardian-relationship { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

.guardian-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.guardian-field { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); min-width: 0; }
.guardian-field.full { grid-column: 1 / -1; }
.guardian-field i { color: var(--primary-color); font-size: .95rem; flex-shrink: 0; }
.guardian-field .gf-label { color: var(--muted); font-size: .78rem; display: block; text-transform: uppercase; letter-spacing: .03em; }
.guardian-field .gf-value { font-weight: 500; word-break: break-word; }

.primary-pill {
  font-size: .68rem;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--primary-color);
  color: #fff;
  letter-spacing: .05em;
  font-weight: 600;
}
.guardian-actions .btn { --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .78rem; }

.guardians-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  background: var(--bg);
}
.guardians-empty i { font-size: 2.25rem; color: var(--muted); display: block; margin-bottom: 8px; }

@media (max-width: 576px) {
  .guardian-card-body { grid-template-columns: 1fr; }

}

/* ==========================================
   DANGER ZONE
   ========================================== */
.danger-zone {
  margin-top: 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-left: 4px solid var(--error-color);
  border-radius: 10px;
  background: rgba(220, 53, 69, 0.04);
}
html.dark .danger-zone { background: rgba(220, 53, 69, 0.08); border-color: rgba(255, 107, 107, 0.35); }

.danger-zone-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #b02a37;
  margin: 0 0 .35rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
html.dark .danger-zone-title { color: var(--error-color); }
.danger-zone-title i { font-size: .95rem; }
.danger-zone-desc { font-size: .82rem; color: var(--muted); margin-bottom: .85rem; line-height: 1.45; }

.danger-zone .btn-delete-student,
.danger-zone .btn-delete-staff {
  --bs-btn-bg: var(--surface);
  --bs-btn-border-color: var(--error-color);
  --bs-btn-color: var(--error-color);
  --bs-btn-hover-bg: var(--error-color);
  --bs-btn-hover-border-color: var(--error-color);
  --bs-btn-hover-color: #fff;
  --bs-btn-focus-shadow-rgb: 220, 53, 69;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 8px;
  padding: .4rem .9rem;
}
.danger-zone .btn-delete-student:disabled,
.danger-zone .btn-delete-staff:disabled {
  --bs-btn-bg: var(--bg);
  --bs-btn-border-color: var(--border-color);
  --bs-btn-color: var(--muted);
  cursor: not-allowed;
}

/* ==========================================
   DELETE CONFIRMATION MODAL
   ========================================== */
.delete-warning {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  background: rgba(220, 53, 69, 0.06);
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-left: 4px solid var(--error-color);
  padding: .85rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  color: #7f1d1d;
  margin-bottom: 1rem;
  line-height: 1.45;
}
html.dark .delete-warning { background: rgba(220, 53, 69, 0.12); color: var(--text); }
.delete-warning i { color: var(--error-color); font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }
.delete-warning strong { color: #991b1b; }
html.dark .delete-warning strong { color: var(--error-color); }

.delete-reason-group .form-label { font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.delete-reason-hint { font-size: .78rem; color: var(--muted); }

.delete-confirm-input-wrap {
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: .75rem .9rem;
}
html.dark .delete-confirm-input-wrap { background: var(--medium-gray); border-color: var(--border-color); }
.delete-confirm-input-wrap .form-label { font-size: .82rem; color: var(--text); }
.delete-confirm-input-wrap code {
  background: var(--medium-gray);
  padding: .05rem .35rem;
  border-radius: 4px;
  font-size: .82rem;
  color: var(--error-color);
  font-weight: 700;
}

/* ==========================================
   ARCHIVED USER ROWS
   ========================================== */
.archived-user { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }

.archived-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.archived-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.archived-user-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
}
.archived-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.archived-meta {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.dark .archived-name { color: var(--text); }
html.dark .archived-meta { color: var(--muted); }

.reason-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(254, 202, 87, 0.15);
  color: #b7791f;
  border: 1px solid rgba(254, 202, 87, 0.45);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.dark .reason-pill { color: var(--warning); }
.reason-pill i { font-size: 0.75rem; flex-shrink: 0; }

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.type-pill.student { background: rgba(78, 205, 196, 0.18); color: #0f766e; }
.type-pill.staff   { background: rgba(124, 109, 240, 0.18); color: var(--primary-dark); }
html.dark .type-pill.student { color: var(--secondary-color); }
html.dark .type-pill.staff   { color: var(--primary-light); }

#archivedTableBody tr.archived-row { cursor: default; }
#archivedTableBody tr.archived-row:hover { background-color: var(--hover-overlay); }

.restore-warning {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  background: rgba(46, 204, 113, 0.10);
  border: 1px solid rgba(46, 204, 113, 0.35);
  border-left: 4px solid var(--success-color);
  padding: .85rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  color: #14532d;
  margin-bottom: 1rem;
  line-height: 1.45;
}
html.dark .restore-warning { color: var(--text); background: rgba(46, 204, 113, 0.12); }
.restore-warning i { color: var(--success-color); font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }

/* ==========================================
   GUARDIAN PICKER
   ========================================== */
#guardian_results {
  max-height: 260px;
  overflow-y: auto;
  position: absolute;
  z-index: 1050;
  width: 100%;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}
html.dark #guardian_results { background: var(--surface); }
.guardian-result-item { cursor: pointer; padding: 0.6rem 0.9rem; color: var(--text); }
.guardian-result-item:hover { background: var(--hover-overlay); }
.guardian-picked-card { border-left: 4px solid var(--primary-color); background: rgba(124, 109, 240, 0.06); }
html.dark .guardian-picked-card { background: rgba(124, 109, 240, 0.12); }
.search-wrapper { position: relative; }
.guardian-new-panel.is-hidden { display: none; }

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.bg-primary-gradient,
.bg-gradient-primary { background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); }

.bg-purple { background: linear-gradient(135deg, var(--primary-light), var(--primary-dark)); }
.bg-orange { background: linear-gradient(135deg, var(--warning), #f9ca24); }
.bg-teal   { background: linear-gradient(135deg, var(--secondary-color), #44bdae); }
.bg-green  { background: linear-gradient(135deg, var(--success-color), #27ae60); }
.bg-red    { background: linear-gradient(135deg, var(--error-color), #ee5a24); }
.bg-pink   { background: linear-gradient(135deg, var(--error-color), #ee5a24); }
.bg-yellow { background: linear-gradient(135deg, var(--warning), #f9ca24); }
.bg-gray   { background: linear-gradient(135deg, var(--muted), var(--dark-gray)); }

.bg-primary   { background: var(--primary-color) !important; }
.bg-success   { background: var(--success-color) !important; }
.bg-danger    { background: var(--error-color)   !important; }
.bg-warning   { background: var(--warning)       !important; }
.bg-info      { background: var(--info)          !important; }
.bg-secondary { background: var(--secondary-color) !important; }
.bg-light-warning { background-color: rgba(254, 202, 87, 0.1) !important; }

.progress-primary   { background: var(--primary-color); }
.progress-success   { background: var(--success-color); }
.progress-warning   { background: var(--warning); }
.progress-danger    { background: var(--error-color); }
.progress-info      { background: var(--info); }
.progress-secondary { background: var(--secondary-color); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: var(--gap-sm); }
.gap-xs { gap: var(--gap-xs); }
.gap-sm { gap: var(--gap-sm); }
.gap { gap: var(--gap); }
.gap-lg { gap: var(--gap-lg); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.text-lg { font-size: var(--text-lg); }

.sr-only {
  position: absolute !important;
  height: 1px;
  width: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

form .btn { align-self: flex-start; }

/* ==========================================
   TYPOGRAPHY & CONTENT
   ========================================== */
.pg-title {
  margin: 0 0 var(--gap-sm) 0.75rem;
  padding: 0.4rem;
  color: var(--dark-gray);
  font-size: var(--text-lg);
  font-weight: 600;
}
html.dark .pg-title { color: var(--muted); }

.content-title { color: var(--primary-color); font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--gap); }
html.dark .content-title { color: var(--primary-light); }

.info-text { color: var(--muted); font-size: var(--text-sm); margin-top: 0.5rem; text-align: center; }

.loading-spinner,
.error-message,
.auth-error { display: none; }
.loading-spinner.is-visible,
.error-message.is-visible,
.auth-error.is-visible { display: block; }

.table-responsive { min-height: 400px; }
.avatar-sm { width: 36px; height: 36px; font-size: 0.9rem; font-weight: 600; }
.avatar-placeholder { width: 90px; height: 90px; }

/* ==========================================
   LOAD BAR
   ========================================== */
#load-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #7c6df0 0%, #4ecdc4 60%, #2ecc71 100%);
  box-shadow: 0 0 8px rgba(124, 109, 240, 0.6), 0 0 4px rgba(78, 205, 196, 0.5);
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.25s ease-out, opacity 0.35s ease-out;
  will-change: width, opacity;
}
#load-bar.active { opacity: 1; }
#load-bar.done   { opacity: 0; }
html.dark #load-bar {
  box-shadow: 0 0 10px rgba(155, 143, 245, 0.75), 0 0 6px rgba(78, 205, 196, 0.6);
}

/* ==========================================
   ANIMATIONS
   ========================================== */
.icon-emoji-dramatic {
  position: relative;
  width: 160px;
  height: 100px;
  margin: 0 auto;
  perspective: 500px;
  overflow: visible !important;
}
.icon-emoji-dramatic .calculator-icon {
  position: absolute;
  width: 70px;
  height: 70px;
  background: linear-gradient(145deg, #7c6df0, #5f4fd1);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  left: 45px;
  top: 10px;
  box-shadow: 0 6px 20px rgba(124, 109, 240, 0.4), inset 0 2px 4px rgba(255,255,255,0.4);
  z-index: 2;
  animation: calculatorGlowSide 7s infinite ease-in-out;
}
.icon-emoji-dramatic .calculator-icon i { font-size: 2.5rem; color: white; }

.icon-emoji-dramatic .emoji-burst {
  position: absolute;
  width: 60px;
  height: 60px;
  left: 50px;
  top: 20px;
  z-index: 1;
  opacity: 0;
  transform: scale(0.3);
  animation: emojiBurstSide 7s infinite ease-in-out;
}

.help-step { margin-top: 60px; }

@keyframes calculatorGlowSide {
  0%, 40% {
    transform: translateX(0) rotateY(0deg);
    box-shadow: 0 6px 20px rgba(124, 109, 240, 0.4), inset 0 2px 4px rgba(255,255,255,0.4);
  }
  10%, 30% {
    transform: translateX(-2px) rotateY(-3deg);
    box-shadow: 0 8px 25px rgba(124, 109, 240, 0.5), inset 0 2px 4px rgba(255,255,255,0.4);
  }
  41% {
    transform: translateX(-5px) scale(0.95) rotateY(10deg);
    box-shadow: 0 4px 15px rgba(124, 109, 240, 0.3), inset 0 2px 4px rgba(255,255,255,0.3);
  }
  50%, 90% {
    transform: translateX(-10px) scale(0.9) rotateY(15deg);
    box-shadow: 0 2px 10px rgba(124, 109, 240, 0.2), inset 0 2px 4px rgba(255,255,255,0.2);
    opacity: 0.8;
  }
  100% {
    transform: translateX(0) rotateY(0deg);
    box-shadow: 0 6px 20px rgba(124, 109, 240, 0.4), inset 0 2px 4px rgba(255,255,255,0.4);
    opacity: 1;
  }
}

@keyframes emojiBurstSide {
  0%, 40% {
    opacity: 0;
    transform: scale(0.3) translateX(0);
    filter: blur(8px) brightness(0.8);
  }
  41% { opacity: 0.2; transform: scale(0.4) translateX(10px); filter: blur(4px) brightness(0.9); }
  44% { opacity: 0.5; transform: scale(0.6) translateX(25px); filter: blur(2px) brightness(1); }
  47% { opacity: 0.8; transform: scale(0.8) translateX(40px); filter: blur(0px) brightness(1.1); }
  50%, 88% { opacity: 1; transform: scale(1) translateX(50px); filter: blur(0px) brightness(1.2); z-index: 3; }
  55% { transform: scale(1.05) translateX(52px); }
  65% { transform: scale(1) translateX(50px); }
  75% { transform: scale(1.03) translateX(51px); }
  85% { transform: scale(1) translateX(50px); }
  89% { opacity: 0.8; transform: scale(0.8) translateX(40px); filter: blur(0px) brightness(1.1); }
  92% { opacity: 0.5; transform: scale(0.6) translateX(25px); filter: blur(2px) brightness(1); }
  95% { opacity: 0.2; transform: scale(0.4) translateX(10px); filter: blur(4px) brightness(0.9); }
  100% { opacity: 0; transform: scale(0.3) translateX(0); filter: blur(8px) brightness(0.8); z-index: 1; }
}

.emoji-burst img {
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(254, 202, 87, 0.5), 0 0 40px rgba(254, 202, 87, 0.4);
  animation: emojiBounce 2s infinite ease-in-out;
}

@keyframes emojiBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

.icon-emoji-dramatic .connection-line {
  position: absolute;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(124, 109, 240, 0.5), rgba(254, 202, 87, 0.5));
  top: 50px;
  left: 110px;
  z-index: 2;
  opacity: 0;
  animation: lineExtend 7s infinite ease-in-out;
}

@keyframes lineExtend {
  0%, 40%, 95%, 100% { width: 0; opacity: 0; left: 110px; }
  47%, 88% { width: 40px; opacity: 0.6; left: 110px; }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
.mobile-display { display: inline-block; }
.desktop-display { text-transform: uppercase; display: none; }

@media (min-width: 993px) {
  .btn { padding: 0.75rem 1.75rem; }
  .sidebar, .sidebar-help { left: 0; }
  .topbar { margin-left: 260px; }
  .topbar-help { margin-left: 360px; }
  .content { font-size: var(--text-sm); margin-left: 260px; }
  .content-help { font-size: var(--text-sm); margin-left: 360px; }
  .sidebar-toggle { display: none; }
  .mobile-display { display: none; }
  .desktop-display { display: inline-block; }
}

@media (min-width: 769px) and (max-width: 992px) {
  .sidebar { left: -260px; }
  .sidebar-help { left: -360px; }
  .topbar, .topbar-help { margin-left: 0; }
  .content { margin-left: 0; padding: 1.5rem; }
  .content-help { margin-left: 0; padding: 1.5rem; }
  .dropdown-menu { width: 320px; }
  .crop-preview-area { flex-direction: row; }
  .crop-sidebar { width: 220px; }
}

@media (max-width: 768px) {
  
  .sidebar-help { width: 310px; }
  .auth-wrapper { flex-direction: column; }
  .auth-left { padding: 30px; }
  .auth-right { padding: 30px; }
  .auth-form-row { flex-direction: column; gap: 0; }

  .dropdown-menu { width: 90vw; max-height: 60vh; }

  .profile-stats { flex-direction: column; gap: 1rem; }
  .profile-header { padding: 1.5rem 1rem; text-align: center; }
  .profile-actions { justify-content: center; }
  .info-item { flex-direction: column; gap: 0.25rem; }
  .info-value { text-align: left; }
  .info-label { width: 100%; margin-bottom: 4px; }

  .profile-tab-nav li a { padding: 10px 14px; font-size: 0.9rem; }

  .content { padding: 1rem; }

  .search-container { margin: 1rem; padding: 1.2rem; }
  .search-input { font-size: 1rem; padding: 0.9rem 1.4rem; padding-right: 50px; }
  .search-button { width: 40px; height: 40px; }

  .crop-preview-area { flex-direction: column; max-height: none; min-height: 320px; }
  .crop-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
  .preview-box { width: 100px; height: 100px; margin: 0; }
  .crop-main { min-height: 260px; border-right: none; border-bottom: 1px solid var(--border-color); }
  .crop-controls { order: -1; }
  .preview-container { text-align: left; }
  .preview-container h6 { margin-bottom: 0.5rem; }
  .crop-footer { padding: 1rem; flex-direction: column; gap: 0.6rem; }
  .crop-footer .btn { width: 100%; }

  .step-indicator { flex-direction: column; gap: 1rem; }
  .step-connector { display: none; }
  .step { width: 100%; }
}

@media (max-width: 576px) {
  .topbar { height: 56px; padding: 0 1rem; }
  .content { padding: 1rem 0.75rem; }
}

/* ==========================================
   PRINT
   ========================================== */
#print-root { display: none; }

@media print {
  html.dark,
  html.dark body,
  html.dark .report-wrapper,
  html.dark .card,
  html.dark .content {
    background: #fff !important;
    color: #000 !important;
  }
  html.dark .info-box {
    background: #f8f9fe !important;
    border-color: #eeedf6 !important;
    color: #000 !important;
  }
  html.dark .school-name { color: #7c6df0 !important; }
  html.dark .school-address { color: #6c6b7e !important; }
  html.dark .summary-box,
  html.dark .officials { color: #000 !important; }

  body { background: white; }
  html, body { height: 100%; }
  .no-print { display: none !important; }
  .sidebar, .sidebar-help, .topbar { display: none !important; }
  .content { margin-left: 0 !important; padding: 20px !important; }
  .report-card, .report-wrapper { box-shadow: none !important; }
  .print-break { page-break-before: always; }

  .report-wrapper {
    padding: 0;
    margin: 0;
    min-height: auto;
    padding-bottom: 10mm;
  }
  @page { size: A4; margin: 12mm; }
  .result-footer {
    display: inline-block;
    font-size: 10px;
    color: #4a4868;
  }

  /* Print-root document */
  body * { visibility: hidden !important; }
  #print-root, #print-root * { visibility: visible !important; }
  #print-root {
    display: block !important;
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    padding: 0;
    margin: 0;
    font-family: "Trebuchet", "Times New Roman", Georgia, serif;
    color: #111;
    font-size: 11pt;
  }
  #print-root, #print-root *,
  .report-wrapper, .report-wrapper * { visibility: visible !important; }
  @page { margin: 12mm 14mm 16mm 14mm; }
}

/* Print document layout */
.doc {
  max-width: 190mm;
  margin: 0 auto;
  padding: 6mm 0;
  overflow: hidden;
}

.doc-letterhead {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 3px double #111;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.doc-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  outline: none;
}
.doc-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-logo .doc-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20pt;
  color: #111;
  background: #f2f2f2;
  letter-spacing: .05em;
}

.doc-school { flex: 1; text-align: center; }
.doc-school-name {
  font-size: 20pt;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 0;
}
.doc-school-sub { font-size: 9.5pt; color: #333; margin-top: 2px; font-style: italic; }

.doc-title {
  text-align: center;
  font-size: 13pt;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: #111;
  color: #fff;
  padding: 5px 0;
  margin: 0 0 14px;
}

.doc-top { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.doc-photo-box {
  width: 110px;
  height: 130px;
  border: 1.5px solid #111;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-photo-box img { width: 100%; height: 100%; object-fit: cover; }
.doc-photo-box .doc-photo-placeholder { font-size: 8pt; color: #888; text-align: center; padding: 6px; }
.doc-photo-caption { text-align: center; font-size: 8pt; color: #444; margin-top: 4px; letter-spacing: .04em; }

.doc-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.doc-summary .row-item { display: flex; gap: 6px; font-size: 10.5pt; padding: 3px 0; border-bottom: 1px dotted #bbb; }
.doc-summary .row-item .lbl { color: #555; min-width: 90px; font-weight: 600; }
.doc-summary .row-item .val { color: #111; flex: 1; word-break: break-word; }
.doc-summary .row-item.full { grid-column: 1 / -1; }

.doc-section { margin-bottom: 14px; }
.doc-section-title {
  font-size: 10.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  border-bottom: 1.5px solid #111;
  padding-bottom: 3px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #111;
  display: inline-block;
  transform: rotate(45deg);
}

.doc-table { width: 100%; border-collapse: collapse; font-size: 10pt; }
.doc-table td { padding: 4px 8px; border: 1px solid #ccc; vertical-align: top; }
.doc-table td.lbl { background: #f2f2f2; font-weight: 600; width: 32%; color: #222; }

.doc-guardian { border: 1px solid #ccc; padding: 8px 10px; margin-bottom: 8px; page-break-inside: avoid; }
.doc-guardian.is-primary { border-left: 4px solid #111; }
.doc-guardian-name { font-weight: 700; font-size: 11pt; margin-bottom: 2px; }
.doc-guardian-name .badge {
  font-size: 7.5pt;
  border: 1px solid #111;
  padding: 1px 6px;
  margin-left: 6px;
  letter-spacing: .08em;
  vertical-align: middle;
}
.doc-guardian-rel { font-size: 9pt; color: #555; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.doc-guardian-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; font-size: 9.5pt; }
.doc-guardian-grid .row-item { display: flex; gap: 6px; }
.doc-guardian-grid .row-item .lbl { color: #555; min-width: 78px; }
.doc-guardian-grid .row-item.full { grid-column: 1 / -1; }

.doc-signatures { display: flex; justify-content: space-between; gap: 30px; margin-top: 34px; page-break-inside: avoid; }
.doc-sign-box { flex: 1; text-align: center; font-size: 9pt; color: #444; }
.doc-sign-line { border-top: 1px solid #111; margin-bottom: 4px; height: 26px; }

.doc-footer-strip {
  margin-top: 18px;
  border-top: 1px solid #999;
  padding-top: 5px;
  font-size: 8pt;
  color: #666;
  display: flex;
  justify-content: space-between;
}

@media screen {
  #print-root { display: none; }
}

/* ==========================================
   SCROLLBARS
   ========================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--medium-gray); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

html.dark ::-webkit-scrollbar { width: 8px; height: 8px; }
html.dark ::-webkit-scrollbar-track { background: #1a1a35; }
html.dark ::-webkit-scrollbar-thumb { background: var(--medium-gray); border-radius: 10px; }
html.dark ::-webkit-scrollbar-thumb:hover { background: rgba(124, 109, 240, 0.4); }



.login-card {
      transition: all 0.2s ease;
      border: 1px solid #dee2e6;
      position: relative;
      min-height: 240px;
    }
    .login-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
      border-color: #0d6efd;
    }
    .password-field {
      font-family: 'Courier New', monospace;
      letter-spacing: 1px;
    
      padding: 6px 10px;
      border-radius: 4px;
      border: 1px dashed #adb5bd;
      font-size: 0.9rem;
      user-select: all;
    }
    .password-hidden {
      font-family: 'Courier New', monospace;
      letter-spacing: 2px;
      color: #666;
    }
    .copy-btn {
      cursor: pointer;
      transition: all 0.2s ease;
      padding: 4px;
    }
    .copy-btn:hover {
      transform: scale(1.1);
      color: #0d6efd !important;
    }
    .copy-btn.copied {
      color: #198754 !important;
    }
    .toggle-password-btn {
      cursor: pointer;
      transition: all 0.2s ease;
      padding: 4px;
      font-size: 0.9rem;
    }
    .toggle-password-btn:hover {
      color: #0d6efd !important;
    }
    .user-number {
      position: absolute;
      top: -8px;
      right: -8px;
      width: 28px;
      height: 28px;
      background: #0d6efd;
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: bold;
      z-index: 1;
    }
    .login-info-row {
      margin-bottom: 8px;
      line-height: 1.4;
    }
    .login-info-row:last-child {
      margin-bottom: 0;
    }
    
    /* School info inside cards */
    .school-info {
      padding: 8px;
      border-radius: 4px;
      margin-bottom: 12px;
      border-left: 3px solid #0d6efd;
    }
    .school-name {
      font-weight: 600;
      color: #0d6efd;
      font-size: 0.9rem;
    }
    .school-url {
      font-size: 0.8rem;
      color: #6c757d;
    }
    
    /* Results container */
    #loginsContainer {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
      gap: 20px;
    }
    
    /* Password action buttons container */
    .password-actions {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    
    /* Search highlight */
    .search-highlight {
      background-color: #fff3cd;
      padding: 0 2px;
      border-radius: 2px;
      font-weight: 600;
    }
    
    /* No results message */
    .no-search-results {
      text-align: center;
      padding: 40px 20px;
      color: #6c757d;
    }
    .no-search-results i {
      font-size: 3rem;
      margin-bottom: 15px;
      color: #dee2e6;
    }
    
    /* Search input styling - No shadow, fits perfectly */
    .search-wrapper {
      border: 1px solid #ced4da;
      border-radius: 0.375rem;
      transition: border-color 0.15s ease-in-out;
    }
    html.dark .search-wrapper {
      border-color: #495057;
    }
    .search-wrapper:focus-within {
      border-color: #86b7fe;
    }
    .search-wrapper .input-group-text {
      background: transparent;
      border: none;
      padding-right: 0;
      color: #6c757d;
    }
    .search-wrapper .form-control {
      border: none;
      border-radius: 1px;
      box-shadow: none !important;
      padding-left: 0.5rem;
    }
    .search-wrapper .form-control:focus {
      box-shadow: none !important;
      border-color: transparent;
    }
    .search-wrapper .btn {
      border: none;
      box-shadow: none !important;
      color: #6c757d;
    }
    .search-wrapper .btn:hover {
      background: transparent;
      color: #0d6efd;
    }
    .search-wrapper .btn:focus {
      box-shadow: none !important;
    }
    .search-wrapper .btn-clear {
      display: none;
      padding: 0.375rem 0.75rem;
    }
    .search-wrapper .btn-clear.visible {
      display: block;
    }
    
    /* Print Styles - Only show cards */
    @media print {
      /* Hide everything except the cards */
      body * {
        visibility: hidden !important;
      }
      
      /* Show only the login cards container and its children */
      #resultsCard, 
      #resultsCard *,
      .login-card-container,
      .login-card-container * {
        visibility: visible !important;
      }
      
      /* Hide the card wrapper but keep its contents */
       /* Let it flow naturally across pages */
  #resultsCard {
    position: static !important;   /* <-- was fixed */
    width: auto !important;
    height: auto !important;       /* <-- was 100% */
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    display: block !important;
  }
      
      /* Hide card header in print */
      #resultsCard .card-header {
        display: none !important;
      }
      
      /* Card body styling */
      #resultsCard .card-body {
        padding: 0 !important;
        background: white !important;
      }
      
      .login-card-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
      }
      
      .login-card {
        visibility: visible !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 0 !important;
        border: 1px solid #000 !important;
        padding: 12px !important;
        min-height: 200px !important;
        height: auto !important;
        background: white !important;
        box-shadow: none !important;
      }
      
      .login-card * {
        visibility: visible !important;
      }
      
      .user-number {
        border: 2px solid #000 !important;
        background: white !important;
        color: #000 !important;
        top: -10px;
        right: -10px;
      }
      
      .password-field {
        background: white !important;
        border: 1px solid #000 !important;
        font-size: 10pt !important;
      }
      
      /* Always show actual passwords when printing */
      .password-hidden {
        display: none !important;
      }
      
      .password-visible {
        display: block !important;
      }
      
      /* Hide password action buttons in print */
      .password-actions,
      .copy-btn,
      .toggle-password-btn {
        display: none !important;
      }
      
      /* School info in print */
      .school-info {
        background: #f8f9fa !important;
        border-left: 3px solid #000 !important;
        padding: 6px !important;
        margin-bottom: 10px !important;
      }
      
      .school-name {
        color: #000 !important;
        font-size: 10pt !important;
      }
      
      .school-url {
        color: #000 !important;
        font-size: 9pt !important;
      }
      
      /* Ensure proper page breaks */
      .login-card:nth-child(8n) {
        page-break-after: always !important;
      }
      
      /* Print header */
      .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 15px;
        font-size: 14pt;
        font-weight: bold;
        visibility: visible !important;
      }
    }
    
    /* Loading spinner */
    .spinner-container {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.8);
      z-index: 9999;
      justify-content: center;
      align-items: center;
    }
    .spinner-container.active {
      display: flex;
    }
    
    /* Password visibility states */
    .password-hidden {
      display: block;
    }
    .password-visible {
      display: none;
    }
    .password-field.revealed .password-hidden {
      display: none;
    }
    .password-field.revealed .password-visible {
      display: block;
    }






/* ----- GLOBAL REFINEMENTS ----- */
    * {
      box-sizing: border-box;
    }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    }

    /* Smooth card styling */
    .card-modern {
      border-radius: 20px;
      border: 1px solid var(--border-color);
      background: var(--surface);
      color: var(--text);
      box-shadow: var(--shadow-sm);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .card-modern:hover {
      box-shadow: var(--shadow-md);
    }

    /* Batch cards grid refinement */
    .batch-card {
      border-radius: 18px;
      transition: all 0.2s;
      cursor: pointer;
      background: var(--surface);
      color: var(--text);
      border: 1px solid var(--border-color);
    }

    .batch-card:hover {
      transform: translateY(-5px);
      border-color: var(--primary-light);
      background: var(--hover-overlay);
    }

    .batch-badge {
      background: var(--light-gray);
      color: var(--text);
      font-size: 0.7rem;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 40px;
    }

    /* TOKEN GRID — elegant tokens for screen & print */
    .token-container {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.25rem;
    }

    .token-card {
      background: var(--surface);
      border: 2px solid var(--border-color);
      border-radius: 3px;
      padding: 1.5rem 1rem;
      text-align: center;
      transition: all 0.2s;
      box-shadow: var(--shadow-sm);
      position: relative;
      overflow: hidden;
      color: var(--text);
    }

    .token-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 4px;
      background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
    }

    .token-title {
      font-size: 0.7rem;
      font-weight: 700;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      color: var(--text);
      background: var(--bg);
      border: 1px solid var(--border-color);
      display: inline-block;
      padding: 0.2rem 0.8rem;
      border-radius: 30px;
      margin-bottom: 0.75rem;
    }

    .token-code {
      font-size: 1.8rem;
      font-weight: 800;
      letter-spacing: 2.5px;
      font-family: 'SF Mono', 'Fira Code', monospace;
      color: var(--primary-dark);
      margin: 0.5rem 0;
      word-break: break-word;
    }

    .token-footer {
      font-size: 0.65rem;
      color: var(--muted);
      border-top: 1px dashed var(--border-color);
      padding-top: 0.75rem;
      margin-top: 0.5rem;
      font-weight: 500;
    }

    /* Loader overlay */
    .spinner-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: var(--bg);
      opacity: 0.85;
      backdrop-filter: blur(3px);
      z-index: 9999;
      justify-content: center;
      align-items: center;
      flex-direction: column;
    }

    .spinner-overlay.active {
      display: flex;
    }

    /* CRITICAL FIX: Enhanced print styles - ensures ALL tokens print across multiple pages */
    @media print {
      @page {
        size: A4;
        margin: 1.2cm 1cm;
      }

      /* Reset body for printing — always black-on-white, theme-independent */
      body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
      }

      /* Hide all non-print elements */
      .sidebar,
      s.sidebar-help,
      .topbar,
      .no-print,
      .btn,
      .toast-container,
      .spinner-overlay,
      .batch-card,
      .card-modern:first-of-type,
      #batchContainer,
      .card-header .badge-token-count,
      .card-header .btn,
      button,
      .no-print {
        display: none !important;
      }

      /* Force results card to display fully */
      #resultsCard {
        display: block !important;
        visibility: visible !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        position: relative !important;
        overflow: visible !important;
      }

      .card {
        border: none !important;
        box-shadow: none !important;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
      }

      .card-body {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
      }

      /* CRITICAL: Token container must display all tokens without cutting off */
      .token-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
      }

      /* Each token card - ensure no content gets cut */
      .token-card {
        border-top: 5px solid #222;
        border-left: 1px solid #222 !important;
        border-right: 1px solid #222 !important;
        border-bottom: 1px solid #222 !important;
        background: white !important;
        color: black !important;
        padding: 1rem 0.8rem !important;
        margin: 0 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        box-shadow: none !important;
        overflow: visible !important;
        height: auto !important;
        min-height: 130px !important;
      }

      /* Force page break after every 10 tokens for A4 cutting */
      .token-card:nth-child(10n) {
        page-break-after: always !important;
        break-after: page !important;
        margin-bottom: 0 !important;
      }

      /* Ensure the container doesn't hide content */
      .content {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        width: 100% !important;
      }

      /* Style token text for print */
      .token-title,
      .token-code,
      .token-footer {
        color: black !important;
        background: transparent !important;
        border-color: transparent !important;
      }

      .token-title {
        font-size: 0.7rem !important;
        font-weight: bold !important;
      }

      .token-code {
        font-size: 1.5rem !important;
        letter-spacing: 2px !important;
        font-weight: 800 !important;
        word-break: break-all !important;
      }

      .token-footer {
        font-size: 0.6rem !important;
      }

      /* Add "Powered by SLLiQ Systems" footer on each printed page */
      @page {
        @bottom-center {
          content: "Powered by SLLiQ Systems";
          font-size: 9pt;
          font-family: Arial, sans-serif;
          color: #555;
        }
      }

      /* Fallback method: add footer to each page via body after content */
      body::after {
        content: "Powered by SLLiQ Systems";
        display: block;
        text-align: center;
        font-size: 9pt;
        font-weight: normal;
        color: #3b3f46;
        margin-top: 1rem;
        padding-top: 0.5rem;
        border-top: 1px solid #ccc;
        width: 100%;
        position: relative;
        bottom: 0;
      }

      /* Ensure last page footer appears */
      .token-container:last-child {
        margin-bottom: 0.5rem;
      }

      /* Hide any floating elements */
      .text-center.mt-4 {
        display: none !important;
      }
    }

    /* Custom button & status */
    .btn-dark-custom {
      background: var(--text);
      color: var(--surface);
      border: none;
      border-radius: 40px;
      padding: 0.5rem 1.4rem;
      font-weight: 500;
      transition: 0.2s;
    }

    .btn-dark-custom:hover {
      background: var(--primary-color);
      color: #fff;
      transform: scale(0.97);
    }

    .badge-token-count {
      background: var(--medium-gray);
      color: var(--text);
      font-weight: 600;
      padding: 0.4rem 0.9rem;
      border-radius: 50px;
    }

    .toast-container {
      z-index: 11000;
    }

    /* Print preview indicator */
    .print-info {
      font-size: 0.75rem;
      color: var(--muted);
    }