:root {
  --erp-primary: #0F4C81;
  --erp-primary-dark: #0a365b;
  --erp-primary-soft: #eaf2f9;
  --erp-accent: #F4B400;
  --erp-success: #16865b;
  --erp-warning: #ed8b16;
  --erp-danger: #d83b45;
  --erp-info: #168aad;
  --erp-bg: #f4f7fb;
  --erp-surface: #ffffff;
  --erp-surface-2: #f8fafc;
  --erp-text: #17202a;
  --erp-muted: #667085;
  --erp-border: #e4e7ec;
  --erp-shadow: 0 10px 32px rgba(15, 76, 129, 0.08);
  --erp-shadow-lg: 0 20px 48px rgba(15, 76, 129, 0.14);
  --erp-radius: 18px;
  --sidebar-width: 278px;
  --sidebar-collapsed-width: 82px;
  --topbar-height: 72px;
}

[data-theme="dark"] {
  --erp-primary: #4f9bd7;
  --erp-primary-dark: #2d7bb5;
  --erp-primary-soft: #152b3d;
  --erp-accent: #ffc83d;
  --erp-success: #49c28f;
  --erp-warning: #ffad42;
  --erp-danger: #ff6b73;
  --erp-info: #55b8d8;
  --erp-bg: #0d1420;
  --erp-surface: #141e2b;
  --erp-surface-2: #192534;
  --erp-text: #eef4fb;
  --erp-muted: #a6b2c2;
  --erp-border: #2b3848;
  --erp-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --erp-shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--erp-text);
  background: var(--erp-bg);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.94rem;
  transition: background-color .25s ease, color .25s ease;
}

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

.erp-shell { min-height: 100vh; }
.erp-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-width);
  color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(244, 180, 0, .18), transparent 28%),
    linear-gradient(180deg, #0f4c81 0%, #0b365d 58%, #082a49 100%);
  box-shadow: 10px 0 35px rgba(4, 28, 48, .16);
  transition: width .25s ease, transform .25s ease;
  overflow: hidden;
}
.erp-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--sidebar-width);
}
.erp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
  padding: 13px 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.erp-brand:hover { color: #fff; }
.erp-brand-logo {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 3px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.erp-brand-copy { min-width: 0; transition: opacity .18s ease; }
.erp-brand-name { display: block; font-size: .97rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-brand-tagline { display: block; margin-top: 2px; font-size: .69rem; color: rgba(255,255,255,.68); letter-spacing: .08em; text-transform: uppercase; }

.erp-nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.24) transparent; }
.erp-nav-section { margin: 17px 10px 7px; color: rgba(255,255,255,.55); font-size: .66rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; }
.erp-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 44px;
  margin: 4px 0;
  padding: 10px 13px;
  color: rgba(255,255,255,.83);
  border-radius: 12px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  white-space: nowrap;
}
.erp-nav-link i { width: 22px; flex: 0 0 22px; font-size: 1.1rem; text-align: center; }
.erp-nav-link:hover { color: #fff; background: rgba(255,255,255,.11); transform: translateX(2px); }
.erp-nav-link.active { color: #0f3557; background: linear-gradient(135deg, #fff 0%, #f6fbff 100%); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.erp-nav-link.active::before { content: ""; position: absolute; left: -12px; top: 10px; width: 4px; height: 24px; border-radius: 4px; background: var(--erp-accent); }
.erp-nav-badge { margin-left: auto; padding: 3px 7px; border-radius: 999px; color: #fff; background: rgba(255,255,255,.16); font-size: .62rem; font-weight: 800; }
.erp-nav-link.disabled { opacity: .55; cursor: not-allowed; }
.erp-sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.erp-user-mini { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 13px; background: rgba(255,255,255,.08); }
.erp-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; color: #12324c; background: linear-gradient(135deg, var(--erp-accent), #ffe08a); font-weight: 800; }
.erp-user-mini-copy { min-width: 0; }
.erp-user-mini-name { color: #fff; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-user-mini-role { color: rgba(255,255,255,.62); font-size: .72rem; }

.erp-main { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left .25s ease; }
.erp-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--topbar-height);
  padding: 10px 26px;
  background: color-mix(in srgb, var(--erp-surface) 90%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--erp-border);
}
.erp-menu-toggle, .erp-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  color: var(--erp-text);
  background: var(--erp-surface);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.erp-menu-toggle:hover, .erp-icon-button:hover { transform: translateY(-1px); border-color: var(--erp-primary); color: var(--erp-primary); }
.erp-global-search { position: relative; width: min(430px, 42vw); }
.erp-global-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--erp-muted); }
.erp-global-search input { width: 100%; height: 43px; padding: 0 72px 0 42px; border: 1px solid var(--erp-border); border-radius: 13px; color: var(--erp-text); background: var(--erp-surface-2); outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
.erp-global-search input:focus { border-color: var(--erp-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--erp-primary) 15%, transparent); }
.erp-search-shortcut { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); padding: 3px 7px; border: 1px solid var(--erp-border); border-radius: 7px; color: var(--erp-muted); background: var(--erp-surface); font-size: .68rem; }
.erp-topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.erp-notification-dot { position: absolute; right: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--erp-danger); border: 2px solid var(--erp-surface); }
.erp-topbar-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 1px solid var(--erp-border); border-radius: 14px; color: var(--erp-text); background: var(--erp-surface); }
.erp-topbar-user:hover { color: var(--erp-text); border-color: var(--erp-primary); }
.erp-topbar-user .erp-avatar { width: 36px; height: 36px; border-radius: 10px; }
.erp-topbar-user-copy { line-height: 1.15; text-align: left; }
.erp-topbar-user-copy strong { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.erp-topbar-user-copy small { color: var(--erp-muted); font-size: .68rem; }

.erp-page { padding: 24px 28px 36px; }
.erp-breadcrumb-wrap { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.breadcrumb { margin: 0; font-size: .8rem; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--erp-muted); }
.breadcrumb-item.active { color: var(--erp-muted); }
.erp-system-status { display: inline-flex; align-items: center; gap: 7px; color: var(--erp-success); font-size: .78rem; font-weight: 700; }
.erp-system-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 12%, transparent); }

