/* ==========================================================================
   Education ERP design system
   Tokens → base → layout (sidebar/topbar/auth) → components → utilities → print
   Bootstrap 5.3 provides the grid/components; these tokens restyle it.
   ========================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Devanagari"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/noto-sans-devanagari-devanagari-400-normal.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "Noto Sans Devanagari"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/noto-sans-devanagari-devanagari-600-normal.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }

:root {
  /* brand (overridden per organization via inline --erp-primary) */
  --erp-primary: #4f46e5;
  --erp-primary-rgb: 79, 70, 229;
  --erp-primary-contrast: #ffffff;
  --erp-accent: #0ea5e9;

  /* neutrals */
  --erp-bg: #f5f6fa;
  --erp-surface: #ffffff;
  --erp-surface-2: #f8f9fc;
  --erp-border: #e6e8f0;
  --erp-text: #1d2433;
  --erp-muted: #667085;
  --erp-sidebar-bg: #111827;
  --erp-sidebar-text: #c5cad6;
  --erp-sidebar-active: #ffffff;

  /* status */
  --erp-success: #12b76a;
  --erp-warning: #f79009;
  --erp-danger: #f04438;
  --erp-info: #2e90fa;

  /* spacing, radius, shadow, type */
  --erp-space-1: .25rem; --erp-space-2: .5rem; --erp-space-3: .75rem; --erp-space-4: 1rem; --erp-space-5: 1.5rem; --erp-space-6: 2rem;
  --erp-radius-sm: 6px; --erp-radius: 10px; --erp-radius-lg: 16px;
  --erp-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --erp-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --erp-shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, .12);
  --erp-font: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --erp-sidebar-w: 260px;
  --erp-sidebar-w-collapsed: 72px;
  --erp-topbar-h: 60px;

  --bs-primary: var(--erp-primary);
  --bs-primary-rgb: var(--erp-primary-rgb);
  --bs-body-font-family: var(--erp-font);
  --bs-body-bg: var(--erp-bg);
  --bs-body-color: var(--erp-text);
  --bs-border-color: var(--erp-border);
  --bs-border-radius: var(--erp-radius);
  --bs-link-color-rgb: var(--erp-primary-rgb);
}

[data-bs-theme="dark"] {
  --erp-bg: #0d1117;
  --erp-surface: #161b22;
  --erp-surface-2: #1c2230;
  --erp-border: #2a3140;
  --erp-text: #e6e9ef;
  --erp-muted: #98a2b3;
  --erp-sidebar-bg: #0a0d12;
  --bs-body-bg: var(--erp-bg);
  --bs-body-color: var(--erp-text);
  --bs-border-color: var(--erp-border);
  --bs-secondary-bg: var(--erp-surface-2);
  --bs-tertiary-bg: var(--erp-surface-2);
}

html[lang="hi"] { --erp-font: "Noto Sans Devanagari", "Inter", system-ui, sans-serif; }

/* ---------- base ---------- */
body { font-family: var(--erp-font); background: var(--erp-bg); color: var(--erp-text); -webkit-font-smoothing: antialiased; }
a { color: var(--erp-primary); }
.text-muted, .form-text { color: var(--erp-muted) !important; }
:focus-visible { outline: 3px solid rgba(var(--erp-primary-rgb), .45); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--erp-surface); padding: .5rem 1rem; border-radius: var(--erp-radius-sm); }
.skip-link:focus { left: 8px; }

