/* =====================================================================
   SarkariAgent — clean government-portal style UI
   Navy authority palette · tricolor accent · large readable controls
   ===================================================================== */
:root {
  --navy: #14335f;
  --navy-dark: #0d2547;
  --navy-mid: #1d4a87;
  --navy-soft: #e8eef7;
  --saffron: #e07b00;
  --green: #1a7f37;
  --red: #c0392b;
  --amber: #b45309;
  --blue: #1d5fa8;
  --purple: #6d28d9;
  --bg: #f2f5f9;
  --card: #ffffff;
  --border: #d9e1ec;
  --text: #1d2937;
  --muted: #5b6b7d;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 42, 78, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans Devanagari", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 15.5px; line-height: 1.55; color: var(--text); background: var(--bg); }
img { max-width: 100%; }
a { color: var(--navy-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.small { font-size: .85rem; } .muted { color: var(--muted); }
.ic { vertical-align: -3px; }
:focus-visible { outline: 3px solid #7fa8e0; outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 14px; z-index: 999; }
.skip-link:focus { left: 8px; }

/* Tricolor strip — quiet national accent */
.tricolor { display: flex; height: 4px; }
.tricolor span { flex: 1; }
.tricolor span:nth-child(1) { background: #f5941e; }
.tricolor span:nth-child(2) { background: #ffffff; border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; }
.tricolor span:nth-child(3) { background: #138808; }

/* ============ Topbar ============ */
.topbar { display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--border); padding: 8px 16px; position: sticky; top: 0; z-index: 60; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.site-logo { height: 38px; width: auto; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.balance-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: #fff; font-weight: 700; padding: 7px 14px; border-radius: 30px; font-size: .95rem; }
.balance-chip:hover { background: var(--navy-mid); text-decoration: none; }
.lang-form select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-family: inherit; font-size: .9rem; }
.user-chip { display: flex; align-items: center; gap: 7px; background: var(--navy-soft); padding: 6px 12px; border-radius: 8px; font-size: .9rem; }
.user-chip small { color: var(--muted); }
.hamburger { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 42px; height: 40px; cursor: pointer; padding: 9px 10px; }
.hamburger span { display: block; height: 2px; background: var(--navy); margin: 4px 0; border-radius: 2px; }

/* ============ Layout: sidebar + content ============ */
.layout { display: flex; min-height: calc(100vh - 62px); }
.sidebar { width: 248px; background: var(--navy); color: #dbe6f5; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-logo { display: flex; gap: 10px; align-items: center; padding: 16px 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-logo img { height: 40px; background: #fff; border-radius: 8px; padding: 3px; }
.sidebar-logo strong { color: #fff; display: block; font-size: .98rem; line-height: 1.25; }
.sidebar-logo small { color: #9db4d4; font-size: .72rem; }
.nav { list-style: none; padding: 10px 8px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 11px; color: #dbe6f5; padding: 11px 12px; border-radius: 8px; font-size: .96rem; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.09); text-decoration: none; }
.nav a.on { background: #fff; color: var(--navy); font-weight: 700; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: #9db4d4; }
.sidebar-foot a { color: #fff; font-weight: 600; }
.backdrop { display: none; }
.content { flex: 1; padding: 20px; max-width: 1280px; width: 100%; }
.page-foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 14px; border-top: 1px solid var(--border); background: #fff; }

/* ============ Page head ============ */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { color: var(--navy); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ Cards ============ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card h2, .card h3 { color: var(--navy); margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

/* Stat cards */
.stat { background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--navy); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1.15; }
.stat .l { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.stat.s-green { border-left-color: var(--green); } .stat.s-green .n { color: var(--green); }
.stat.s-red { border-left-color: var(--red); } .stat.s-red .n { color: var(--red); }
.stat.s-amber { border-left-color: var(--saffron); } .stat.s-amber .n { color: var(--amber); }
.stat.s-blue { border-left-color: var(--blue); } .stat.s-blue .n { color: var(--blue); }
.stat.s-purple { border-left-color: var(--purple); } .stat.s-purple .n { color: var(--purple); }

/* Service cards */
.svc-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.svc-img { aspect-ratio: 16/8; background: var(--navy-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.svc-img img { width: 100%; height: 100%; object-fit: cover; }
.svc-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.svc-name { font-weight: 700; color: var(--navy); font-size: 1rem; line-height: 1.3; }
.svc-price { display: inline-block; background: #eef6ee; color: var(--green); border: 1px solid #cfe6cf; font-weight: 800; padding: 3px 10px; border-radius: 6px; font-size: .95rem; width: fit-content; }
.svc-actions { display: flex; gap: 8px; margin-top: auto; }
.svc-actions .btn { flex: 1; }

/* ============ Buttons ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: inherit; font-size: .95rem; font-weight: 600; border-radius: 8px; padding: 10px 16px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s; min-height: 42px; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-mid); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #14602a; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #9c2d21; }
.btn-warn { background: var(--saffron); color: #fff; }
.btn-warn:hover { background: #c06600; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy-soft); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--navy-soft); }
.btn-sm { padding: 6px 11px; font-size: .86rem; min-height: 34px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ============ Forms ============ */
.form-group { margin-bottom: 15px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .93rem; }
.req { color: var(--red); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #c3cedd; border-radius: 8px; font-family: inherit; font-size: .97rem; background: #fff; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-mid); outline: 2px solid #cfe0f5; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.radio { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.radio input { width: 18px; height: 18px; min-height: 0; }
.check-list label { font-weight: 500; display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.check-list input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filter-bar .form-group { margin-bottom: 0; min-width: 150px; flex: 1; max-width: 230px; }
.filter-bar .btn { min-height: 44px; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
.table th { background: var(--navy-soft); color: var(--navy); text-align: left; padding: 11px 12px; font-size: .84rem; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.table td { padding: 11px 12px; border-top: 1px solid #e8edf4; vertical-align: top; }
.table tr:hover td { background: #f7fafd; }
.table.kv { min-width: 0; }
.table.kv th { width: 38%; background: #f7f9fc; text-transform: none; font-size: .9rem; }
.file-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }

/* ============ Badges & alerts ============ */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-green { background: #e5f3e8; color: var(--green); }
.badge-red { background: #fdeae7; color: var(--red); }
.badge-amber { background: #fdf1e0; color: var(--amber); }
.badge-blue { background: #e5effa; color: var(--blue); }
.badge-purple { background: #f0e9fc; color: var(--purple); }
.badge-gray { background: #edf0f4; color: var(--muted); }
.alert { padding: 12px 15px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; font-size: .94rem; }
.alert-success { background: #e9f7ee; border-color: #bfe3cc; color: #135a2a; }
.alert-error { background: #fdeeec; border-color: #f3c4bd; color: #8c2318; }
.alert-info { background: #e9f1fb; border-color: #c4d8f0; color: #163e6b; }
.alert-warn { background: #fdf4e3; border-color: #f0d9ab; color: #7a4c07; }

/* ============ Announcement ticker ============ */
.announce { display: flex; align-items: center; gap: 10px; background: #fff8ec; border: 1px solid #f0d9ab; color: #7a4c07; border-radius: 8px; padding: 9px 13px; margin-bottom: 15px; overflow: hidden; }
.announce-track { overflow: hidden; white-space: nowrap; flex: 1; }
.announce-track span { display: inline-block; animation: ticker 18s linear infinite; padding-left: 100%; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ============ Timeline ============ */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-dot { position: absolute; left: -22px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--muted); }
.tl-submitted .tl-dot, .tl-resubmitted .tl-dot { border-color: var(--amber); }
.tl-processing .tl-dot, .tl-note .tl-dot { border-color: var(--blue); }
.tl-approved .tl-dot, .tl-refund .tl-dot { border-color: var(--green); }
.tl-reverted .tl-dot { border-color: var(--purple); }
.tl-rejected .tl-dot { border-color: var(--red); }
.tl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tl-when { color: var(--muted); font-size: .82rem; }
.tl-who { font-size: .85rem; margin-top: 2px; }
.tl-remark { background: #f7f9fc; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; margin-top: 7px; font-size: .92rem; }

/* ============ Pagination ============ */
.pagination { display: flex; gap: 6px; margin: 16px 0 4px; flex-wrap: wrap; }
.pg { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-weight: 600; padding: 0 10px; }
.pg.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pg.dis { pointer-events: none; opacity: .45; }
.pg:hover { text-decoration: none; background: var(--navy-soft); }
.pg.on:hover { background: var(--navy); }

/* ============ Modal / popup ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(13, 37, 71, .55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 18px; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; max-width: 520px; width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--navy); color: #fff; border-radius: 12px 12px 0 0; }
.modal-head h3 { color: #fff; margin: 0; }
.modal-close { background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-body { padding: 18px; }
.modal-body img { border-radius: 8px; }

/* ============ Auth pages ============ */
.auth-body { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 100%); min-height: 100vh; }
.auth-wrap { max-width: 470px; margin: 0 auto; padding: 34px 16px 40px; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; margin-bottom: 18px; justify-content: center; text-align: left; }
.auth-brand img { height: 52px; background: #fff; border-radius: 10px; padding: 5px; }
.auth-brand strong { font-size: 1.3rem; display: block; }
.auth-brand small { color: #c9d8ee; }
.auth-brand:hover { text-decoration: none; }
.auth-card { background: #fff; border-radius: 14px; padding: 26px 24px; box-shadow: 0 8px 30px rgba(0,0,0,.22); }
.auth-card h1 { color: var(--navy); margin-bottom: 16px; font-size: 1.3rem; }
.auth-foot { text-align: center; color: #c9d8ee; font-size: .82rem; margin-top: 16px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: .92rem; flex-wrap: wrap; }
.otp-input { letter-spacing: 10px; font-size: 1.4rem; text-align: center; font-weight: 700; }
.debug-otp { background: #fff3cd; border: 2px dashed #d39e00; color: #6b5200; padding: 12px; border-radius: 8px; text-align: center; font-size: 1.1rem; margin-bottom: 14px; }
.debug-otp b { font-size: 1.5rem; letter-spacing: 4px; }

/* ============ Landing page ============ */
.land-nav { background: #fff; border-bottom: 1px solid var(--border); }
.land-nav-in { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; flex-wrap: wrap; }
.land-nav-in .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
.hero { background: linear-gradient(150deg, var(--navy-dark) 0%, var(--navy) 55%, var(--navy-mid) 100%); color: #fff; padding: 56px 16px 60px; }
.hero-in { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: 1.25fr 1fr; gap: 34px; align-items: center; }
.hero h1 { font-size: 2rem; line-height: 1.25; margin-bottom: 14px; }
.hero p { color: #cfdcef; font-size: 1.05rem; margin-bottom: 22px; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-points { list-style: none; display: grid; gap: 10px; }
.hero-points li { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: .96rem; }
.hero-points .ic { color: #8fd19e; flex-shrink: 0; }
.section { max-width: 1140px; margin: 0 auto; padding: 44px 16px; }
.section > h2 { text-align: center; color: var(--navy); font-size: 1.5rem; margin-bottom: 6px; }
.section > .sub { text-align: center; color: var(--muted); margin-bottom: 26px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; }
.step { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); counter-increment: step; }
.step::before { content: counter(step); display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 10px; }
.trustband { background: var(--navy); color: #fff; }
.trustband .section { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; padding-top: 30px; padding-bottom: 30px; text-align: center; }
.trustband .n { font-size: 1.8rem; font-weight: 800; }
.trustband .l { color: #c9d8ee; font-size: .9rem; }
.land-footer { background: var(--navy-dark); color: #b9c9e0; }
.land-footer .section { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; padding-top: 36px; padding-bottom: 26px; }
.land-footer h3 { color: #fff; margin-bottom: 10px; font-size: 1rem; }
.land-footer a { color: #d7e2f2; display: block; padding: 3px 0; }
.land-footer .legal { border-top: 1px solid rgba(255,255,255,.14); text-align: center; padding: 14px; font-size: .82rem; }
.kw { font-size: .85rem; color: #93a8c6; line-height: 1.7; }

/* ============ Misc ============ */
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--navy-soft); color: var(--navy); border-radius: 6px; padding: 3px 9px; font-size: .8rem; font-weight: 600; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.inline-form { display: inline; }
.w-auto { width: auto; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; } .mb0 { margin-bottom: 0; }
.fields-table td { vertical-align: middle; }
.sort-btns { display: inline-flex; gap: 4px; }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .hero-in, .two-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hamburger { display: block; }
  .sidebar { position: fixed; left: -270px; top: 0; bottom: 0; z-index: 90; transition: left .22s ease; width: 262px; overflow-y: auto; }
  .sidebar.open { left: 0; }
  .backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; }
  .backdrop.show { display: block; }
  .brand-name { display: none; }
  .content { padding: 14px; }
  .user-chip span { display: none; }
  .hide-sm { display: none; }
  .table { font-size: .88rem; }
  .hero { padding: 38px 16px 42px; }
  .hero h1 { font-size: 1.55rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