body.sidebar-collapsed .erp-sidebar { width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .erp-main { margin-left: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .erp-brand-copy,
body.sidebar-collapsed .erp-nav-section,
body.sidebar-collapsed .erp-nav-link span:not(.erp-nav-badge),
body.sidebar-collapsed .erp-nav-badge,
body.sidebar-collapsed .erp-user-mini-copy { opacity: 0; pointer-events: none; }
body.sidebar-collapsed .erp-nav-link { justify-content: center; padding-inline: 10px; }
body.sidebar-collapsed .erp-nav-link.active::before { left: -12px; }
body.sidebar-collapsed .erp-brand { justify-content: center; padding-inline: 12px; }
body.sidebar-collapsed .erp-user-mini { justify-content: center; }

.card {
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  color: var(--erp-text);
  background: var(--erp-surface);
  box-shadow: var(--erp-shadow);
}
.card-header, .card-footer { color: var(--erp-text); background: transparent; border-color: var(--erp-border); }
.erp-card { padding: 20px; }
.erp-section-title { margin: 0; font-size: 1.02rem; font-weight: 800; }
.erp-section-subtitle { margin: 4px 0 0; color: var(--erp-muted); font-size: .8rem; }

.erp-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.erp-page-heading h1, .erp-page-heading h2, .erp-page-heading h3 { margin: 0; font-weight: 800; letter-spacing: -.025em; }
.erp-page-heading p { margin: 5px 0 0; color: var(--erp-muted); }
.erp-title-kicker { margin-bottom: 5px; color: var(--erp-primary); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.metric-card {
  position: relative;
  min-height: 145px;
  padding: 18px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.metric-card:hover { transform: translateY(-4px); box-shadow: var(--erp-shadow-lg); border-color: color-mix(in srgb, var(--metric-color, var(--erp-primary)) 35%, var(--erp-border)); }
.metric-card::after { content: ""; position: absolute; right: -38px; bottom: -45px; width: 120px; height: 120px; border-radius: 50%; background: color-mix(in srgb, var(--metric-color, var(--erp-primary)) 10%, transparent); }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.metric-icon { display: inline-flex; align-items: center; justify-content: center; width: 43px; height: 43px; border-radius: 13px; color: var(--metric-color, var(--erp-primary)); background: color-mix(in srgb, var(--metric-color, var(--erp-primary)) 13%, transparent); font-size: 1.2rem; }
.metric-label { margin-top: 13px; color: var(--erp-muted); font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.metric-value { margin-top: 4px; font-size: 1.55rem; font-weight: 850; letter-spacing: -.035em; }
.metric-meta { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--erp-muted); font-size: .7rem; }
.metric-change { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 999px; font-weight: 800; }
.metric-change.up { color: var(--erp-success); background: color-mix(in srgb, var(--erp-success) 11%, transparent); }
.metric-change.down { color: var(--erp-danger); background: color-mix(in srgb, var(--erp-danger) 11%, transparent); }
.metric-change.flat { color: var(--erp-muted); background: var(--erp-surface-2); }
.metric-spark { display: flex; align-items: end; gap: 3px; height: 25px; }
.metric-spark span { width: 4px; border-radius: 4px; background: color-mix(in srgb, var(--metric-color, var(--erp-primary)) 55%, transparent); }

.quick-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--erp-border);
  border-radius: 15px;
  color: var(--erp-text);
  background: var(--erp-surface-2);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.quick-action:hover { color: var(--erp-text); transform: translateY(-2px); border-color: var(--erp-primary); box-shadow: 0 9px 22px rgba(15,76,129,.09); }
.quick-action-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; color: #fff; background: var(--action-color, var(--erp-primary)); font-size: 1.08rem; }
.quick-action strong { display: block; font-size: .82rem; }
.quick-action small { display: block; margin-top: 2px; color: var(--erp-muted); font-size: .68rem; }

.chart-card { min-height: 350px; }
.chart-wrap { position: relative; min-height: 270px; }
.chart-wrap.small { min-height: 235px; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--erp-text); --bs-table-border-color: var(--erp-border); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .78rem .75rem; }
.table thead th { color: var(--erp-muted); background: var(--erp-surface-2); border-bottom-width: 1px; font-size: .7rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: color-mix(in srgb, var(--erp-primary) 5%, transparent); }
.table-responsive { border-radius: 12px; }

.form-label { color: var(--erp-text); font-size: .79rem; font-weight: 700; }
.form-control, .form-select {
  min-height: 43px;
  border-color: var(--erp-border);
  border-radius: 11px;
  color: var(--erp-text);
  background-color: var(--erp-surface);
}
.form-control:focus, .form-select:focus { border-color: var(--erp-primary); color: var(--erp-text); background-color: var(--erp-surface); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--erp-primary) 14%, transparent); }
.form-control::placeholder { color: color-mix(in srgb, var(--erp-muted) 70%, transparent); }
.form-check-input:checked { background-color: var(--erp-primary); border-color: var(--erp-primary); }

