/* Mid Valley Fire – Report Portal
   Modern app shell: left sidebar for signed-in users, two-panel screen for sign-in.
   No external assets (strict Content Security Policy); Inter is self-hosted. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --brand: #d22f2f;
  --brand-dark: #b02424;
  --brand-soft: #fdecec;
  --brand-ink: #7f1a1a;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #e9ecf1;
  --line-strong: #d7dbe3;
  --focus: #2563eb;
  --ok: #15803d; --ok-bg: #ecfdf3; --ok-line: #b7ebc6;
  --warn: #92400e; --warn-bg: #fff8e6; --warn-line: #f6dc93;
  --err: #b42318; --err-bg: #fef1f0; --err-line: #f6b9b3;
  --info: #1d4ed8; --info-bg: #eef3ff; --info-line: #c9d8fe;
  --r-lg: 18px;
  --r: 12px;
  --r-sm: 9px;
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04), 0 2px 8px rgba(17, 24, 39, .04);
  --shadow-md: 0 4px 16px rgba(17, 24, 39, .08), 0 1px 3px rgba(17, 24, 39, .05);
  --shadow-lg: 0 20px 50px rgba(17, 24, 39, .14);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: 160ms cubic-bezier(.2, .7, .3, 1);
  --sidebar-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand-dark); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .9em; }
.center { text-align: center; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; font-weight: 700; color: var(--faint); margin-bottom: .35rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--brand); }
.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.icon--lg { width: 1.6em; height: 1.6em; }

/* Accessibility */
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 8px; outline: 2px solid var(--focus); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }

/* =========================================================================================
   App shell (signed in): sidebar + content
   ========================================================================================= */
