html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}


/* ===== Admin dark mode helpers ===== */
html.sm-dark body,
html.sm-dark .admin-shell {
  color-scheme: dark;
}
html.sm-dark .admin-shell .mud-paper {
  background-color: var(--mud-palette-surface);
}
html.sm-dark .admin-nav-search .mud-input-outlined .mud-input-outlined-border {
  border-color: #334155;
}
html.sm-dark .app-color-tabs .mud-tabs-panels {
  background: #151b2b;
  border-color: #1f2937;
}
html.sm-dark .od-preview,
html.sm-dark .ai-page .ai-chat {
  background: #151b2b;
}
html.sm-dark .ai-row.bot .ai-bubble {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
/* Keep print areas light */
@media print {
  html.sm-dark, html.sm-dark body {
    background: #fff !important;
    color: #000 !important;
  }
}


/* ===== Admin content spacing & readable page headers ===== */
.admin-shell .mud-main-content.print-content,
.admin-shell main.mud-main-content {
  padding: 1.5rem 1.5rem 2.5rem !important;
  /* Fixed MudAppBar is ~64px — keep titles visible below it */
  padding-top: 5rem !important;
  box-sizing: border-box;
  min-height: calc(100vh - 64px);
}
.admin-shell .mud-main-content > .mud-grid:first-child,
.admin-shell .mud-main-content > h1:first-child,
.admin-shell .mud-main-content > h2:first-child,
.admin-shell .mud-main-content > h3:first-child,
.admin-shell .mud-main-content > .mud-paper:first-child,
.admin-shell .mud-main-content > .d-flex:first-child {
  margin-top: 0.25rem !important;
}
/* Page titles always readable (light + dark) */
.admin-shell .mud-main-content .mud-typography-h3,
.admin-shell .mud-main-content .mud-typography-h4,
.admin-shell .mud-main-content .mud-typography-h5,
.admin-shell .mud-main-content .mud-typography-h6,
.admin-shell .mud-main-content h1,
.admin-shell .mud-main-content h2,
.admin-shell .mud-main-content h3,
.admin-shell .mud-main-content h4 {
  color: var(--mud-palette-text-primary) !important;
  opacity: 1 !important;
  visibility: visible !important;
  line-height: 1.35 !important;
  margin-bottom: 0.65rem !important;
}
.admin-shell .mud-main-content .mud-typography-body1,
.admin-shell .mud-main-content .mud-typography-body2,
.admin-shell .mud-main-content .mud-typography-subtitle1,
.admin-shell .mud-main-content .mud-typography-subtitle2,
.admin-shell .mud-main-content .mud-typography-caption {
  color: var(--mud-palette-text-secondary) !important;
  opacity: 1 !important;
}
html.sm-dark .admin-shell .mud-main-content {
  color: #e8eef7 !important;
}
html.sm-dark .admin-shell .mud-main-content .mud-typography-h3,
html.sm-dark .admin-shell .mud-main-content .mud-typography-h4,
html.sm-dark .admin-shell .mud-main-content .mud-typography-h5,
html.sm-dark .admin-shell .mud-main-content .mud-typography-h6,
html.sm-dark .admin-shell .mud-main-content h1,
html.sm-dark .admin-shell .mud-main-content h2,
html.sm-dark .admin-shell .mud-main-content h3,
html.sm-dark .admin-shell .mud-main-content h4 {
  color: #f8fafc !important;
}
html.sm-dark .admin-shell .mud-main-content .mud-typography-body1,
html.sm-dark .admin-shell .mud-main-content .mud-typography-body2,
html.sm-dark .admin-shell .mud-main-content .mud-typography-subtitle1,
html.sm-dark .admin-shell .mud-main-content .mud-typography-subtitle2 {
  color: #cbd5e1 !important;
}
/* AppBar should not cover content */
.admin-shell .mud-appbar {
  z-index: 1200;
}
.admin-shell .mud-drawer {
  z-index: 1100;
}


/* ===== LIGHT MODE admin drawer (readable menus) ===== */
html:not(.sm-dark) .admin-shell .mud-drawer,
html:not(.sm-dark) .admin-shell .admin-drawer,
html:not(.sm-dark) .admin-shell .metronic-drawer {
  background: #ffffff !important;
  color: #0f172a !important;
  border-right: 1px solid #e2e8f0;
}
html:not(.sm-dark) .admin-shell .mud-nav-link,
html:not(.sm-dark) .admin-shell .mud-nav-group,
html:not(.sm-dark) .admin-shell .mud-nav-link .mud-nav-link-text,
html:not(.sm-dark) .admin-shell .mud-typography {
  color: #1e293b !important;
}
html:not(.sm-dark) .admin-shell .mud-nav-link:hover,
html:not(.sm-dark) .admin-shell .mud-nav-link.active {
  background: #f1f5f9 !important;
  color: #0d47a1 !important;
}
html:not(.sm-dark) .admin-shell .mud-nav-link .mud-icon-root {
  color: #475569 !important;
}
html:not(.sm-dark) .admin-shell .mud-nav-link.active .mud-icon-root {
  color: #0d47a1 !important;
}
html:not(.sm-dark) .admin-shell .admin-nav-search .mud-input-slot,
html:not(.sm-dark) .admin-shell .admin-nav-search input {
  color: #0f172a !important;
}


/* ===== Selects / popovers: stay clickable above app bar ===== */
.mud-popover {
  z-index: 2000 !important;
  pointer-events: auto !important;
}
.mud-popover .mud-list,
.mud-popover .mud-list-item,
.mud-select-item,
.mud-menu-item {
  pointer-events: auto !important;
  cursor: pointer !important;
}
/* Do not raise generic overlays above popovers */
.mud-overlay.mud-overlay-dialog {
  z-index: 1400;
}
/* Labels must not steal clicks from the input */
.mud-input-control .mud-input-label {
  pointer-events: none !important;
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* .cms-tab-bar is styled in css/cms-tabs.css */


/* System Admin / all admin pages — clear fixed top bar */
.admin-shell .mud-layout {
  padding-top: 0 !important;
}
.admin-shell .mud-appbar.mud-appbar-fixed-top,
.admin-shell .admin-appbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1300 !important;
}
.admin-shell main.mud-main-content,
.admin-shell .mud-main-content {
  padding-top: 5rem !important;
  margin-top: 0 !important;
}
.admin-shell .mud-drawer.mud-drawer-fixed {
  top: 64px !important;
  height: calc(100% - 64px) !important;
}


/* ===== Modern KPI counter cards ===== */
.kpi-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  color: #fff;
  min-height: 96px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}