.btn { min-height: 40px; border-radius: 11px; font-weight: 700; font-size: .82rem; }
.btn-sm { min-height: 32px; border-radius: 9px; }
.btn-primary { --bs-btn-bg: var(--erp-primary); --bs-btn-border-color: var(--erp-primary); --bs-btn-hover-bg: var(--erp-primary-dark); --bs-btn-hover-border-color: var(--erp-primary-dark); }
.btn-warning { --bs-btn-bg: var(--erp-accent); --bs-btn-border-color: var(--erp-accent); color: #2b2400; }
.btn-outline-primary { --bs-btn-color: var(--erp-primary); --bs-btn-border-color: var(--erp-primary); --bs-btn-hover-bg: var(--erp-primary); --bs-btn-hover-border-color: var(--erp-primary); }

.badge { border-radius: 999px; font-weight: 750; }
.alert { border: 0; border-radius: 14px; box-shadow: var(--erp-shadow); }
.dropdown-menu { min-width: 230px; padding: 8px; border: 1px solid var(--erp-border); border-radius: 14px; color: var(--erp-text); background: var(--erp-surface); box-shadow: var(--erp-shadow-lg); }
.dropdown-item { padding: 9px 11px; border-radius: 9px; color: var(--erp-text); font-size: .8rem; }
.dropdown-item:hover { color: var(--erp-text); background: var(--erp-primary-soft); }
.dropdown-divider { border-color: var(--erp-border); }
.modal-content { border: 1px solid var(--erp-border); border-radius: 18px; color: var(--erp-text); background: var(--erp-surface); }

.widget-list { display: flex; flex-direction: column; gap: 1px; }
.widget-item { display: flex; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid var(--erp-border); }
.widget-item:last-child { border-bottom: 0; }
.widget-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; color: var(--widget-color, var(--erp-primary)); background: color-mix(in srgb, var(--widget-color, var(--erp-primary)) 12%, transparent); }
.widget-copy { min-width: 0; flex: 1; }
.widget-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .79rem; }
.widget-copy small { color: var(--erp-muted); font-size: .69rem; }
.widget-value { font-size: .76rem; font-weight: 800; white-space: nowrap; }