.app { display: flex; min-height: 100vh; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.sidebar { width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; z-index: 30; }
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; color: var(--ink); text-decoration: none; }
.sidebar__brand:hover { color: var(--ink); }
.brand__mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, #1f2430, #0f1218); display: grid; place-items: center; flex: none; box-shadow: 0 6px 14px rgba(15, 18, 24, .25); }
.brand__mark svg { width: 20px; height: 20px; fill: #ff5a4e; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 800; font-size: 1rem; letter-spacing: -.01em; }
.brand__sub { font-size: .68rem; color: var(--faint); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.sidebar__section { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 10px 12px 6px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .93rem; transition: background var(--ease), color var(--ease); }
.sidebar__nav a .icon { width: 19px; height: 19px; color: var(--muted); transition: color var(--ease); }
.sidebar__nav a:hover { background: var(--surface-2); color: var(--ink); }
.sidebar__nav a.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.sidebar__nav a.is-active .icon { color: var(--brand); }
.sidebar__footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); transition: background var(--ease); }
.userchip:hover { background: var(--surface-2); color: var(--ink); }
.userchip__avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(145deg, #e5e7eb, #d1d5db); color: var(--ink-2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.userchip__avatar--staff { background: linear-gradient(145deg, #fca5a5, #d22f2f); color: #fff; }
.userchip__text { min-width: 0; line-height: 1.2; }
.userchip__name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip__meta { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__signout { margin-top: 6px; }
.sidebar__signout .btn { width: 100%; justify-content: flex-start; color: var(--muted); }
.sidebar__signout .btn:hover { color: var(--err); background: var(--err-bg); }

.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobilebar { display: none; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 25; }
.mobilebar__brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; }
.mobilebar__brand .brand__mark { width: 30px; height: 30px; border-radius: 8px; }
.mobilebar__brand .brand__mark svg { width: 16px; height: 16px; }
.mobilebar__toggle { margin-left: auto; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.mobilebar__toggle .icon { width: 20px; height: 20px; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 29; }

.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 34px 40px 64px; }
.flash-stack { margin-bottom: 4px; }
.app-footer { margin-top: auto; padding-top: 0; padding-bottom: 28px; color: var(--faint); }
.app-footer a { color: var(--muted); }
.app-footer .icon { width: 14px; height: 14px; }

/* =========================================================================================
   Auth shell (signed out): brand panel + form
   ========================================================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth__brand { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at -10% -10%, rgba(210, 47, 47, .55), transparent 55%), linear-gradient(160deg, #1b202b 0%, #0f1218 100%); color: #fff; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth__brand::after { content: ""; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255, 90, 78, .35), rgba(255, 90, 78, 0) 70%); pointer-events: none; }
.auth__brand .brand__name, .auth__brand .brand__sub { color: #fff; }
.auth__brand .brand__sub { color: rgba(255, 255, 255, .6); }
.auth__brand .sidebar__brand { padding: 0; color: #fff; }
.auth__brand .brand__mark { background: rgba(255, 255, 255, .1); box-shadow: none; border: 1px solid rgba(255, 255, 255, .15); }
.auth__headline { font-size: 2rem; font-weight: 800; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 14px; max-width: 460px; }
.auth__lead { color: rgba(255, 255, 255, .72); font-size: 1.02rem; max-width: 440px; margin-bottom: 28px; }
.auth__points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; max-width: 440px; }
.auth__points li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .85); font-size: .95rem; }
.auth__points .icon { width: 20px; height: 20px; color: #ff8a80; flex: none; margin-top: 2px; }
.auth__points strong { color: #fff; display: block; font-weight: 600; }
.auth__foot { color: rgba(255, 255, 255, .45); font-size: .8rem; position: relative; }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__panel-inner { width: 100%; max-width: 480px; }
.auth__panel .card--narrow { max-width: none; margin: 0; }
.auth__panel .card--wide { max-width: none; }
.auth__panel .login-logo { display: none; }
.auth .flash-stack { width: 100%; max-width: 480px; margin: 0 auto; }

/* =========================================================================================
   Components
   ========================================================================================= */
/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 24px 26px; margin-bottom: 22px; }
.card--narrow { max-width: 460px; margin: 40px auto; }
.card--wide { max-width: 620px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__head h2 { margin: 0; display: inline-flex; align-items: center; gap: 9px; }
.card__head h2 .icon { color: var(--faint); width: 18px; height: 18px; }
.card__head > a.small { font-weight: 600; text-decoration: none; }
.card__head > a.small:hover { text-decoration: underline; }
.card--flush .card__head { padding: 18px 22px 0; }
.card .table-wrap { margin: 0 -26px -24px; }
.card--flush .table-wrap { margin: 0; }
.card .table-wrap table { border-top: 1px solid var(--line); }
.card--flush .table-wrap table { border-top: 0; }
.card .empty { margin: 0 -26px -24px; }
.card--flush .empty { margin: 0; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; max-width: 640px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 22px; align-items: start; }
.grid-2--sidebar { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }
.stack > * + * { margin-top: 22px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease); }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); color: inherit; }
.stat__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.stat__icon .icon { width: 22px; height: 22px; }
.stat__icon--red { background: var(--brand-soft); color: var(--brand); }
.stat__icon--blue { background: #e8f0fe; color: #1d4ed8; }
.stat__icon--green { background: var(--ok-bg); color: var(--ok); }
.stat__icon--amber { background: var(--warn-bg); color: #b45309; }
.stat__icon--purple { background: #f1e8fd; color: #6d28d9; }
.stat__value { font-size: 1.75rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; }
.stat__label { color: var(--muted); font-size: .84rem; margin-top: 2px; }

/* Summary strip (customer home) */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.summary__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-sm); }
.summary__item .icon { width: 22px; height: 22px; color: var(--brand); flex: none; }
.summary__value { font-weight: 800; font-size: 1.15rem; line-height: 1.2; letter-spacing: -.02em; }
.summary__label { color: var(--muted); font-size: .8rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: 6px; line-height: 1.45; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 13px; min-height: 44px; transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #bfc5cf; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(210, 47, 47, .12); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.form-actions--center { justify-content: center; }

/* Password field + strength */
.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.password-field__toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; color: var(--muted); padding: 7px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.password-field__toggle:hover { color: var(--ink); background: var(--surface-2); }
.strength { margin-top: 10px; }
.strength__bar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.strength__fill { height: 100%; width: 0; background: var(--err); transition: width var(--ease), background var(--ease); border-radius: 6px; }
.strength--ok .strength__fill { background: #d97706; }
.strength--good .strength__fill { background: var(--ok); }
.strength__list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; font-size: .8rem; color: var(--muted); }
.strength__list li { display: flex; align-items: center; gap: 6px; }
.strength__list li .icon { width: 14px; height: 14px; }
.strength__list li.is-met { color: var(--ok); }

/* Upload drop zone */
.dropzone { position: relative; border: 2px dashed var(--line-strong); border-radius: 14px; padding: 26px 16px; text-align: center; background: var(--surface-2); transition: border-color var(--ease), background var(--ease); cursor: pointer; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--ok-line); background: var(--ok-bg); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__icon { width: 40px; height: 40px; color: var(--faint); margin: 0 auto 8px; display: block; }
.dropzone.has-file .dropzone__icon { color: var(--ok); }
.dropzone__title { font-weight: 600; }
.dropzone__meta { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.dropzone__file { font-weight: 600; word-break: break-all; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: .92rem; padding: 0 16px; min-height: 42px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 1px 2px rgba(210, 47, 47, .25), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; box-shadow: 0 4px 12px rgba(210, 47, 47, .28); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn--secondary:hover { background: var(--surface-2); border-color: #bfc5cf; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--danger { background: var(--surface); color: var(--err); border-color: var(--err-line); }
.btn--danger:hover { background: var(--err-bg); color: var(--err); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: .82rem; gap: 5px; border-radius: 9px; }
.btn--block { width: 100%; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 1rem; border-radius: 12px; }
.btn[disabled], .btn.is-loading { opacity: .65; cursor: default; pointer-events: none; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Alerts / flash */
.alert { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r); border: 1px solid; margin-bottom: 18px; font-size: .94rem; }
.alert .icon { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.alert__body { flex: 1; }
.alert__close { background: transparent; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; margin: -2px -4px 0 0; }
.alert__close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.alert--success { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.alert--warning { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.alert--error { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.alert--info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.flash-stack .alert { animation: fade-in .25s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Tables → clean lists */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; background: var(--surface); position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.actions, th.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn, td.actions form + .btn, td.actions .btn + form, td.actions form + form { margin-left: 6px; }
.report-name { font-family: var(--mono); font-weight: 700; font-size: .93rem; letter-spacing: .01em; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty .icon { width: 48px; height: 48px; padding: 11px; border-radius: 50%; background: var(--surface-2); color: var(--faint); margin-bottom: 10px; }
.empty strong { color: var(--ink-2); }
.empty .btn { margin-top: 12px; }

/* Badges & pills */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; line-height: 1.4; white-space: nowrap; border: 1px solid transparent; letter-spacing: .01em; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--blue { background: #e8f0fe; color: #1d4ed8; border-color: #d3e0fd; }
.badge--red { background: #fdecec; color: #b42318; border-color: #f9cfcc; }
.badge--purple { background: #f1e8fd; color: #6d28d9; border-color: #e2d3fb; }
.badge--amber { background: #fff4d6; color: #92400e; border-color: #f7e2a6; }
.badge--green { background: #e6f6ec; color: #166534; border-color: #c6ecd3; }
.badge--gray { background: #f1f3f5; color: #4b5563; border-color: #e3e7ec; }
.badge--new { background: var(--brand); color: #fff; border-color: var(--brand); font-size: .66rem; padding: 2px 8px; letter-spacing: .06em; text-transform: uppercase; }
.badge--new::before { display: none; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 7px; background: #f1f3f5; color: var(--ink-2); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--err { background: var(--err-bg); color: var(--err); }
.pill--info { background: var(--info-bg); color: var(--info); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .8rem; font-weight: 600; text-decoration: none; }
.chip:hover { background: var(--ink-2); color: #fff; }
.chip .icon { width: 14px; height: 14px; }

/* Service groups (customer & admin report views) */
.service-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); margin-bottom: 20px; overflow: hidden; }
.service-group__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.service-group__head::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gc, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gc, var(--brand)) 18%, transparent); flex: none; }
.service-group__head h2 { margin: 0; font-size: 1.05rem; }
.service-group__count { color: var(--muted); font-size: .85rem; margin-left: auto; white-space: nowrap; }
.service-group--blue { --gc: #2563eb; }
.service-group--red { --gc: #dc2626; }
.service-group--purple { --gc: #7c3aed; }
.service-group--amber { --gc: #d97706; }
.service-group--green { --gc: #16a34a; }
.service-group th { position: static; }
.service-group th, .service-group td { padding: 12px 14px; }
/* In the narrow reports column next to the upload form, drop secondary columns earlier */
@media (max-width: 1500px) { .grid-2--sidebar th.hide-md, .grid-2--sidebar td.hide-md { display: none; } }

/* Filter bar */
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.filters .field { margin: 0; min-width: 200px; }
.filters .field label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.filters .btn { margin-bottom: 1px; }
.filters .spacer { flex: 1; }
.filters .summary-text { color: var(--muted); font-size: .9rem; align-self: center; white-space: nowrap; }

/* Misc */
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: .93rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.name-preview { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 11px 13px; display: flex; align-items: center; gap: 9px; }
.name-preview.is-empty { color: var(--muted); font-weight: 400; font-family: var(--font); }
.name-preview .icon { color: var(--faint); }
.message-body { white-space: pre-wrap; font-size: .93rem; }
details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--ease); margin-right: 4px; }
details[open] summary::before { transform: rotate(45deg); }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.trust { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: .8rem; margin-top: 14px; }
.trust .icon { width: 15px; height: 15px; color: var(--ok); }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-line { display: flex; align-items: center; gap: 8px; }
.copy-btn { gap: 6px; }
.copy-btn.is-copied { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.greeting { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; margin: 0 0 6px; }

/* Utilities */
.mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; }
.mb-10 { margin-bottom: 10px; }
.w-240 { width: 260px; max-width: 100%; }
.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Two-factor authentication */
.code-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .22em; text-align: center; min-height: 52px; }
.steps { padding-left: 22px; margin: 0; }
.steps li { margin-bottom: 20px; }
.steps li::marker { font-weight: 800; color: var(--brand); }
.qr { display: block; width: fit-content; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 12px 0 8px; box-shadow: var(--shadow-xs); }
.qr svg { display: block; width: 200px; height: 200px; }
.manual-key { font-size: 1.05rem; letter-spacing: .08em; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; user-select: all; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.recovery-codes { columns: 2; list-style: none; padding: 0; margin: 0 0 16px; }
.recovery-codes li { font-size: 1.1rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; break-inside: avoid; text-align: center; background: var(--surface-2); }
.audit-details { font-family: var(--mono); font-size: .78rem; color: var(--muted); word-break: break-all; }

/* =========================================================================================
   Responsive
   ========================================================================================= */
@media (max-width: 1100px) {
  th.hide-md, td.hide-md { display: none; }
  .content { padding: 28px 28px 56px; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: auto; transform: translateX(-104%); transition: transform 220ms cubic-bezier(.2, .7, .3, 1); box-shadow: none; }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .nav-toggle:checked ~ .scrim { display: block; }
  .mobilebar { display: flex; }
  .auth { grid-template-columns: 1fr; }
  .auth__brand { padding: 24px 22px; }
  .auth__brand::after { display: none; }
  .auth__headline { font-size: 1.35rem; margin-bottom: 6px; }
  .auth__lead { font-size: .92rem; margin-bottom: 0; }
  .auth__points, .auth__foot { display: none; }
  .auth__panel { align-items: flex-start; padding: 24px 16px 40px; }
}
@media (max-width: 860px) {
  .grid-2, .grid-2--sidebar { grid-template-columns: 1fr; }
  th { position: static; }
}
@media (max-width: 640px) {
  .content { padding: 18px 14px 40px; }
  h1 { font-size: 1.45rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; gap: 12px; }
  .stat__icon { width: 38px; height: 38px; border-radius: 11px; }
  .stat__value { font-size: 1.4rem; }
  .stat__label { font-size: .78rem; }
  .card { padding: 18px; }
  .card .table-wrap, .card .empty { margin-left: -18px; margin-right: -18px; margin-bottom: -18px; }
  .card--narrow { margin: 16px auto; }
  .form-row { grid-template-columns: 1fr; }
  .filters .field { min-width: 0; flex: 1 1 140px; }
  th.hide-sm, td.hide-sm { display: none; }
  td.actions .btn { padding: 0 10px; }
  td.actions .btn + .btn { margin-left: 4px; }
  .recovery-codes { columns: 1; }
  .page-head .btn { width: 100%; }
  .summary { display: flex; overflow-x: auto; gap: 10px; scrollbar-width: none; padding-bottom: 2px; }
  .summary::-webkit-scrollbar { display: none; }
  .summary__item { flex: 0 0 auto; min-width: 160px; padding: 12px 14px; }
  .summary__item .icon { display: none; }
  .summary__value { font-size: 1rem; }
  .summary__label { font-size: .74rem; }
}
@media print {
  .sidebar, .mobilebar, .scrim, .filters, .btn, form, .skip-link, .alert__close, .auth__brand { display: none !important; }
  .card, .service-group { box-shadow: none; }
  .recovery-codes li { border-color: #000; }
  .content { padding: 0; }
}
