:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #5d6676;
  --line: #e3dfd6;
  --primary: #0f5c4d;
  --primary-ink: #ffffff;
  --primary-soft: #e3f0ec;
  --accent: #d9822b;
  --danger: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 4px 16px rgba(20, 30, 40, .05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b212a;
    --ink: #e8ebf0;
    --muted: #9aa3b2;
    --line: #2c3440;
    --primary: #3fb39a;
    --primary-ink: #0b1512;
    --primary-soft: #18302b;
    --accent: #f0a050;
    --danger: #f2706a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Oriya", "Noto Sans", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h2 { font-size: 1.25rem; margin-top: 1.6em; }
h3 { font-size: 1.05rem; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.main { flex: 1; padding-block: 32px 56px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.inline { display: inline; margin: 0; }
.odia { font-weight: 400; color: var(--muted); font-size: .9em; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 600; color: var(--accent); margin: 0 0 .5em; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 66px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-right: auto; }
.brand img { border-radius: 6px; object-fit: cover; }
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.2; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .btn-link {
  padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .95rem;
}
.nav a:hover, .btn-link:hover { background: var(--primary-soft); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav .btn { color: var(--primary-ink); }
.nav-user { font-weight: 600; }
.btn-link { background: none; border: 0; font: inherit; cursor: pointer; }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 820px) {
  .brand small { display: none; }
  .nav-burger { display: block; width: 40px; height: 40px; cursor: pointer; position: relative; }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    position: absolute; left: 10px; width: 20px; height: 2px; background: var(--ink); content: "";
  }
  .nav-burger span { top: 19px; }
  .nav-burger span::before { top: -6px; left: 0; }
  .nav-burger span::after { top: 6px; left: 0; }
  .nav:not(.nav-plain) { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav-toggle:checked ~ .nav { display: flex; }
}

/* Buttons */
.btn {
  display: inline-block; background: var(--primary); color: var(--primary-ink); border: 1px solid var(--primary);
  padding: 10px 18px; border-radius: 10px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 12px; font-size: .875rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 1.2em 0; }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card p:last-child { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid-2 > .card, .grid-3 > .card { margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h1, .section-head h2 { margin: 0; }

/* Landing */
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 24px 40px; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 38em; }
.hero-logo { border-radius: 20px; box-shadow: var(--shadow); justify-self: center; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-logo { max-width: 240px; order: -1; } }

/* Auth */
.auth-card { max-width: 440px; margin: 24px auto; padding: 28px; }
.auth-card.wide { max-width: 640px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > label { flex: 1 1 180px; }
.row > label.grow { flex: 3 1 220px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); width: 100%;
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.alert-error { color: var(--danger); border-color: currentColor; background: color-mix(in srgb, var(--danger) 8%, transparent); }
.alert-success { color: var(--primary); border-color: currentColor; background: var(--primary-soft); }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0 28px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; color: var(--muted); font-size: .9rem; }
.stat span { display: block; font-size: 1.9rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.notice { border-left: 4px solid var(--accent); }
.about { margin-top: 40px; }
.about .lead { margin-bottom: 20px; }
.about .grid-2 { margin-bottom: 16px; }
.about-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.notice-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.notice-list a { font-weight: 600; }
.notice-list span { display: block; }
.news-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
.news-card:hover { border-color: var(--primary); }
.news-card time, .article time { color: var(--accent); font-size: .82rem; font-weight: 600; display: block; margin-bottom: 4px; }
.news-card p { color: var(--muted); margin: 0; }
.article { max-width: 760px; padding: 32px; }
.article time { margin-top: 16px; }

/* Team */
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input, .search select { width: auto; flex: 1 1 180px; padding: 7px 12px; }
.doc-filter { margin-bottom: 8px; }
.doc-filter input[type="search"] { flex: 2 1 220px; }
.district h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.person { display: flex; gap: 14px; align-items: center; margin: 0; padding: 14px 16px; }
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .9rem; text-transform: uppercase;
}

/* Services */
.service { display: block; color: inherit; text-decoration: none; }
.service:hover { border-color: var(--primary); }
.service p { color: var(--muted); }
.link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.link-list .card { margin: 0; padding: 14px 16px; }
.link-list h3 { margin: 0 0 2px; color: var(--primary); }
.link-list p { margin: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn, .actions-cell form { margin: 2px 0; }

/* Admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; background: var(--surface); }
.pill.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* Digital signatures — always on white, since signatures are dark ink */
.sig-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 14px; text-align: center; }
.sig-box img { max-height: 140px; object-fit: contain; }
.sig-thumb { width: 180px; padding: 4px; margin: 0; }
.sig-thumb img { max-height: 60px; }
.sheet-page { background: #fff; color: #000; }
.sheet { max-width: 1000px; margin: 0 auto; padding: 24px 16px; }
.sheet-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sheet-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 12px; }
.sheet table { font-size: .85rem; }
.sheet th, .sheet td { border: 1px solid #999; padding: 6px 8px; color: #000; }
.sheet th { background: #eee; }
.sheet tr { break-inside: avoid; }
.sheet-sig { width: 160px; max-height: 60px; object-fit: contain; }
@media print {
  .sheet-toolbar { display: none; }
  .sheet { max-width: none; padding: 0; }
  @page { margin: 12mm; }
}

/* Employee photo (passport size, 35 × 45 mm) */
.photo { width: 120px; aspect-ratio: 35 / 45; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); }
.photo-empty { display: grid; place-items: center; }
.photo-thumb { width: 44px; display: block; }
.photo-field { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-field label { flex: 1 1 240px; }
.form label .hint { font-weight: 400; }
.forgot-link { margin: -6px 0 0; text-align: right; }
.pw-rules { list-style: none; margin: -4px 0 0; padding: 10px 14px; border-radius: 8px; background: var(--bg); color: var(--muted); display: grid; gap: 2px; }
.pw-rules li::before { content: '○'; display: inline-block; width: 1.4em; }
.pw-rules li.ok { color: var(--primary); }
.pw-rules li.ok::before { content: '✓'; font-weight: 700; }
.pw-rules li.bad { color: var(--danger); }
.pw-rules li.bad::before { content: '✗'; }
.employee-card { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.employee-card .details { flex: 1 1 300px; }
.employee-card .actions { flex-basis: 100%; margin-bottom: 0; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-block: 24px; }