.btn-primary { --bs-btn-bg: var(--erp-primary); --bs-btn-border-color: var(--erp-primary); --bs-btn-hover-bg: color-mix(in srgb, var(--erp-primary) 88%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--erp-primary) 88%, #000); --bs-btn-active-bg: color-mix(in srgb, var(--erp-primary) 80%, #000); --bs-btn-disabled-bg: var(--erp-primary); --bs-btn-disabled-border-color: var(--erp-primary); color: var(--erp-primary-contrast); }
.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); --bs-btn-active-bg: var(--erp-primary); }
.btn { border-radius: var(--erp-radius-sm); font-weight: 500; min-height: 38px; }
.btn-lg { min-height: 48px; }
.form-control, .form-select { border-radius: var(--erp-radius-sm); min-height: 40px; background-color: var(--erp-surface); }
.form-control:focus, .form-select:focus { border-color: var(--erp-primary); box-shadow: 0 0 0 .2rem rgba(var(--erp-primary-rgb), .18); }
.form-check-input:checked { background-color: var(--erp-primary); border-color: var(--erp-primary); }
.text-primary { color: var(--erp-primary) !important; }
.bg-primary { background-color: var(--erp-primary) !important; }
.bg-primary-subtle { background-color: rgba(var(--erp-primary-rgb), .1) !important; }

/* ---------- panel layout ---------- */
.erp-shell { display: flex; min-height: 100vh; }
.erp-sidebar {
  width: var(--erp-sidebar-w); background: var(--erp-sidebar-bg); color: var(--erp-sidebar-text);
  position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column;
  transition: width .2s ease, transform .2s ease; overflow: hidden;
}
.erp-sidebar .brand { height: var(--erp-topbar-h); display: flex; align-items: center; gap: .65rem; padding: 0 1.1rem; color: #fff; text-decoration: none; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.06); white-space: nowrap; }
.erp-sidebar .brand-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--erp-primary); display: grid; place-items: center; color: #fff; flex: none; overflow: hidden; }
.erp-sidebar .brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.erp-nav { overflow-y: auto; padding: .75rem .6rem 2rem; flex: 1; }
.erp-nav .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #7c8496; padding: 1rem .75rem .35rem; white-space: nowrap; }
.erp-nav a { display: flex; align-items: center; gap: .75rem; color: var(--erp-sidebar-text); text-decoration: none; padding: .55rem .75rem; border-radius: var(--erp-radius-sm); white-space: nowrap; font-size: .925rem; }
.erp-nav a .bi { font-size: 1.1rem; width: 1.25rem; text-align: center; flex: none; }
.erp-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.erp-nav a.active { background: var(--erp-primary); color: var(--erp-sidebar-active); }
.erp-main { flex: 1; margin-left: var(--erp-sidebar-w); min-width: 0; transition: margin-left .2s ease; display: flex; flex-direction: column; }
.erp-topbar {
  height: var(--erp-topbar-h); background: var(--erp-surface); border-bottom: 1px solid var(--erp-border);
  display: flex; align-items: center; gap: .75rem; padding: 0 1rem; position: sticky; top: 0; z-index: 1030;
}
.erp-topbar .search { max-width: 360px; flex: 1; position: relative; }
.erp-topbar .search > .bi { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--erp-muted); }
.erp-topbar .search input { padding-left: 2.2rem; background: var(--erp-surface-2); border-color: transparent; }
.erp-topbar .search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--erp-surface); border: 1px solid var(--erp-border); border-radius: var(--erp-radius); box-shadow: var(--erp-shadow-lg); max-height: 320px; overflow-y: auto; display: none; z-index: 1050; }
.erp-topbar .search-results.show { display: block; }
.erp-topbar .search-results a { display: flex; gap: .6rem; padding: .55rem .8rem; color: var(--erp-text); text-decoration: none; }
.erp-topbar .search-results a:hover, .erp-topbar .search-results a.focused { background: var(--erp-surface-2); }
.erp-content { padding: 1.5rem; flex: 1; }
.erp-footer { padding: 1rem 1.5rem; color: var(--erp-muted); font-size: .8rem; }

body.sidebar-collapsed .erp-sidebar { width: var(--erp-sidebar-w-collapsed); }
body.sidebar-collapsed .erp-main { margin-left: var(--erp-sidebar-w-collapsed); }
body.sidebar-collapsed .erp-nav .nav-section, body.sidebar-collapsed .erp-nav a span, body.sidebar-collapsed .brand-name { display: none; }
body.sidebar-collapsed .erp-nav a { justify-content: center; }