.empty-state { padding: 30px 18px; text-align: center; color: var(--erp-muted); }
.empty-state i { display: block; margin-bottom: 8px; font-size: 2rem; color: color-mix(in srgb, var(--erp-muted) 55%, transparent); }

.erp-login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); background: var(--erp-bg); }
.erp-login-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 5vw, 76px); overflow: hidden; color: #fff; background: radial-gradient(circle at 15% 15%, rgba(244,180,0,.3), transparent 28%), linear-gradient(135deg, #0f4c81 0%, #082c4c 100%); }
.erp-login-visual::after { content: ""; position: absolute; right: -100px; bottom: -100px; width: 420px; height: 420px; border: 70px solid rgba(255,255,255,.06); border-radius: 50%; }
.erp-login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.erp-login-brand img { width: 62px; height: 62px; padding: 4px; border-radius: 17px; object-fit: contain; background: #fff; }
.erp-login-hero { position: relative; z-index: 1; max-width: 620px; }
.erp-login-hero h1 { margin: 0 0 18px; font-size: clamp(2rem, 4vw, 4.2rem); font-weight: 850; line-height: 1.02; letter-spacing: -.05em; }
.erp-login-hero p { max-width: 520px; color: rgba(255,255,255,.72); font-size: 1.02rem; line-height: 1.7; }
.erp-login-features { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; }
.erp-login-feature { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(255,255,255,.07); font-size: .74rem; }
.erp-login-panel { display: flex; align-items: center; justify-content: center; padding: 34px; background: var(--erp-surface); }
.erp-login-card { width: min(440px, 100%); }
.erp-login-card h2 { font-weight: 850; letter-spacing: -.03em; }
.erp-password-wrap { position: relative; }
.erp-password-wrap .form-control { padding-right: 50px; }
.erp-password-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 35px; height: 35px; border: 0; border-radius: 9px; color: var(--erp-muted); background: transparent; }

.erp-overlay { display: none; position: fixed; inset: 0; z-index: 1030; background: rgba(4,16,28,.52); backdrop-filter: blur(2px); }
.erp-loader { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; background: rgba(7,20,34,.35); backdrop-filter: blur(3px); }
.erp-loader.show { display: flex; }
.erp-loader-card { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 14px; color: var(--erp-text); background: var(--erp-surface); box-shadow: var(--erp-shadow-lg); }
.erp-loader-spinner { width: 24px; height: 24px; border: 3px solid var(--erp-border); border-top-color: var(--erp-primary); border-radius: 50%; animation: erpSpin .7s linear infinite; }
@keyframes erpSpin { to { transform: rotate(360deg); } }
@keyframes erpFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.erp-page > * { animation: erpFadeUp .28s ease both; }

