/* Thara Group MIS — Shared Theme (light) */
body { font-family: 'Inter', sans-serif; background: #f7f9fb; color: #0f172a; }
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; vertical-align: middle; }

/* Sidebar */
.tg-side { width: 240px; position: fixed; inset: 0 auto 0 0; height: 100vh; background: #f2f4f6; display: flex; flex-direction: column; padding: 24px 16px 24px 0; z-index: 40; }
.tg-side h1 { font-weight: 900; letter-spacing: -0.02em; color: #0f172a; }
.tg-side .brand { display: flex; gap: 12px; align-items: center; padding: 0 24px; margin-bottom: 32px; }
.tg-side .brand .logo { width: 40px; height: 40px; border-radius: 10px; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; }
.tg-side nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.tg-side nav a { display: flex; gap: 12px; align-items: center; color: #475569; padding: 12px 16px; margin-left: 8px; border-radius: 8px; font-size: 13px; text-decoration: none; transition: background .2s; }
.tg-side nav a:hover { background: #e6e8ea; }
.tg-side nav a.active { background: #fff; color: #2563eb; font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.06); }

/* Top bar */
.tg-top { position: fixed; top: 0; left: 240px; right: 0; height: 64px; z-index: 30; background: rgba(247,249,251,.8); backdrop-filter: blur(20px); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; box-shadow: 0 1px 0 rgba(15,23,42,.04); }
.tg-top .chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px; background: #f2f4f6; font-size: 12px; font-weight: 500; color: #475569; cursor: pointer; }
.tg-top .chip.primary { background: #2563eb; color: #fff; font-weight: 700; }
.tg-top .avatar { width: 32px; height: 32px; border-radius: 999px; background: #dbe1ff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #003ea8; }

/* Main canvas */
.tg-main { margin-left: 240px; padding: 88px 32px 48px; min-height: 100vh; }
.tg-main h2.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.tg-main p.page-sub { color: #475569; margin-top: 4px; }

/* Cards */
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04); padding: 24px; }
.card-compact { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(15,23,42,.06); padding: 16px; }

/* KPI */
.kpi { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.kpi .label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #475569; margin-bottom: 8px; }
.kpi .value { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: #0f172a; }
.kpi .value .unit { color: #94a3b8; font-size: 12px; font-weight: 700; margin-left: 4px; }
.kpi .delta-up { color: #10b981; font-weight: 700; font-size: 10px; }
.kpi .delta-down { color: #ef4444; font-weight: 700; font-size: 10px; }

/* Pills */
.pill { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pill-green { background: #d1fae5; color: #047857; }
.pill-red { background: #fee2e2; color: #991b1b; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-grey { background: #e2e8f0; color: #475569; }
.pill-blue { background: #dbeafe; color: #1e40af; }

/* Tables */
table.tg { width: 100%; text-align: left; border-collapse: collapse; }
table.tg thead { background: #f8fafc; }
table.tg th { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #475569; padding: 12px 16px; }
table.tg td { padding: 16px; border-top: 1px solid #e2e8f0; font-size: 14px; }
table.tg tr:hover td { background: #f1f5f9; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all .15s; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #0f172a; border: 1px solid #e2e8f0; }
.btn-tertiary { background: transparent; color: #2563eb; }

/* Input */
.input { width: 100%; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid #e2e8f0; font-size: 14px; background: #fff; }
.input:focus { outline: 2px solid #dbeafe; border-color: #2563eb; }

/* ════════════════════════════════════════════════════════════════════
   v2 — Top navigation + analytics components (Jun 2026 redesign)
   Same tokens as above: #2563EB primary, Inter, 8px unit, 12px radius.
   ════════════════════════════════════════════════════════════════════ */

/* App bar (replaces the 240px sidebar) */
.tg-appbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid #e2e8f0; }
.tg-appbar .bar { height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 24px; max-width: 1840px; margin: 0 auto; }
.tg-appbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #0f172a; flex: 0 0 auto; }
.tg-appbar .brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#2563eb,#1d4ed8); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; letter-spacing: -.02em; }
.tg-appbar .brand b { font-size: 14px; font-weight: 800; letter-spacing: -.01em; line-height: 1; }
.tg-appbar .brand small { display: block; font-size: 8.5px; font-weight: 700; letter-spacing: .14em; color: #94a3b8; text-transform: uppercase; margin-top: 2px; }
.tg-appbar nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tg-appbar nav::-webkit-scrollbar { display: none; }
.tg-appbar nav a { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #64748b; text-decoration: none; padding: 7px 10px; border-radius: 8px; transition: color .15s, background .15s; white-space: nowrap; }
.tg-appbar nav a:hover { color: #0f172a; background: #f1f5f9; }
.tg-appbar nav a.active { color: #2563eb; background: #eff6ff; }
.tg-appbar .right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.tg-appbar select { padding: 6px 28px 6px 10px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; font-size: 11.5px; font-weight: 600; color: #334155; cursor: pointer; max-width: 230px; }
.tg-appbar select:focus { outline: 2px solid #dbeafe; border-color: #2563eb; }

/* Filter / status toolbar under the app bar */
.tg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0 0; }
.tg-toolbar .meta { margin-left: auto; font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 14px; }
.tg-toolbar .meta b { color: #334155; font-weight: 700; }

/* Legacy tg-main pages adopting the top nav */
.tg-main--top { margin-left: 0; padding-top: 24px; }

/* Compact analytical KPI card */
.kpi2 { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px 12px; box-shadow: 0 1px 2px rgba(15,23,42,.04); display: flex; flex-direction: column; min-height: 118px; position: relative; overflow: hidden; }
.kpi2 .label { font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #64748b; }
.kpi2 .value { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi2 .value .rs { color: #2563eb; font-weight: 600; font-size: 15px; margin-right: 2px; }
.kpi2 .value .unit { color: #94a3b8; font-size: 11px; font-weight: 700; margin-left: 3px; }
.kpi2 .sub { font-size: 10px; color: #94a3b8; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi2 .spark { margin-top: auto; height: 30px; }
.kpi2.accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(180deg,#2563eb,#60a5fa); }

/* Delta / context chips */
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip-up { background: #d1fae5; color: #047857; }
.chip-down { background: #fee2e2; color: #b91c1c; }
.chip-flat { background: #e2e8f0; color: #475569; }
.chip-info { background: #dbeafe; color: #1e40af; }
.chip-warn { background: #fef3c7; color: #92400e; }

/* Findings — severity-edged cards with inline evidence rows */
.find-card { background: #fff; border: 1px solid #e2e8f0; border-left-width: 3px; border-radius: 10px; padding: 10px 12px; }
.find-card.sev-high { border-left-color: #ef4444; }
.find-card.sev-med  { border-left-color: #f59e0b; }
.find-card.sev-low  { border-left-color: #94a3b8; }
.find-card .ex { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: #64748b; padding: 3px 0; border-top: 1px dashed #f1f5f9; font-variant-numeric: tabular-nums; }
.find-card .ex:first-of-type { border-top: 0; margin-top: 4px; }
.find-card .ex b { color: #334155; font-weight: 700; }

/* Ranked ledger rows */
.rankrow { display: flex; align-items: center; gap: 10px; padding: 5px 6px; margin: 0 -6px; border-radius: 8px; text-decoration: none; color: inherit; }
.rankrow:hover { background: #f8fafc; }
.rankrow .rk { flex: 0 0 18px; font-size: 10px; font-weight: 800; color: #cbd5e1; text-align: right; font-variant-numeric: tabular-nums; }
.rankrow .nm { flex: 1 1 auto; min-width: 0; }
.rankrow .nm .t { font-size: 11.5px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rankrow .nm .bar { height: 3px; border-radius: 99px; background: #f1f5f9; margin-top: 3px; overflow: hidden; }
.rankrow .nm .bar i { display: block; height: 100%; border-radius: 99px; }
.rankrow .v { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }

/* Dense analytical table */
table.tg2 { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.tg2 th { position: sticky; top: 0; background: #f8fafc; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #64748b; padding: 9px 12px; white-space: nowrap; cursor: pointer; user-select: none; z-index: 1; }
table.tg2 td { padding: 7px 12px; border-top: 1px solid #f1f5f9; font-size: 11.5px; white-space: nowrap; }
table.tg2 tbody tr:hover td { background: #f8fafc; }
table.tg2 tfoot td { border-top: 2px solid #e2e8f0; background: #f8fafc; font-weight: 800; font-size: 11.5px; }
.microbar { display: inline-block; width: 44px; height: 4px; border-radius: 99px; background: #f1f5f9; vertical-align: middle; margin-left: 6px; overflow: hidden; }
.microbar i { display: block; height: 100%; border-radius: 99px; }

/* Section card heading */
.h-card { font-size: 13px; font-weight: 800; letter-spacing: -.01em; color: #0f172a; }
.h-sub { font-size: 10.5px; color: #94a3b8; }

@media print {
  .tg-appbar, .no-print { display: none !important; }
  body { background: #fff !important; }
  .kpi2, .card, .find-card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; break-inside: avoid; }
}
