/* ------------------------------------------------------------------
   Durai Sir's IAS Academy - Admin theme
   Ported from the Proflujo Academy admin portal (navy + gold palette)
------------------------------------------------------------------- */
:root {
  --ink: #050047;
  --ink-soft: #172061;
  --plum: #020035;
  --maroon: #050078;
  --gold: #f2b91e;
  --gold-light: #ffe073;
  --muted: #5f6686;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --font-admin: 'Plus Jakarta Sans', 'Ubuntu', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Ubuntu, sans-serif;
  line-height: 1.65;
  background: var(--slate-50);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------
   Login page (matches /admin/login)
------------------------------------------------------------------- */
.admin-page-bg {
  font-family: var(--font-admin);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: url("../assets/images/admin-bg-pattern.svg") center center / cover no-repeat, #f8fafc;
  overflow: hidden;
  padding: clamp(16px, 4vh, 36px) clamp(16px, 4vw, 28px);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 12s ease-in-out infinite alternate;
}
.orb-1 { width: min(400px, 75vw); height: min(400px, 75vw); background: rgba(242, 185, 30, 0.22); top: -80px; left: -80px; }
.orb-2 { width: min(450px, 80vw); height: min(450px, 80vw); background: rgba(5, 0, 120, 0.12); bottom: -120px; right: -100px; animation-delay: -6s; }

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 35px) scale(1.1); }
}

.admin-card-container { position: relative; z-index: 10; max-width: 410px; width: 100%; margin: auto; }

.admin-card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(5, 0, 120, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  border: none;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.admin-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #050078 0%, #f2b91e 50%, #050078 100%);
}
.admin-card:hover { transform: translateY(-3px); box-shadow: 0 28px 65px rgba(5, 0, 120, 0.18); }
.admin-card-body { padding: clamp(28px, 4.5vh, 36px) clamp(26px, 4.5vw, 36px); }

.brand-logo-container { text-align: center; margin-bottom: clamp(18px, 3vh, 24px); }

/* Logo slot: replace the .brand-mark span with an <img> when the logo is ready */
.brand-icon-wrapper {
  width: clamp(75px, 16vw, 90px);
  height: clamp(75px, 16vw, 90px);
  margin: 0 auto clamp(12px, 1.8vh, 16px);
  background: #ffffff;
  border: 2.5px solid #f2b91e;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(242, 185, 30, 0.3);
  transition: all 0.3s ease;
}
.brand-icon-wrapper:hover { transform: scale(1.05) rotate(1deg); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), 0 0 28px rgba(242, 185, 30, 0.5); }
.brand-icon-wrapper img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; margin: auto; }
.brand-mark {
  font-family: var(--font-admin);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--maroon);
  letter-spacing: -1px;
}