.kpi-card::after {
  content: "";
  position: absolute;
  right: -18px; top: -18px;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  pointer-events: none;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}
.kpi-clickable { cursor: pointer; }
.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
  backdrop-filter: blur(6px);
}
.kpi-body { min-width: 0; position: relative; z-index: 1; }
.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .02em;
  opacity: .92;
  text-transform: uppercase;
}
.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 2px;
  letter-spacing: -0.02em;
}
.kpi-hint {
  font-size: 0.72rem;
  opacity: .85;
  margin-top: 2px;
}
.kpi-teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.kpi-blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.kpi-violet { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.kpi-amber { background: linear-gradient(135deg, #b45309, #f59e0b); }
.kpi-rose { background: linear-gradient(135deg, #be123c, #fb7185); }
.kpi-slate { background: linear-gradient(135deg, #334155, #64748b); }
.kpi-emerald { background: linear-gradient(135deg, #047857, #34d399); }
html.sm-dark .kpi-card { box-shadow: 0 12px 30px rgba(0,0,0,.35); }


/* ===== Admin AppBar follows theme (light teal / dark navy) ===== */
html:not(.sm-dark) .admin-shell .mud-appbar.mud-appbar-fixed-top,
html:not(.sm-dark) .admin-shell .admin-appbar,
html:not(.sm-dark) .admin-shell .mud-appbar {
  background: linear-gradient(90deg, #0f766e 0%, #0d9488 55%, #14b8a6 100%) !important;
  color: #ffffff !important;
  border-bottom: none !important;
  box-shadow: 0 2px 12px rgba(15, 118, 110, 0.25) !important;
}
html:not(.sm-dark) .admin-shell .mud-appbar .mud-typography,
html:not(.sm-dark) .admin-shell .mud-appbar .mud-button-root,
html:not(.sm-dark) .admin-shell .mud-appbar .mud-icon-button,
html:not(.sm-dark) .admin-shell .mud-appbar .mud-input-control,
html:not(.sm-dark) .admin-shell .mud-appbar svg {
  color: #ffffff !important;
  fill: currentColor;
}
html.sm-dark .admin-shell .mud-appbar.mud-appbar-fixed-top,
html.sm-dark .admin-shell .admin-appbar,
html.sm-dark .admin-shell .mud-appbar {
  background: linear-gradient(90deg, #0b1220 0%, #111827 60%, #0f172a 100%) !important;
  color: #f8fafc !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15) !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.45) !important;
}
html.sm-dark .admin-shell .mud-appbar .mud-typography,
html.sm-dark .admin-shell .mud-appbar .mud-button-root,
html.sm-dark .admin-shell .mud-appbar .mud-icon-button,
html.sm-dark .admin-shell .mud-appbar svg {
  color: #f1f5f9 !important;
}


/* Education Officer — full width, no drawer */
.admin-shell.officer-shell .mud-drawer { display: none !important; }
.admin-shell.officer-shell .mud-main-content.officer-main,
.admin-shell.officer-shell main.mud-main-content {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100% !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  padding-top: 4.75rem !important;
}
