/* eOffice Seva Desk — professional light theme, Devanagari-friendly */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --danger: #b91c1c;
  --radius: 10px;
  --font: "Noto Sans Devanagari", "Mangal", "Nirmala UI", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar */
.topbar { background: #0f2a5c; color: #fff; position: sticky; top: 0; z-index: 50; }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: 0.75rem; opacity: 0.85; }
.brand-logo { font-size: 1.6rem; }
/* (Primary navigation is the 5-item rail/tab bar — see "Workstream B" section below.) */
.userbox { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.user-name { color: #e5e7eb; font-size: 0.9rem; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 1.5rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card h1, .card h2, .card h3 { margin-top: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { text-align: center; margin-bottom: 0; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: 0.9rem; }

/* Forms */
label { display: block; margin-bottom: 0.9rem; font-weight: 600; font-size: 0.95rem; }
label input, label select, label textarea {
  display: block; width: 100%; margin-top: 0.35rem; font-weight: 400;
  font-family: var(--font); font-size: 1rem; padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--ink);
}
label input:focus, label select:focus, label textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; display: inline-block; margin: 0 0.35rem 0 0; }
.check-row, .radio-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 0.35rem; }
.check-row label, .radio-row label { margin: 0; font-weight: 400; display: inline-flex; align-items: center; }
.form-card { max-width: 760px; }
.row-form { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; }
.row-form select { flex: 1; font-family: var(--font); font-size: 0.95rem; padding: 0.5rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 8px; }
.inline { display: inline; }
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filters input[type="search"], .filters select {
  font-family: var(--font); font-size: 0.95rem; padding: 0.5rem 0.7rem;
  border: 1px solid #cbd5e1; border-radius: 8px;
}
.filters input[type="search"] { flex: 1; min-width: 200px; }