.brand-logo-container h2 {
  font-size: clamp(1.3rem, 3.8vw, 1.5rem);
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  color: #020035;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #050078;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.brand-badge::before { content: ""; width: 6px; height: 6px; background: #f2b91e; border-radius: 50%; }

.form-group { margin-bottom: clamp(16px, 2.5vh, 20px); }
.form-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  color: #020035;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.input-icon-group { position: relative; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #475569;
  transition: color 0.2s ease;
  pointer-events: none;
}
.toggle-password-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  margin: 0;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  border-radius: 6px;
}
.toggle-password-btn:hover { color: #050078; }

.form-control-theme {
  width: 100%;
  padding: 12px 42px 12px 44px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.92rem;
  background: #ffffff;
  color: #020035;
  font-weight: 700;
  transition: all 0.25s ease;
}
.form-control-theme::placeholder { color: #94a3b8; font-weight: 500; }
.form-control-theme:focus { outline: none; border-color: #050078; background: #ffffff; box-shadow: 0 0 0 3.5px rgba(5, 0, 120, 0.15); }
.form-control-theme:focus ~ .input-icon,
.input-icon-group:focus-within .input-icon { color: #050078; }

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: #334155;
  font-weight: 700;
  margin-top: 4px;
  margin-bottom: clamp(18px, 3vh, 24px);
  cursor: pointer;
  user-select: none;
}
.remember-me input[type="checkbox"] { width: 16px; height: 16px; accent-color: #050078; cursor: pointer; border-radius: 4px; }

.btn-theme-submit {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #050078 0%, #172061 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.94rem;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(5, 0, 120, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
}
.btn-theme-submit:hover { background: linear-gradient(135deg, #020035 0%, #050078 100%); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(5, 0, 120, 0.45); }
.btn-theme-submit:active { transform: translateY(0); }

.alert-error {
  background: rgba(254, 226, 226, 0.95);
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-size: 0.88rem;
}
.alert-error ul { margin: 0; padding-left: 16px; }

@media (max-width: 992px) {
  .admin-page-bg { background-size: cover; padding: 24px 16px; }
  .admin-card-container { max-width: 420px; }
}
@media (max-width: 480px) {
  .admin-page-bg { padding: 16px 12px; background-position: center top; }
  .admin-card-container { max-width: 100%; }
  .admin-card { border-radius: 20px; }
  .admin-card-body { padding: 22px 18px; }
  .brand-logo-container h2 { font-size: 1.25rem; }
  .form-control-theme { padding: 10px 38px 10px 40px; font-size: 0.88rem; }
  .btn-theme-submit { padding: 11px 16px; font-size: 0.9rem; }
}
@media (max-width: 360px) {
  .admin-card-body { padding: 18px 14px; }
  .brand-logo-container h2 { font-size: 1.15rem; }
  .brand-badge { font-size: 0.7rem; padding: 3px 10px; }
  .form-group { margin-bottom: 12px; }
  .remember-me { margin-bottom: 14px; font-size: 0.8rem; }
}
@media (max-height: 640px) {
  .brand-logo-container { margin-bottom: 12px; }
  .form-group { margin-bottom: 10px; }
  .remember-me { margin-bottom: 12px; }
}

/* ------------------------------------------------------------------
   Admin dashboard shell (same palette as the login page)
------------------------------------------------------------------- */
.admin-body { font-family: var(--font-admin); background: var(--slate-50); }

.admin-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.admin-sidebar {
  width: 264px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #020035 0%, #050078 100%);
  color: #fff;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  box-shadow: 0 20px 50px rgba(5, 0, 120, 0.25);
  z-index: 20;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); margin-bottom: 18px; }
.brand-icon-sm { width: 48px; height: 48px; margin: 0; border-radius: 12px; padding: 4px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), 0 0 14px rgba(242, 185, 30, 0.3); }
.brand-icon-sm .brand-mark { font-size: 1.5rem; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.sidebar-brand-text strong { font-weight: 800; font-size: 0.95rem; letter-spacing: -0.2px; }
.sidebar-brand-text small { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #f2b91e; }

.sidebar-nav { display: grid; gap: 6px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.sidebar-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar-link.active { background: #f2b91e; color: #020035; box-shadow: 0 8px 20px rgba(242, 185, 30, 0.3); }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.sidebar-logout:hover { background: rgba(254, 226, 226, 0.15); color: #fecaca; }

.admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(14px, 2.5vw, 24px);
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 10;
}
.sidebar-toggle { display: none; background: none; border: 1.5px solid var(--slate-300); border-radius: 10px; padding: 6px; color: #050078; cursor: pointer; }
.topbar-title { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-title h1 { font-size: 1.25rem; font-weight: 800; color: #020035; letter-spacing: -0.3px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-avatar {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #050078 0%, #172061 100%);
  color: #fff; font-weight: 800;
  box-shadow: 0 6px 16px rgba(5, 0, 120, 0.3);
}
.topbar-user-text { display: flex; flex-direction: column; line-height: 1.25; }
.topbar-user-text strong { font-size: 0.9rem; color: #020035; font-weight: 800; }
.topbar-user-text small { font-size: 0.76rem; color: var(--slate-600); font-weight: 600; }

.admin-main { padding: clamp(14px, 2.5vw, 24px); display: grid; gap: 18px; align-content: start; }

.welcome-banner {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: clamp(26px, 4vw, 40px);
  background: linear-gradient(135deg, #020035 0%, #050078 60%, #172061 100%);
  color: #fff;
  box-shadow: 0 20px 50px rgba(5, 0, 120, 0.25);
}
.welcome-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #f2b91e 0%, #ffe073 50%, #f2b91e 100%);
}
.welcome-banner .orb { filter: blur(60px); }
.welcome-banner .orb-1 { background: rgba(242, 185, 30, 0.35); width: 300px; height: 300px; top: -120px; right: -60px; left: auto; }
.welcome-banner .orb-2 { background: rgba(255, 255, 255, 0.12); width: 260px; height: 260px; bottom: -140px; left: 10%; right: auto; }
.welcome-banner-text { position: relative; z-index: 1; }
.welcome-eyebrow { display: inline-block; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: #f2b91e; margin-bottom: 8px; }
.welcome-banner h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.welcome-banner p { color: rgba(255, 255, 255, 0.78); font-weight: 500; }

.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--slate-200);
  box-shadow: 0 10px 30px rgba(5, 0, 120, 0.06);
  transition: all 0.3s ease;
}
.stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #050078 0%, #f2b91e 100%); }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 20px 45px rgba(5, 0, 120, 0.12); }
.stat-icon {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #050078;
  margin-bottom: 6px;
}
.stat-label { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--slate-600); }
.stat-value { font-size: 0.98rem; font-weight: 800; color: #020035; word-break: break-all; }

@media (max-width: 900px) {
  .admin-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.3s ease; }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .topbar-user-text small { display: none; }
}
@media (max-width: 480px) {
  .topbar-user-text { display: none; }
}

/* ------------------------------------------------------------------
   Admin: banner actions, panels, charts, tables, forms, pagination
------------------------------------------------------------------- */
.welcome-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.welcome-banner-actions { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-gold, .btn-outline-light, .btn-primary, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; font-family: var(--font-admin); font-weight: 800; font-size: 0.88rem;
  cursor: pointer; transition: all 0.25s ease; border: 1.5px solid transparent; white-space: nowrap;
}
.btn-gold { background: #f2b91e; color: #020035; box-shadow: 0 8px 20px rgba(242, 185, 30, 0.3); }
.btn-gold:hover { background: #ffe073; transform: translateY(-1px); }
.btn-outline-light { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.16); }
.btn-primary { background: linear-gradient(135deg, #050078 0%, #172061 100%); color: #fff; box-shadow: 0 8px 20px rgba(5, 0, 120, 0.25); }
.btn-primary:hover { background: linear-gradient(135deg, #020035 0%, #050078 100%); transform: translateY(-1px); }
.btn-outline { background: #fff; color: #050078; border-color: #cbd5e1; }
.btn-outline:hover { border-color: #050078; background: #f1f5f9; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn-link { background: none; border: none; padding: 4px 6px; font-family: inherit; font-weight: 800; font-size: 0.84rem; color: #050078; cursor: pointer; border-radius: 6px; }
.btn-link:hover { background: #f1f5f9; }
.text-danger { color: #b42318 !important; }

.stat-card-success::before { background: linear-gradient(90deg, #0f7b4b 0%, #f2b91e 100%); }
.stat-card-success .stat-icon { color: #0f7b4b; background: #ecfdf3; border-color: #a6e9c5; }
.stat-card-danger::before { background: linear-gradient(90deg, #b42318 0%, #f2b91e 100%); }
.stat-card-danger .stat-icon { color: #b42318; background: #fef3f2; border-color: #fecaca; }
.stat-number { font-size: 1.45rem; letter-spacing: -0.5px; }
.stat-sub { font-size: 0.78rem; font-weight: 700; color: var(--slate-600); }

.panel { background: #fff; border-radius: 16px; border: 1px solid var(--slate-200); box-shadow: 0 10px 30px rgba(5, 0, 120, 0.06); padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h3 { font-size: 1.05rem; font-weight: 800; color: #020035; letter-spacing: -0.2px; }
.panel-head p { font-size: 0.84rem; color: var(--slate-600); font-weight: 600; }

.chart-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-box { position: relative; height: 240px; }
.chart-box-donut { height: 280px; }
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } }

.two-col { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 20px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; white-space: nowrap; }
.pill-success { background: #ecfdf3; color: #0f7b4b; border-color: #a6e9c5; }
.pill-warning { background: #fff7e0; color: #9a6b00; border-color: #f2d27a; }
.pill-danger { background: #fef3f2; color: #b42318; border-color: #fecaca; }

.alert-success { background: #ecfdf3; border: 1px solid #a6e9c5; color: #0f7b4b; padding: 12px 16px; border-radius: 14px; font-size: 0.88rem; font-weight: 700; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 36px 16px; text-align: center; color: var(--slate-600); font-weight: 600; border: 1.5px dashed #cbd5e1; border-radius: 14px; }
.empty-state strong { color: #020035; font-weight: 800; }
.empty-state a { color: #050078; text-decoration: underline; }

.table-wrap { overflow-x: auto; border: 1px solid var(--slate-200); border-radius: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { text-align: left; padding: 12px 14px; background: #f8fafc; color: var(--slate-600); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid var(--slate-200); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--slate-100); color: #0f172a; font-weight: 600; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f8fafc; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions form { display: inline; }
.cell-sub { display: block; font-size: 0.76rem; color: var(--slate-600); font-weight: 600; }

.search-form { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 260px; max-width: 520px; }
.search-form .form-control-theme { padding: 10px 14px; }
.input-plain { padding: 11px 14px !important; }
textarea.form-control-theme { resize: vertical; min-height: 90px; }
select.form-control-theme { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23475569' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px !important; }

.admin-form { font-family: var(--font-admin); }
.form-sections { display: grid; gap: 22px; }
.form-section { border: 1px solid var(--slate-200); border-radius: 16px; padding: 18px 20px 6px; }
.form-section legend { padding: 0 8px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #050078; }
.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-1 { grid-template-columns: 1fr; }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid-4 .form-group:has(.switch-label) { align-self: end; padding-bottom: 14px; }
@media (max-width: 1100px) { .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Stacked full-width sections (list on top, form below; the form jumps to the top while editing). */
.stack-col { display: grid; gap: 24px; grid-template-columns: 1fr; }
.stack-col.edit-first .years-list { order: 2; }
.form-grid-4 .form-group .field-hint { margin-top: 4px; }
.stack-col .inline-form-row input[type="file"] { flex: 1 1 320px; }
/* DataTables lists (subjects, holidays): keep dates/numbers on one line; the wrapper scrolls on phones. */
.stack-col .data-table.dt td[data-order], .stack-col .data-table.dt td.num, .stack-col .data-table.dt td.actions { white-space: nowrap; }
@media (max-width: 640px) { .stack-col .data-table.dt th, .stack-col .data-table.dt td { padding: 10px 10px; } }
.form-group-full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.form-group .req { color: #b42318; }
.field-hint { display: block; margin-top: 6px; font-size: 0.76rem; color: var(--slate-600); font-weight: 600; }
.field-hint a { color: #050078; text-decoration: underline; }
.switch-label { display: flex !important; align-items: center; justify-content: flex-start !important; gap: 10px; padding: 12px 0; cursor: pointer; font-weight: 700 !important; }
.switch-label input { width: 18px; height: 18px; accent-color: #050078; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.test-mail-form { margin-top: 22px; padding-top: 18px; border-top: 1px dashed #cbd5e1; }
.test-mail-form label { display: block; font-size: 0.88rem; font-weight: 800; color: #020035; margin-bottom: 6px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .form-control-theme { flex: 1; min-width: 200px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 0.84rem; }
.pagination-info { color: var(--slate-600); font-weight: 600; }
.pagination-links { display: flex; gap: 6px; }
.page-link { padding: 6px 12px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: #050078; font-weight: 800; }
.page-link:hover { background: #f1f5f9; }
.page-link.active { background: #050078; color: #fff; border-color: #050078; }
.page-link.disabled { color: #94a3b8; pointer-events: none; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(2, 0, 53, 0.45); z-index: 15; }
.sidebar-backdrop.show { display: block; }

/* ------------------------------------------------------------------
   Fees, queue, DataTables
------------------------------------------------------------------- */
.panel-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat-grid-compact .stat-card { padding: 14px 16px; gap: 2px; }
.stat-grid-compact .stat-value { font-size: 1.2rem; }
.plan-preview { padding: 11px 14px; border: 1.5px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; font-size: 0.86rem; font-weight: 700; color: #020035; min-height: 46px; }
.queue-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.queue-stat { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--slate-200); }
.queue-stat span { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--slate-600); }
.queue-stat strong { font-size: 1.3rem; color: #020035; }
.queue-stat-ok strong { color: #0f7b4b; }
.queue-stat-bad strong { color: #b42318; }
.cell-error { max-width: 260px; color: #b42318; font-size: 0.8rem; white-space: normal; }
.topbar-user:hover .topbar-user-text strong { color: #050078; }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.field-hint code { background: #f1f5f9; padding: 1px 6px; border-radius: 6px; }

/* DataTables in the admin theme */
.table-wrap:has(table.dt) { border: none; overflow: visible; }
table.dataTable { border-collapse: collapse !important; }
table.dataTable thead th { background: #f8fafc; }
table.dataTable.data-table thead > tr > th { padding: 12px 26px 12px 14px; border-bottom: 1px solid var(--slate-200); }
table.dataTable.data-table > tbody > tr > td { padding: 12px 14px; }
table.dataTable > thead > tr > th.dt-orderable-asc:hover, table.dataTable > thead > tr > th.dt-orderable-desc:hover { outline: none; background: #f1f5f9; }
div.dt-container { font-family: var(--font-admin); }
div.dt-container .dt-search { margin-bottom: 12px; }
div.dt-container .dt-search input { padding: 10px 14px; border: 1.5px solid #cbd5e1; border-radius: 12px; font: inherit; font-size: 0.88rem; font-weight: 600; color: #020035; min-width: 260px; margin: 0; }
div.dt-container .dt-search input:focus { outline: none; border-color: #050078; box-shadow: 0 0 0 3.5px rgba(5, 0, 120, 0.15); }
div.dt-container .dt-info { font-size: 0.82rem; font-weight: 600; color: var(--slate-600); padding-top: 14px; }
div.dt-container .dt-paging { padding-top: 10px; }
div.dt-container .dt-paging .dt-paging-button { padding: 6px 12px; border-radius: 8px !important; border: 1px solid #cbd5e1 !important; background: #fff !important; color: #050078 !important; font-weight: 800; font-size: 0.82rem; margin: 0 2px; box-shadow: none !important; }
div.dt-container .dt-paging .dt-paging-button:hover { background: #f1f5f9 !important; color: #050078 !important; }
div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover { background: #050078 !important; color: #ffffff !important; border-color: #050078 !important; }
div.dt-container .dt-paging .dt-paging-button.disabled,
div.dt-container .dt-paging .dt-paging-button.disabled:hover { color: #94a3b8 !important; background: #fff !important; }
div.dt-container .dt-layout-row { margin: 0; }
div.dt-container .dt-layout-table { border: 1px solid var(--slate-200); border-radius: 14px; overflow: auto; }

/* Logo upload */
.logo-row { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { margin: 0; width: 110px; height: 110px; flex-shrink: 0; }
.logo-form { flex: 1; min-width: 280px; }
input[type="file"].form-control-theme { padding: 9px 12px !important; font-weight: 600; }

/* Plain list pages (no card) */
.list-plain .empty-state { background: #fff; }
.list-plain div.dt-container .dt-layout-table { background: #fff; box-shadow: 0 10px 30px rgba(5, 0, 120, 0.06); }
.list-plain .table-wrap:not(:has(table.dt)) { background: #fff; }

/* Keep wide tables inside the content column */
.admin-main > * , .chart-grid > *, .two-col > * { min-width: 0; max-width: 100%; }
.panel { overflow: hidden; }
.row-title { font-weight: 800; color: #020035; }
.row-title:hover { color: #050078; text-decoration: underline; }
.data-table td.actions, .data-table th.actions { white-space: nowrap; }
.data-table td:first-child { white-space: nowrap; }
table.dataTable.data-table thead > tr > th.no-sort { padding-right: 14px; }
table.dataTable.data-table.dt-serial > tbody > tr > td { padding: 10px 11px; }
table.dataTable.data-table.dt-serial thead > tr > th { padding: 11px 22px 11px 11px; }

/* Inline rows under the fee schedule */
tr.row-inline > td { background: #f8fafc; border-bottom: 1px solid var(--slate-200) !important; }
.inline-form-row { align-items: center; gap: 8px; }
.inline-form-row strong { flex-basis: 100%; font-size: 0.84rem; color: #020035; }
.inline-form-row .form-control-theme { flex: 0 1 180px; min-width: 140px; padding: 8px 10px !important; font-size: 0.84rem; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 700; color: #334155; }
.checkbox-inline input { accent-color: #050078; }

/* Settings tab strip */
.settings-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; background: #fff; border: 1px solid var(--slate-200); border-radius: 14px; }
.settings-tab { padding: 8px 16px; border-radius: 10px; font-size: 0.86rem; font-weight: 800; color: #050078; transition: all 0.2s ease; }
.settings-tab:hover { background: #f1f5f9; }
.settings-tab.active { background: linear-gradient(135deg, #050078 0%, #172061 100%); color: #fff; box-shadow: 0 6px 16px rgba(5, 0, 120, 0.25); }

/* Fee calculation box + GST badge */
.gst-rate-badge { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; background: #f1f5f9; border: 1px solid #cbd5e1; color: #050078; }
.fee-calc { border: 1.5px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; padding: 10px 14px; display: grid; gap: 6px; font-size: 0.86rem; }
.fee-calc > div { display: flex; justify-content: space-between; gap: 12px; }
.fee-calc span { color: #475569; font-weight: 700; }
.fee-calc strong { color: #020035; font-weight: 800; }
.fee-calc-total { padding-top: 6px; border-top: 1px solid var(--slate-200); }
.fee-calc-total strong { color: #050078; font-size: 0.95rem; }
.list { list-style: none; display: grid; gap: 8px; }
.list-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 12px; }
.list-item strong { display: block; color: #020035; font-size: 0.9rem; }
.list-item small { display: block; color: var(--slate-600); font-weight: 600; font-size: 0.8rem; }

/* Template editor */
.template-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 22px; }
@media (max-width: 1100px) { .template-grid { grid-template-columns: 1fr; } }
.template-block { border: 1px solid var(--slate-200); border-radius: 14px; padding: 16px 18px 6px; margin-bottom: 16px; }
.template-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.template-block-head h4, .placeholders h4 { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #050078; }
.template-block-head .form-control-theme { width: auto; padding: 7px 34px 7px 12px !important; font-size: 0.84rem; }
.template-side { display: grid; gap: 16px; align-content: start; }
.template-preview { border: 1.5px dashed #cbd5e1; border-radius: 14px; padding: 16px 18px; background: #f8fafc; }
.preview-subject { margin-top: 10px; font-weight: 800; color: #020035; font-size: 0.9rem; padding-bottom: 8px; border-bottom: 1px solid var(--slate-200); }
.preview-body { margin-top: 10px; font-family: inherit; font-size: 0.86rem; line-height: 1.6; white-space: pre-wrap; color: #0f172a; font-weight: 500; }
.placeholders { border: 1px solid var(--slate-200); border-radius: 14px; padding: 16px 18px; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.placeholder-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.76rem; font-weight: 700; padding: 4px 9px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: #050078; cursor: pointer; }
.placeholder-chip:hover { background: #050078; color: #fff; border-color: #050078; }
textarea.tpl-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84rem; font-weight: 500; line-height: 1.55; }

/* ------------------------------------------------------------------
   Responsive pass: phones and tablets
------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
img, svg, canvas { max-width: 100%; }
.stat-value { overflow-wrap: anywhere; }
.form-control-theme, .input-plain { max-width: 100%; }
div.dt-container .dt-search input { max-width: 100%; min-width: 0; width: min(260px, 100%); }
div.dt-container .dt-search { width: 100%; }
.queue-stats { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.topbar-title { min-width: 0; flex-wrap: wrap; gap: 8px; }
.topbar-title h1 { font-size: clamp(1rem, 2.5vw, 1.25rem); }
.panel-head h3 { font-size: clamp(0.95rem, 2.5vw, 1.05rem); }
.list-item { flex-wrap: wrap; }

@media (max-width: 900px) {
  .admin-main { padding: 14px; gap: 14px; }
  .admin-topbar { gap: 10px; padding: 10px 14px; }
  .topbar-actions { order: 3; width: 100%; }
  .topbar-actions .btn-primary, .topbar-actions .btn-outline, .topbar-actions form { flex: 1; }
  .topbar-actions .btn-primary, .topbar-actions .btn-outline { width: 100%; }
  .panel { padding: 14px; border-radius: 14px; }
  .form-section { padding: 14px 14px 4px; }
  .form-actions .btn-primary, .form-actions .btn-outline { flex: 1; min-width: 140px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-number { font-size: 1.15rem; }
  .chart-box { height: 220px; }
  /* Tabs wrap on phones so none are hidden off-screen; each grows to fill its row. */
  .settings-tabs { flex-wrap: wrap; gap: 4px; }
  .settings-tab { white-space: nowrap; flex: 1 1 auto; text-align: center; padding-left: 10px; padding-right: 10px; }
  .template-block-head { flex-wrap: wrap; }
  .inline-form-row .form-control-theme { flex: 1 1 140px; }
  .logo-row { flex-direction: column; }
}

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-grid-compact { grid-template-columns: 1fr; }
  .queue-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .queue-stat { padding: 8px 4px; }
  .queue-stat strong { font-size: 1.05rem; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td,
  table.dataTable.data-table > tbody > tr > td,
  table.dataTable.data-table.dt-serial > tbody > tr > td { padding: 9px 8px; }
  table.dataTable.data-table thead > tr > th,
  table.dataTable.data-table.dt-serial thead > tr > th { padding: 9px 18px 9px 8px; }
  .pagination, div.dt-container .dt-layout-row:last-child { flex-direction: column; align-items: flex-start; gap: 8px; }
  div.dt-container .dt-paging .dt-paging-button { padding: 5px 9px; font-size: 0.78rem; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .panel-head-actions { width: 100%; }
  .panel-head-actions form, .panel-head-actions .btn-outline { flex: 1; }
  .panel-head-actions .btn-outline { width: 100%; }
  .inline-form { flex-direction: column; }
  .inline-form .form-control-theme, .inline-form .btn-outline, .inline-form .btn-primary { width: 100%; }
  .inline-form-row { flex-direction: column; align-items: stretch; }
  .inline-form-row .form-control-theme { flex: 1 1 auto; width: 100%; }
  .welcome-banner-actions { width: 100%; }
  .sidebar-brand-text strong { font-size: 0.9rem; }
  .template-preview, .placeholders { padding: 12px; }
  .fee-calc { font-size: 0.82rem; }
}

@media (max-width: 380px) {
  .admin-main { padding: 10px; }
  .panel { padding: 12px; }
  .brand-badge { font-size: 0.68rem; padding: 3px 10px; }
  .topbar-avatar { width: 34px; height: 34px; }
  .settings-tab { padding: 7px 12px; font-size: 0.8rem; }
}

/* Top bar on small screens: one tidy row, actions drop below */
@media (max-width: 900px) {
  .admin-topbar { flex-wrap: wrap; }
  .sidebar-toggle { order: 0; flex-shrink: 0; }
  .topbar-title { order: 1; flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
  .topbar-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar-title .brand-badge { flex-shrink: 0; max-width: 46%; overflow: hidden; }
  .topbar-user { order: 2; flex-shrink: 0; }
  .topbar-actions { order: 3; }
}
@media (max-width: 600px) {
  .topbar-title .brand-badge { display: none; }
}

/* Discount type + value side by side */
.discount-row { display: flex; gap: 8px; }
.discount-row select { flex: 1 1 55%; }
.discount-row input { flex: 1 1 45%; min-width: 90px; }

/* Honour the hidden attribute everywhere, including flex rows */
[hidden] { display: none !important; }

/* Receipt design gallery */
.design-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.design-card { border: 1.5px solid var(--slate-200); border-radius: 14px; overflow: hidden; background: #fff; transition: all 0.2s ease; display: flex; flex-direction: column; }
.design-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(5, 0, 120, 0.1); }
.design-card.active { border-color: #050078; box-shadow: 0 0 0 3px rgba(5, 0, 120, 0.12); }
.design-thumb { position: relative; height: 170px; background: #fff; border-bottom: 1px solid var(--slate-200); padding: 10px 12px; overflow: hidden; font-size: 7px; }
.design-thumb .dt-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--a) 0 33%, var(--b) 33% 66%, var(--a) 66%); }
.design-thumb .dt-band { margin: -10px -12px 8px; padding: 8px 12px; background: var(--a); color: #fff; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--b); }
.design-thumb .dt-band-title, .design-thumb .dt-title { font-weight: 800; font-size: 8px; }
.design-thumb .dt-band-sub, .design-thumb .dt-sub { font-weight: 800; font-size: 6px; letter-spacing: 0.5px; opacity: 0.85; }
.design-thumb .dt-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 8px; color: var(--a); padding-bottom: 5px; border-bottom: 1px solid var(--slate-200); }
.design-thumb .dt-head-rule { border-bottom: 1.5px solid var(--a); }
.design-thumb .dt-lines i { display: block; height: 3px; border-radius: 2px; background: #e2e8f0; margin: 3px 0; width: 60%; }
.design-thumb .dt-lines i.short { width: 40%; }
.design-thumb .dt-table { margin-top: 8px; }
.design-thumb .dt-th { height: 7px; border-radius: 2px; }
.design-thumb .dt-table.fill .dt-th { background: var(--a); }
.design-thumb .dt-table.line .dt-th { background: transparent; border-bottom: 1.5px solid var(--a); border-radius: 0; }
.design-thumb .dt-tr { height: 6px; border-bottom: 1px solid #e2e8f0; }
.design-thumb .dt-total { margin: 8px 0 0 auto; width: 45%; height: 8px; border-radius: 2px; background: color-mix(in srgb, var(--b) 25%, #fff); border: 1px solid var(--b); }
.design-thumb .dt-stamp { position: absolute; right: 14px; bottom: 12px; transform: rotate(-12deg); border: 2px solid #0f7b4b; color: #0f7b4b; font-weight: 800; font-size: 9px; padding: 1px 6px; border-radius: 4px; opacity: 0.6; }
.design-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.design-body strong { font-size: 0.92rem; color: #020035; }
.design-body small { color: var(--slate-600); font-weight: 600; font-size: 0.78rem; line-height: 1.4; }
.design-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.letterhead-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 1.2fr); gap: 18px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed #cbd5e1; }
@media (max-width: 900px) { .letterhead-box { grid-template-columns: 1fr; } }
.letterhead-preview { min-height: 90px; display: flex; align-items: center; justify-content: center; border: 1.5px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; padding: 10px; color: var(--slate-600); font-size: 0.82rem; font-weight: 600; text-align: center; }
.letterhead-preview img { max-width: 100%; max-height: 140px; object-fit: contain; }
.letterhead-form h4 { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #050078; margin-bottom: 6px; }
.letterhead-form .inline-form { margin-top: 10px; }

/* Enquiry log on the student page */
.enquiry-log { border-left: 4px solid #f2b91e; }
.log-grid { display: grid; gap: 12px 18px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.log-grid > div { display: flex; flex-direction: column; gap: 2px; }
.log-grid span { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--slate-600); }
.log-grid strong { color: #020035; font-size: 0.92rem; }
.log-grid small { color: var(--slate-600); font-weight: 600; font-size: 0.78rem; }
.log-grid .log-full { grid-column: 1 / -1; }

/* ---- Multi-academy: switcher, platform console, inheritance */
.sidebar-switch { display: flex; align-items: center; gap: 8px; margin: -6px 6px 12px; padding: 7px 10px; border-radius: 10px; font-size: 0.78rem; font-weight: 800; color: #f2b91e; background: rgba(255, 255, 255, 0.06); }
.sidebar-switch:hover { background: rgba(255, 255, 255, 0.12); }
.platform-sidebar { background: linear-gradient(180deg, #111827 0%, #1f2937 100%); }
.platform-sidebar .sidebar-link.active { background: #f2b91e; color: #111827; }
.platform-banner { background: #fff7e0; border-bottom: 1px solid #f2d27a; color: #9a6b00; font-size: 0.84rem; font-weight: 700; padding: 8px 20px; }
.platform-banner a { margin-left: 10px; color: #050078; text-decoration: underline; }
.switcher-container { max-width: 520px; }
.switcher-list { list-style: none; display: grid; gap: 10px; margin-top: 16px; }
.switcher-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid #cbd5e1; border-radius: 14px; }
.switcher-item.current { border-color: #050078; }
.switcher-mark { width: 44px; height: 44px; border-radius: 12px; border: 2px solid #f2b91e; display: grid; place-items: center; font-weight: 800; color: #050078; flex-shrink: 0; overflow: hidden; }
.switcher-mark img { max-width: 100%; max-height: 100%; object-fit: contain; }
.switcher-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.switcher-text strong { color: #020035; font-size: 0.95rem; }
.switcher-text small { color: #475569; font-weight: 600; font-size: 0.78rem; }
.switcher-default { font-size: 0.76rem; font-weight: 700; color: #475569; display: flex; align-items: center; gap: 4px; }
.switcher-empty { margin-top: 14px; color: #475569; font-weight: 600; text-align: center; }
.switcher-platform { width: 100%; margin-top: 14px; }
.switcher-logout { text-align: center; margin-top: 10px; }
.inherit-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.perm-groups { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.perm-group { border: 1px solid var(--slate-200); border-radius: 12px; padding: 12px 14px; }
.perm-group h4 { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #050078; margin-bottom: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.perm-item code { margin-left: auto; font-size: 0.7rem; color: #94a3b8; }

/* Password fields with show/hide toggle (profile, member and user forms) */
.password-field .form-control-theme { padding-right: 44px !important; }

/* Uploaded PDF receipt template */
.pdf-file { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #050078; }
.pdf-file strong { font-size: 0.84rem; color: #020035; word-break: break-all; }
.pdf-layout-form { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #cbd5e1; }
.pdf-layout-form .form-actions { margin-top: 6px; }
.fields-table td { padding: 6px 8px !important; }
.input-xs { padding: 6px 8px !important; width: 88px; font-size: 0.82rem; }
.fields-table select.input-xs { width: 96px; padding-right: 28px !important; }

/* PDF template as a gallery design + full-width template settings */
.design-thumb-pdf { padding: 10px; background: #f8fafc; display: grid; place-items: center; }
.pdf-thumb-page { width: 100%; height: 100%; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 6px 18px rgba(5, 0, 120, 0.08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #050078; text-align: center; padding: 10px; }
.pdf-thumb-title { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; }
.pdf-thumb-file { font-size: 9px; color: #475569; font-weight: 600; word-break: break-all; }
.pdf-thumb-mode { font-size: 9px; color: #94a3b8; font-weight: 600; }
.pdf-template-box { grid-template-columns: 1fr; }
.pdf-template-box .letterhead-preview { min-height: 70px; }
.fields-table { min-width: 560px; }
.design-thumb .dt-inv-head { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 6px; }
.design-thumb .dt-inv-logo { width: 34px; height: 12px; border-radius: 3px; background: var(--b); opacity: 0.8; }
.design-thumb .dt-inv-title { font-weight: 800; font-size: 11px; color: #64748b; letter-spacing: 0.5px; }
.design-thumb .dt-inv-meta { margin-left: auto; width: 46%; border: 1px solid #cbd5e1; border-radius: 3px; padding: 3px; }
.design-thumb .dt-inv-meta i { display: block; height: 3px; background: #e2e8f0; margin: 2px 0; }
.logo-box-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .logo-box-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.switcher-current { margin-top: 12px; font-size: 0.86rem; color: #475569; font-weight: 600; text-align: center; }
.switcher-current a { color: #050078; text-decoration: underline; margin-left: 4px; }
.erase-title { margin-top: 16px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #050078; }
.erase-table { min-width: 420px; }

/* Unified template upload card */
.template-upload-box { grid-template-columns: minmax(0, 1fr) minmax(300px, 1.1fr); }
.template-uploads { flex-direction: column; align-items: stretch; gap: 10px; text-align: left; }
.upload-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; color: #050078; }
.upload-item img { max-height: 48px; max-width: 120px; object-fit: contain; }
.upload-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.upload-item-text strong { font-size: 0.86rem; color: #020035; }
.upload-item-text small { font-size: 0.76rem; color: var(--slate-600); font-weight: 600; word-break: break-word; }
.upload-item-text a { color: #050078; text-decoration: underline; }

/* Academics + audit (Phase 0) */
.term-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px dashed #e2e8f0; font-size: 0.86rem; }
.term-row:last-of-type { border-bottom: 0; }
.term-actions { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.term-actions form { display: inline; }
.term-add { margin-top: 8px; }
.term-add .input-xs { max-width: 150px; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.audit-filters { margin-bottom: 14px; align-items: center; }
.audit-details { max-width: 420px; font-size: 0.82rem; }
.audit-changes { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.audit-changes code { font-size: 0.75rem; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.audit-from { color: #b91c1c; text-decoration: line-through; }
.audit-to { color: #047857; font-weight: 700; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .form-grid-3 { grid-template-columns: 1fr; } }

/* Attendance */
.attendance-filters { align-items: flex-end; margin-bottom: 14px; }
.attendance-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; font-weight: 800; color: #475569; }
.status-radios { display: flex; flex-wrap: wrap; gap: 6px; }
.status-radio { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border: 1.5px solid #cbd5e1; border-radius: 999px; font-size: 0.78rem; font-weight: 700; cursor: pointer; background: #fff; }
.status-radio input { margin: 0; }
.status-radio:has(input:checked) { border-color: #050078; background: #eef2ff; color: #050078; }
.status-radio.status-present:has(input:checked) { border-color: #059669; background: #ecfdf5; color: #047857; }
.status-radio.status-absent:has(input:checked) { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
.status-radio.status-late:has(input:checked), .status-radio.status-half_day:has(input:checked) { border-color: #d97706; background: #fffbeb; color: #b45309; }
.mark-all { margin-bottom: 10px; align-items: center; font-size: 0.82rem; font-weight: 800; color: #475569; }
.attendance-table .input-xs { min-width: 110px; }
.completion-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.completion-chip { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1.5px solid #fca5a5; background: #fef2f2; border-radius: 10px; font-size: 0.8rem; color: #991b1b; min-width: 140px; }
.completion-chip.done { border-color: #6ee7b7; background: #ecfdf5; color: #065f46; }
.lock-actions { margin-top: 14px; }
.row-active td { background: #eef2ff; }
@media (max-width: 760px) { .status-radio { padding: 4px 7px; font-size: 0.72rem; } }

/* Imports */
.row-error td { background: #fff1f2; }

/* Module picker (platform) */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.module-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid #cbd5e1; border-radius: 10px; background: #fff; cursor: pointer; font-size: 0.84rem; }
.module-option:has(input:checked) { border-color: #050078; background: #eef2ff; }
.module-option input { margin-top: 3px; }
.module-option span { display: flex; flex-direction: column; gap: 2px; }
.module-option small { color: #64748b; font-weight: 600; }

/* ------------------------------------------------------------------
   Dropdowns, dates and calendar (uniform look everywhere)
------------------------------------------------------------------- */
select.form-control-theme {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23050078' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
  padding-right: 40px !important; cursor: pointer;
}
select.form-control-theme.input-xs { background-position: right 8px center; padding-right: 26px !important; }
select.form-control-theme:disabled { background-color: #f8fafc; color: #94a3b8; cursor: not-allowed; }
select.form-control-theme option { font-weight: 600; }
input[type="date"].form-control-theme, input[type="time"].form-control-theme, input.flatpickr-input.form-control-theme {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23050078' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px !important; cursor: pointer;
}
input[type="time"].form-control-theme, input.flatpickr-input[data-time] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23050078' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polyline points='12 6 12 12 16 14'/></svg>");
}
input[type="date"].form-control-theme::-webkit-calendar-picker-indicator, input[type="time"].form-control-theme::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; right: 0; width: 40px; height: 100%; cursor: pointer; }
/* Fields with a leading icon (login) keep their icon padding; plain admin fields use .input-plain. */
.form-control-theme.flatpickr-input:not(.input-plain) { padding-left: 44px; }
.flatpickr-calendar { border-radius: 14px; box-shadow: 0 18px 40px rgba(2, 0, 53, 0.18); border: 1px solid #e2e8f0; font-family: inherit; }
.flatpickr-months { padding-top: 6px; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month, .flatpickr-weekdays, span.flatpickr-weekday { background: transparent; color: #050078; font-weight: 800; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 800; }
.flatpickr-day { font-weight: 600; border-radius: 10px; }
.flatpickr-day.today { border-color: #f2b91e; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.startRange, .flatpickr-day.endRange { background: #050078; border-color: #050078; color: #fff; }
.flatpickr-day:hover { background: #eef2ff; border-color: #eef2ff; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: #f2b91e; }
.flatpickr-time input, .flatpickr-time .flatpickr-am-pm { font-weight: 700; color: #050078; }

/* ------------------------------------------------------------------
   Responsive polish and alignment
------------------------------------------------------------------- */
.form-grid { align-items: start; }
.form-group label { display: block; margin-bottom: 6px; }
.inline-form-row { display: flex; flex-wrap: wrap; }
.inline-form-row > label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; font-weight: 800; color: #475569; }
/* Inside a stacked label the row's flex-basis would become a height, so reset it (fixes the tall "Day" box). */
.inline-form-row > label > .form-control-theme { flex: 0 0 auto; width: auto; height: auto; min-height: 0; }
.inline-form-row > label > .flatpickr-input + .form-control-theme { flex: 0 0 auto; }
/* Compact filter: label text sits beside its field instead of above it. */
.inline-form-row.compact { gap: 10px; }
.inline-form-row.compact > label { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.inline-form-row.compact > label > .form-control-theme { min-width: 150px; }
.panel-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions, .topbar-actions { flex-wrap: wrap; }
.data-table td, .data-table th { vertical-align: middle; }
.data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; }
.table-wrap table { min-width: 100%; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekday-picker { gap: 8px 12px; }
}
@media (max-width: 600px) {
  .input-xs, .term-add .input-xs, .attendance-table .input-xs { width: 100%; max-width: none; min-width: 0; }
  .attendance-filters label, .attendance-filters .btn-outline { width: 100%; }
  .attendance-filters .btn-outline { text-align: center; }
  .completion-chip { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .module-grid { grid-template-columns: 1fr; }
  .audit-filters select, .audit-filters input, .audit-filters .btn-outline { width: 100%; }
  .lock-actions form { flex-direction: column; align-items: stretch; }
  .lock-actions .btn-primary, .lock-actions .btn-outline { width: 100%; }
  .mark-all { gap: 6px; }
  .mark-all .btn-outline { flex: 1 1 calc(50% - 6px); }
  .status-radios { gap: 4px; }
  .discount-row { flex-direction: column; }
  .form-actions form { width: 100%; }
  .form-actions form .btn-primary, .form-actions form .btn-outline { width: 100%; }
  .table-wrap:not(:has(table.dt)) { border-radius: 10px; }
}

/* ------------------------------------------------------------------
   Leave calendar
------------------------------------------------------------------- */
.leave-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.leave-calendar-head { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #475569; text-align: center; padding: 6px 0; }
.leave-day { min-height: 96px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.leave-day.off { background: #f8fafc; }
.leave-day.holiday { background: #fff7ed; border-color: #fdba74; }
.leave-day.today { border-color: #050078; box-shadow: inset 0 0 0 1px #050078; }
.leave-day.outside { opacity: 0.35; }
.leave-day-num { font-weight: 800; font-size: 0.82rem; color: #020035; display: flex; justify-content: space-between; align-items: center; }
.leave-day-num small { font-weight: 700; color: #b45309; font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.leave-chip { display: block; font-size: 0.72rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leave-chip.approved { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.leave-chip.pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.leave-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; font-weight: 700; color: #475569; margin-top: 10px; }
.leave-legend span { display: inline-flex; align-items: center; gap: 6px; }
.leave-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid #e2e8f0; }
@media (max-width: 760px) {
  .leave-calendar { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .leave-calendar-head { display: none; }
  .leave-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .leave-day.outside { display: none; }
  .leave-day-num { width: 100%; }
  .leave-day-num::before { content: attr(data-weekday) ' '; color: #64748b; font-weight: 700; margin-right: 4px; }
  .leave-chip { white-space: normal; }
}

/* ------------------------------------------------------------------
   Login / switcher background (navy mesh with gold accents)
------------------------------------------------------------------- */
.admin-page-bg {
  background:
    radial-gradient(900px 600px at 10% 10%, rgba(242, 185, 30, 0.35), transparent 60%),
    radial-gradient(800px 600px at 90% 20%, rgba(99, 102, 241, 0.45), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(242, 185, 30, 0.18), transparent 60%),
    linear-gradient(135deg, #020035 0%, #050078 55%, #172061 100%);
}
.admin-page-bg::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9), transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9), transparent 75%);
}
.admin-page-bg::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -35vh; height: 70vh; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.10), transparent 65%);
  transform: rotate(-6deg);
}
.admin-page-bg .orb-1 { background: rgba(242, 185, 30, 0.45); filter: blur(90px); }
.admin-page-bg .orb-2 { background: rgba(129, 140, 248, 0.45); filter: blur(100px); }
.admin-page-bg .orb-3 { position: absolute; width: min(320px, 60vw); height: min(320px, 60vw); border-radius: 50%; background: rgba(255, 255, 255, 0.10); filter: blur(70px); top: 55%; left: 55%; pointer-events: none; z-index: 0; animation: floatOrb 16s ease-in-out infinite alternate-reverse; }
.admin-card { box-shadow: 0 30px 70px rgba(2, 0, 53, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.18); }
.admin-card-container { animation: cardIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.login-tagline { position: relative; z-index: 1; text-align: center; color: rgba(255, 255, 255, 0.78); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.4px; margin-top: 16px; }
.login-tagline strong { color: #f2b91e; }
@media (prefers-reduced-motion: reduce) { .orb, .admin-page-bg .orb-3, .admin-card-container { animation: none; } }

/* Staff daily redesign, self check-in, people cells */
.daily-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.daily-stat { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: #fff; }
.daily-stat strong { font-size: 1.2rem; color: #020035; }
.daily-stat span { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: #64748b; }
.daily-stat.ok { background: #ecfdf5; border-color: #a7f3d0; } .daily-stat.ok strong { color: #047857; }
.daily-stat.warn { background: #fffbeb; border-color: #fde68a; } .daily-stat.warn strong { color: #b45309; }
.daily-stat.bad { background: #fef2f2; border-color: #fecaca; } .daily-stat.bad strong { color: #b91c1c; }
.daily-stat.muted { background: #f8fafc; }
.person { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #050078, #172061); color: #f2b91e; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.status-radio.status-auto:has(input:checked) { border-color: #475569; background: #f1f5f9; color: #334155; }
.staff-daily-table .input-xs { min-width: 100px; }
.checkin-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; background: #eef2ff; color: #050078; border: 1.5px solid #c7d2fe; white-space: nowrap; }
.checkin-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #6366f1; }
.checkin-chip.in { background: #ecfdf5; border-color: #a7f3d0; color: #047857; } .checkin-chip.in .dot { background: #10b981; }
.checkin-chip.done { background: #f1f5f9; border-color: #cbd5e1; color: #475569; } .checkin-chip.done .dot { background: #94a3b8; }
.checkin-times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.checkin-time { border: 1.5px dashed #cbd5e1; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.checkin-time.done { border-style: solid; border-color: #a7f3d0; background: #ecfdf5; }
.checkin-time span { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; color: #64748b; letter-spacing: 0.4px; }
.checkin-time strong { font-size: 1.5rem; color: #020035; }
.checkin-time small { color: #475569; font-weight: 600; }
.checkin-actions { justify-content: center; }
.btn-lg { padding: 14px 32px !important; font-size: 1rem !important; }
.camera-box { position: relative; border-radius: 16px; overflow: hidden; background: #020035; aspect-ratio: 4 / 3; max-width: 480px; margin: 0 auto 10px; }
.camera-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-status { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; background: rgba(2, 0, 53, 0.75); color: #fff; font-size: 0.8rem; font-weight: 700; }
.camera-status.bad { background: rgba(185, 28, 28, 0.85); }
@media (max-width: 900px) { .daily-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .checkin-times { grid-template-columns: 1fr; } .checkin-chip { padding: 6px 10px; font-size: 0.72rem; } .daily-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Student hero + tabs */
.student-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, #050078 0%, #172061 100%); color: #fff; border-radius: 18px; padding: 18px 22px; margin-bottom: 14px; box-shadow: 0 14px 34px rgba(5, 0, 120, 0.25); }
.student-hero-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.student-hero h2 { margin: 0 0 6px; font-size: clamp(1.05rem, 2.6vw, 1.35rem); }
.student-hero-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.82rem; }
.student-hero-meta .pill { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: transparent; }
.student-hero-meta .pill-success { background: rgba(16, 185, 129, 0.35); }
.student-hero-contact { color: rgba(255, 255, 255, 0.8); font-weight: 600; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; background: #f2b91e; color: #050078; }
.avatar-muted { background: #e2e8f0; color: #475569; }
.student-hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.student-hero-stats > div { background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; min-width: 92px; }
.student-hero-stats span { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.student-hero-stats strong { font-size: 1.05rem; }
.student-hero-stats strong.ok { color: #6ee7b7; } .student-hero-stats strong.bad { color: #fca5a5; }
.student-tabs { margin-bottom: 14px; }
@media (max-width: 600px) { .student-hero { padding: 14px; } .student-hero-stats { width: 100%; } .student-hero-stats > div { flex: 1 1 40%; min-width: 0; } }

.date-nav { flex-wrap: nowrap !important; flex-direction: row !important; align-items: center; gap: 6px; }
.date-nav .btn-outline { flex: 0 0 auto; width: auto !important; padding: 8px 12px; }
.date-nav .input-xs { width: 150px !important; flex: 0 1 150px; }
@media (max-width: 600px) { .date-nav { width: 100%; } .date-nav .input-xs { flex: 1 1 auto; width: auto !important; } }

/* Student attendance redesign */
.register-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.register-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; color: #475569; }
.register-filters .btn-primary { height: 46px; }
.daily-summary.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.student-register td:first-child { color: #94a3b8; font-weight: 700; }
.completion-chip.current { outline: 2px solid #050078; outline-offset: 1px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0)); padding-top: 12px; margin-top: 10px; z-index: 2; }
.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.class-card { display: flex; flex-direction: column; gap: 8px; border: 1.5px solid #e2e8f0; border-radius: 14px; padding: 14px; background: #fff; color: inherit; transition: all 0.2s ease; }
.class-card:hover { border-color: #050078; box-shadow: 0 10px 24px rgba(5, 0, 120, 0.12); transform: translateY(-1px); }
.class-card.active { border-color: #050078; background: #eef2ff; }
.class-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.class-card-head strong { font-size: 0.95rem; color: #020035; }
.class-card-row { display: flex; justify-content: space-between; font-size: 0.82rem; color: #475569; font-weight: 600; }
.class-card-row strong.ok { color: #047857; } .class-card-row strong.warn { color: #b45309; } .class-card-row strong.bad { color: #b91c1c; }
.meter { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #050078, #6366f1); border-radius: 999px; }
.class-card-link { font-size: 0.78rem; font-weight: 800; color: #050078; margin-top: auto; }
@media (max-width: 900px) { .daily-summary.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .daily-summary.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .register-filters { grid-template-columns: 1fr; }
  .student-register thead { display: none; }
  .student-register tr { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 8px; border-bottom: 1px solid #e2e8f0; }
  .student-register td { display: block; padding: 0 !important; border: 0; }
  .student-register td:first-child { display: none; }
  .student-register td .input-xs { width: 100%; }
}

/* Check-in method chooser + biometrics */
.method-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.method-tab { padding: 8px 16px; border-radius: 999px; border: 1.5px solid #cbd5e1; background: #fff; font-weight: 800; font-size: 0.84rem; color: #050078; cursor: pointer; }
.method-tab.active { background: #050078; border-color: #050078; color: #fff; }
.bio-block h4 { margin: 0; font-size: 0.95rem; color: #020035; }
.panel-highlight { outline: 2px solid #f2b91e; outline-offset: 2px; }
.inline-delete { display: inline; margin-left: 6px; }

/* ------------------------------------------------------------------
   Login / switcher background v3: light, airy, brand accents
------------------------------------------------------------------- */
.admin-page-bg {
  background:
    radial-gradient(700px 500px at 0% 0%, rgba(242, 185, 30, 0.28), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(5, 0, 120, 0.18), transparent 60%),
    linear-gradient(160deg, #fbfbff 0%, #eef2ff 55%, #fff8e8 100%);
}
.admin-page-bg::before {
  background-image:
    linear-gradient(rgba(5, 0, 120, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(5, 0, 120, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 72%);
}
.admin-page-bg::after {
  left: -20%; right: -20%; bottom: -46vh; height: 70vh; transform: rotate(-4deg);
  background: linear-gradient(90deg, #050078 0%, #172061 60%, #f2b91e 100%);
  opacity: 0.92; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.admin-page-bg .orb-1 { background: rgba(242, 185, 30, 0.35); filter: blur(70px); }
.admin-page-bg .orb-2 { background: rgba(99, 102, 241, 0.28); filter: blur(80px); }
.admin-page-bg .orb-3 { background: rgba(255, 255, 255, 0.9); filter: blur(60px); }
.admin-card { box-shadow: 0 24px 60px rgba(5, 0, 120, 0.18), 0 2px 8px rgba(0, 0, 0, 0.04); border: 1px solid rgba(255, 255, 255, 0.9); }

/* ------------------------------------------------------------------
   Login / switcher background v4: illustrated campus pattern (SVG)
------------------------------------------------------------------- */
.admin-page-bg { background: #050078 url("../assets/images/login-bg.svg") center center / cover no-repeat; }
.admin-page-bg::before, .admin-page-bg::after { display: none; }
.admin-page-bg .orb-1, .admin-page-bg .orb-2, .admin-page-bg .orb-3 { display: none; }
.admin-card { box-shadow: 0 30px 70px rgba(2, 0, 53, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.25); }
.admin-card-container { animation: cardIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ------------------------------------------------------------------
   Login v5: split screen
------------------------------------------------------------------- */
.auth-split { font-family: var(--font-admin); min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-visual { position: relative; overflow: hidden; color: #fff; background: #050078 url("../assets/images/login-bg.svg") center center / cover no-repeat; display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-visual-inner { position: relative; z-index: 1; max-width: 520px; width: 100%; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.auth-brand .brand-icon-wrapper { width: 54px; height: 54px; border-radius: 14px; background: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.auth-brand .brand-icon-wrapper img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.auth-brand .brand-mark { color: #050078; font-weight: 800; font-size: 1.4rem; }
.auth-brand strong { font-size: 1.25rem; letter-spacing: 0.2px; }
.auth-visual h1 { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.15; margin: 0 0 26px; font-weight: 800; }
.auth-points { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: 0.92rem; backdrop-filter: blur(6px); }
.auth-points i { font-style: normal; font-weight: 800; color: #f2b91e; font-size: 0.8rem; letter-spacing: 1px; }
.auth-stats { display: flex; gap: 24px; }
.auth-stats div { display: flex; flex-direction: column; }
.auth-stats strong { font-size: 1.1rem; color: #f2b91e; }
.auth-stats span { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.6px; color: rgba(255, 255, 255, 0.75); font-weight: 700; }
.auth-shape { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-shape-1 { width: 420px; height: 420px; right: -160px; top: -160px; background: radial-gradient(circle, rgba(242, 185, 30, 0.35), transparent 65%); }
.auth-shape-2 { width: 520px; height: 520px; left: -220px; bottom: -220px; background: radial-gradient(circle, rgba(129, 140, 248, 0.35), transparent 65%); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 28px; background: linear-gradient(180deg, #ffffff, #f8fafc); }
.auth-form-inner { width: 100%; max-width: 420px; animation: cardIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.auth-form-head { margin-bottom: 26px; }
.auth-form-head h2 { font-size: 1.7rem; margin: 10px 0 6px; color: #020035; font-weight: 800; }
.auth-form-head p { margin: 0; color: #475569; font-weight: 600; }
.auth-mobile-brand { display: none; width: 48px; height: 48px; border-radius: 12px; background: #050078; color: #f2b91e; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 12px; }
.auth-mobile-brand img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; }
.auth-foot { margin-top: 26px; font-size: 0.76rem; color: #94a3b8; font-weight: 600; text-align: center; }
@media (max-width: 960px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-visual { min-height: 0; padding: 28px 22px; }
  .auth-visual h1 { font-size: 1.35rem; margin-bottom: 14px; }
  .auth-points, .auth-stats { display: none; }
  .auth-brand { margin-bottom: 12px; }
  .auth-form { padding: 28px 20px 40px; }
}
@media (max-width: 480px) { .auth-visual { display: none; } .auth-mobile-brand { display: inline-flex; } .auth-form { min-height: 100dvh; } }

/* Avatars with photos */
.topbar-avatar img, .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.topbar-avatar, .avatar { overflow: hidden; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.6rem; }
.brand-preview { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed #cbd5e1; border-radius: 14px; }
.brand-preview .brand-icon-wrapper { width: 56px; height: 56px; }
.brand-preview strong { display: block; color: #020035; font-size: 1.05rem; }
.brand-preview small { color: #64748b; font-weight: 600; }
.auth-brand { justify-content: flex-start; }
.auth-brand .brand-icon-wrapper, .auth-mobile-brand { margin: 0; flex: 0 0 auto; }
.auth-brand .brand-icon-wrapper .brand-mark { color: #050078; }
.auth-mobile-brand .brand-mark { color: #f2b91e; font-weight: 800; font-size: 1.3rem; }
.auth-form-head .brand-badge { display: inline-flex; }

/* ------------------------------------------------------------------
   Login v7: constellation background + dark glass card with gold band
------------------------------------------------------------------- */
.auth-neo { font-family: var(--font-admin); position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; background: radial-gradient(1200px 700px at 70% 20%, #1a2a8a 0%, #050078 40%, #020035 100%); }
#auth-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.neo-glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; }
.neo-glow-1 { width: 480px; height: 480px; background: rgba(242, 185, 30, 0.28); top: -180px; left: -140px; }
.neo-glow-2 { width: 560px; height: 560px; background: rgba(99, 102, 241, 0.35); bottom: -240px; right: -160px; }
.neo-card { position: relative; z-index: 1; display: grid; grid-template-columns: 92px 1fr; width: 100%; max-width: 760px; min-height: 520px; border-radius: 26px; overflow: hidden; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); animation: cardIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.neo-band { position: relative; background: linear-gradient(180deg, #f2b91e 0%, #e0a50f 100%); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 22px 0; color: #050078; }
.neo-logo { width: 54px; height: 54px; border-radius: 16px; background: #050078; color: #f2b91e; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.5rem; overflow: hidden; box-shadow: 0 10px 24px rgba(5, 0, 120, 0.35); }
.neo-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 6px; }
.neo-band-text { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; letter-spacing: 4px; text-transform: uppercase; font-size: 0.82rem; opacity: 0.9; }
.neo-band-year { font-weight: 800; font-size: 0.78rem; letter-spacing: 2px; opacity: 0.8; }
.neo-form { padding: clamp(28px, 5vw, 48px) clamp(24px, 5vw, 52px); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.neo-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #f2b91e; }
.neo-kicker i { width: 22px; height: 2px; background: #f2b91e; display: inline-block; }
.neo-head h1 { margin: 10px 0 6px; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.3px; }
.neo-head p { margin: 0 0 24px; color: rgba(255, 255, 255, 0.72); font-weight: 600; }
.neo-field { margin-bottom: 16px; }
.neo-field label { display: block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: rgba(255, 255, 255, 0.72); margin-bottom: 8px; }
.neo-form .form-control-theme { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.neo-form .form-control-theme::placeholder { color: rgba(255, 255, 255, 0.4); }
.neo-form .form-control-theme:focus { background: rgba(255, 255, 255, 0.12); border-color: #f2b91e; box-shadow: 0 0 0 3.5px rgba(242, 185, 30, 0.25); }
.neo-form .input-icon, .neo-form .toggle-password-btn { color: rgba(255, 255, 255, 0.7); }
.neo-form .toggle-password-btn:hover, .neo-form .input-icon-group:focus-within .input-icon { color: #f2b91e; }
.neo-row { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 18px; }
.neo-form .remember-me { color: rgba(255, 255, 255, 0.8); margin: 0; }
.neo-form .remember-me input[type="checkbox"] { accent-color: #f2b91e; }
.neo-submit { background: linear-gradient(135deg, #f2b91e, #e0a50f) !important; color: #050078 !important; box-shadow: 0 14px 30px rgba(242, 185, 30, 0.35) !important; }
.neo-submit:hover { transform: translateY(-1px); filter: brightness(1.05); }
.neo-alert { background: rgba(254, 226, 226, 0.95); }
.neo-foot { margin: 22px 0 0; font-size: 0.74rem; color: rgba(255, 255, 255, 0.5); font-weight: 600; }
@media (max-width: 640px) {
  .auth-neo { padding: 14px; align-items: stretch; }
  .neo-card { grid-template-columns: 1fr; max-width: 100%; min-height: 0; border-radius: 20px; }
  .neo-band { flex-direction: row; padding: 14px 18px; }
  .neo-band-text { writing-mode: horizontal-tb; transform: none; letter-spacing: 2px; }
  .neo-logo { width: 44px; height: 44px; font-size: 1.2rem; border-radius: 12px; }
  .neo-form { padding: 24px 20px 28px; }
}
@media (max-width: 640px) {
  .auth-neo { align-items: center; }
  .neo-card { grid-template-rows: auto 1fr; }
  .neo-band { justify-content: space-between; gap: 12px; }
}

/* Login v8: lighter constellation background + classic white card */
.auth-neo { background: radial-gradient(1200px 700px at 70% 20%, #7c8cf5 0%, #4f5fd6 40%, #2c3a9e 100%); }
.neo-glow-1 { background: rgba(242, 185, 30, 0.35); }
.neo-glow-2 { background: rgba(255, 255, 255, 0.28); }
.neo-old-card { position: relative; z-index: 1; }
.neo-old-card .admin-card { box-shadow: 0 30px 70px rgba(20, 28, 90, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.5); }
.neo-old-card .brand-badge { max-width: 100%; }
@media (max-width: 640px) { .auth-neo { align-items: center; padding: 16px 12px; } }
/* Login v9: teal background (matches the platform logo) */
.auth-neo { background: radial-gradient(1200px 700px at 70% 20%, #5eead4 0%, #14b8a6 35%, #0f766e 70%, #134e4a 100%); }
.neo-glow-1 { background: rgba(242, 185, 30, 0.30); }
.neo-glow-2 { background: rgba(255, 255, 255, 0.30); }
.neo-old-card .admin-card { box-shadow: 0 30px 70px rgba(19, 78, 74, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.5); }
/* Login v10: theme colours, light */
.auth-neo { background: radial-gradient(1100px 650px at 75% 15%, #e0e4ff 0%, #c9d0f8 35%, #aab3ee 70%, #8f9be6 100%); }
.neo-glow-1 { background: rgba(242, 185, 30, 0.38); }
.neo-glow-2 { background: rgba(5, 0, 120, 0.18); }
.neo-old-card .admin-card { box-shadow: 0 26px 60px rgba(5, 0, 120, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.9); }

/* Login v11: clean theme composition (light base, navy wave, gold ring) */
.auth-neo { background: #f3f4fb url("../assets/images/login-bg2.svg") center center / cover no-repeat; }
.neo-old-card .admin-card { box-shadow: 0 28px 70px rgba(5, 0, 120, 0.25), 0 2px 8px rgba(0, 0, 0, 0.05); border-radius: 26px; }
.neo-old-card .brand-logo-container h2 { letter-spacing: -0.2px; }
.neo-old-card .btn-theme-submit { background: linear-gradient(135deg, #050078 0%, #172061 100%); }
@media (max-width: 640px) { .auth-neo { background-position: 62% center; } }

/* ------------------------------------------------------------------
   Login background variants (choose with LOGIN_BACKGROUND / ?bg=)
------------------------------------------------------------------- */
.auth-neo.bg-wave { background: #f3f4fb url("../assets/images/login-bg2.svg") center center / cover no-repeat; }
.auth-neo.bg-stars { background: radial-gradient(1200px 700px at 70% 20%, #4c5bd4 0%, #2b3aa8 40%, #141c6e 100%); }
.auth-neo.bg-stars::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 400px at 10% 0%, rgba(242, 185, 30, 0.35), transparent 65%), radial-gradient(600px 500px at 95% 100%, rgba(255, 255, 255, 0.18), transparent 65%); pointer-events: none; }
.auth-neo.bg-mesh { background: radial-gradient(900px 600px at 10% 10%, rgba(242, 185, 30, 0.35), transparent 60%), radial-gradient(800px 600px at 90% 20%, rgba(99, 102, 241, 0.45), transparent 60%), radial-gradient(700px 500px at 50% 100%, rgba(242, 185, 30, 0.18), transparent 60%), linear-gradient(135deg, #020035 0%, #050078 55%, #172061 100%); }
.auth-neo.bg-mesh::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9), transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9), transparent 75%); }
.auth-neo.bg-clean { background: linear-gradient(160deg, #ffffff 0%, #eef1ff 60%, #fff6e0 100%); }
.auth-neo.bg-clean .admin-card { box-shadow: 0 20px 50px rgba(5, 0, 120, 0.12), 0 0 0 1px #e2e8f0; }
.auth-neo.bg-stars .admin-card, .auth-neo.bg-mesh .admin-card { box-shadow: 0 30px 70px rgba(2, 0, 53, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.25); }

/* Avatar images: fill their container and follow its corner radius */
.topbar-avatar { padding: 0; overflow: hidden; }
.topbar-avatar img, .avatar img, .avatar-xl img { width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: inherit; display: block; }
.avatar-xl { width: 72px; height: 72px; border-radius: 50%; font-size: 1.6rem; }
/* Avatar photos: square tiles, image centred */
.topbar-avatar:has(img), .avatar:has(img), .avatar-xl:has(img) { border-radius: 4px; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.topbar-avatar img, .avatar img, .avatar-xl img { border-radius: 4px; object-fit: cover; object-position: center center; }
.avatar-xl { border-radius: 4px; }
.profile-photo-row { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.profile-photo-row .avatar-xl { width: 120px; height: 120px; font-size: 2.4rem; }
.profile-photo-row .inline-form-row { justify-content: center; }
/* Avatar photos: framed */
.topbar-avatar:has(img), .avatar:has(img), .avatar-xl:has(img) { border: 2px solid #f2b91e; box-shadow: 0 4px 12px rgba(5, 0, 120, 0.15); padding: 2px; box-sizing: border-box; }
.topbar-avatar img, .avatar img, .avatar-xl img { border-radius: 2px; }
.profile-photo-row .avatar-xl:has(img) { border-width: 3px; padding: 3px; }

/* Timetable grids */
.tt-wrap { overflow-x: auto; }
.tt-grid th, .tt-grid td { vertical-align: top; min-width: 150px; }
.tt-grid .tt-period { min-width: 120px; background: #f8fafc; position: sticky; left: 0; z-index: 1; }
.tt-grid.tt-view td { font-size: 0.84rem; }
/* Published week view: fluid columns that share the width, so all days fit without sideways scrolling. */
.tt-grid.tt-view { table-layout: fixed; width: 100%; }
.tt-grid.tt-view th, .tt-grid.tt-view td { min-width: 0; padding: 10px 8px; overflow-wrap: anywhere; }
.tt-grid.tt-view th { font-size: 0.68rem; letter-spacing: 0.3px; }
.tt-grid.tt-view .tt-period { width: 96px; }
.tt-grid.tt-view td strong { display: block; font-size: 0.82rem; line-height: 1.25; }
.tt-grid.tt-view td .cell-sub { display: block; font-size: 0.74rem; line-height: 1.3; }
.tt-break td { background: #fffbeb; }
.tt-cell { display: grid; gap: 4px; }
.tt-cell .input-xs { width: 100% !important; }
.tt-day-title { margin: 0 0 10px; font-size: 1rem; color: #020035; }
.row-muted td { opacity: 0.55; }
.sub-form { flex-wrap: wrap; }
.sub-form .input-xs { width: 150px; }
@media (max-width: 600px) { .tt-grid th, .tt-grid td { min-width: 120px; } .sub-form .input-xs { width: 100%; } }

/* Exams */
.subjects-table .input-xs, .marks-table .input-xs { width: 100% !important; min-width: 90px; }
.marks-table .mark-value { max-width: 110px; }
.scale-block { margin-bottom: 18px; } .scale-block h4 { margin: 0; font-size: 0.95rem; }
.report-card { max-width: 900px; margin: 0 auto; }
.report-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid #050078; padding-bottom: 12px; margin-bottom: 14px; }
.report-head h2 { margin: 0 0 4px; font-size: 1.2rem; color: #020035; } .report-head p { margin: 0; color: #475569; font-weight: 600; }
.report-student { text-align: right; } .report-student strong { display: block; font-size: 1.05rem; color: #020035; } .report-student small { color: #64748b; font-weight: 600; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.report-summary div { border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.report-summary span { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: #64748b; } .report-summary strong { font-size: 1.1rem; color: #020035; } .report-summary small { color: #475569; font-weight: 600; }
.report-sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; } .report-sign span { flex: 1; border-top: 1px solid #94a3b8; padding-top: 6px; text-align: center; font-size: 0.78rem; font-weight: 700; color: #475569; }

/* Dashboard action queue */
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.queue-item a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid #e2e8f0; background: #f8fafc; font-weight: 700; color: #020035; }
.queue-item.bad a { border-color: #fecaca; background: #fef2f2; } .queue-item.warn a { border-color: #fde68a; background: #fffbeb; } .queue-item.muted a { color: #475569; }
.queue-item a span { color: #050078; }

/* Timetable v2: class/teacher chips, staff cards, mobile day switcher */
.class-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.class-chip { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid #cbd5e1; background: #f8fafc; color: #020035; min-width: 150px; transition: all 0.15s ease; }
.class-chip span { font-size: 0.72rem; font-weight: 700; color: #64748b; }
.class-chip.published { border-color: #a7f3d0; background: #ecfdf5; } .class-chip.published span { color: #047857; }
.class-chip.draft { border-color: #fde68a; background: #fffbeb; } .class-chip.draft span { color: #b45309; }
.class-chip.active { outline: 2px solid #050078; outline-offset: 1px; }
.class-chip:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(5, 0, 120, 0.12); }
.tt-days { display: none; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tt-day-btn { padding: 7px 12px; border-radius: 999px; border: 1.5px solid #cbd5e1; background: #fff; font-weight: 800; font-size: 0.8rem; color: #050078; cursor: pointer; }
.tt-day-btn.active { background: #050078; border-color: #050078; color: #fff; }
.tt-history { margin-top: 12px; } .tt-history summary { cursor: pointer; font-weight: 800; color: #050078; margin-bottom: 8px; }
.staff-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; align-items: start; }
.staff-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1.5px solid #e2e8f0; border-radius: 14px; background: #fff; color: inherit; transition: all 0.15s ease; min-width: 0; overflow: hidden; text-decoration: none; }
.staff-card:hover { border-color: #050078; box-shadow: 0 10px 24px rgba(5, 0, 120, 0.12); }
.staff-card .person { min-width: 0; }
.staff-card .person > div { min-width: 0; }
.staff-card .person strong { display: block; overflow-wrap: anywhere; }
.staff-card .person .cell-sub { display: block; overflow-wrap: anywhere; }
.staff-card-meta { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.staff-card-meta:empty { display: none; }
/* Pills in cards wrap at every width instead of overflowing the card edge. */
.staff-card-meta .pill { white-space: normal; text-align: left; line-height: 1.3; max-width: 100%; overflow-wrap: anywhere; }
.staff-card-empty { font-size: 0.78rem; font-weight: 600; color: #94a3b8; padding: 10px 0 2px; border-top: 1px dashed #e2e8f0; margin-top: auto; }
.load-bar { display: flex; gap: 6px; align-items: flex-end; height: 44px; min-width: 0; }
.load-bar span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.load-bar i { display: block; width: 100%; background: linear-gradient(180deg, #6366f1, #050078); border-radius: 4px 4px 0 0; min-height: 2px; }
.load-bar small { font-size: 0.65rem; font-weight: 800; color: #94a3b8; }
/* Builder cells hold three selects, so the one-day-at-a-time view applies up to tablet width. */
@media (max-width: 1024px) {
  .tt-days, .tt-days-wide { display: flex; }
  .tt-grid [data-day].tt-hidden { display: none; }
  .tt-grid.tt-view .tt-period { width: 110px; }
  .tt-grid.tt-view th, .tt-grid.tt-view td { padding: 12px 14px; }
  .tt-grid.tt-view td strong { font-size: 0.9rem; }
  .tt-grid.tt-view td .cell-sub { font-size: 0.8rem; }
  .tt-grid.tt-builder [data-day].tt-hidden { display: none; }
  .tt-grid.tt-builder th, .tt-grid.tt-builder td { min-width: 0; }
  .tt-grid.tt-builder .tt-period { min-width: 110px; }
}
@media (max-width: 760px) {
  .tt-days { display: flex; }
  .staff-cards { grid-template-columns: 1fr; }
  .tt-grid [data-day].tt-hidden { display: none; }
  .tt-grid th, .tt-grid td { min-width: 0; }
  .tt-grid .tt-period { min-width: 96px; }
  .class-chip { min-width: calc(50% - 8px); }
}

.settings-h4 { margin: 18px 0 8px; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: #475569; border-bottom: 1px solid #e2e8f0; padding-bottom: 6px; }


/* ------------------------------------------------------------------
   File inputs (all upload fields)
------------------------------------------------------------------- */
input[type="file"].form-control-theme { padding: 8px 10px !important; line-height: 1.3; cursor: pointer; font-weight: 600; color: #475569; background-image: none !important; }
input[type="file"].form-control-theme::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 9px; background: linear-gradient(135deg, #050078 0%, #172061 100%); color: #fff; font-weight: 800; font-size: 0.82rem; font-family: inherit; cursor: pointer; transition: filter 0.15s ease; }
input[type="file"].form-control-theme::file-selector-button:hover { filter: brightness(1.12); }
input[type="file"].form-control-theme:focus { border-color: #050078; box-shadow: 0 0 0 3.5px rgba(5, 0, 120, 0.15); }
input[type="file"].form-control-theme.input-xs { padding: 4px 6px !important; }
input[type="file"].form-control-theme.input-xs::file-selector-button { padding: 5px 10px; font-size: 0.74rem; margin-right: 8px; }
.inline-form-row input[type="file"] { flex: 1 1 240px; min-width: 0; }
@media (max-width: 600px) { input[type="file"].form-control-theme { width: 100%; } }

input[type="file"].form-control-theme.input-xs { width: auto !important; max-width: 100%; }

/* ---- Health monitor (/health) ----------------------------------------------------------- */
.health-body { background: #f4f6fb; }
.health-shell { min-height: 100vh; display: flex; flex-direction: column; }
.health-topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px clamp(14px, 3vw, 28px); background: #fff; border-bottom: 1px solid var(--slate-200); position: sticky; top: 0; z-index: 20; }
.health-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #020035; }
.health-brand span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.health-brand strong { font-size: 0.98rem; font-weight: 900; }
.health-brand small { font-size: 0.72rem; font-weight: 700; color: var(--slate-600); text-transform: uppercase; letter-spacing: 0.4px; }
.health-dot { width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.2); flex: none; }
.health-dot.is-ok { background: #0f7b4b; box-shadow: 0 0 0 4px rgba(15, 123, 75, 0.2); }
.health-dot.is-minor { background: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); }
.health-dot.is-moderate { background: #d97706; box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2); }
.health-dot.is-critical { background: #b42318; box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.25); animation: health-pulse 1.2s infinite; }
@keyframes health-pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.25); } 50% { box-shadow: 0 0 0 9px rgba(180, 35, 24, 0.08); } }
.health-nav { display: flex; gap: 4px; margin-left: 8px; }
.health-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font-weight: 800; font-size: 0.88rem; color: var(--slate-600); text-decoration: none; }
.health-nav a:hover { background: #f1f5f9; color: #050078; }
.health-nav a.active { background: #050078; color: #fff; }
.health-nav-count:empty { display: none; }
.health-nav-count { background: #f2b91e; color: #020035; border-radius: 20px; padding: 1px 8px; font-size: 0.72rem; }
.health-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.health-hb { font-size: 0.76rem; font-weight: 700; color: var(--slate-600); }
.health-hb.is-off { color: #b42318; }
.health-main { display: grid; gap: 18px; width: 100%; margin-top: 18px; }
.health-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #f8fafc; border: 1px solid var(--slate-200); }
.health-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.health-level { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: #fff; border-radius: 16px; border: 1px solid var(--slate-200); border-left-width: 6px; text-decoration: none; color: #020035; box-shadow: 0 10px 30px rgba(5, 0, 120, 0.05); transition: transform .15s; }
.health-level:hover { transform: translateY(-2px); }
.health-level.lvl-3 { border-left-color: #b42318; } .health-level.lvl-2 { border-left-color: #d97706; } .health-level.lvl-1 { border-left-color: #2563eb; }
.health-level.has-open.lvl-3 { background: #fff5f5; }
.health-level.has-open.lvl-2 { background: #fffaf0; }
.health-level-count { font-size: 2.3rem; font-weight: 900; line-height: 1; min-width: 56px; }
.health-level.lvl-3 .health-level-count { color: #b42318; } .health-level.lvl-2 .health-level-count { color: #d97706; } .health-level.lvl-1 .health-level-count { color: #2563eb; }
.health-level-text { display: flex; flex-direction: column; gap: 3px; }
.health-level-text strong { font-size: 1rem; font-weight: 900; }
.health-level-text small { font-size: 0.78rem; color: var(--slate-600); font-weight: 600; line-height: 1.35; }
.health-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.lvl-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap; }
.lvl-badge.lvl-3 { background: #b42318; color: #fff; } .lvl-badge.lvl-2 { background: #fff1d6; color: #9a6b00; border: 1px solid #f2d27a; } .lvl-badge.lvl-1 { background: #e8f0ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.live-feed { display: flex; flex-direction: column; gap: 6px; }
.live-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--slate-200); text-decoration: none; color: #0f172a; background: #fff; }
.live-item:hover { background: #f8fafc; }
.live-item.lvl-3 { border-color: #fecaca; background: #fff8f8; }
.live-msg { font-weight: 700; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-item small { color: var(--slate-600); font-weight: 600; white-space: nowrap; }
.health-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.health-checks li { display: grid; grid-template-columns: 84px 1fr; gap: 2px 12px; align-items: center; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--slate-200); }
.health-checks li.is-fail.lvl-3 { background: #fff5f5; border-color: #fecaca; } .health-checks li.is-fail.lvl-2 { background: #fffaf0; border-color: #f2d27a; }
.health-checks .check-state { grid-row: span 2; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.4px; padding: 4px 8px; border-radius: 8px; text-align: center; background: #ecfdf3; color: #0f7b4b; }
.health-checks li.is-fail.lvl-3 .check-state { background: #b42318; color: #fff; } .health-checks li.is-fail.lvl-2 .check-state { background: #fff1d6; color: #9a6b00; }
.health-checks .check-label { font-weight: 800; font-size: 0.9rem; }
.health-checks small { color: var(--slate-600); font-weight: 600; font-size: 0.78rem; }
.health-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.health-stats > div { padding: 12px 14px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--slate-200); display: flex; flex-direction: column; gap: 2px; }
.health-stats strong { font-size: 1.25rem; font-weight: 900; color: #020035; }
.health-stats small { font-size: 0.74rem; color: var(--slate-600); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.health-stats .is-bad strong { color: #b42318; } .health-stats .is-warn strong { color: #d97706; }
.health-bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 120px; align-items: end; padding: 8px 4px 0; border-bottom: 1px solid var(--slate-200); margin-bottom: 16px; }
.health-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.health-bar-fill { width: 100%; min-height: 2px; background: #050078; border-radius: 4px 4px 0 0; opacity: 0.85; }
.health-bar-fill.has-err { background: #b42318; }
.health-bar small { font-size: 0.62rem; color: var(--slate-600); font-weight: 700; margin-top: 3px; }
.health-table td small { display: block; font-size: 0.74rem; }
.health-table .muted { color: var(--slate-600); }
.health-table tr.is-resolved { opacity: 0.6; }
.health-msg { font-weight: 800; color: #020035; text-decoration: none; }
.health-msg:hover { text-decoration: underline; }
.status-code { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 900; font-size: 0.78rem; font-family: ui-monospace, monospace; }
.status-code.s2 { background: #ecfdf3; color: #0f7b4b; } .status-code.s3 { background: #f1f5f9; color: #475569; } .status-code.s4 { background: #fff7e0; color: #9a6b00; } .status-code.s5 { background: #b42318; color: #fff; }
.text-warn { color: #d97706; font-weight: 800; }
.health-detail { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.health-dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; margin: 0; font-size: 0.9rem; }
.health-dl dt { font-weight: 800; color: var(--slate-600); } .health-dl dd { margin: 0; font-weight: 600; }
.health-resolve { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 260px; }
.health-pre { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 14px; font-size: 0.78rem; line-height: 1.5; overflow: auto; max-height: 420px; white-space: pre-wrap; word-break: break-word; }
.health-similar { margin: 0; padding-left: 18px; font-size: 0.88rem; font-weight: 600; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 700; color: var(--slate-600); white-space: nowrap; }
.check-inline input { width: 16px; height: 16px; margin: 0; accent-color: #050078; }
.inline-form-row > label.check-inline { flex-direction: row; align-items: center; justify-content: flex-start; }
.mt-1 { margin-top: 6px; }
@media (max-width: 900px) {
    .health-levels, .health-grid, .health-detail { grid-template-columns: 1fr; }
    .health-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
    .health-bars { grid-template-columns: repeat(12, 1fr); } .health-bar:nth-child(odd) { display: none; }
    .health-dl { grid-template-columns: 1fr; gap: 2px; } .health-dl dt { margin-top: 8px; }
    .live-item { grid-template-columns: auto 1fr; } .live-msg { white-space: normal; } .live-item small { grid-column: 2; }
}

/* ---- Stacked tables: on phones each row becomes a card with the column name before each value ---- */
.nowrap { white-space: nowrap; }
@media (max-width: 640px) {
  .table-wrap:has(> .table-stack) { border: none; overflow: visible; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack thead { display: none; }
  .table-stack tr { border: 1px solid var(--slate-200); border-radius: 12px; margin-bottom: 10px; background: #fff; overflow: hidden; }
  .table-stack tr.row-error { border-color: #fecaca; }
  .table-stack td { display: flex; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 9px 12px; border-bottom: 1px solid var(--slate-100); text-align: right; flex-wrap: wrap; }
  .table-stack td > code { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: right; }
  .table-stack td > small, .table-stack td > .cell-sub { flex-basis: 100%; text-align: right; }
  .table-stack td > a.health-msg { max-width: 100%; text-align: right; }
  .table-stack td:last-child { border-bottom: none; }
  .table-stack td[data-label]::before { content: attr(data-label); flex: 0 0 auto; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--slate-600); text-align: left; }
  .table-stack td:not([data-label]) { justify-content: flex-end; }
  .table-stack td.num { text-align: right; }
  .table-stack td.actions { white-space: normal; justify-content: flex-end; flex-wrap: wrap; }
  .table-stack td.actions .sub-form { width: 100%; display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 4px; }
  .table-stack td.actions .sub-form .btn-outline { width: 100%; }
  .table-stack .cell-sub { display: block; }
  /* A cell holding its own list/form (e.g. terms) renders as a block with the label on top. */
  .table-stack td.td-block { display: block; text-align: left; }
  .table-stack td.td-block::before { display: block; margin-bottom: 6px; }
  .table-stack td.td-block .cell-sub { display: inline; }
  .table-stack td.td-block .term-add { flex-direction: column; }
  .table-stack tbody tr:hover td { background: transparent; }
}

/* ---- Pagination (shared view: pagination::academy) ----------------------------------------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 0.84rem; }
.pager-info { color: var(--slate-600); font-weight: 700; }
.pager-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-numbers { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pager-compact { display: none; font-weight: 800; color: #020035; padding: 0 6px; }
.pager .page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 6px 12px; text-decoration: none; }
@media (max-width: 640px) {
  .pager { flex-direction: column; align-items: stretch; }
  .pager-info { text-align: center; }
  .pager-links { justify-content: space-between; flex-wrap: nowrap; }
  .pager-numbers { display: none; }
  .pager-compact { display: inline; text-align: center; flex: 1; }
  .pager .page-link { flex: 0 0 auto; }
}

/* ---- Roles & permissions ---------------------------------------------------------------- */
.alert-info { background: #eef2ff; border: 1px solid #c7d2fe; color: #1e1b4b; border-radius: 12px; padding: 12px 14px; font-size: 0.88rem; font-weight: 600; line-height: 1.45; }
.roles-notice { margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.role-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1.5px solid var(--slate-200); border-radius: 16px; background: #fff; min-width: 0; }
.role-card.is-system { background: linear-gradient(180deg, #f8fafc, #fff); }
.role-card.has-gap { border-color: #f2d27a; }
.role-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.role-card-head .row-title { font-size: 1.02rem; }
.role-card-head .cell-sub { display: block; margin-top: 2px; }
.role-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.role-facts div { background: #f8fafc; border-radius: 10px; padding: 8px 10px; }
.role-facts dt { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--slate-600); }
.role-facts dd { margin: 0; font-weight: 900; color: #020035; font-size: 1.05rem; }
.role-menus { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-sm { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef2ff; color: #1e1b4b; font-size: 0.74rem; font-weight: 800; }
.role-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.role-card-actions form { display: inline; }
.perm-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.perm-summary { font-size: 0.88rem; color: var(--slate-600); font-weight: 600; }
.perm-summary strong { color: #020035; font-size: 1rem; }
.perm-presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.78rem; font-weight: 800; color: var(--slate-600); }
.btn-xs { padding: 5px 10px; font-size: 0.76rem; border-radius: 8px; }
.perm-missing { margin-bottom: 12px; }
.perm-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.perm-module { border: 1.5px solid var(--slate-200); border-radius: 14px; overflow: hidden; background: #fff; transition: border-color .15s; }
.perm-module.has-on { border-color: #050078; }
.perm-module-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px; background: #f8fafc; border-bottom: 1px solid var(--slate-200); }
.perm-module.has-on .perm-module-head { background: #eef2ff; }
.perm-module-head strong { display: block; font-size: 0.92rem; color: #020035; }
.perm-module-head small { display: block; font-size: 0.76rem; color: var(--slate-600); font-weight: 600; margin-top: 2px; line-height: 1.3; }
.perm-all { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 800; color: #050078; white-space: nowrap; cursor: pointer; }
.perm-all input { accent-color: #050078; width: 16px; height: 16px; }
.perm-list { display: flex; flex-direction: column; padding: 6px 8px; }
.perm-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; font-size: 0.86rem; font-weight: 600; color: #0f172a; cursor: pointer; }
.perm-item:hover { background: #f8fafc; }
.perm-item input { width: 17px; height: 17px; accent-color: #050078; flex: none; margin: 0; }
.perm-item.is-new { background: #fffaf0; }
.perm-new { margin-left: auto; font-style: normal; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.4px; text-transform: uppercase; color: #9a6b00; background: #fff1d6; border: 1px solid #f2d27a; padding: 1px 7px; border-radius: 999px; }

/* ---- Menu picker (platform: menus an academy can use) ------------------------------------- */
.menu-picker { border: 1.5px solid var(--slate-200); border-radius: 16px; padding: 14px; background: #fff; }
.menu-picker-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.menu-picker-head strong { display: block; font-size: 0.95rem; color: #020035; }
.menu-picker-head small { display: block; font-size: 0.78rem; color: var(--slate-600); font-weight: 600; margin-top: 2px; }
.menu-picker-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.menu-switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.menu-picker label.menu-switch, .menu-switch { display: grid; grid-template-columns: 40px 1fr auto; margin: 0; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--slate-200); border-radius: 14px; background: #f8fafc; cursor: pointer; transition: all .15s; min-width: 0; }
.menu-switch:hover { border-color: #94a3b8; }
.menu-switch.is-on { border-color: #050078; background: #fff; box-shadow: 0 6px 18px rgba(5, 0, 120, 0.08); }
.menu-switch-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem; background: #e2e8f0; color: #475569; }
.menu-switch.is-on .menu-switch-icon { background: linear-gradient(135deg, #050078, #172061); color: #f2b91e; }
.menu-switch-text { min-width: 0; }
.menu-switch-text strong { display: block; font-size: 0.9rem; color: #020035; }
.menu-switch-text small { display: block; font-size: 0.74rem; color: var(--slate-600); font-weight: 600; line-height: 1.3; margin-top: 2px; }
.menu-switch:not(.is-on) .menu-switch-text strong { color: #475569; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background .15s; }
.switch i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: #050078; }
.switch input:checked + i::after { transform: translateX(18px); background: #f2b91e; }
.switch input:focus-visible + i { outline: 3px solid rgba(5, 0, 120, 0.3); outline-offset: 2px; }
@media (max-width: 640px) {
  .role-facts { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .role-facts dd { font-size: 0.95rem; }
  .perm-toolbar { align-items: flex-start; }
  .menu-picker label.menu-switch { grid-template-columns: 36px 1fr auto; padding: 10px; }
}

/* ---- App dialog (replaces browser confirm/alert/prompt) ---------------------------------- */
.dlg { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg[hidden] { display: none; }
.dlg-backdrop { position: absolute; inset: 0; background: rgba(2, 0, 53, 0.55); backdrop-filter: blur(2px); }
.dlg-box { position: relative; width: min(100%, 440px); background: #fff; border-radius: 18px; padding: 24px 22px 20px; box-shadow: 0 30px 70px rgba(2, 0, 53, 0.35); animation: cardIn .18s ease-out; text-align: left; }
.dlg-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; background: #eef2ff; color: #050078; }
.dlg[data-tone="danger"] .dlg-icon { background: #fef3f2; color: #b42318; }
.dlg[data-tone="warning"] .dlg-icon { background: #fff7e0; color: #9a6b00; }
.dlg-title { font-size: 1.08rem; font-weight: 900; color: #020035; margin: 0 0 6px; }
.dlg-message { font-size: 0.92rem; color: #334155; font-weight: 600; line-height: 1.5; margin: 0; white-space: pre-line; }
.dlg-field { margin-top: 14px; }
.dlg-label { display: block; font-size: 0.78rem; font-weight: 800; color: #475569; margin-bottom: 6px; }
.dlg-field textarea { width: 100%; resize: vertical; }
.dlg-error { display: block; margin-top: 6px; font-size: 0.78rem; font-weight: 700; color: #b42318; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.dlg-actions .btn-primary, .dlg-actions .btn-outline { min-width: 110px; }
.btn-primary.btn-danger { background: linear-gradient(135deg, #b42318 0%, #8f1a12 100%); box-shadow: 0 8px 20px rgba(180, 35, 24, 0.25); }
.btn-primary.btn-danger:hover { background: linear-gradient(135deg, #8f1a12 0%, #b42318 100%); }
body.dlg-open { overflow: hidden; }
@media (max-width: 480px) { .dlg { align-items: flex-end; padding: 0; } .dlg-box { width: 100%; border-radius: 18px 18px 0 0; } .dlg-actions { flex-direction: column-reverse; } .dlg-actions .btn-primary, .dlg-actions .btn-outline { width: 100%; } }

.queue-health { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.86rem; font-weight: 600; color: #334155; }
.queue-health li { padding: 8px 12px 8px 30px; border-radius: 10px; background: #f8fafc; position: relative; line-height: 1.4; }
.queue-health li::before { content: ""; position: absolute; left: 12px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: #0f7b4b; }
.queue-health li.warn::before { background: #d97706; } .queue-health li.bad::before { background: #b42318; }
.queue-health li.bad { background: #fef3f2; }

/* ---- Site details export / import -------------------------------------------------------- */
.transfer-panel { margin-top: 24px; }
.transfer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.transfer-box { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1.5px solid var(--slate-200); border-radius: 14px; background: #fff; }
.transfer-box h4 { margin: 0; font-size: 1rem; color: #020035; }
.transfer-box .btn-primary, .transfer-box .btn-outline { align-self: flex-start; margin-top: 6px; }

/* ---- First-run setup guide (dashboard panel + next-step strip) */
.setup-guide { border: 1.5px solid #c7d2fe; background: linear-gradient(180deg, #f5f7ff 0%, #fff 60%); }
.setup-progress { height: 6px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin: 4px 0 14px; }
.setup-progress span { display: block; height: 100%; background: #050078; border-radius: 99px; transition: width .3s; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.setup-step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1.5px solid #e2e8f0; border-radius: 14px; background: #fff; }
.setup-step.now { border-color: #050078; box-shadow: 0 4px 14px rgba(5, 0, 120, .08); }
.setup-step.done { background: #f0fdf4; border-color: #bbf7d0; }
.setup-step-no { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #e2e8f0; color: #334155; }
.setup-step.now .setup-step-no { background: #050078; color: #fff; }
.setup-step.done .setup-step-no { background: #16a34a; color: #fff; }
.setup-step-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.setup-step-body strong { color: #020035; }
.setup-step-body span { color: #475569; font-size: .9rem; }
.setup-step.done .setup-step-body strong { text-decoration: line-through; color: #166534; }
.setup-hide { margin-top: 10px; text-align: right; }
.setup-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; margin-bottom: 16px; border: 1.5px solid #c7d2fe; border-radius: 14px; background: #f5f7ff; }
.setup-strip-step { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #050078; }
.setup-strip strong { color: #020035; flex: 1; min-width: 160px; }
.setup-strip-dots { display: inline-flex; gap: 5px; }
.setup-strip-dots i { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.setup-strip-dots i.done { background: #16a34a; } .setup-strip-dots i.now { background: #050078; }
@media (max-width: 640px) {
    .setup-step { flex-wrap: wrap; }
    .setup-step > .btn-primary, .setup-step > .btn-outline { width: 100%; text-align: center; }
    .setup-strip strong { flex-basis: 100%; }
}

/* Small heading inside a panel form (payroll salary / payslip edit) */
.form-subhead { margin: 0 0 10px; font-size: .95rem; color: #020035; }

/* Dashboard: three charts in a row. Staff › My Attendance month tiles */
.chart-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .chart-grid-3 { grid-template-columns: 1fr; } }
.my-att-counts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.my-att-counts li { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; background: #f8fafc; }
.my-att-counts strong { font-size: 1.3rem; color: #020035; }
.my-att-counts span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: #64748b; letter-spacing: 0.3px; }
.my-att-counts li.ok { background: #ecfdf5; border-color: #a7f3d0; }
.my-att-counts li.warn { background: #fffbeb; border-color: #fde68a; }
.my-att-counts li.bad { background: #fef2f2; border-color: #fecaca; }
.my-att-counts li.muted strong { color: #64748b; }

/* ------------------------------------------------------------------
   Top bar, every screen size. One row while everything fits; when the
   title would be squeezed, the page buttons move to their own row
   (.topbar-stacked is set by the layout script). No button is ever hidden.
------------------------------------------------------------------- */
.admin-topbar { flex-wrap: nowrap; row-gap: 10px; }
.admin-topbar > * { min-width: 0; }
.sidebar-toggle { order: 0; flex-shrink: 0; }
.topbar-title { order: 1; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.topbar-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-title .brand-badge { flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.topbar-actions { order: 2; flex: 0 0 auto; width: auto; flex-wrap: nowrap; align-items: center; }
.topbar-actions > .btn-primary, .topbar-actions > .btn-outline, .topbar-actions > form { flex: 0 0 auto; width: auto; white-space: nowrap; }
.checkin-chip { order: 3; flex-shrink: 0; }
.topbar-user { order: 4; flex-shrink: 0; }
.topbar-user-text { min-width: 0; }
.topbar-user-text strong, .topbar-user-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
@media (max-width: 1500px) { .topbar-user-text small { display: none; } }

.admin-topbar.topbar-stacked { flex-wrap: wrap; }
.admin-topbar.topbar-stacked .topbar-actions { order: 5; flex: 1 1 100%; flex-wrap: wrap; }

/* Without the script (or before it runs) small screens still stack. */
@media (max-width: 1100px) {
  .admin-topbar:not([data-fit]) { flex-wrap: wrap; }
  .admin-topbar:not([data-fit]) .topbar-actions { order: 5; flex: 1 1 100%; flex-wrap: wrap; }
}
/* Tablets: page buttons share the row evenly. */
@media (max-width: 900px) {
  .admin-topbar.topbar-stacked .topbar-actions > .btn-primary,
  .admin-topbar.topbar-stacked .topbar-actions > .btn-outline,
  .admin-topbar.topbar-stacked .topbar-actions > form { flex: 1 1 0; }
  .admin-topbar .topbar-actions > form > button { width: 100%; }
}
/* Phones: two buttons per row, every button visible. */
@media (max-width: 600px) {
  .admin-topbar .topbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .admin-topbar .topbar-actions > * { width: 100%; min-width: 0; text-align: center; white-space: normal; }
  .admin-topbar .topbar-actions > :only-child { grid-column: 1 / -1; }
  .admin-topbar .topbar-actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .checkin-chip { padding: 6px 10px; font-size: 0.72rem; gap: 6px; }
}
@media (max-width: 360px) {
  .admin-topbar { gap: 8px; padding: 8px 10px; }
  .checkin-chip { padding: 5px 8px; font-size: 0.68rem; }
}

/* Top bar user: just the name, compact, on every screen size */
.topbar-user { gap: 0; padding: 6px 12px; border: 1px solid var(--slate-200); border-radius: 999px; background: #f8fafc; max-width: 200px; line-height: 1.2; }
.topbar-user:hover { border-color: #c7d2fe; background: #eef2ff; }
.topbar-user-name { display: block; font-size: 0.82rem; font-weight: 800; color: #020035; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 600px) { .topbar-user { max-width: 110px; padding: 5px 10px; } .topbar-user-name { font-size: 0.74rem; } }
@media (max-width: 360px) { .topbar-user { max-width: 84px; } }
