/* School ERP — एक ही CSS फ़ाइल, बिना बाहरी लाइब्रेरी के (तेज़ लोडिंग के लिए) */
:root {
  --school: #3b5bdb;
  --ink: #1b2236;
  --ink-2: #4a5470;
  --muted: #78819a;
  --line: #e3e6ee;
  --bg: #f4f5f9;
  --card: #fff;
  --side: #1f2a44;
  --side-ink: #c9d0e3;
  --good: #15803d;
  --good-bg: #e7f6ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #9a5b00;
  --warn-bg: #fff4dc;
  --info-bg: #e9efff;
  --r: 10px;
  --font: "Noto Sans Devanagari", "Nirmala UI", "Mangal", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--school); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: #eef0f6; padding: 1px 6px; border-radius: 5px; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h3 { font-size: 1.05rem; }
small { font-size: .82em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .85rem; margin: .4em 0 1em; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }

/* ---------- ढाँचा ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 256px; flex: 0 0 256px; background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-bottom: 24px; }
.brand { display: flex; gap: 12px; align-items: center; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: #fff; }
.brand strong { display: block; color: #fff; font-size: .98rem; }
.brand small { display: block; color: var(--side-ink); opacity: .75; font-size: .75rem; line-height: 1.3; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: var(--school); color: #fff; font-weight: 700; flex: none; }
.brand-mark.big { width: 64px; height: 64px; border-radius: 16px; font-size: 1.2rem; background: var(--side); }
.switch { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.switch label { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--side-ink); margin-bottom: 6px; }
.switch select { width: 100%; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; padding: 8px 10px; font: inherit; }
.switch option { color: var(--ink); }
nav { padding: 8px 8px 0; }
.nav-group { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: rgba(201,208,227,.55); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-size: .92rem; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on { background: var(--school); color: #fff; }
.nav-item.soon { opacity: .45; cursor: default; }
.nav-item.soon:hover { background: none; color: var(--side-ink); }
.nav-item em { margin-left: auto; white-space: nowrap; flex: none; font-style: normal; font-size: .68rem; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; padding: 0 7px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top h1 { font-size: 1.15rem; margin: 0; flex: 1; }
.who { display: flex; align-items: center; gap: 6px; }
.who form { margin: 0; }
.who-name { text-align: right; font-size: .88rem; line-height: 1.2; margin-right: 4px; }
.who-name small { display: block; color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--bg); }
.lang-btn { display: inline-grid; place-items: center; min-width: 40px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--school); font-weight: 700; font-size: .86rem; text-decoration: none; }
.lang-btn:hover { background: var(--info-bg); }
.login-box { position: relative; }
.login-lang { position: absolute; top: 14px; right: 14px; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1180px; width: 100%; }
.foot { padding: 16px 24px; color: var(--muted); font-size: .8rem; margin-top: auto; }
.scrim { display: none; }

/* ---------- कार्ड, फ़ॉर्म ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.card.narrow { max-width: 460px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .lead { margin: 0; color: var(--ink-2); }
.page-head form { margin: 0; }
label { display: block; font-size: .85rem; color: var(--ink-2); margin-bottom: 12px; }
.label { font-size: .85rem; color: var(--ink-2); margin: 0 0 4px; display: block; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid #cfd4e0; border-radius: 8px; padding: 9px 11px; min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--school) 35%, transparent); border-color: var(--school); }
input[type=checkbox] { display: inline-block; width: 18px; min-height: 0; height: 18px; margin: 0 6px 0 0; vertical-align: -3px; accent-color: var(--school); }
input[type=color] { padding: 3px; height: 42px; width: 80px; }
input[type=file] { padding: 7px; }
input:disabled { background: var(--bg); color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px 4px; margin: 0 0 16px; }
legend { font-size: .9rem; font-weight: 600; padding: 0 6px; display: flex; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.span2 { grid-column: span 2; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.checks.perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.check { display: flex; align-items: center; color: var(--ink); font-size: .92rem; margin-bottom: 8px; }
.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline input:not([type=checkbox]) { flex: 1; min-width: 200px; margin-top: 0; }
.inline-label { display: flex; align-items: center; gap: 8px; margin: 0; }
.inline-label input { margin: 0; }
.w-sm, input.w-sm { width: 90px; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters label { margin: 0; flex: 1; min-width: 150px; }
.row-actions { display: flex; gap: 10px; }
.pw-wrap { position: relative; display: block; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 2px; border: 0; background: none; color: var(--school); font: inherit; font-size: .82rem; cursor: pointer; padding: 6px; }
.logo-field .logo-preview { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; display: block; margin: 4px 0 8px; background: #fff; }

/* ---------- बटन ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid #cfd4e0; background: #fff; color: var(--ink); font: inherit; font-size: .92rem; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--school); border-color: var(--school); color: #fff; }
.btn.primary:hover { filter: brightness(.93); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--school); }
.btn.ghost:hover { background: var(--info-bg); }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--bad); }
.btn.danger-ghost:hover { background: var(--bad-bg); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .84rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- संदेश ---------- */
.alert { border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; font-size: .93rem; border: 1px solid transparent; }
.alert.success { background: var(--good-bg); color: #14532d; border-color: #b7e2c4; }
.alert.error { background: var(--bad-bg); color: #7a1a12; border-color: #f4c2bd; }
.alert.warn { background: var(--warn-bg); color: #6b3f00; border-color: #f3d898; }
.alert.info { background: var(--info-bg); color: #1e3a8a; border-color: #c8d5fb; }
.alert.big { font-size: 1rem; padding: 16px 18px; }
.alert .cred { margin: 10px 0; font-size: 1.05rem; }
.alert .cred code { font-size: 1.05rem; background: #fff; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 20px; background: #eef0f6; color: var(--ink-2); }
.badge.good { background: var(--good-bg); color: var(--good); }

/* ---------- टेबल ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .8rem; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td input { margin: 0; }
.tbl tr.off td { opacity: .55; }
.tbl .acts { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.tbl .acts form { margin: 0; }
.tbl .details { font-size: .84rem; color: var(--ink-2); max-width: 420px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }
.switch-ui { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; }
.switch-ui input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-ui span { position: absolute; inset: 0; background: #cfd4e0; border-radius: 24px; cursor: pointer; transition: .15s; }
.switch-ui span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch-ui input:checked + span { background: var(--good); }
.switch-ui input:checked + span::before { transform: translateX(18px); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--school); border-bottom-color: var(--school); font-weight: 600; }

/* ---------- डैशबोर्ड ---------- */
.hello h2 { font-size: 1.4rem; margin-bottom: .1em; }
.hello p { margin: 0 0 18px; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.good b { color: var(--good); }
.stat.bad b { color: var(--bad); }
.phases { list-style: none; padding: 0; margin: 0; counter-reset: ph; }
.phases li { display: flex; flex-direction: column; padding: 10px 0 10px 34px; border-bottom: 1px dashed var(--line); position: relative; }
.phases li:last-child { border-bottom: 0; }
.phases li::before { content: ""; position: absolute; left: 6px; top: 15px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #cfd4e0; }
.phases li.done::before { background: var(--good); border-color: var(--good); }
.phases li span { color: var(--muted); font-size: .86rem; }
.todo { margin: 0; padding-left: 20px; }
.todo li { margin-bottom: 6px; }

pre.copy { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: .84rem; cursor: pointer; position: relative; white-space: pre-wrap; word-break: break-all; }
pre.copy::after { content: attr(data-hint); position: absolute; right: 10px; top: 8px; font-family: var(--font); font-size: .7rem; color: #94a3b8; }
pre.copy.copied::after { content: attr(data-done); color: #86efac; }
.danger-zone { border-color: #f4c2bd; }

/* ---------- लॉगिन / इंस्टॉल ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: linear-gradient(160deg, #eef1f8, #e4e8f3); }
.login-box { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; box-shadow: 0 10px 40px rgba(27,34,54,.08); }
.install-box { width: 100%; max-width: 760px; }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand h1 { font-size: 1.35rem; margin: 12px 0 2px; }
.login-brand p { margin: 0; color: var(--muted); font-size: .88rem; }
.checklist { list-style: none; padding: 0; margin: 0; columns: 2; }
.checklist li { margin-bottom: 4px; }
.checklist .ok { color: var(--good); }
.checklist .bad { color: var(--bad); font-weight: 600; }
.steps li { margin-bottom: 8px; }

/* ---------- मोबाइल ---------- */
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 20; }
  .menu-btn { display: inline-grid; }
  .top { padding: 10px 14px; }
  .who-name { display: none; }
  .content { padding: 16px 12px; }
  .card { padding: 16px 14px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .checklist { columns: 1; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; margin-bottom: 10px; background: #fff; }
  .tbl td { border: 0; padding: 5px 0; }
  .tbl td[data-l]::before { content: attr(data-l); display: block; font-size: .74rem; color: var(--muted); }
  .tbl .acts { justify-content: flex-start; }
  .tbl td.w-sm { display: inline-block; width: auto; margin-right: 10px; }
}
@media print {
  .side, .top, .foot, .btn { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}