/* Buttons */
.btn {
  display: inline-block; font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  padding: 0.55rem 1.1rem; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: #fff; border-color: #cbd5e1; color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #7f1d1d; color: #fff; }
.btn-sm { font-size: 0.85rem; padding: 0.35rem 0.7rem; }
.topbar .btn-outline { background: transparent; border-color: rgba(255,255,255,0.5); color: #fff; }
.topbar .btn-outline:hover { border-color: #fff; color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { background: #f8fafc; font-weight: 700; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }

/* Badges */
.badge { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.st-blue   { background: #dbeafe; color: #1e40af; }   /* नवीन */
.st-orange { background: #ffedd5; color: #9a3412; }  /* सुरू */
.st-purple { background: #ede9fe; color: #5b21b6; }  /* माहिती हवी */
.st-green  { background: #dcfce7; color: #166534; }  /* Solve */
.st-gray   { background: #e5e7eb; color: #374151; }  /* बंद */

/* Flash messages */
.flashes { margin-bottom: 1rem; }
.flash { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 0.6rem; font-weight: 500; }
.flash-success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.flash-warning { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; }
.flash-info    { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }

/* Detail lists */
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 0.35rem 1rem; margin: 0 0 1rem; }
.dl dt { font-weight: 700; color: var(--muted); }
.dl dd { margin: 0; }
.pre { white-space: pre-wrap; font-family: var(--font); }
.muted { color: var(--muted); }

/* Comments */
.comment { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.comment-head { margin-bottom: 0.25rem; }

/* Attachments */
.attach-list { list-style: none; padding: 0; margin: 0; }
.attach-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; align-items: start; }
.kanban-col { background: #eef2f7; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; }
.kanban-head { font-size: 1.05rem; margin: 0 0 0.75rem; display: flex; justify-content: space-between; align-items: center; }
.kanban-head .count { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 0.6rem; font-size: 0.85rem; }
.kanban-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem; margin-bottom: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.kanban-meta { font-size: 0.9rem; color: var(--muted); margin: 0.4rem 0; }
.kanban-empty { text-align: center; padding: 1rem 0; }

/* KB */
.cat-list, .article-list { list-style: none; padding: 0; margin: 0; }
.cat-list li, .article-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.article-list li { display: block; }
.cat-list .count { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 0.6rem; font-size: 0.85rem; }
.article-body { white-space: pre-wrap; }

/* Generator draft */
.draft { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; white-space: pre-wrap; font-family: var(--font); max-height: 480px; overflow: auto; }

/* Auth */
.auth-card { max-width: 420px; margin: 3rem auto; }
.auth-card h1 { margin-top: 0; }

/* Mobile */
@media (max-width: 860px) {
  .userbox { margin-left: 0; width: 100%; padding-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.15); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: 0.5rem; }
  .stat-num { font-size: 1.6rem; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .kanban { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ============================================================
   eOffice Seva Desk — UX/branding polish (wizard, brand, charts)
   ============================================================ */

/* ---- Brand header ---- */
.tricolor-bar {
  height: 4px;
  background: linear-gradient(to right, #ff9933 0 33.33%, #ffffff 33.33% 66.66%, #138808 66.66% 100%);
}
.brand-lockup { display: flex; align-items: center; gap: 0.75rem; }
.brand-emblem { flex: 0 0 auto; display: block; border-radius: 50%; }
.brand-names { display: flex; flex-direction: column; line-height: 1.25; }
.brand-org { display: block; font-weight: 700; font-size: 1.02rem; }
.brand-product { display: block; font-size: 0.8rem; opacity: 0.92; font-weight: 500; }
.brand-sep { opacity: 0.6; margin: 0 0.15rem; }

/* ---- Form labels: big Marathi + small English hint ---- */
.req { color: var(--danger); font-style: normal; }
.lbl-mr { display: block; font-size: 1.05rem; font-weight: 700; }
.lbl-en { display: block; font-size: 0.78rem; font-weight: 400; color: var(--muted); }
h2 .lbl-en, p .lbl-en { display: inline; }
.fld { margin-bottom: 1rem; }
.fld > label { margin-bottom: 0; }
.hint-note { font-size: 0.85rem; margin: 0.4rem 0 0; }
.hp-field { display: none !important; }
.note-card { background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.note-card p { margin: 0.25rem 0; }

/* ---- Wizard ---- */
.wsteps { list-style: none; margin: 0 0 1.75rem; padding: 0; display: flex; }
.wsteps li { flex: 1; text-align: center; position: relative; color: var(--muted); font-size: 0.88rem; }
.wsteps li::before { content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.wsteps li:first-child::before { display: none; }
.wsteps li.done::before { background: var(--primary); }
.wstep-dot {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2px solid var(--line);
  font-weight: 700; margin-bottom: 0.3rem; transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.wsteps li.active .wstep-dot { border-color: var(--primary); color: var(--primary); }
.wsteps li.done .wstep-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.wstep-txt { display: block; font-weight: 700; color: var(--ink); }
.wsteps li.active .wstep-txt { color: var(--primary); }
.wstep-en { display: block; font-size: 0.74rem; font-weight: 400; }
.wstep[hidden] { display: none; }
.wnav { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.wizard input[type="text"], .wizard input[type="tel"], .wizard input[type="email"],
.wizard input[type="date"], .wizard select { min-height: 48px; font-size: 1.05rem; }
.wizard input[type="file"] { min-height: 48px; padding: 0.7rem; font-size: 1rem; }
.wizard textarea { min-height: 96px; font-size: 1.05rem; }
.review { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.25rem; }
.review dd { overflow-wrap: anywhere; }

/* ---- Success screen ---- */
.success-wrap { max-width: 600px; margin: 2rem auto; text-align: center; }
.success-check {
  width: 96px; height: 96px; margin: 0 auto 1rem; border-radius: 50%;
  background: #dcfce7; display: flex; align-items: center; justify-content: center;
}
.success-check svg { width: 52px; height: 52px; }
.ticket-row { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin: 0.5rem 0; }
.ticket-id {
  display: inline-block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.7rem; font-weight: 800; letter-spacing: 0.05em; color: var(--primary-dark);
  background: #eff6ff; border: 2px dashed var(--primary); border-radius: 12px; padding: 0.55rem 1.3rem;
}
.ticket-id-lg { font-size: 2rem; margin: 0.25rem 0 0.75rem; }
.keep-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 0.8rem 1rem; margin: 1rem 0 1.5rem; }

/* ---- Tracking ---- */
.track-card { max-width: 540px; margin: 2rem auto; }
.track-card h1 { margin-top: 0; }
.track-kicker { margin-bottom: 0.25rem; }
.track-title { margin: 0.5rem 0 0.25rem; }
.timeline { list-style: none; margin: 1.5rem 0; padding: 0; display: flex; }
.timeline li { flex: 1; text-align: center; position: relative; font-size: 0.85rem; }
.timeline li::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.timeline li:first-child::before { display: none; }
.tl-dot { position: relative; z-index: 1; display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--line); margin-bottom: 0.3rem; }
.timeline li.hit .tl-dot { background: var(--primary); border-color: var(--primary); }
.timeline li.hit::before { background: var(--primary); }
.tl-lbl { display: block; font-weight: 700; }
.tl-date { display: block; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }

/* ---- Dashboard polish ---- */
.stat { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(15, 42, 92, 0.12); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); }
.ch-label { font-size: 12px; fill: var(--ink); font-weight: 600; }
.ch-val { font-size: 12px; fill: var(--muted); }
.ch-track { fill: #eef2f7; }
.ch-open { fill: #3b82f6; }
.ch-solved { fill: #22c55e; }
.ch-legend { display: flex; gap: 1.25rem; align-items: center; margin-top: 0.6rem; font-size: 0.88rem; color: var(--muted); flex-wrap: wrap; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 0.35rem; vertical-align: -1px; }
.lg-open { background: #3b82f6; }
.lg-solved { background: #22c55e; }
.bar-name { font-size: 11px; fill: var(--muted); }
.bar-val { font-size: 11px; fill: var(--ink); font-weight: 700; }

/* ---- Auth branding ---- */
.auth-brand { display: flex; justify-content: center; margin-bottom: 1.25rem; color: var(--ink); }
.auth-brand .brand-org { font-size: 0.98rem; }
.auth-brand .brand-product { font-size: 0.78rem; }

/* ---- Buttons ---- */
.btn { transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
.btn-lg { font-size: 1.05rem; padding: 0.75rem 1.6rem; min-height: 52px; }
.btn-block { display: block; width: 100%; }
.btn-secondary { background: #eef2f7; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Public form head ---- */
.form-head { max-width: 760px; margin-bottom: 0.5rem; }
.form-head h1 { margin-bottom: 0.25rem; }

@media (max-width: 600px) {
  .brand-org { font-size: 0.92rem; }
  .brand-product { font-size: 0.72rem; }
  .brand-emblem { width: 38px; height: 38px; }
  .ticket-id, .ticket-id-lg { font-size: 1.4rem; padding: 0.5rem 0.9rem; }
  .wstep-txt { font-size: 0.8rem; }
  .wstep-en { display: none; }
  .timeline { font-size: 0.78rem; }
}

/* ============================================================
   ITSM v2 — component system (mobile-first, functional only)
   ============================================================ */

/* ---- Priority badges P1-P4 ---- */
.badge.prio-p1 { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge.prio-p2 { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.badge.prio-p3 { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.badge.prio-p4 { background: #e0e7ff; color: #3730a3; border: 1px solid #a5b4fc; }

/* ---- SLA chips ---- */
.badge.sla-ok     { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge.sla-risk   { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge.sla-breach { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---- Lifecycle status chips (v2 statuses) ---- */
.badge.st-new        { background: #dbeafe; color: #1e40af; }
.badge.st-ack        { background: #e0e7ff; color: #3730a3; }
.badge.st-triage    { background: #ede9fe; color: #5b21b6; }
.badge.st-prog      { background: #ffedd5; color: #9a3412; }
.badge.st-wait-user  { background: #fef9c3; color: #854d0e; }
.badge.st-wait-vendor{ background: #fce7f3; color: #9d174d; }
.badge.st-escalated  { background: #fee2e2; color: #991b1b; }
.badge.st-resolved   { background: #dcfce7; color: #166534; }
.badge.st-confirm    { background: #ccfbf1; color: #115e59; }
.badge.st-closed     { background: #e5e7eb; color: #374151; }
.badge.st-reopened   { background: #ffedd5; color: #7c2d12; border: 1px dashed #fdba74; }

/* ---- Office type badges ---- */
.badge.type-collector { background: #dbeafe; color: #1e3a8a; }
.badge.type-sdo       { background: #ede9fe; color: #5b21b6; }
.badge.type-tahsil    { background: #dcfce7; color: #166534; }

/* ---- Ticket cards (mobile-first) ---- */
.ticket-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem; margin-bottom: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.ticket-card .tc-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.ticket-card .tc-id { font-weight: 700; font-size: 1.05rem; }
.ticket-card .tc-title { font-size: 1rem; margin: 0.2rem 0 0.4rem; }
.ticket-card .tc-meta { font-size: 0.88rem; color: var(--muted); display: flex; gap: 0.9rem; flex-wrap: wrap; }
.ticket-card .tc-actions { margin-top: 0.6rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---- Bottom sheet (mobile) / inline panel (desktop) ---- */
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-top: 1rem; }
.sheet-handle { display: none; }
@media (max-width: 860px) {
  .sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; margin: 0;
    border-radius: 16px 16px 0 0; max-height: 85vh; overflow-y: auto;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18); transform: translateY(105%); transition: transform 0.18s ease-out; }
  .sheet.open { transform: translateY(0); }
  .sheet-handle { display: block; width: 44px; height: 5px; border-radius: 999px;
    background: #cbd5e1; margin: 0 auto 0.75rem; }
  .sheet-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 190; }
}

/* ---- Responsive tables collapse to cards (needs data-label on td) ----
   Applies to every .table-wrap > table.table on mobile unless the table
   carries .no-collapse (wide report tables that prefer horizontal scroll). */
@media (max-width: 860px) {
  .table-wrap:not(.no-collapse) { overflow-x: visible; }
  .table-wrap:not(.no-collapse) table.table { display: block; }
  .table-wrap:not(.no-collapse) table.table thead { display: none; }
  .table-wrap:not(.no-collapse) table.table tbody,
  .table-wrap:not(.no-collapse) table.table tr,
  .table-wrap:not(.no-collapse) table.table td { display: block; width: 100%; }
  .table-wrap:not(.no-collapse) table.table tr {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 0.75rem; padding: 0.4rem 0.9rem; }
  .table-wrap:not(.no-collapse) table.table td {
    border: none; padding: 0.3rem 0; display: flex; gap: 0.6rem; align-items: baseline; }
  .table-wrap:not(.no-collapse) table.table td::before {
    content: attr(data-label); font-weight: 700; color: var(--muted);
    flex: 0 0 38%; font-size: 0.85rem; }
  /* tables without data-labels: keep plain stacked rows, no empty label gutter */
  .table-wrap:not(.no-collapse) table.table td:not([data-label])::before { content: none; }
  .table-wrap:not(.no-collapse) table.table td:not([data-label]) { display: block; }
}

/* ---- Engineer workload list ---- */
.work-list { list-style: none; padding: 0; margin: 0; }
.work-row { display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.work-name { font-weight: 600; }
.work-count { background: var(--primary); color: #fff; border-radius: 999px;
  min-width: 2rem; text-align: center; padding: 0.15rem 0.6rem; font-weight: 700; }

/* ---- Alert stat (Critical) ---- */
.stat.alert .stat-num { color: var(--danger); }
.stat.alert { border: 1px solid #fca5a5; border-radius: var(--radius); background: #fef2f2; }

/* ---- Toasts (functional feedback) ---- */
.toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 0.5rem; width: min(92vw, 420px); }
.toast { background: #0f2a5c; color: #fff; border-radius: 10px; padding: 0.75rem 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25); font-size: 0.95rem; }
.toast-success { background: #14532d; }
.toast-error { background: #7f1d1d; }

/* ---- Loading skeleton ---- */
.skel { background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 50%, #eef2f7 75%);
  background-size: 200% 100%; border-radius: 6px; min-height: 1rem; }

/* ---- SLA warning highlight on rows ---- */
tr.sla-risk-row { background: #fffbeb; }
tr.sla-breach-row { background: #fef2f2; }

/* ---- Accessibility: visible focus ---- */
:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; border-radius: 4px; }

/* ---- Touch targets on mobile ---- */
@media (max-width: 860px) {
  .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { min-height: 40px; }
  input, select, textarea { font-size: 16px; } /* prevents iOS zoom on focus */
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  .stat-num { font-size: 1.5rem; }
  .stat-label { font-size: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
  .skel { background: #eef2f7; }
}

/* Ops-gap badges */
.badge-recurring { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.badge-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge-bad { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ============================================================
   ITSM v2 — Worker E: PWA + mobile UX (§17, §54–§59)
   ============================================================ */

/* ============================================================
   GAP-3 §40 — 6-group primary nav (replaces the 5-item nav)
   Desktop: slim icon sidebar (.app-sidebar) with 6 group buttons.
   Mobile (ADDENDUM 4): bottom tab bar (.bottomnav) with exactly 5 tabs —
   आढावा | तक्रारी | नवीन | शोध | अधिक (4 for requesters: no staff
   तक्रारी tab). अधिक opens the combined More sheet; other tabs link
   directly. Group buttons open sheets (.sheet): bottom sheets
   on mobile, right slide-overs on desktop.
   Government palette: navy rail, saffron action.
   ============================================================ */

/* ---- shared primary-nav item ---- */
.pnav-item {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.15rem; border: 0; background: none;
  color: #cbd5e1; font-family: var(--font); font-size: 0.72rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border-radius: 10px; padding: 0.35rem 0.2rem;
}
.pnav-item:hover { color: #fff; text-decoration: none; }
.pnav-item[aria-current="page"] { color: #fff; background: rgba(255,255,255,0.14); }
.pnav-item:focus-visible { outline: 3px solid #93c5fd; outline-offset: -3px; }
.pnav-ic { font-size: 1.4rem; line-height: 1; }
.pnav-lbl { line-height: 1.25; }
.pnav-badge {
  position: absolute; background: #dc2626; color: #fff; border-radius: 999px;
  min-width: 20px; height: 20px; padding: 0 5px; font-size: 0.72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.app-sidebar { display: none; }
.bottomnav { display: none; }
@media (max-width: 860px) {
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    background: #0f2a5c; border-top: 1px solid rgba(255,255,255,0.15);
    padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
  }
  .bottomnav .pnav-item { flex: 1; min-height: 60px; }
  .bottomnav .pnav-badge { top: 5px; right: calc(50% - 30px); }
  /* keep page content clear of the fixed nav */
  body.has-appnav .container { padding-bottom: 6.5rem; }
  body.has-appnav .footer { padding-bottom: 5.5rem; }
}

/* ---- desktop: slim icon sidebar ---- */
@media (min-width: 861px) {
  .bottomnav { display: none; }
  body.has-appnav { padding-left: 80px; }
  .app-sidebar {
    display: flex; flex-direction: column; gap: 0.3rem; align-items: stretch;
    position: fixed; left: 0; top: 0; bottom: 0; width: 80px; z-index: 60;
    background: #0f2a5c; border-right: 1px solid rgba(255,255,255,0.12);
    padding: 0.8rem 0.45rem;
  }
  .app-sidebar .pnav-item { min-height: 62px; width: 100%; }
  .app-sidebar .pnav-badge { top: 4px; right: 6px; }
}

/* ---- sheets: bottom sheet (mobile) / right slide-over (desktop) ---- */
@media (min-width: 861px) {
  .sheet {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 200; margin: 0;
    width: min(380px, 94vw); max-height: none; overflow-y: auto;
    border: none; border-left: 1px solid var(--line); border-radius: 0;
    box-shadow: -6px 0 24px rgba(0,0,0,0.16); padding: 1.25rem;
    transform: translateX(105%); transition: transform 0.18s ease-out;
  }
  .sheet.open { transform: translateX(0); }
  .sheet-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 190; }
}
.sheet-body h2 { margin-top: 0; font-size: 1.2rem; }

/* ---- group sheet link grid (all viewports) ---- */
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.more-link {
  display: flex; align-items: center; gap: 0.6rem; min-height: 52px;
  padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font-weight: 600; font-size: 0.95rem; background: #fff;
}
.more-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.more-link.more-admin { border-color: #f59e0b; }
/* section sub-heading inside a sheet (mobile "More" combined sheet) */
.grp-sec {
  grid-column: 1 / -1; margin: 0.75rem 0 0.25rem; font-size: 0.85rem;
  font-weight: 700; color: #0f2a5c;
}
.grp-sec:first-child { margin-top: 0; }
/* count badge inside a sheet link (e.g. Tickets in the Operations sheet) */
.link-badge {
  margin-left: auto; background: #dc2626; color: #fff; border-radius: 999px;
  min-width: 22px; height: 22px; padding: 0 6px; font-size: 0.78rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* admin marker in the top bar */
.badge-admin { background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.4); }

/* ============================================================
   Workstream B — dashboard v2: mobile-first cards, govt look
   ============================================================ */
.dash-sec { margin-bottom: 1.5rem; }
.dash-sec > h2 { font-size: 1.15rem; margin: 0 0 0.75rem; color: #0f2a5c; }
.dash-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.dash-sec-head h2 { font-size: 1.15rem; margin: 0; color: #0f2a5c; }
.section-link { font-size: 0.9rem; white-space: nowrap; }
.ticket-mini {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.8rem 0.95rem; margin-bottom: 0.6rem; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.ticket-mini.sla-breach { border-left: 4px solid #dc2626; }
.ticket-mini.sla-risk { border-left: 4px solid #d97706; }
.tm-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.tm-id { font-weight: 700; color: #0f2a5c; }
.tm-title { margin: 0.3rem 0 0.35rem; font-size: 0.98rem; }
.tm-meta { font-size: 0.85rem; color: var(--muted); display: flex; gap: 0.8rem; flex-wrap: wrap; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.activity-list li:last-child { border-bottom: none; }
.activity-list .act-time { color: var(--muted); font-size: 0.82rem; }

/* ---- Sticky ticket action bar (§17): ticket detail, engineers, mobile ----
   Built by app.js from the action forms actually rendered (so it is
   permission-aware: only actions the server allowed appear). */
.sticky-actions { display: none; }
@media (max-width: 860px) {
  .sticky-actions {
    display: flex; gap: 0.5rem; position: fixed; left: 0; right: 0; z-index: 140;
    bottom: 68px; /* sits above .bottomnav */
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.97); border-top: 1px solid var(--line);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08); overflow-x: auto;
  }
  .sticky-actions .btn { flex: 1 0 auto; min-height: 48px; white-space: nowrap; }
  body.has-sticky-actions .container { padding-bottom: 10rem; }
}

/* ---- Offline draft status pill (§54) ---- */
.draft-status {
  border-radius: 8px; padding: 0.55rem 0.9rem; margin-bottom: 0.9rem;
  font-size: 0.9rem; font-weight: 600;
}
.draft-saved { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.draft-offline { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* ---- Upload progress (§58): opt-in via form[data-upload-progress] ---- */
.upload-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  background: rgba(15,42,92,0.08);
}
.upload-progress .up-track { height: 6px; background: #e5e7eb; }
.upload-progress .up-fill { height: 6px; width: 0; background: var(--primary); }
.upload-progress .up-label {
  text-align: center; font-size: 0.85rem; font-weight: 600; color: #0f2a5c;
  padding: 0.3rem; background: #fff; border-bottom: 1px solid var(--line);
}

/* ---- Button loading state (§58): state-communicating submit feedback ---- */
.btn.is-loading { position: relative; pointer-events: none; opacity: 0.75; }
.btn.is-loading::after {
  content: ""; display: inline-block; width: 1em; height: 1em; margin-left: 0.5em;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
}

/* ---- Toast entrance (§58) — motion only when allowed ---- */
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.22s ease-out; }
  @keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .btn.is-loading::after { animation: spin 0.8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .upload-progress .up-fill { transition: width 0.15s linear; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .btn.is-loading::after { animation: none; }
}

/* ================= Phase 1 addendum ================= */

/* ---- Public hero (tracking landing page) ---- */
.public-hero { margin: -1rem -1rem 1rem; border-radius: 0 0 12px 12px; overflow: hidden; }
.public-hero img { display: block; width: 100%; height: auto; }

/* ---- Floating "मदत" button (public pages) ---- */
.help-float { position: fixed; right: 1rem; bottom: 1rem; z-index: 900; }
.help-float-btn { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem;
  background: var(--brand); color: #fff; border-radius: 999px; padding: .7rem 1.1rem;
  font-weight: 700; font-size: 1rem; box-shadow: 0 4px 16px rgba(15,42,92,.35); min-height: 48px; }
.help-float-btn::-webkit-details-marker { display: none; }
.help-float-box { position: relative; }
.help-float-panel { position: absolute; right: 0; bottom: 3.8rem; width: min(19rem, calc(100vw - 2rem));
  padding: 1rem; }
.help-float-title { font-weight: 700; margin: 0 0 .6rem; }
.help-float-contact { margin: .6rem 0 0; font-size: .85rem; line-height: 1.5; }

/* ---- Breadcrumbs (admin pages) ---- */
.crumbs { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
  font-size: .82rem; color: var(--muted); margin: 0 0 .9rem; padding: 0; list-style: none; }
.crumbs a { color: var(--brand); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 700; }
.crumbs .crumb-sep { opacity: .5; }

/* ---- Print-friendly: ticket detail + generated forms ---- */
.print-btn { margin-left: auto; }
@media print {
  .topbar, .app-sidebar, .bottomnav, .sheet, .scrim, .footer,
  .help-float, .print-btn, .flash, .crumbs, .noprint { display: none !important; }
  body { padding: 0 !important; background: #fff; color: #000; }
  main.container { max-width: none; margin: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; margin-bottom: .8rem; }
  .btn { display: none !important; }
  a { color: #000; text-decoration: none; }
  h1, h2 { break-after: avoid; }
}

/* ---- Import validation report (directory/import.html, upload_preview.html) ---- */
.row-error { background: #fef2f2; }
.row-ok { background: #f0fdf4; }
.err-list { margin: 0; padding-left: 1.1rem; color: #b91c1c; font-size: .85rem; }
.ok { color: #15803d; font-weight: 600; }
