/* Birol City School — design system (public site, admin, portal, print) */
@font-face { font-family: "Hind Siliguri"; font-weight: 400; font-display: swap; src: url("../../libs/fonts/hind-siliguri-bengali-400-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 500; font-display: swap; src: url("../../libs/fonts/hind-siliguri-bengali-500-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC; }
@font-face { font-family: "Hind Siliguri"; font-weight: 600; font-display: swap; src: url("../../libs/fonts/hind-siliguri-bengali-600-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC; }
@font-face { font-family: "Hind Siliguri"; font-weight: 700; font-display: swap; src: url("../../libs/fonts/hind-siliguri-bengali-700-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC; }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../../libs/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../../libs/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../../libs/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../../libs/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --navy-900: #071a3a;
  --navy-800: #0b2a5b;
  --navy-700: #12397a;
  --navy-600: #1d4d9c;
  --navy-100: #e7eef9;
  --navy-50: #f3f6fc;
  --gold: #c69a3c;
  --gold-soft: #f6eedb;
  --gold-strong: #8a6516; /* AA contrast with white text */
  --ink: #1b2433;
  --muted: #5d6879;
  --line: #e2e7ef;
  --surface: #ffffff;
  --bg: #f5f7fb;
  --radius: .65rem;
  --shadow-sm: 0 1px 2px rgba(7, 26, 58, .06), 0 1px 3px rgba(7, 26, 58, .08);
  --shadow: 0 6px 24px rgba(7, 26, 58, .08);
  --bs-primary: #0b2a5b;
  --bs-primary-rgb: 11, 42, 91;
  --bs-link-color: #12397a;
  --bs-link-color-rgb: 18, 57, 122;
  --bs-link-hover-color: #071a3a;
  --bs-body-font-family: "Inter", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: #1b2433;
  --bs-border-color: #e2e7ef;
}
html[lang="bn"] { --bs-body-font-family: "Hind Siliguri", "Inter", system-ui, sans-serif; }
html[lang="bn"] body { font-size: 1.02rem; line-height: 1.7; }
body { background: var(--bg); color: var(--ink); }
a { text-underline-offset: .15em; }
.btn-primary { --bs-btn-bg: var(--navy-800); --bs-btn-border-color: var(--navy-800); --bs-btn-hover-bg: var(--navy-700); --bs-btn-hover-border-color: var(--navy-700); --bs-btn-active-bg: var(--navy-900); --bs-btn-disabled-bg: var(--navy-600); }
.btn-outline-primary { --bs-btn-color: var(--navy-800); --bs-btn-border-color: var(--navy-800); --bs-btn-hover-bg: var(--navy-800); --bs-btn-hover-border-color: var(--navy-800); --bs-btn-active-bg: var(--navy-900); }
.btn-gold { background: var(--gold-strong); color: #fff; border-color: var(--gold-strong); }
.btn-gold:hover, .btn-gold:focus { background: #6f5011; color: #fff; }
/* Darker outline variants for WCAG AA text contrast on white */
.btn-outline-secondary { --bs-btn-color: #4a525a; --bs-btn-border-color: #8a939b; }
.btn-outline-success { --bs-btn-color: #11633c; --bs-btn-border-color: #198754; }
.btn-outline-warning { --bs-btn-color: #7a5600; --bs-btn-border-color: #c79100; --bs-btn-hover-color: #000; }
.btn-outline-info { --bs-btn-color: #075f70; --bs-btn-border-color: #0aa2c0; }
.btn-outline-danger { --bs-btn-color: #a61e2d; }
.text-muted { color: #5d6879 !important; }
.text-navy { color: var(--navy-800) !important; }
.text-gold { color: var(--gold) !important; }
.bg-navy { background: var(--navy-800) !important; color: #fff; }
.bg-navy-soft { background: var(--navy-50) !important; }
.form-control:focus, .form-select:focus { border-color: var(--navy-600); box-shadow: 0 0 0 .2rem rgba(29, 77, 156, .18); }
:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: #fff; padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: var(--surface); border-bottom: 1px solid var(--line); font-weight: 600; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--navy-50); font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
html[lang="bn"] .table thead th { text-transform: none; font-size: .88rem; letter-spacing: 0; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .bi { font-size: 2.25rem; color: #b5c0d3; display: block; margin-bottom: .5rem; }
.required::after { content: " *"; color: #c0392b; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Public site ---------- */
.topbar { background: var(--navy-900); color: #c9d4ea; font-size: .85rem; }
.topbar a { color: #e6ecf7; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--navy-800); }
.brand img { height: 64px; width: auto; }
.brand-mark { width: 60px; height: 60px; border-radius: 50%; background: var(--navy-800); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.25rem; border: 3px solid var(--gold); }
.brand-name { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.brand-sub { color: var(--muted); font-size: .88rem; }
.main-nav { background: var(--navy-800); }
.main-nav .nav-link { color: #e6ecf7 !important; font-weight: 500; padding: .85rem 1rem !important; }
.main-nav .nav-link:hover, .main-nav .nav-link.active, .main-nav .show > .nav-link { color: #fff !important; background: var(--navy-700); }
.main-nav .dropdown-menu { border-radius: 0 0 var(--radius) var(--radius); border: 0; box-shadow: var(--shadow); margin-top: 0; }
.main-nav .navbar-toggler { border-color: rgba(255, 255, 255, .4); }
.main-nav .navbar-toggler-icon { filter: invert(1); }
.ticker { background: var(--gold-soft); border-bottom: 1px solid #ecdcb4; font-size: .93rem; }
.ticker-label { background: var(--gold-strong); color: #fff; font-weight: 600; padding: .5rem 1rem; white-space: nowrap; }
.ticker-track { overflow: hidden; white-space: nowrap; flex: 1; }
.ticker-track ul { display: inline-flex; gap: 2.5rem; margin: 0; padding: .5rem 0 .5rem 100%; list-style: none; animation: ticker 40s linear infinite; }
.ticker-track:hover ul, .ticker-track:focus-within ul { animation-play-state: paused; }
.ticker-track a { color: var(--ink); text-decoration: none; }
@keyframes ticker { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track ul { animation: none; padding-left: 1rem; } }
.hero { position: relative; background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: #fff; }
.hero .carousel-item img { height: 460px; object-fit: cover; width: 100%; filter: brightness(.62); }
.hero .carousel-caption { text-align: left; bottom: 18%; left: 8%; right: 8%; }
.hero .carousel-caption h2 { font-weight: 700; font-size: clamp(1.5rem, 3.5vw, 2.6rem); text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.hero-plain { padding: 5rem 0; }
.section { padding: 3.5rem 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-weight: 700; color: var(--navy-800); position: relative; padding-bottom: .6rem; margin-bottom: 1.5rem; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 3px; background: var(--gold); border-radius: 2px; }
.text-center .section-title::after, .section-title.text-center::after { left: 50%; transform: translateX(-50%); }
.page-hero { background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 2.4rem 0 2rem; }
.page-hero h1 { font-weight: 700; font-size: clamp(1.4rem, 3vw, 2.1rem); margin: 0; }
.page-hero .breadcrumb { margin: .5rem 0 0; --bs-breadcrumb-divider-color: #9fb2d6; --bs-breadcrumb-item-active-color: #c9d4ea; }
.page-hero .breadcrumb a { color: #fff; }
.notice-list .list-group-item { border-left: 0; border-right: 0; padding: .85rem 0; background: transparent; }
.notice-date { min-width: 58px; text-align: center; background: var(--navy-50); border: 1px solid var(--navy-100); border-radius: .5rem; padding: .25rem; line-height: 1.1; color: var(--navy-800); }
.notice-date .d { font-size: 1.3rem; font-weight: 700; display: block; }
.notice-date .m { font-size: .72rem; text-transform: uppercase; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center; box-shadow: var(--shadow-sm); }
.stat-card .value { font-size: 2.1rem; font-weight: 700; color: var(--navy-800); }
.stat-card .label { color: var(--muted); }
.quick-link { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: .15s; height: 100%; }
.quick-link:hover { border-color: var(--navy-600); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--navy-800); }
.quick-link .bi { font-size: 1.6rem; color: var(--navy-700); background: var(--navy-50); border-radius: .6rem; padding: .45rem .6rem; }
.person-card { position: relative; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; height: 100%; }
.person-card img, .person-card .avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid var(--navy-100); margin-bottom: .75rem; }
.avatar { display: inline-grid; place-items: center; background: var(--navy-100); color: var(--navy-800); font-weight: 700; font-size: 2rem; }
.avatar-sm { width: 36px; height: 36px; font-size: .9rem; border-radius: 50%; object-fit: cover; }
.principal-photo { width: 100%; max-width: 260px; border-radius: var(--radius); border: 4px solid #fff; box-shadow: var(--shadow); }
.prose { max-width: 75ch; }
.prose img { max-width: 100%; height: auto; border-radius: .5rem; }
.prose table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: .45rem .6rem; }
.prose blockquote { border-left: 4px solid var(--gold); padding-left: 1rem; color: var(--muted); }
.gallery-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .5rem; background: var(--navy-100); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-thumb:hover img { transform: scale(1.05); }
.news-card img { aspect-ratio: 16 / 9; object-fit: cover; }
.ratio-embed { border-radius: var(--radius); overflow: hidden; }
.site-footer { background: var(--navy-900); color: #b8c5de; padding-top: 3rem; }
.site-footer h2 { color: #fff; font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem; }
.site-footer a { color: #dbe3f2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 1rem 0; margin-top: 2rem; font-size: .85rem; }
.site-footer .design-credit { font-family: Inter, "Hind Siliguri", sans-serif; letter-spacing: .01em; }
.site-footer .design-credit a { text-decoration: underline; text-underline-offset: 2px; }
.map-embed { width: 100%; height: 320px; border: 0; border-radius: var(--radius); }
.timeline { border-left: 3px solid var(--navy-100); padding-left: 1.25rem; }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before { content: ""; position: absolute; left: -1.72rem; top: .35rem; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--navy-100); }

/* ---------- Admin / portal ---------- */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex-shrink: 0; background: var(--navy-900); color: #c4cfe4; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand-mini { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar .brand-mini .brand-mark { width: 38px; height: 38px; font-size: .85rem; border-width: 2px; }
.sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7d8db0; padding: 1rem 1.25rem .35rem; }
.sidebar .nav-link { color: #c4cfe4; padding: .48rem 1.25rem; display: flex; align-items: center; gap: .65rem; border-left: 3px solid transparent; font-size: .93rem; }
.sidebar .nav-link .bi { font-size: 1.05rem; opacity: .85; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.sidebar .nav-link.active { color: #fff; background: rgba(255, 255, 255, .08); border-left-color: var(--gold); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1.25rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1020; }
.admin-content { padding: 1.5rem; flex: 1; }
.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.45rem; font-weight: 700; color: var(--navy-800); margin: 0; }
.kpi { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); display: flex; gap: 1rem; align-items: center; height: 100%; }
.kpi .icon { width: 46px; height: 46px; border-radius: .7rem; display: grid; place-items: center; font-size: 1.35rem; background: var(--navy-50); color: var(--navy-700); flex-shrink: 0; }
.kpi .value { font-size: 1.5rem; font-weight: 700; color: var(--navy-900); line-height: 1.1; }
.kpi .label { color: var(--muted); font-size: .85rem; }
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; margin-bottom: 1rem; }
.att-status .btn-check:checked + .btn-outline-success { background: #198754; color: #fff; }
.marks-input { width: 90px; }
.chart-box { position: relative; height: 260px; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -280px; z-index: 1045; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: var(--shadow); }
  .admin-content { padding: 1rem; }
  .hero .carousel-item img { height: 300px; }
}
.sidebar-backdrop { display: none; }
.sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1040; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); padding: 1.5rem; }
.auth-card { width: 100%; max-width: 430px; border: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }

/* ---------- Print documents ---------- */
.print-page { background: #fff; max-width: 210mm; margin: 1rem auto; padding: 14mm; box-shadow: var(--shadow); }
.print-head { display: flex; align-items: center; gap: 1rem; border-bottom: 3px double var(--navy-800); padding-bottom: .75rem; margin-bottom: 1rem; }
.print-head img { height: 70px; }
.print-head .school { flex: 1; text-align: center; }
.print-head .school h1 { font-size: 1.5rem; margin: 0; color: var(--navy-800); font-weight: 700; }
.doc-title { text-align: center; font-weight: 700; letter-spacing: .05em; margin: .5rem 0 1rem; text-transform: uppercase; color: var(--navy-800); }
.print-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.print-table th, .print-table td { border: 1px solid #9aa6b9; padding: .3rem .45rem; }
.print-table th { background: #eef2f8; }
.signature-row { display: flex; justify-content: space-between; margin-top: 3.5rem; text-align: center; }
.signature-row div { border-top: 1px solid #333; padding-top: .3rem; min-width: 150px; font-size: .85rem; }
.id-card { width: 86mm; height: 54mm; border: 1px solid #9aa6b9; border-radius: 3mm; overflow: hidden; display: inline-flex; flex-direction: column; margin: 3mm; page-break-inside: avoid; background: #fff; font-size: 8.5pt; vertical-align: top; }
.id-card .top { background: var(--navy-800); color: #fff; padding: 1.5mm 3mm; text-align: center; font-weight: 700; font-size: 9pt; }
.id-card .body { display: flex; gap: 3mm; padding: 2.5mm 3mm; flex: 1; }
.id-card .photo { width: 22mm; height: 27mm; object-fit: cover; border: 1px solid #ccd; background: var(--navy-50); }
.id-card .foot { background: var(--gold); height: 2mm; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff !important; }
  .no-print, .admin-topbar, .sidebar, .site-header, .site-footer, .main-nav, .topbar { display: none !important; }
  .print-page { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .admin-content { padding: 0; }
  a { text-decoration: none; color: inherit; }
  .page-break { page-break-after: always; }
}

/* Official letters on the school letterhead */
.letter-page { position: relative; min-height: 297mm; display: flex; flex-direction: column; font-size: 11.5pt; line-height: 1.6; }
.letterhead { display: flex; align-items: center; gap: 1rem; border-bottom: 3px double var(--navy-800); padding-bottom: .6rem; margin-bottom: 1.2rem; }
.letterhead img { height: 78px; width: auto; }
.letterhead .brand-mark { width: 78px; height: 78px; flex: 0 0 78px; font-size: 2rem; display: inline-flex; align-items: center; justify-content: center; }
.letterhead .lh-text { flex: 1; text-align: center; padding-right: 78px; }
.letterhead h1 { font-size: 1.6rem; margin: 0; color: var(--navy-800); font-weight: 700; }
.letterhead .lh-en { font-weight: 600; color: var(--navy-800); }
.letter-plain { padding-top: 50mm; }
.letter-meta { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.letter-to { margin-bottom: 1rem; }
.letter-subject { margin-bottom: 1rem; }
.letter-body p { text-align: justify; margin-bottom: .8rem; }
.letter-sign { margin-top: 3rem; margin-left: auto; text-align: center; min-width: 220px; }
.letter-sign .sign-line { border-top: 1px solid #333; margin-bottom: .3rem; }
.letterfoot { margin-top: auto; border-top: 1px solid #9aa6b9; padding-top: .4rem; text-align: center; font-size: 8.5pt; color: #555; }
@media print { .letter-page { min-height: 277mm; } }

/* Faint school logo behind report cards; text stays fully readable */
.print-page.has-watermark { position: relative; overflow: hidden; }
.print-page.has-watermark > *:not(.watermark) { position: relative; z-index: 1; }
.print-page .watermark { position: absolute; top: 50%; left: 50%; width: 55%; max-width: 110mm; transform: translate(-50%, -50%); opacity: .06; z-index: 0; pointer-events: none; }
@media print { .print-page .watermark { opacity: .07; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* Class result sheet (notice board): landscape, compact, every student of a class on one page */
.print-page.result-sheet { max-width: 297mm; }
.result-table { font-size: 8.5pt; width: 100%; }
.result-table th, .result-table td { text-align: center; padding: 2px 3px; white-space: nowrap; }
.result-table td.text-start, .result-table th.text-start { text-align: left; white-space: normal; }
.result-table .g { display: block; font-size: 7pt; color: #555; }
.result-table tr.fail td { background: #fdf0f0; }
@media print { .print-page.result-sheet { max-width: none; } .result-table tr { page-break-inside: avoid; } }
.result-sheet .print-head { padding-bottom: .3rem; margin-bottom: .4rem; }
.result-sheet .print-head img, .result-sheet .print-head .brand-mark { height: 46px; width: auto; }
.result-sheet .doc-title { margin: .2rem 0 .4rem; }
.result-sheet .signature-row { margin-top: 1.6rem; }
.result-table th, .result-table td { padding: 1px 3px; }
