/* ============================================================
   Vantage — Branch Performance Console
   Shared stylesheet (offline prototype)
   ============================================================ */

/* Optional web fonts — load when online, fall back to system fonts offline */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Surfaces */
  --bg:        #eef1f7;
  --surface:   #ffffff;
  --surface-2: #f7f9fc;
  --sidebar:   #141a24;
  --sidebar-2: #1d2632;
  --sidebar-line: #2a3340;

  /* Ink */
  --ink:    #131822;
  --ink-2:  #3c4655;
  --muted:  #6b7686;
  --faint:  #9aa3b2;
  --line:   #e3e8f0;
  --line-2: #d4dae4;

  /* Brand accent (no blue in RAG, so safe for interactive) */
  --accent:      #2d62e0;
  --accent-ink:  #1c4bbd;
  --accent-soft: #e7eefc;

  /* RAG — the signature palette */
  --red:    #d64545;
  --amber:  #e2982f;
  --green:  #2aa269;
  --red-soft:   rgba(214, 69, 69, 0.12);
  --amber-soft: rgba(226, 152, 47, 0.14);
  --green-soft: rgba(42, 162, 105, 0.13);

  /* Type */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(19, 24, 34, 0.06), 0 1px 3px rgba(19, 24, 34, 0.05);
  --shadow-md: 0 6px 20px rgba(19, 24, 34, 0.08);

  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
a { color: inherit; }
button { font-family: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ============================================================
   App shell (sidebar + main)
   ============================================================ */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sidebar);
  color: #c4ccd8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--sidebar-line);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 2px; padding: 4px; background: #0e131b;
}
.brand-mark span { border-radius: 2px; }
.brand-mark span:nth-child(1) { background: var(--green); }
.brand-mark span:nth-child(2) { background: var(--amber); }
.brand-mark span:nth-child(3) { background: var(--ink-2); }
.brand-mark span:nth-child(4) { background: var(--red); }
.brand-name { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 18px; line-height: 1; }
.brand-sub { font-size: 11px; color: #7d8798; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 3px; }

.sidebar__nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: #aab3c1; text-decoration: none; font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-link:hover { background: var(--sidebar-2); color: #fff; }
.nav-link.is-active { background: var(--accent); color: #fff; }
.nav-link.is-active svg { opacity: 1; }

.sidebar__foot { padding: 14px; border-top: 1px solid var(--sidebar-line); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), #6b46c1);
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px;
}
.user-meta { min-width: 0; }
.user-name { color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: #7d8798; }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; }

/* Topbar (mobile shows hamburger; desktop shows page title) */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-size: 19px; font-weight: 600; }
.topbar__sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.topbar__spacer { flex: 1; }
.menu-btn { display: none; background: none; border: 1px solid var(--line-2); border-radius: var(--r-sm); width: 40px; height: 40px; cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; }

.page { padding: 26px; flex: 1; max-width: 1320px; width: 100%; }

/* ============================================================
   Buttons / forms
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 9px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--block { width: 100%; }
.btn--sm { padding: 6px 11px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.input, select.input {
  appearance: none; width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7686' d='M6 8L1.5 3.5h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
.input:focus, select.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 12px; color: var(--muted); }

/* ============================================================
   Panels / cards
   ============================================================ */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel__title { font-size: 15.5px; font-weight: 600; }
.panel__sub { font-size: 12.5px; color: var(--muted); }
.panel__body { padding: 20px; }
.panel + .panel { margin-top: 20px; }

/* Filter bar */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.filters--top { margin-bottom: 20px; }

/* Natural-language comparison builder */
.builder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 15px; }
.builder .word { color: var(--muted); font-weight: 500; }
.builder select.input { width: auto; min-width: 0; padding: 8px 30px 8px 12px; font-weight: 600; background-color: var(--surface-2); }
.builder select.input:hover { border-color: var(--accent); }