.erp-backdrop { display: none; }
@media (max-width: 991.98px) {
  .erp-sidebar { transform: translateX(-100%); width: var(--erp-sidebar-w) !important; }
  .erp-main { margin-left: 0 !important; }
  body.sidebar-open .erp-sidebar { transform: none; }
  body.sidebar-open .erp-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; }
  body.sidebar-collapsed .erp-nav .nav-section, body.sidebar-collapsed .erp-nav a span, body.sidebar-collapsed .brand-name { display: initial; }
  .erp-content { padding: 1rem; }
  .erp-topbar .search { display: none; }
}

/* mobile bottom navigation (portals) */
.erp-bottom-nav { display: none; }
@media (max-width: 767.98px) {
  .has-bottom-nav .erp-content { padding-bottom: 5rem; }
  .erp-bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: var(--erp-surface); border-top: 1px solid var(--erp-border); z-index: 1030; }
  .erp-bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--erp-muted); text-decoration: none; font-size: .7rem; min-height: 48px; }
  .erp-bottom-nav a .bi { font-size: 1.3rem; }
  .erp-bottom-nav a.active { color: var(--erp-primary); }
}

/* ---------- page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-header .breadcrumb { margin: 0 0 .15rem; font-size: .8rem; }
.page-header .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- cards & stats ---------- */
.card { background: var(--erp-surface); border: 1px solid var(--erp-border); border-radius: var(--erp-radius); box-shadow: var(--erp-shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--erp-border); padding: .9rem 1.1rem; font-weight: 600; }
.card-body { padding: 1.1rem; }
.stat-card { padding: 1.1rem; display: flex; flex-direction: row; gap: 1rem; align-items: center; height: 100%; }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex: none; background: rgba(var(--erp-primary-rgb), .1); color: var(--erp-primary); }
.stat-card .stat-icon.success { background: rgba(18,183,106,.12); color: var(--erp-success); }
.stat-card .stat-icon.warning { background: rgba(247,144,9,.12); color: var(--erp-warning); }
.stat-card .stat-icon.danger { background: rgba(240,68,56,.12); color: var(--erp-danger); }
.stat-card .stat-icon.info { background: rgba(46,144,250,.12); color: var(--erp-info); }
.stat-card .stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: var(--erp-muted); font-size: .825rem; }
.stat-card > div:not(.stat-icon), .stat-card > .card-body > div:not(.stat-icon) { min-width: 0; }
.stat-card .stat-value { overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .stat-card { padding: .85rem; gap: .65rem; } .stat-card .stat-icon { width: 38px; height: 38px; font-size: 1.1rem; } .stat-card .stat-value { font-size: 1.15rem; } }
.desk-tabs .nav-link { white-space: nowrap; }
.usage-bar { height: 8px; border-radius: 99px; background: var(--erp-surface-2); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: var(--erp-primary); border-radius: 99px; }
.usage-bar > span.warn { background: var(--erp-warning); }
.usage-bar > span.full { background: var(--erp-danger); }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--erp-border); }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--erp-muted); font-weight: 600; background: var(--erp-surface-2); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--erp-surface-2); }
/* Wide tables become stacked cards on phones: add .table-stack and data-label on cells */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border: 1px solid var(--erp-border); border-radius: var(--erp-radius); margin: .75rem; width: auto; background: var(--erp-surface); }
  .table-stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0 !important; padding: .45rem .9rem !important; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--erp-muted); text-align: left; }
  .table-stack td.actions-cell { justify-content: flex-end; }
  .table-stack td.actions-cell::before { content: none; }
}

