/* ------------------------------------------------------------------
   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; }
  .topbar-actions .btn-outline { 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-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; }
  .settings-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .settings-tab { white-space: nowrap; }
  .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; }