.scope-grid { display: grid; grid-template-columns: 86px 1fr; gap: 12px 14px; align-items: start; }
.scope-grid > .scope-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding-top: 7px; text-transform: uppercase; letter-spacing: .03em; }
.mini-btns { display: inline-flex; gap: 6px; margin-left: auto; }
.scope-row-head { display: flex; align-items: center; }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { padding: 7px 12px; border-radius: 999px; border: 1px dashed var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.preset:hover { border-style: solid; border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

.builder-sentence { font-size: 13px; color: var(--muted); margin-top: 12px; }
.builder-sentence strong { color: var(--ink-2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); user-select: none;
}
.chip input { display: none; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.chip.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.chip.is-on .dot { background: var(--accent); }

/* ============================================================
   KPI cards
   ============================================================ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi__label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi__value { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.kpi__meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.kpi__accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.kpi--red .kpi__accent { background: var(--red); }
.kpi--amber .kpi__accent { background: var(--amber); }
.kpi--green .kpi__accent { background: var(--green); }

/* RAG distribution bar */
.ragbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; margin-top: 12px; background: var(--line); }
.ragbar span { display: block; height: 100%; }
.ragbar .seg-red { background: var(--red); }
.ragbar .seg-amber { background: var(--amber); }
.ragbar .seg-green { background: var(--green); }

/* ============================================================
   Chart
   ============================================================ */
.chart-wrap { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, -120%);
  background: var(--ink); color: #fff; padding: 8px 11px; border-radius: 8px; font-size: 12.5px;
  box-shadow: var(--shadow-md); white-space: nowrap; opacity: 0; transition: opacity .1s;
}
.chart-tip strong { font-weight: 600; }
.chart-tip .tip-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; }
.chart-tip .tip-dot { width: 8px; height: 8px; border-radius: 50%; }