/* ---------- empty state & skeleton ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--erp-muted); }
.empty-state .bi { font-size: 2.5rem; display: block; margin-bottom: .5rem; color: var(--erp-border); }
.skeleton { background: linear-gradient(90deg, var(--erp-surface-2) 25%, var(--erp-border) 37%, var(--erp-surface-2) 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--erp-radius-sm); min-height: 1rem; }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }

/* ---------- toasts & loading ---------- */
.erp-toasts { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.erp-toast { background: var(--erp-surface); border: 1px solid var(--erp-border); border-left: 4px solid var(--erp-info); border-radius: var(--erp-radius); box-shadow: var(--erp-shadow-lg); padding: .75rem 1rem; display: flex; gap: .6rem; align-items: flex-start; animation: toast-in .2s ease; }
.erp-toast.success { border-left-color: var(--erp-success); }
.erp-toast.error { border-left-color: var(--erp-danger); }
.erp-toast.warning { border-left-color: var(--erp-warning); }
@keyframes toast-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1rem; height: 1rem; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-outline-primary.is-loading::after, .btn-light.is-loading::after { border-color: var(--erp-primary) var(--erp-primary) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: linear-gradient(140deg, var(--erp-primary), color-mix(in srgb, var(--erp-primary) 55%, #0b1020)); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h2 { font-weight: 700; font-size: 2rem; line-height: 1.2; }
.auth-aside ul { list-style: none; padding: 0; }
.auth-aside li { display: flex; gap: .6rem; margin-bottom: .6rem; opacity: .92; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: var(--erp-surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 700; }
.auth-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--erp-text); text-decoration: none; margin-bottom: 2rem; }
.auth-brand .brand-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--erp-primary); color: #fff; display: grid; place-items: center; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display: none; } }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; background: var(--erp-surface-2); border: 1px dashed var(--erp-border); border-radius: var(--erp-radius-sm); padding: .6rem .8rem; word-break: break-all; }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-family: ui-monospace, monospace; }

/* ---------- wizard / steps ---------- */
.steps { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; padding: 0; list-style: none; counter-reset: step; }
.steps li { flex: 1; min-width: 120px; padding: .6rem .75rem; border-radius: var(--erp-radius-sm); background: var(--erp-surface-2); color: var(--erp-muted); font-size: .85rem; counter-increment: step; }
.steps li::before { content: counter(step) ". "; font-weight: 700; }
.steps li.done { color: var(--erp-success); }
.steps li.current { background: rgba(var(--erp-primary-rgb), .12); color: var(--erp-primary); font-weight: 600; }

/* ---------- permission matrix ---------- */
.perm-matrix th, .perm-matrix td { text-align: center; vertical-align: middle; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--erp-surface); z-index: 1; min-width: 200px; }
.perm-matrix td.na { color: var(--erp-border); }
.perm-matrix .form-check-input { width: 1.2rem; height: 1.2rem; cursor: pointer; }

/* ---------- banners ---------- */
.erp-banner { padding: .55rem 1rem; font-size: .875rem; display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap; text-align: center; }
.erp-banner.impersonate { background: #7a2e0e; color: #fff; }
.erp-banner.warning { background: #fffaeb; color: #93370d; border-bottom: 1px solid #fedf89; }
.erp-banner.danger { background: #fef3f2; color: #912018; border-bottom: 1px solid #fecdca; }
[data-bs-theme="dark"] .erp-banner.warning { background: #3a2a0a; color: #fedf89; border-color: #5a3d0a; }
[data-bs-theme="dark"] .erp-banner.danger { background: #3a1210; color: #fecdca; border-color: #5a1d18; }

/* ---------- marketing site ---------- */
.mk-nav { background: var(--erp-surface); border-bottom: 1px solid var(--erp-border); }
.mk-hero { padding: 5rem 0 4rem; background: radial-gradient(1200px 400px at 80% -10%, rgba(var(--erp-primary-rgb), .18), transparent), var(--erp-bg); }
.mk-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.mk-feature .bi { font-size: 1.6rem; color: var(--erp-primary); }
.price-card.featured { border: 2px solid var(--erp-primary); box-shadow: var(--erp-shadow-lg); }
.price-card .price { font-size: 2.2rem; font-weight: 800; }

/* ---------- utilities ---------- */
.min-w-0 { min-width: 0; }
.fw-semibold { font-weight: 600 !important; }
.small-caps { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--erp-muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(var(--erp-primary-rgb), .14); color: var(--erp-primary); display: inline-grid; place-items: center; font-weight: 600; font-size: .85rem; flex: none; }
.dropdown-menu { border-color: var(--erp-border); box-shadow: var(--erp-shadow-lg); border-radius: var(--erp-radius); background: var(--erp-surface); }
.list-group-item { background: var(--erp-surface); border-color: var(--erp-border); }
.touch-target { min-width: 44px; min-height: 44px; }
.offline-badge { font-size: .75rem; }

/* ---------- print ---------- */
@media print {
  .erp-sidebar, .erp-topbar, .erp-footer, .erp-bottom-nav, .erp-banner, .no-print, .page-header .actions, .erp-toasts { display: none !important; }
  .erp-main { margin: 0 !important; }
  .erp-content { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { border: 0; box-shadow: none; }
  a { color: #000; text-decoration: none; }
}
@page { size: A4; margin: 12mm; }
.print-a5 { width: 148mm; } .print-thermal { width: 80mm; font-size: 12px; }

/* light buttons follow surface tokens so they work in dark mode too */
.btn-light { --bs-btn-bg: var(--erp-surface-2); --bs-btn-border-color: var(--erp-surface-2); --bs-btn-color: var(--erp-text); --bs-btn-hover-bg: var(--erp-border); --bs-btn-hover-border-color: var(--erp-border); --bs-btn-hover-color: var(--erp-text); --bs-btn-active-bg: var(--erp-border); --bs-btn-active-border-color: var(--erp-border); --bs-btn-active-color: var(--erp-text); }
[data-bs-theme="dark"] .text-bg-light { background-color: var(--erp-surface-2) !important; color: var(--erp-text) !important; }
[data-bs-theme="dark"] .bg-body-tertiary { background-color: var(--erp-surface) !important; }
img.avatar { object-fit: cover; padding: 0; }
.search-results .search-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--erp-muted); padding: .5rem .9rem .2rem; border-top: 1px solid var(--erp-border); }

/* ---------- fee receipts (screen + print) ---------- */
.rcpt-sheet { background: #fff; color: #111; margin: 0 auto; box-shadow: var(--erp-shadow); border-radius: 6px; padding: 18px; }
.rcpt-sheet-a4 { max-width: 210mm; } .rcpt-sheet-a5 { max-width: 148mm; } .rcpt-sheet-thermal { max-width: 80mm; padding: 8px; }
.rcpt { position: relative; font-size: 12.5px; line-height: 1.4; font-family: var(--erp-font), "Noto Sans Devanagari", Arial, sans-serif; }
.rcpt-thermal { font-size: 11px; }
.rcpt-head { display: flex; gap: 12px; align-items: center; border-bottom: 2px solid #111; padding-bottom: 8px; }
.rcpt-thermal .rcpt-head { flex-direction: column; text-align: center; border-bottom-style: dashed; }
.rcpt-logo { width: 54px; height: 54px; object-fit: contain; }
.rcpt-name { font-size: 1.35em; font-weight: 700; }
.rcpt-sub { font-size: .9em; color: #333; }
.rcpt-title { text-align: center; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 8px 0; }
.rcpt-title span { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .9em; }
.rcpt table { width: 100%; border-collapse: collapse; }
.rcpt .r { text-align: right; }
.rcpt-meta td { padding: 2px 0; vertical-align: top; }
.rcpt-thermal .rcpt-meta td { display: block; text-align: left !important; }
.rcpt-lines { margin-top: 8px; }
.rcpt-lines th, .rcpt-lines td { border-bottom: 1px solid #ccc; padding: 4px 6px; }
.rcpt-lines thead th { background: #f2f2f2; font-weight: 600; }
.rcpt-lines tfoot th { border-top: 2px solid #111; font-size: 1.1em; }
.rcpt-words, .rcpt-mode, .rcpt-balance, .rcpt-cancel-note { margin-top: 6px; }
.rcpt-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 14px; }
.rcpt-thermal .rcpt-foot { flex-direction: column; align-items: center; text-align: center; }
.rcpt-verify { display: flex; gap: 8px; align-items: center; font-size: .85em; }
.rcpt-qr svg { width: 72px; height: 72px; display: block; }
.rcpt-url { word-break: break-all; }
.rcpt-sign { text-align: right; font-size: .9em; } .rcpt-sign span { display: inline-block; margin-top: 22px; border-top: 1px solid #111; padding-top: 2px; }
.rcpt-note { margin-top: 8px; font-size: .85em; color: #333; }
.rcpt-gen { margin-top: 6px; text-align: center; font-size: .75em; color: #666; }
.rcpt-cut { border-top: 1px dashed #999; margin: 18px 0; }
.rcpt-stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 3em; font-weight: 800; color: rgba(220, 38, 38, .35); border: 4px solid rgba(220, 38, 38, .35); padding: 4px 18px; pointer-events: none; }
@media print {
  .rcpt-sheet { box-shadow: none; padding: 0; max-width: none; }
  body.rcpt-page-thermal .rcpt-sheet { width: 72mm; }
}
@page { margin: 10mm; }
.stat-card > .card-body { padding: 0; display: flex; flex-direction: row; gap: 1rem; align-items: center; width: 100%; }

/* ---------- attendance ---------- */
.att-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.att-day { padding: .35rem 0; min-height: 3rem; line-height: 1.2; }
.att-grid th, .att-grid td { padding: .15rem .25rem; white-space: nowrap; }
.att-grid td.att-absent { color: var(--bs-danger); font-weight: 600; }
.att-grid td.att-late, .att-grid td.att-half_day { color: var(--bs-warning-text-emphasis); }
.att-grid td.att-leave { color: var(--bs-secondary-color); }
@media print {
  @page attreg { size: A4 landscape; margin: 8mm; }
  .att-register { border: 0 !important; page: attreg; }
  .att-grid { font-size: 7.5pt; }
  .att-grid th, .att-grid td { padding: 1px 2px; }
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
.cal-day { min-height: 5.5rem; }
@media (max-width: 767.98px) {
  .cal-grid { grid-template-columns: 1fr; }
  .cal-grid > .text-center { display: none; }
  .cal-day { min-height: 0; }
  .cal-day.cal-empty { display: none; }
}
.tt-grid th, .tt-grid td { vertical-align: top; }
@media print { .tt-grid select, .tt-grid input { border: 0; padding: 0; background: none; appearance: none; font-size: 8pt; } }

/* ---------- report cards & admit cards ---------- */
.report-card { max-width: 820px; margin-left: auto; margin-right: auto; }
.report-card svg { width: 72px; height: 72px; }
@media print {
  .report-card { break-after: page; border: 0 !important; box-shadow: none !important; margin: 0 !important; max-width: none; }
  .report-card:last-child { break-after: auto; }
  .admit-grid { display: block !important; }
  .admit-wrap { width: 100% !important; max-width: 100% !important; break-inside: avoid; margin-bottom: 6mm; }
  .admit-wrap:nth-child(2n) { break-after: page; }
  .admit-card { border: 1px dashed #999 !important; }
}

/* ---------- certificates & ID cards ---------- */
.cert-page { background: #fff; color: #111; margin: 0 auto 1.5rem; padding: 14mm; box-shadow: 0 1px 6px rgba(0,0,0,.08); font-family: "Times New Roman", Georgia, serif; position: relative; overflow: hidden; }
.cert-a4_portrait { width: 210mm; min-height: 297mm; }
.cert-a4_landscape { width: 297mm; min-height: 210mm; }
.cert-a5_landscape { width: 210mm; min-height: 148mm; }
.cert-card { width: 85.6mm; height: 54mm; padding: 0; overflow: hidden; border: 1px solid #ccc; border-radius: 3mm; background: #fff; color: #111; font-family: Arial, sans-serif; }
.cert-page.cert-card { padding: 0; min-height: 0; }
.cert-cards { display: grid; grid-template-columns: repeat(auto-fill, 85.6mm); gap: 6mm; justify-content: center; margin-bottom: 1.5rem; }
.cert-photo { width: 20mm; height: 25mm; object-fit: cover; border: 1px solid #ccc; display: inline-block; flex-shrink: 0; background: #f2f2f2; }
.cert-page:not(.cert-card) .cert-photo { width: 30mm; height: 37mm; }
.cert-logo { height: 18mm; width: auto; }
.cert-card .cert-logo { height: 8mm; }
.cert-qr svg { width: 26mm; height: 26mm; display: block; }
.cert-card .cert-qr svg { width: 15mm; height: 15mm; }
.cert-qr-sample { display: inline-flex; align-items: center; justify-content: center; width: 20mm; height: 20mm; border: 1px dashed #999; font-size: 10px; }
.cert-cancelled::after { content: "CANCELLED"; position: absolute; top: 40%; left: 10%; font-size: 64px; color: rgba(220,38,38,.35); transform: rotate(-25deg); font-weight: 700; pointer-events: none; }
.cert-card.cert-cancelled { position: relative; }
.cert-card.cert-cancelled::after { font-size: 26px; top: 35%; }
.cert-preview-wrap { zoom: .55; }
@media (max-width: 767.98px) { .cert-page:not(.cert-card) { zoom: .42; } .cert-preview-wrap { zoom: .4; } }
@media print {
  .cert-page { box-shadow: none !important; margin: 0 !important; break-after: page; zoom: 1 !important; }
  .cert-page:last-child { break-after: auto; }
  .cert-a4_landscape, .cert-a5_landscape { page: certland; }
  @page certland { size: A4 landscape; margin: 0; }
  .cert-cards { gap: 4mm; grid-template-columns: repeat(2, 85.6mm); }
  .cert-card { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- CRM board ---------- */
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.crm-col { min-height: 200px; }
.crm-col .card-body { max-height: 70vh; overflow-y: auto; }
.crm-card:hover { border-color: var(--bs-primary); }

/* ---------- portal ---------- */
.att-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.att-cal-h { text-align: center; font-size: .75rem; font-weight: 600; color: var(--erp-muted); }
.att-cal-d { border: 1px solid var(--erp-border); border-radius: 8px; min-height: 48px; padding: 3px 4px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.att-cal-d.att-today { outline: 2px solid var(--erp-primary); }
.test-q { white-space: normal; overflow-wrap: anywhere; }
.material-note { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.exam-shell { max-width: 1100px; margin: 0 auto; }
.exam-bar { position: sticky; top: 0; z-index: 1020; background: var(--erp-surface); border-bottom: 1px solid var(--erp-border); }
.exam-timer { font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 700; }
.exam-timer.low { color: var(--bs-danger); }
.q-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.q-palette button { height: 40px; border-radius: 8px; border: 1px solid var(--erp-border); background: var(--erp-surface); font-weight: 600; }
.q-palette button.answered { background: var(--bs-success); color: #fff; border-color: var(--bs-success); }
.q-palette button.review { background: var(--bs-warning); color: #000; border-color: var(--bs-warning); }
.q-palette button.current { outline: 2px solid var(--erp-primary); outline-offset: 1px; }
.exam-option { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 1rem; border: 1px solid var(--erp-border); border-radius: 10px; cursor: pointer; min-height: 48px; }
.exam-option:has(input:checked) { border-color: var(--erp-primary); background: color-mix(in srgb, var(--erp-primary) 8%, transparent); }

/* ---------- library labels ---------- */
.lib-labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(62mm, 1fr)); gap: 3mm; }
.lib-label { display: flex; gap: 2mm; align-items: center; border: 1px dashed var(--erp-border); padding: 2mm; border-radius: 4px; background: #fff; color: #000; break-inside: avoid; }
.lib-qr svg { width: 18mm; height: 18mm; display: block; }
.hostel-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
