/* Brand: follows southlandtrailers.com (black + Southland amber, Poppins headings, Space Grotesk text).
   Fonts are self-hosted because the CSP only allows 'self'. */
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url(/static/fonts/poppins-600.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url(/static/fonts/poppins-700.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 800; font-display: swap; src: url(/static/fonts/poppins-800.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 300 700; font-display: swap; src: url(/static/fonts/space-grotesk.woff2) format("woff2"); }

:root {
  --font-head: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Space Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  --amber: #faa918;
  --amber-deep: #e0920a;
  --ink: #141414;            /* top bar, always dark */
  --ink-2: #222222;

  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f2f1ee;
  --border: #e3e1dc;
  --border-strong: #cfccc5;
  --text: #1b1b1b;
  --muted: #6b6965;
  --accent: var(--amber);
  --accent-text: #141414;
  --accent-soft: #fff1d6;
  --link: #9c5a00;
  --strong-bg: #1b1b1b;      /* active tabs, segmented controls */
  --strong-text: #ffffff;
  --note-bg: #fffaeb;
  --note-border: #ecd38c;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success: #1e7b45;
  --success-soft: #e6f4ec;
  --warn-soft: #fff4dc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.05), 0 2px 8px rgba(20, 20, 20, 0.04);
  --shadow-lift: 0 4px 18px rgba(20, 20, 20, 0.1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0f;
    --surface: #18181a;
    --surface-2: #212124;
    --border: #2d2d31;
    --border-strong: #3d3d42;
    --text: #ecebe8;
    --muted: #9b9994;
    --accent-soft: #3a2a0c;
    --link: #fbb83d;
    --strong-bg: #faa918;
    --strong-text: #141414;
    --note-bg: #2a2410;
    --note-border: #6b5622;
    --danger: #f27a6e;
    --danger-soft: #3a1d1b;
    --success: #5cc48a;
    --success-soft: #16301f;
    --warn-soft: #33290f;
    --shadow: none;
    --shadow-lift: 0 4px 18px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.7rem; margin: 0 0 4px; line-height: 1.2; letter-spacing: -0.035em; }
h2 { font-size: 1.15rem; margin: 28px 0 12px; }
h3 { font-size: 0.95rem; margin: 0 0 4px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
::selection { background: var(--amber); color: #141414; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.inline { display: inline; }

/* Top bar: black like the public site, with an amber rule */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 0 28px; min-height: 60px;
  background: var(--ink); color: #fff;
  border-bottom: 3px solid var(--amber);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; padding: 12px 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 20px; width: auto; display: block; }
.brand-app {
  font-family: var(--font-head); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--amber); padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.25); line-height: 1.6;
}
.mainnav { display: flex; gap: 2px; flex: 1; flex-wrap: nowrap; align-self: stretch; }
.mainnav a {
  display: flex; align-items: center; padding: 0 12px; white-space: nowrap;
  color: rgba(255, 255, 255, 0.78); font-family: var(--font-head); font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 3px solid transparent;
}
.mainnav a:hover { color: #fff; text-decoration: none; }
.mainnav a.active { color: #fff; border-bottom-color: #fff; }
.who { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.7); font-size: 0.88rem; }
.who .avatar { background: var(--amber); color: #141414; }
.topbar .linkbtn { color: var(--amber); }
.linkbtn { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

.container { max-width: 1280px; margin: 0 auto; padding: 32px 28px; }
.container.medium { max-width: 860px; }
.container.narrow { max-width: 440px; padding-top: 10vh; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head h1::before, .container > h1::before {
  /* the slanted amber bar echoes the italic Southland wordmark */
  content: ""; display: inline-block; width: 7px; height: 0.8em; margin-right: 12px;
  background: var(--amber); transform: skewX(-18deg); vertical-align: -0.04em;
}
.page-head > div > .muted { font-size: 0.88rem; margin-bottom: 2px; }

/* Surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card.empty, td.empty { color: var(--muted); text-align: center; padding: 36px 16px; }
.card h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.flash { padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; border-left-width: 4px; }
.flash.info { background: var(--accent-soft); border-left-color: var(--amber); }
.flash.success { background: var(--success-soft); color: var(--success); border-left-color: var(--success); }
.flash.error { background: var(--danger-soft); color: var(--danger); border-left-color: var(--danger); }
.flash.warn { background: var(--warn-soft); border-left-color: var(--amber-deep); }

/* Live updates (app.js): the "page changed" banner, and a brief highlight on new or changed items */
.live-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@keyframes live-new { from { background-color: var(--accent-soft); } }
.live-new { animation: live-new 4s ease-out; }
@media (prefers-reduced-motion: reduce) { .live-new { animation: none; box-shadow: inset 3px 0 0 var(--amber); } }

/* Forms */
input[type=text], input[type=email], input[type=search], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(250, 169, 24, 0.28); }
input[type=file] { font-size: 0.9rem; max-width: 100%; }
input[type=file]::file-selector-button {
  font: 600 0.8rem var(--font-head); padding: 6px 12px; margin-right: 10px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2); color: var(--text);
}
input[type=checkbox], input[type=radio] { accent-color: var(--amber); }
label { display: block; font-size: 0.88rem; font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 5px; font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
[hidden] { display: none !important; }

/* Category questions on the new-ticket forms */
fieldset.questions {
  margin: 0; min-width: 0; padding: 14px 16px 16px;
  border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
fieldset.questions legend { font-family: var(--font-head); font-weight: 600; padding: 0 6px; }
label .hint { display: block; font-weight: 400; margin-top: 2px; }
.questions label.check { align-items: flex-start; }
.questions label.check > input { margin-top: 3px; }
.req { color: var(--danger); }
.answers { margin-bottom: 14px; }
.answers dd { white-space: pre-line; }
.questions-admin .retired { opacity: 0.65; }
.question-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Buttons: pills, like the public site */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; font-family: var(--font-head); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.01em;
  border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface);
  color: var(--text); cursor: pointer; white-space: nowrap; line-height: 1.3;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--amber); border-color: var(--amber); color: #141414;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; font-size: 0.8rem;
  box-shadow: 0 2px 0 var(--amber-deep);
}
.btn.primary:hover { background: #ffb935; border-color: #ffb935; box-shadow: 0 2px 0 var(--amber-deep), 0 6px 16px rgba(250, 169, 24, 0.35); }
.btn.small { padding: 4px 12px; font-size: 0.8rem; }
.btn.wide { width: 100%; margin-bottom: 16px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

/* Lists */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .tabs { margin-bottom: 0; }
.tabs a {
  padding: 6px 14px; border-radius: 999px; color: var(--muted); font-family: var(--font-head);
  font-weight: 600; font-size: 0.82rem; border: 1px solid transparent;
}
.tabs a:hover { background: var(--surface); border-color: var(--border); color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--strong-bg); color: var(--strong-text); }
.count {
  display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 2px; border-radius: 999px; text-align: center;
  font-size: 0.75rem; font-weight: 700; background: var(--surface-2); color: var(--muted);
}
.tabs a.active .count { background: var(--amber); color: #141414; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .filters { margin-bottom: 0; }
.filters select { width: auto; }
.filters label.check { font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.filters label.check > input { margin: 0; }
.filters input[type=search] { width: 300px; max-width: 100%; }
.filters input[type=search], .filters select { border-radius: 999px; padding-left: 16px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.list th {
  text-align: left; font-family: var(--font-head); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap;
}
table.list th, table.list td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background 0.1s; }
table.list tbody tr:hover { background: var(--accent-soft); }
table.list tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
table.list td:first-child a { font-family: var(--font-head); font-weight: 600; font-size: 0.85rem; }
td.subject { min-width: 260px; }
td.subject a { color: var(--text); font-weight: 600; }
.row-form { display: flex; gap: 12px; align-items: center; }
.row-form select { width: auto; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 18px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-family: var(--font-head); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge[class*=" s-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.big { font-size: 0.85rem; padding: 5px 14px; }
.badge.s-new { background: #dbeafe; color: #1d4ed8; }
.badge.s-open { background: #ffedc7; color: #8a4b00; }
.badge.s-open_deferred { background: #fef6e4; color: #a16207; }
.badge.s-in_progress { background: #ede9fe; color: #6d28d9; }
.badge.s-holding_parts, .badge.s-holding_appointment { background: #ffe4e6; color: #be123c; }
.badge.s-resolved { background: #dcfce7; color: #166534; }
.badge.s-closed, .badge.s-canceled { background: var(--surface-2); color: var(--muted); }
.badge.note { background: var(--note-border); color: #5a4300; }
.badge.staff { background: var(--strong-bg); color: var(--strong-text); }
.badge.o-sent { background: var(--success-soft); color: var(--success); }
.badge.o-failed { background: var(--danger-soft); color: var(--danger); }
.badge.o-pending { background: var(--accent-soft); color: var(--link); }
@media (prefers-color-scheme: dark) {
  .badge.s-new { background: #172a4a; color: #8db7ff; }
  .badge.s-open { background: #3a2a0c; color: #fbc15a; }
  .badge.s-open_deferred { background: #2b2414; color: #d6b56a; }
  .badge.s-in_progress { background: #2a1f47; color: #c4b2ff; }
  .badge.s-holding_parts, .badge.s-holding_appointment { background: #3f1a22; color: #fda4af; }
  .badge.s-resolved { background: #16301f; color: #6fd39b; }
  .badge.note { color: #fbe3a0; }
}
.prio { font-size: 0.85rem; }
.prio.p-low { color: var(--muted); }
.prio.p-high { color: #c2410c; font-weight: 600; }
.prio.p-urgent { color: var(--danger); font-weight: 700; }
.prio.p-high::before, .prio.p-urgent::before { content: "▲ "; font-size: 0.7em; vertical-align: 0.1em; }
.kv { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 4px 12px; margin: 0; font-size: 0.88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.msg .body details { margin-top: 12px; }
.msg .body details > summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.tag { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--border-strong); padding: 0 7px; border-radius: 999px; margin-left: 4px; font-weight: 400; }

/* Ticket view */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.side .card { margin-bottom: 16px; }
.side p { margin: 4px 0; overflow-wrap: anywhere; }
.thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.msg.staff { border-left: 4px solid var(--amber); }
.msg.note { background: var(--note-bg); border: 1px dashed var(--note-border); }
.msg header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.msg header strong { font-family: var(--font-head); font-weight: 600; }
.msg.note header { border-color: var(--note-border); }
.msg header time { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink-2); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 0.8rem; flex: none;
}
.msg.staff .avatar { background: var(--amber); color: #141414; }
.msg .body { padding: 14px 18px; overflow-wrap: anywhere; overflow-x: auto; }
.body img { max-width: 100%; height: auto; }
.body p:first-child { margin-top: 0; }
.body p:last-child { margin-bottom: 0; }
.body blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.body pre { background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.code-block { background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.82rem; }
.body table { border-collapse: collapse; }
.body td, .body th { border: 1px solid var(--border); padding: 4px 8px; }
.files { list-style: none; margin: 0; padding: 4px 18px 14px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.88rem; }
.files li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; }
.files li::before { content: "📎 "; }
.event {
  display: flex; justify-content: space-between; gap: 12px; font-size: 0.82rem; color: var(--muted);
  padding: 0 8px 0 18px; position: relative;
}
.event::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }

.composer { display: flex; flex-direction: column; gap: 12px; }
.composer-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.composer-row input[type=file] { flex: 1; }
.inline-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.inline-label select { width: auto; margin: 0; }
.inline-label input[type=datetime-local] { width: auto; margin: 0; }
.composer-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-block { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 0.88rem; }
.cell-sub { margin-top: 3px; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; align-self: flex-start; }
.segmented label { font-family: var(--font-head); font-weight: 600; font-size: 0.8rem; padding: 5px 14px; cursor: pointer; display: flex; gap: 6px; align-items: center; border-radius: 999px; color: var(--muted); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--amber); outline-offset: 1px; }
fieldset.segmented { margin: 0; min-width: 0; }
.segmented label:has(input:checked) { background: var(--strong-bg); color: var(--strong-text); }
.composer.is-note { background: var(--note-bg); border: 1px dashed var(--note-border); }
.composer.is-note .segmented label:has(input:checked) { background: #c99a1e; color: #141414; }
.hint { margin: 0; font-size: 0.82rem; color: var(--muted); }

/* Knowledge base */
.kb-layout { grid-template-columns: minmax(0, 1fr) 260px; }
.topic-nav { display: flex; flex-direction: column; gap: 2px; }
.topic-nav h3 { margin-bottom: 8px; }
.topic-nav a { color: var(--text); padding: 6px 10px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.topic-nav a:hover { background: var(--surface-2); text-decoration: none; }
.topic-nav a.active { background: var(--accent-soft); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--amber); }
.head-actions { display: flex; align-items: center; gap: 10px; }
.article { padding: 0; }
.article .body { padding: 24px 28px; overflow-wrap: anywhere; overflow-x: auto; font-size: 1rem; }
.article .body h2:first-child, .article .body h3:first-child { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.rte { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.rte:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(250, 169, 24, 0.28); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.rte-toolbar .btn { padding: 2px 10px; font-size: 0.78rem; border-width: 1px; }
.rte-body { min-height: 320px; max-height: 70vh; overflow-y: auto; padding: 12px 14px; outline: none; }

/* Portal */
.cards { display: flex; flex-direction: column; gap: 10px; }
.ticket-card {
  display: flex; flex-direction: column; gap: 4px; color: var(--text); margin: 0; position: relative;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.ticket-card strong { font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.ticket-card:hover { border-color: var(--amber); box-shadow: var(--shadow-lift); transform: translateY(-1px); text-decoration: none; }
.ticket-card-top { display: flex; justify-content: space-between; gap: 12px; }
.ticket-card-top .muted { font-size: 0.85rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--amber); }
.stat strong { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }

/* Sign-in page: dark, like the public site's hero */
body.auth { background: var(--ink) radial-gradient(ellipse at 70% -10%, rgba(250, 169, 24, 0.22), transparent 55%); min-height: 100vh; }
body.auth .topbar { display: none; }
body.auth .container.narrow { padding-top: 12vh; }
.auth-logo { display: block; width: 260px; height: auto; max-width: 80%; margin: 0 auto 10px; }
.auth-tagline {
  text-align: center; color: var(--amber); font-family: var(--font-head); font-weight: 700; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.22em; margin: 0 0 28px;
}
body.auth .card { padding: 28px; border: 0; border-top: 4px solid var(--amber); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); }
.login h1 { margin-bottom: 8px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .stats, .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 1280px) {
  .who-name { display: none; }
}
@media (max-width: 1100px) {
  .topbar { gap: 0 16px; }
  .who { margin-left: auto; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 -16px; padding: 0 4px; border-top: 1px solid rgba(255, 255, 255, 0.08); scrollbar-width: none; }
  .mainnav a { padding: 12px 12px; }
}
@media (max-width: 600px) {
  .container { padding: 20px 16px; }
  .status-block { align-items: flex-start; }
  .topbar { padding: 0 16px; position: static; }
  .brand-app { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .filters input[type=search] { width: 100%; }
  .row-form { flex-wrap: wrap; }
}