.report-card { position: relative; overflow: hidden; background: white; padding: 18px; border-radius: 12px; max-width: 210mm; margin: 0 auto; color: #111; }
.print-watermark{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:0}
.print-watermark img{width:130mm;max-width:78%;opacity:.07;object-fit:contain}
.print-content{position:relative;z-index:1}
.badge-soft { background:#eef2ff; color:#29337a; }
.page-logo { width: 70px; height: 70px; object-fit: contain; }
.one-page-report { font-size: 12px; }
.one-page-report h2 { font-size: 22px; }
.one-page-report h4 { font-size: 16px; }
.student-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; border: 1px solid #cbd5e1; padding: 8px; background: #f8fafc; }
.compact-table th, .compact-table td { padding: 5px 6px; font-size: 12px; vertical-align: middle; }
.subject-name, .creche-check-table td:nth-child(2) { font-size: 12px !important; }
.creche-check-table th, .creche-check-table td { padding: 3px 4px; font-size: 12px; vertical-align: middle; }
.creche-remarks-table th, .creche-remarks-table td { font-size: 12px; padding: 5px 6px; }
.creche-attendance-line { display:flex; flex-wrap:wrap; gap:8px 18px; border:1.5px solid #111; padding:7px 9px; font-size:11px; background:rgba(255,255,255,.86); }
.remark-line { min-height: 22px; }
.tick-box { font-size: 15px; line-height: 1; }
.signature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; text-align: center; font-size: 12px; align-items: end; }
.signature-img { height: 45px; max-width: 170px; object-fit: contain; display: block; margin: 0 auto 2px auto; }
.jhs-signature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: center; margin-top: 6px; font-size: 12px; }
.jhs-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); border: 2px solid #111; border-bottom: 0; font-size: 12px; }
.jhs-info-grid div { padding: 5px 8px; border-bottom: 1px solid #bbb; }
.jhs-report-table { border: 2px solid #111; font-size: 12px; }
.jhs-report-table th, .jhs-report-table td { border: 1.5px solid #111 !important; padding: 5px 6px; text-align: center; vertical-align: middle; font-size: 12px; }
.jhs-report-table th { font-weight: 700; }
.jhs-report-table td:first-child { text-align: left; }
.jhs-footer { border: 2px solid #111; border-top: 0; padding: 6px 8px; font-size: 12px; line-height: 1.8; }
.jhs-scale { border: 2px solid #111; border-top: 0; padding: 5px 8px; font-size: 11px; line-height: 1.4; }

@media (max-width: 1199.98px) {
  .quick-action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .erp-global-search { width: min(340px, 35vw); }
}

@media (max-width: 991.98px) {
  .erp-sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
  .erp-main, body.sidebar-collapsed .erp-main { margin-left: 0; }
  body.sidebar-mobile-open .erp-sidebar { transform: translateX(0); }
  body.sidebar-mobile-open .erp-overlay { display: block; }
  body.sidebar-collapsed .erp-brand-copy,
  body.sidebar-collapsed .erp-nav-section,
  body.sidebar-collapsed .erp-nav-link span:not(.erp-nav-badge),
  body.sidebar-collapsed .erp-nav-badge,
  body.sidebar-collapsed .erp-user-mini-copy { opacity: 1; pointer-events: auto; }
  body.sidebar-collapsed .erp-nav-link { justify-content: flex-start; padding-inline: 13px; }
  body.sidebar-collapsed .erp-brand, body.sidebar-collapsed .erp-user-mini { justify-content: flex-start; }
  .erp-global-search { display: none; }
  .erp-page { padding: 20px 18px 30px; }
}

@media (max-width: 767.98px) {
  .erp-topbar { padding: 9px 14px; }
  .erp-topbar-user-copy { display: none; }
  .erp-page-heading { flex-direction: column; }
  .erp-breadcrumb-wrap { align-items: flex-start; }
  .erp-system-status { display: none; }
  .quick-action-grid { grid-template-columns: 1fr; }
  .erp-login-page { grid-template-columns: 1fr; }
  .erp-login-visual { display: none; }
  .erp-login-panel { min-height: 100vh; padding: 24px; }
  .student-info-grid { grid-template-columns: 1fr; }
}

@page { size: A4; margin: 10mm; }
@media print {
  body { background: #fff !important; color: #111 !important; }
  .erp-sidebar, .erp-topbar, .erp-breadcrumb-wrap, .erp-overlay, .erp-loader, nav, .no-print, .alert { display: none !important; }
  .erp-main { margin-left: 0 !important; }
  .erp-page, .container-fluid { padding: 0 !important; }
  .card { box-shadow: none !important; border-color: #bbb !important; }
  .report-card { width: 100%; max-width: 100%; box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
  .one-page-report { font-size: 10.5px; page-break-after: avoid; }
  .one-page-report h2 { font-size: 18px; }
  .one-page-report h4 { font-size: 13px; }
  .page-logo { width: 50px; height: 50px; }
  .compact-table th, .compact-table td { padding: 3px 4px; font-size: 10.5px; }
  .subject-name, .creche-check-table td:nth-child(2) { font-size: 12px !important; }
  .creche-check-table th, .creche-check-table td { padding: 2px 3px; font-size: 12px; }
  .creche-remarks-table th, .creche-remarks-table td { font-size: 12px; padding: 3px 4px; }
  .creche-attendance-line { gap:4px 10px; padding:4px 6px; font-size:10.5px; page-break-inside:avoid; }
  .tick-box { font-size: 11px; }
  .student-info-grid { grid-template-columns: repeat(3, 1fr); padding: 5px; gap: 4px 8px; }
  .signature-grid { font-size: 10.5px; margin-top: 10px !important; }
  .signature-img { height: 35px; max-width: 130px; }
  .jhs-signature-grid { font-size: 10.5px; margin-top: 4px; }
  .jhs-info-grid div { padding: 3px 6px; font-size: 10.5px; }
  .jhs-report-table th, .jhs-report-table td { padding: 3px 4px; font-size: 10.5px; }
  .jhs-footer { padding: 4px 6px; font-size: 10.5px; line-height: 1.55; }
  .jhs-scale { padding: 4px 6px; font-size: 9.5px; }
}

/* Enterprise core extensions */
.executive-summary-card{position:relative;overflow:hidden;background:linear-gradient(135deg,rgba(15,76,129,.08),rgba(244,180,0,.10));border:1px solid rgba(15,76,129,.14)}
.executive-summary-card::after{content:"";position:absolute;width:180px;height:180px;border-radius:50%;right:-70px;top:-90px;background:rgba(244,180,0,.12)}
.executive-ai-icon{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#0F4C81,#2878B5);color:#fff;font-size:1.45rem;box-shadow:0 12px 30px rgba(15,76,129,.22);flex:0 0 auto}
.timeline-list{display:grid;gap:1rem}.timeline-item{display:flex;align-items:flex-start;gap:1rem;padding:1rem;border:1px solid var(--erp-border,#e6eaf0);border-radius:18px;background:var(--erp-card,#fff)}
.timeline-date{width:58px;height:62px;border-radius:16px;background:linear-gradient(145deg,#0F4C81,#2878B5);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:0 0 auto}.timeline-date strong{font-size:1.35rem;line-height:1}.timeline-date span{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}.timeline-content{flex:1;min-width:0}
.announcement-card{border-left:4px solid #0F4C81}.announcement-card.priority-high{border-left-color:#ED8B16}.announcement-card.priority-urgent{border-left-color:#D83B45}
.notification-list{display:grid}.notification-row{display:flex;align-items:center;gap:1rem;padding:1rem;border-bottom:1px solid var(--erp-border,#e8ebf0)}.notification-row:last-child{border-bottom:0}.notification-row.unread{background:rgba(15,76,129,.045)}.notification-icon{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:rgba(15,76,129,.1);color:#0F4C81;flex:0 0 auto}.notification-copy{flex:1;min-width:0}.notification-copy p{margin:.25rem 0;color:var(--bs-secondary-color)}
.student-photo-placeholder,.student-profile-photo{display:grid;place-items:center;background:linear-gradient(135deg,#0F4C81,#2878B5);color:#fff;font-weight:800;letter-spacing:.04em}.student-photo-placeholder{width:68px;height:68px;border-radius:20px;font-size:1.2rem}.student-profile-photo{width:150px;height:150px;border-radius:34px;font-size:2.4rem;overflow:hidden;box-shadow:0 16px 36px rgba(15,76,129,.22)}.student-profile-photo img{width:100%;height:100%;object-fit:cover}
.portal-mini-stat{padding:.85rem;border-radius:15px;background:var(--erp-soft,#f5f7fa);height:100%}.portal-mini-stat span{display:block;font-size:.74rem;color:var(--bs-secondary-color);text-transform:uppercase;letter-spacing:.04em}.portal-mini-stat strong{display:block;margin-top:.2rem;font-size:1rem}
.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.profile-grid>div{padding:1rem;border-radius:16px;background:var(--erp-soft,#f6f8fb)}.profile-grid span{display:block;font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:var(--bs-secondary-color)}.profile-grid strong{display:block;margin-top:.25rem}.profile-details{margin:1rem 0 0}.profile-details dt{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--bs-secondary-color)}.profile-details dd{white-space:pre-line;margin-bottom:1.1rem}
.module-icon{width:48px;height:48px;border-radius:15px;display:grid;place-items:center;background:rgba(15,76,129,.1);color:#0F4C81;font-size:1.3rem}.tracking-wide{letter-spacing:.45em;font-weight:700}.sticky-form-actions{position:sticky;bottom:1rem;z-index:10;background:rgba(255,255,255,.92);backdrop-filter:blur(12px);border:1px solid var(--erp-border,#e5e7eb);box-shadow:0 12px 30px rgba(15,23,42,.12);padding:1rem;border-radius:18px;display:flex;gap:.6rem}
[data-theme="dark"] .sticky-form-actions{background:rgba(21,29,43,.92)}
@media(max-width:767.98px){.profile-grid{grid-template-columns:1fr}.notification-row{align-items:flex-start;flex-wrap:wrap}.timeline-item{padding:.85rem}.executive-summary-card .d-flex{flex-wrap:wrap}}

/* Multi-category fee creation */
.fee-category-choice{cursor:pointer;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.fee-category-choice:hover{border-color:rgba(15,76,129,.55)!important;box-shadow:0 8px 22px rgba(15,76,129,.08);transform:translateY(-1px)}
.fee-category-choice:has(.form-check-input:checked){border-color:#0F4C81!important;background:rgba(15,76,129,.07)!important;box-shadow:0 0 0 2px rgba(15,76,129,.08)}
.fee-category-choice .form-check-input:checked{background-color:#0F4C81;border-color:#0F4C81}

/* Professional operations suite */
.erp-fab{position:fixed;right:24px;bottom:24px;z-index:1025;display:flex;flex-direction:column-reverse;align-items:flex-end;gap:10px}.erp-fab-main{width:58px;height:58px;border:0;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,var(--erp-primary,#0F4C81),#2878B5);color:#fff;font-size:1.45rem;box-shadow:0 14px 34px rgba(15,76,129,.35);transition:.2s}.erp-fab.open .erp-fab-main{transform:rotate(45deg)}.erp-fab-menu{display:flex;flex-direction:column;gap:8px;opacity:0;transform:translateY(12px);pointer-events:none;transition:.2s}.erp-fab.open .erp-fab-menu{opacity:1;transform:none;pointer-events:auto}.erp-fab-menu a{display:flex;align-items:center;gap:9px;padding:9px 13px;border-radius:999px;background:var(--erp-surface,#fff);color:var(--erp-text,#111827);text-decoration:none;box-shadow:0 8px 24px rgba(15,23,42,.16);border:1px solid var(--erp-border,#e5e7eb);font-size:.82rem;font-weight:700}.erp-fab-menu i{color:var(--erp-primary,#0F4C81);font-size:1rem}.empty-state{border:1px dashed var(--erp-border,#cbd5e1);border-radius:18px;background:var(--erp-soft,#f8fafc)}
@media(max-width:767.98px){.erp-fab{right:16px;bottom:16px}.erp-fab-main{width:52px;height:52px}.erp-fab-menu span{display:none}.erp-fab-menu a{width:44px;height:44px;justify-content:center;padding:0}}

/* Scholarship management */
.scholarship-stat{border-top:3px solid rgba(15,76,129,.45)}
.scholarship-stat-icon{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;font-size:1.15rem;flex:0 0 auto}
.scholarship-award-card{padding:1rem;border:1px solid var(--erp-border,#e5e7eb);border-radius:18px;background:var(--erp-soft,#f8fafc)}
[data-theme="dark"] .scholarship-award-card{background:rgba(255,255,255,.035)}

/* Consistent warning treatment for every destructive action. */
.delete-action {
  position: relative;
  font-weight: 700;
}
.delete-action .delete-warning-icon,
.delete-action > .bi-exclamation-triangle-fill,
.delete-action > .bi-exclamation-octagon-fill {
  color: currentColor;
}
.delete-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--erp-danger) 30%, transparent);
  outline-offset: 2px;
}
.btn-outline-danger.delete-action:hover,
.btn-danger.delete-action:hover {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--erp-danger) 14%, transparent);
}

/* Full-height A4 terminal reports: Creche, Primary and JHS */
@media print {
  .report-card.one-page-report {
    width: 100% !important;
    height: 277mm !important;
    min-height: 277mm !important;
    max-height: 277mm !important;
    padding: 5mm !important;
    margin: 0 !important;
    border: 1.5px solid #111 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .report-card.one-page-report .print-content {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
  }

  .report-card.one-page-report .report-header-print,
  .report-card.one-page-report .student-info-grid,
  .report-card.one-page-report .table-responsive,
  .report-card.one-page-report table,
  .report-card.one-page-report .creche-attendance-line,
  .report-card.one-page-report .signature-grid,
  .report-card.one-page-report .jhs-info-grid,
  .report-card.one-page-report .jhs-footer,
  .report-card.one-page-report .jhs-scale {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .report-card.one-page-report .report-header-print {
    align-self: stretch;
  }

  .report-card.one-page-report .page-logo {
    width: 58px !important;
    height: 58px !important;
  }

  .report-card.one-page-report h2 {
    font-size: 20px !important;
    line-height: 1.08 !important;
  }

  .report-card.one-page-report h4 {
    font-size: 14px !important;
    line-height: 1.1 !important;
  }

  .report-card.one-page-report {
    font-size: 11px !important;
  }

  .report-card.one-page-report .student-info-grid {
    padding: 6px 8px !important;
    gap: 5px 10px !important;
    font-size: 11px !important;
  }

  .report-card.one-page-report .table-responsive {
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    overflow: visible !important;
  }

  .report-card.one-page-report .table-responsive > table {
    width: 100% !important;
    height: 100% !important;
    table-layout: fixed !important;
  }

  .report-card.one-page-report .table-responsive > table th,
  .report-card.one-page-report .table-responsive > table td {
    vertical-align: middle !important;
  }

  .report-card.one-page-report .signature-grid,
  .report-card.one-page-report .jhs-signature-grid {
    min-height: 19mm !important;
    align-items: end !important;
  }

  .report-card.one-page-report .signature-img {
    height: 42px !important;
    max-width: 150px !important;
  }

  .report-card.one-page-report .print-watermark img {
    width: 132mm !important;
    max-width: 80% !important;
  }

  /* JHS layout: the results table grows to use the centre of the A4 page. */
  .report-card.jhs-full-report .print-content {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto !important;
    gap: 1.4mm !important;
  }

  .report-card.jhs-full-report .jhs-info-grid {
    font-size: 11px !important;
  }

  .report-card.jhs-full-report .jhs-info-grid div {
    padding: 5px 7px !important;
    font-size: 11px !important;
  }

  .report-card.jhs-full-report .jhs-report-table th,
  .report-card.jhs-full-report .jhs-report-table td {
    padding: 4px 5px !important;
    font-size: 11px !important;
  }

  .report-card.jhs-full-report .jhs-report-table tbody tr {
    height: 1px;
  }

  .report-card.jhs-full-report .jhs-footer {
    padding: 5px 7px !important;
    font-size: 10.8px !important;
    line-height: 1.55 !important;
  }

  .report-card.jhs-full-report .jhs-scale {
    padding: 5px 7px !important;
    font-size: 9.8px !important;
    line-height: 1.35 !important;
  }

  /* Creche layout: checklist rows expand evenly down the page. */
  .report-card.creche-full-report .print-content {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto auto !important;
    gap: 1.4mm !important;
  }

  .report-card.creche-full-report .creche-check-table th,
  .report-card.creche-full-report .creche-check-table td {
    padding: 3px 4px !important;
    font-size: 11.5px !important;
  }

  .report-card.creche-full-report .creche-check-table tbody tr {
    height: 1px;
  }

  .report-card.creche-full-report .creche-remarks-table th,
  .report-card.creche-full-report .creche-remarks-table td {
    padding: 6px 7px !important;
    font-size: 11px !important;
  }

  .report-card.creche-full-report .creche-attendance-line {
    padding: 6px 8px !important;
    font-size: 10.8px !important;
  }

  /* Primary/basic layout: the subject table occupies the available A4 height. */
  .report-card.standard-full-report .print-content {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto !important;
    gap: 1.6mm !important;
  }

  .report-card.standard-full-report .report-table th,
  .report-card.standard-full-report .report-table td {
    padding: 4px 5px !important;
    font-size: 11px !important;
  }

  .report-card.standard-full-report .report-table tbody tr {
    height: 1px;
  }

  .report-card.standard-full-report > .print-content > .compact-table th,
  .report-card.standard-full-report > .print-content > .compact-table td {
    padding: 7px 7px !important;
    font-size: 11px !important;
  }
}

/* Student activity duplicate protection */
.fee-activity-locked {
  opacity: .9;
}
.fee-activity-locked .fee-item-amount,
.fee-activity-locked .fee-item-arrears {
  background-color: var(--bs-secondary-bg);
  cursor: not-allowed;
}
.fee-activity-locked .existing-fee-edit-link {
  white-space: nowrap;
}
