/* =========================================================
   ATSE Panel - design (blue theme, matches the public website)
   ========================================================= */
:root {
  --blue: #0D3B8C; --navy: #082457; --navy-2: #0A2E6E; --sky: #1565C0; --sky-50: #EAF1FB;
  --gold: #F5B82E; --gold-ink: #2A1300; --saffron: #F07A1A; --orange: #C2560A;
  --green: #2E7D32; --green-50: #E6F4E7; --red: #C62828; --red-50: #FCEAEA; --teal: #0F7C7A;
  --bg: #F2F6FC; --card: #FFFFFF; --ink: #14213D; --ink-2: #4A5873; --line: #E2E8F3; --line-2: #CBD6E8;
  --shadow: 0 1px 2px rgba(13,59,140,.06), 0 4px 14px rgba(13,59,140,.06);
  --radius: 14px; --side-w: 264px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Mukta', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15.5px; line-height: 1.55; }
a { color: var(--sky); text-decoration: none; }
a:hover { color: var(--orange); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); } .small { font-size: 13.5px; }
h2 { font-size: 19px; margin: 0 0 12px; color: var(--blue); line-height: 1.3; }
h3 { font-size: 16.5px; margin: 0 0 10px; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--sky-50); padding: 1px 6px; border-radius: 6px; font-size: 14px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex-shrink: 0; background: var(--navy); color: #DCE6F7; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand:hover { color: #fff; }
.brand img { background: #fff; border-radius: 50%; padding: 2px; }
.brand b { display: block; font-size: 18px; line-height: 1.2; }
.brand small { display: block; font-size: 12.5px; color: #AFC3E6; }
.side nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #DCE6F7; font-weight: 600; font-size: 15px; line-height: 1.2; }
.nav small { display: block; font-weight: 400; font-size: 12px; color: #93A9D2; }
.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav.is-active { background: var(--gold); color: var(--gold-ink); }
.nav.is-active small { color: #6B4A00; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; background: rgba(242,246,252,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 12px 28px; }
.top-title { flex: 1; min-width: 0; }
.top-title h1 { margin: 0; font-size: 21px; line-height: 1.25; color: var(--navy); }
.top-title p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--navy); align-items: center; justify-content: center; cursor: pointer; }
.year-form { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 4px 0 10px; color: var(--blue); }
.year-form select { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--navy); padding: 8px 4px; cursor: pointer; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.who-txt b { display: block; font-size: 14.5px; line-height: 1.2; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-txt small { display: block; font-size: 12px; color: var(--ink-2); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 24px 28px 40px; flex: 1; display: flex; flex-direction: column; gap: 20px; }
.foot { padding: 14px 28px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--line); }
.scrim { position: fixed; inset: 0; background: rgba(8,36,87,.45); z-index: 35; }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat { display: flex; gap: 14px; align-items: center; padding: 18px; color: var(--ink); }
.stat:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.stat .ico { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat .ico .ic { width: 24px; height: 24px; }
.stat b { display: block; font-size: 28px; line-height: 1.1; font-weight: 800; }
.stat span { font-size: 14px; color: var(--ink-2); }
.t-blue .ico { background: var(--sky-50); color: var(--sky); } .t-gold .ico { background: #FFF3D6; color: #8A6200; }
.t-green .ico { background: var(--green-50); color: var(--green); } .t-orange .ico { background: #FDEBD6; color: var(--orange); }

.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: 74px 1fr 52px; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { display: block; height: 12px; background: var(--sky-50); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--sky), var(--blue)); border-radius: 6px; }
.bar b { text-align: right; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid transparent; background: var(--blue); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn .ic { width: 18px; height: 18px; }
.btn-gold { background: var(--gold); color: var(--gold-ink); } .btn-gold:hover { background: #E9A815; color: var(--gold-ink); }
.btn-ghost { background: #fff; color: var(--blue); border-color: var(--line-2); } .btn-ghost:hover { background: var(--sky-50); color: var(--navy); }
.btn-danger { background: #fff; color: var(--red); border-color: #F0C2C2; } .btn-danger:hover { background: var(--red-50); color: var(--red); }
.btn-wa { background: #1F8F4E; } .btn-wa:hover { background: #17733E; }
.btn-sm { min-height: 34px; padding: 4px 10px; font-size: 13.5px; border-radius: 8px; }
.btn-icon { min-height: 34px; width: 34px; padding: 0; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; min-width: 0; }
label.f > span.req::after { content: " *"; color: var(--red); }
.hint { font-weight: 400; color: var(--ink-2); font-size: 12.5px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 15.5px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(21,101,192,.16); }
.has-err input, .has-err select, .has-err textarea, input.err, select.err { border-color: var(--red); background: #FFF8F8; }
.err-msg { color: var(--red); font-size: 13px; font-weight: 600; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }

/* alerts */
.alert { padding: 12px 16px; border-radius: 12px; font-weight: 600; border: 1.5px solid; }
.alert-ok { background: var(--green-50); color: #1B5E20; border-color: #A7D3AA; }
.alert-error { background: var(--red-50); color: #8A1C1C; border-color: #EDB5B5; }
.alert-info { background: var(--sky-50); color: var(--navy); border-color: #BCD2F0; }
.alert ul { margin: 6px 0 0 18px; padding: 0; font-weight: 500; }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; background: #F6F9FE; color: var(--ink-2); font-weight: 700; font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #FAFCFF; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .acts { white-space: nowrap; text-align: right; }
.tbl .acts form { display: inline; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.tag { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--sky-50); color: var(--blue); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tag-gold { background: #FFF3D6; color: #7A5600; } .tag-green { background: var(--green-50); color: var(--green); } .tag-red { background: var(--red-50); color: var(--red); } .tag-grey { background: #EEF1F6; color: #4A5873; }
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 12px; }
.pg { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-weight: 700; padding: 0 8px; }
.pg.is-on { background: var(--blue); color: #fff; border-color: var(--blue); }
.gap { color: var(--ink-2); }

/* bulk entry grid */
.grid-entry { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.grid-entry th { position: sticky; top: 0; background: #F6F9FE; text-align: left; padding: 8px; font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid-entry td { padding: 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid-entry input, .grid-entry select { min-height: 38px; padding: 6px 8px; font-size: 14.5px; border-radius: 8px; min-width: 96px; }
.grid-entry .rn { color: var(--ink-2); font-weight: 700; text-align: center; padding-top: 12px; width: 34px; }
.grid-entry tr.row-err td { background: #FFF6F6; }
.grid-entry tr.row-ok td { background: #F3FAF3; }
.row-msg { display: block; font-size: 12px; color: var(--red); font-weight: 600; padding: 2px 4px 0; }
.dob { display: flex; gap: 4px; }
.dob select { min-width: 64px; }

/* credentials card */
.cred { border: 1.5px dashed var(--gold); background: #FFFBF0; border-radius: 14px; padding: 16px; }
.cred-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cred dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; }
.cred dt { color: var(--ink-2); font-size: 14px; } .cred dd { margin: 0; overflow-wrap: anywhere; }
.cred-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }

/* login page */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.login-art { background: radial-gradient(circle at 20% 15%, #1C55B5 0, var(--blue) 38%, var(--navy) 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.login-art .logos { display: flex; gap: 14px; }
.login-art .logos img { width: 84px; height: 84px; background: #fff; border-radius: 50%; padding: 3px; }
.login-art h1 { font-size: 34px; line-height: 1.25; margin: 0 0 10px; }
.login-art p { color: #C9D8F2; margin: 0; font-size: 16.5px; }
.login-art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.login-art li { display: flex; gap: 12px; align-items: flex-start; color: #E5EDFA; }
.login-art li .ic { color: var(--gold); margin-top: 3px; }
.login-box { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 430px; }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #E6EDF8; padding: 5px; border-radius: 12px; margin-bottom: 18px; }
.role-tabs label { cursor: pointer; text-align: center; padding: 9px 6px; border-radius: 9px; font-weight: 700; color: var(--ink-2); line-height: 1.2; }
.role-tabs label small { display: block; font-weight: 500; font-size: 12px; }
.role-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.role-tabs input:checked + label { background: #fff; color: var(--blue); box-shadow: var(--shadow); }
.role-tabs input:focus-visible + label { outline: 3px solid var(--gold); }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; padding: 6px; }

/* print */
@media print {
  .side, .top, .foot, .no-print, .pager, .alert { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .content { padding: 0; } .card { box-shadow: none; border: 0; padding: 0; }
  .tbl-wrap { border: 0; overflow: visible; } .tbl th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tbl td, .tbl th { padding: 4px 6px; border: 1px solid #999; }
  .print-head { display: block !important; }
}
.print-head { display: none; text-align: center; margin-bottom: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .side.is-open { transform: none; }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 14px; flex-wrap: wrap; }
  .who-txt { display: none; }
  .content { padding: 16px 14px 32px; gap: 16px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .login-page { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: 28px 20px; } .login-art ul { display: none; } .login-art h1 { font-size: 24px; }
  .login-art .logos img { width: 60px; height: 60px; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; } .stat .ico { width: 40px; height: 40px; } .stat b { font-size: 22px; }
  .year-form { order: 3; width: 100%; } .year-form select { flex: 1; }
  .top-title h1 { font-size: 18px; }
  .card { padding: 14px; }
  /* tables become cards on phones */
  .tbl-wrap.stack { border: 0; background: none; }
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 4px; }
  .tbl.stack td { border: 0; padding: 4px 10px; display: flex; gap: 10px; justify-content: space-between; text-align: right; }
  .tbl.stack td::before { content: attr(data-l); color: var(--ink-2); font-size: 12.5px; font-weight: 700; text-align: left; }
  .tbl.stack td.acts { justify-content: flex-end; }
  .tbl.stack td.acts::before { content: ""; }
}

/* language switch (English / मराठी) */
.lang-sw { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; flex: none; }
.lang-sw a { padding: 7px 11px; font-size: 13.5px; font-weight: 700; color: var(--blue); text-decoration: none; line-height: 1.2; }
.lang-sw a + a { border-left: 1px solid var(--line-2); }
.lang-sw a.is-on { background: var(--blue); color: #fff; }
.lang-sw a:not(.is-on):hover { background: var(--sky-50); }
.login-box { position: relative; }
.login-lang { position: absolute; top: 18px; right: 20px; }
@media (max-width: 720px) { .top .lang-sw a { padding: 6px 8px; font-size: 12.5px; } }
@media print { .lang-sw { display: none; } }

/* side menu groups: name opens the page, + opens the sub-links */
.nav-row { display: flex; align-items: center; gap: 4px; }
.nav-row .nav { flex: 1; min-width: 0; }
.nav-toggle { flex: none; width: 24px; height: 24px; margin-right: 4px; border: 0; border-radius: 6px; background: rgba(255,255,255,.06); color: #DCE6F7; cursor: pointer; display: grid; place-items: center; }
.nav-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.nav-toggle span { position: relative; width: 9px; height: 9px; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; top: 4px; width: 9px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform .2s; }
.nav-toggle span::after { transform: rotate(90deg); }
.nav-group.is-open .nav-toggle span::after { transform: rotate(0deg); }
.subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 23px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.14); }
.subnav a { padding: 7px 10px; border-radius: 8px; font-size: 14px; color: #BFD0EE; line-height: 1.25; }
.subnav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.subnav a.is-current { color: #fff; font-weight: 700; background: rgba(255,255,255,.1); }
@media (prefers-reduced-motion: reduce) { .nav-toggle span::before, .nav-toggle span::after { transition: none; } }
.subnav[hidden] { display: none; }
