:root {
  --brand: #17594A;
  --brand-dark: #0F3D33;
  --brand-50: #EEF6F3;
  --brand-100: #D7EAE3;
  --accent: #F5B942;
  --accent-dark: #B97F0B;
  --ink: #14231F;
  --ink-2: #44554F;
  --ink-3: #6F7F79;
  --line: #E2E8E5;
  --bg: #F6F8F7;
  --card: #FFFFFF;
  --ok: #1E7A4C;
  --ok-bg: #E6F4EC;
  --warn: #9A6400;
  --warn-bg: #FFF4DB;
  --bad: #B3261E;
  --bad-bg: #FCE9E7;
  --info: #1D5FA8;
  --info-bg: #E7F0FB;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 32, .06), 0 4px 16px rgba(16, 40, 32, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans Devanagari", "Noto Sans", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.55; }
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.12rem; }
.brand img { width: 36px; height: 36px; }
.brand small { display: block; font-weight: 500; font-size: .7rem; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; margin-top: -3px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 10px; font-weight: 550; font-size: .95rem; }
.nav a:hover { background: var(--brand-50); color: var(--brand); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; background: var(--brand); padding: 6px 14px; }
.nav a.btn-primary:hover { background: var(--brand-dark); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; padding: 11px 18px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; min-height: 46px; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #2B1D00; }
.btn-accent:hover { background: #EAA92A; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* forms */
label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 6px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #CBD6D1; border-radius: 10px; padding: 11px 12px; min-height: 46px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 89, 74, .15); }
.hint { font-size: .82rem; color: var(--ink-3); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .92rem; color: var(--ink-2); }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--brand); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--brand-50); padding: 5px; border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font: inherit; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.gray { background: #EEF1F0; color: var(--ink-3); }
.chip { display: inline-block; font-size: .8rem; padding: 3px 9px; border-radius: 8px; background: #F1F4F3; color: var(--ink-2); margin: 0 4px 4px 0; }

/* alerts / toast */
.alert { padding: 12px 14px; border-radius: 11px; font-size: .93rem; margin-bottom: 14px; border: 1px solid transparent; }
.alert.err { background: var(--bad-bg); color: var(--bad); border-color: #F4C7C2; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: #BFE3CE; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: #F3DDA6; }
.alert.info { background: var(--info-bg); color: var(--info); border-color: #C6DAF3; }
.toast { pointer-events: none; visibility: hidden; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; transition: .25s; z-index: 100; max-width: calc(100% - 32px); font-size: .95rem; }
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* stats */
.stat { padding: 18px; }
.stat .k { font-size: .82rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat .s { font-size: .82rem; color: var(--ink-3); }
.stat .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); float: right; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: #FAFBFB; font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FAFCFB; }

/* footer */
.footer { border-top: 1px solid var(--line); background: #fff; margin-top: 56px; padding: 28px 0; font-size: .9rem; color: var(--ink-3); }
.footer .container { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--brand); }

/* doc pages */
.doc { max-width: 760px; margin: 40px auto; padding: 0 20px; }
.doc .card { padding: 32px; }
.doc h1 { font-size: 2rem; }
.doc h2 { margin-top: 1.6em; font-size: 1.2rem; color: var(--brand-dark); }
.doc .eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); font-weight: 700; }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty svg { width: 56px; height: 56px; color: var(--brand-100); margin-bottom: 8px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .nav .hide-sm { display: none; }
  .card { padding: 16px; }
  .doc .card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.announce { background: var(--accent); color: #2B1D00; text-align: center; font-weight: 650; padding: 9px 16px; font-size: .92rem; }
.contact-line { margin-top: 14px; font-size: .88rem; color: var(--ink-2); }
.contact-line a { color: var(--ink-2); }
.contact-card { margin-top: 16px; }
.doc ul { padding-left: 20px; }

.langbtn { font-weight: 700; font-size: .85rem; color: var(--brand); background: var(--brand-50); border-radius: 999px; padding: 6px 12px; text-decoration: none; white-space: nowrap; flex: none; }
.langbtn:hover { background: var(--brand-100); }