.legend { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.legend-group { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.legend-swatch { width: 22px; height: 0; border-top: 3px solid var(--muted); border-radius: 2px; }
.legend-dot { width: 11px; height: 11px; border-radius: 50%; }
.legend-label { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-right: 2px; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--surface-2); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge .bdot { width: 7px; height: 7px; border-radius: 50%; }
.badge--red { background: var(--red-soft); color: #a8302f; }
.badge--red .bdot { background: var(--red); }
.badge--amber { background: var(--amber-soft); color: #9a6512; }
.badge--amber .bdot { background: var(--amber); }
.badge--green { background: var(--green-soft); color: #1c7a4d; }
.badge--green .bdot { background: var(--green); }

/* ============================================================
   Auth pages
   ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth__brand {
  background: var(--sidebar); color: #fff; padding: 48px 52px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth__brand::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px;
  background: radial-gradient(circle at center, rgba(45,98,224,.35), transparent 60%);
}
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-pitch h1 { font-size: 34px; line-height: 1.12; color: #fff; max-width: 12ch; }
.auth-pitch p { color: #aab3c1; max-width: 38ch; margin-top: 14px; }
.auth-rag { display: flex; gap: 10px; margin-top: 26px; }
.auth-rag .pill { display: flex; align-items: center; gap: 8px; background: var(--sidebar-2); border: 1px solid var(--sidebar-line); padding: 8px 13px; border-radius: 999px; font-size: 12.5px; color: #c4ccd8; }
.auth-rag .pill i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.auth__form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; font-size: 14px; }
.auth-card .field + .field { margin-top: 16px; }
.auth-card .btn { margin-top: 22px; }
.auth-foot { margin-top: 20px; font-size: 14px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.demo-note { margin-top: 18px; padding: 11px 13px; background: var(--accent-soft); border-radius: var(--r-sm); font-size: 12.5px; color: var(--accent-ink); }

/* ============================================================
   Misc helpers
   ============================================================ */
.proto-banner {
  background: #fff7e6; border-bottom: 1px solid #f0dca5; color: #8a6516;
  font-size: 12.5px; text-align: center; padding: 6px 14px; font-weight: 500;
}
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; align-items: center; }
.stack-sm > * + * { margin-top: 8px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 10px; }

/* Format/help table on upload page */
.format-grid { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; font-size: 12.5px; }
.format-grid div { padding: 8px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.format-grid .yr { background: #fff8c2; font-weight: 700; text-align: center; }
.format-grid .mh { background: #fffce0; font-weight: 600; text-align: center; }
.format-grid .mo { font-weight: 600; }

/* Mobile backdrop for off-canvas sidebar */
.backdrop { display: none; position: fixed; inset: 0; background: rgba(10,14,20,.45); z-index: 40; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1040px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50;
    transform: translateX(-100%); transition: transform .22s ease; height: 100vh;
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open .backdrop { display: block; }
  .menu-btn { display: inline-grid; place-items: center; }
  .auth { grid-template-columns: 1fr; }
  .auth__brand { padding: 30px 26px; }
  .auth-pitch h1 { font-size: 26px; }
  .auth-pitch { display: none; }   /* keep just logo + rag on small screens */
  .auth-rag { display: none; }
}

@media (max-width: 560px) {
  .page { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .kpis { grid-template-columns: 1fr; }
  .kpi__value { font-size: 26px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .panel__body { padding: 14px; }
}

/* ============================================================
   Daily Entry calendar
   ============================================================ */
:root { --c-med: #32C28E; --c-ohc: #36BFD6; --c-upg: #AC8AD6; }

.cal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.cal-nav { display: inline-flex; align-items: center; gap: 8px; }
.cal-nav button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 18px; color: var(--ink-2); }
.cal-nav button:hover { background: var(--surface-2); }
.cal-month { font-family: var(--font-display); font-size: 19px; font-weight: 700; min-width: 168px; text-align: center; }

.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.cal-legend .li { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.cal-legend .sw { width: 13px; height: 13px; border-radius: 4px; }

.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 8px; }
.cal-head div { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day { display: flex; flex-direction: column; gap: 6px; }
.day.is-pad { background: transparent; }
.day__num { text-align: center; font-weight: 600; font-size: 15px; color: var(--ink-2); margin-bottom: 2px; }
.day__num.sun { color: var(--red); }
.day__wd { display: none; color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 6px; }

.val { width: 100%; border: none; border-radius: 8px; padding: 9px 6px; text-align: center; font-weight: 700; font-size: 15px; color: #fff; font-family: inherit; appearance: textfield; -moz-appearance: textfield; }
.val::-webkit-outer-spin-button, .val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.val::placeholder { color: rgba(255,255,255,.72); font-weight: 600; }
.val:focus { outline: 2px solid rgba(0,0,0,.28); outline-offset: 1px; }
.val--med { background: var(--c-med); }
.val--ohc { background: var(--c-ohc); }
.val--upg { background: var(--c-upg); }

.cal-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 22px; }
.total-card { border-radius: var(--r-md); padding: 16px 18px; color: #fff; box-shadow: var(--shadow-sm); }
.total-card .t-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .94; }
.total-card .t-value { font-family: var(--font-display); font-size: 34px; font-weight: 700; margin-top: 4px; }
.tc-med { background: var(--c-med); }
.tc-ohc { background: var(--c-ohc); }
.tc-upg { background: var(--c-upg); }

@media (max-width: 760px) {
  .cal-head { display: none; }
  .cal-grid { grid-template-columns: 1fr; gap: 10px; }
  .day.is-pad { display: none; }
  .day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
  .day__num { width: 100%; text-align: left; margin-bottom: 0; }
  .day__wd { display: inline; }
  .val { flex: 1; min-width: 70px; }
  .cal-legend { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .cal-totals { grid-template-columns: 1fr; }
}

/* ============================================================
   Dashboard builder — collapsible sections (declutter)
   ============================================================ */
.disclosure { border: 1px solid var(--line); border-radius: var(--r-md); margin-top: 14px; background: #f8fafc; overflow: hidden; }
.disclosure > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; font-size: 13.5px; color: var(--ink); user-select: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { background: #f1f5f9; }
.disclosure > summary .chev { width: 18px; height: 18px; color: var(--muted); transition: transform .15s ease; flex: none; }
.disclosure[open] > summary .chev { transform: rotate(180deg); }
.disclosure > summary .disc-hint,
.disclosure > summary .disc-summary { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.disclosure__body { padding: 16px; background: var(--surface); }
.disclosure__body .preset-row { margin: 0; }
.disclosure__body .scope-grid { row-gap: 14px; }

/* ============================================================
   Apps launcher (tiles + embedded viewer)
   ============================================================ */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.app-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 1px 2px rgba(20, 30, 50, .06); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; position: relative; overflow: hidden; font-family: inherit; }
.app-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(20, 30, 50, .14); border-color: var(--accent); }
.app-tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.app-tile__badge { width: 46px; height: 46px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-bottom: 8px; }
.app-tile__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); }
.app-tile__host { font-size: 12.5px; color: var(--muted); }
.app-tile__go { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); }

.apps-viewer__bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.apps-viewer__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.apps-viewer__frame { width: 100%; height: calc(100vh - 210px); min-height: 460px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }

/* Apps tiles are links now */
a.app-tile { text-decoration: none; color: inherit; }
.app-tile__badge { font-size: 18px; letter-spacing: .3px; }

/* ============================================================
   Apps hub — standalone page (no sidebar)
   ============================================================ */
.apps-page { background: #f4f6fb; min-height: 100vh; }
.apps-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.apps-brand { display: flex; align-items: center; gap: 12px; }
.apps-user { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.apps-main { max-width: 1000px; margin: 0 auto; padding: 46px 28px 60px; }
.apps-main h1 { font-family: var(--font-display); font-size: 25px; font-weight: 700; margin: 0 0 6px; color: var(--ink); }
.apps-main .sub { color: var(--muted); margin: 0 0 28px; font-size: 14.5px; }

/* icon inside the tile badge */
.app-tile__badge { color: #fff; }
.app-tile__badge svg { width: 24px; height: 24px; }

/* ============================================================
   MFC curated table
   ============================================================ */
.mfc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mfc-table thead th { background: #f1f5f9; color: var(--ink-2); font-weight: 700; text-align: center; padding: 9px 12px; border: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.mfc-table thead th .sub { font-weight: 500; color: var(--muted); font-size: 11px; }
.mfc-table thead th.grp { background: #e8eefc; }
.mfc-table tbody td { padding: 0; border: 1px solid var(--line); text-align: right; }
.mfc-table tbody td.mon { text-align: left; padding: 7px 12px; color: var(--ink-2); white-space: nowrap; }
.mfc-table td.yr { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; background: #f8fafc; color: var(--ink); width: 64px; }
.mfc-table td.num { padding: 7px 12px; font-variant-numeric: tabular-nums; color: var(--ink); }
.mfc-table td.gt-col, .mfc-table th.gt-col { background: #fbf7ee; font-weight: 700; }
.mfc-table thead th.gt-col { background: #f4ecd8; }

.mfc-in { width: 100%; box-sizing: border-box; border: none; background: transparent; padding: 7px 12px; text-align: right; font: inherit; font-variant-numeric: tabular-nums; color: var(--ink); -moz-appearance: textfield; }
.mfc-in::-webkit-outer-spin-button, .mfc-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mfc-in::placeholder { color: #c7ced9; }
.mfc-in:focus { outline: 2px solid var(--accent, #2d62e0); outline-offset: -2px; background: #fff; }

.mfc-table tr.yr-total td { background: #eef2f7; font-weight: 700; color: var(--ink); padding: 8px 12px; border-top: 2px solid var(--line-2, #cbd5e1); }
.mfc-table tr.yr-total td.gt-col { background: #f1ead6; }
.mfc-table tr.all-total td { background: var(--ink, #141a24); color: #fff; font-weight: 700; padding: 10px 12px; }
.mfc-table tr.all-total td.gt-col { background: #2a3343; }

/* Statistics table tweaks */
.stats-table th.mon-h { background: #f8fafc; text-align: left; }
.stats-table td.avg, .stats-table th:nth-child(3n) { background: #fafbfd; }
.stats-table td.avg { color: var(--muted); font-style: italic; }
.stats-table thead th.grp { border-bottom: 1px solid var(--line); }
.stats-table .mfc-in { min-width: 56px; }

/* MFC vertical tables */
.mfc-table th.yr-h, .mfc-table th.mon-h { text-align: left; }
.mfc-table td.avg { color: var(--muted); font-style: italic; }

/* Tabs (MFC: MF / OHSC) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs .tab { appearance: none; border: none; background: transparent; padding: 10px 16px; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: var(--ink-2); }
.tabs .tab.is-active { color: var(--accent, #2d62e0); border-bottom-color: var(--accent, #2d62e0); }
.tab-panel[hidden] { display: none; }

/* Daily Entry: combined total card + date-range comparison */
.tc-all { background: linear-gradient(135deg, #2b3550, #1f2a44); }
.range-row { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-bottom: 18px; }
.range-grp { display: flex; align-items: center; gap: 8px; }
.range-grp .input[type="date"] { width: auto; }
.range-grp .dash { color: var(--muted); }
.range-tag { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 9px; border-radius: 6px; }
.range-a .range-tag { color: #2d62e0; background: rgba(45, 98, 224, .10); }
.range-b .range-tag { color: #e2982f; background: rgba(226, 152, 47, .14); }

/* Password field with show/hide toggle */
.pw-field { position: relative; }
.pw-field .input { padding-right: 42px; width: 100%; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 6px; cursor: pointer; color: var(--muted); display: flex; align-items: center; }
.pw-toggle:hover { color: var(--ink-2, #334155); }
.pw-toggle svg { width: 18px; height: 18px; }

/* Users admin page */
.chk-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.role-pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.role-pill.admin { color: #2d62e0; background: rgba(45,98,224,.10); }
.role-pill.user { color: #2aa269; background: rgba(42,162,105,.12); }
.btn--danger { background: #d64545; color: #fff; border: none; }
.btn--danger:hover { background: #c23a3a; }

/* Sidebar account links */
.user-links { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-top: 2px; }
.user-links a { color: var(--muted); text-decoration: none; }
.user-links a:hover { color: var(--accent, #2d62e0); }
.user-links .dot { color: var(--muted); opacity: .6; }

/* Change-password modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.22); overflow: hidden; }
.modal__head { padding: 16px 20px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--line, #e7eaf0); }
.modal__body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal__foot { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line, #e7eaf0); background: #fafbfc; }
