:root {
  --red: #e2231a;
  --red-dark: #b81913;
  --red-soft: #fdecea;
  --ink: #252525;
  --ink-soft: #4f4f4f;
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --bg: #f4f5f7;
  --surface: #fff;
  --green: #1e8e3e;
  --blue: #2563eb;
  --amber: #a66b16;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); }
a { color: var(--red); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(226, 35, 26, .2); outline-offset: 2px; }
.layout { min-height: 100vh; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; width: 244px; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar, .main, .sidebar-toggle { transition: width .18s ease, margin-left .18s ease, left .18s ease; }
.brand { display: flex; min-height: 88px; align-items: center; gap: 13px; padding: 18px 20px; border-bottom: 1px solid #eee; color: var(--ink); text-decoration: none; }
.brand img { width: 96px; height: 42px; object-fit: contain; }
.brand > span { padding-left: 12px; border-left: 1px solid #ddd; color: #444; font-size: 12px; font-weight: 800; letter-spacing: .04em; line-height: 1.15; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 0; }
.main-nav { display: grid; gap: 4px; padding: 18px 12px; }
.main-nav a { display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 10px 13px; border-left: 3px solid transparent; border-radius: 7px; color: #555; font-weight: 600; text-decoration: none; }
.main-nav a:hover { background: #f7f7f8; color: #222; }
.main-nav a.active { border-left-color: var(--red); background: var(--red-soft); color: var(--red); font-weight: 800; }
.nav-icon { display: grid; width: 20px; height: 20px; flex: none; place-items: center; font-size: 20px; font-weight: 400; line-height: 1; }
.account { display: flex; min-width: 0; align-items: center; gap: 10px; margin-top: auto; padding: 15px 14px; border-top: 1px solid var(--line); }
.account-mark { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 50%; background: #333; color: #fff; font-size: 12px; font-weight: 800; }
.account-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.account-text strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.account form { margin: 0; }
.link-button { border: 0; background: none; color: #777; font-size: 20px; cursor: pointer; }
.sidebar-toggle { position: fixed; z-index: 45; top: 28px; left: 226px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #777; cursor: pointer; box-shadow: 0 3px 10px rgba(0, 0, 0, .06); }
.sidebar-toggle span { width: 8px; height: 8px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
.sidebar-toggle:hover { color: var(--red); }
.sidebar-collapsed .sidebar { width: 76px; }
.sidebar-collapsed .brand { justify-content: center; padding: 16px 8px; }
.sidebar-collapsed .brand img { width: 58px; }
.sidebar-collapsed .brand > span, .sidebar-collapsed .main-nav a > span:last-child, .sidebar-collapsed .account-text, .sidebar-collapsed .account form { display: none; }
.sidebar-collapsed .main-nav { padding-right: 10px; padding-left: 10px; }
.sidebar-collapsed .main-nav a { justify-content: center; padding-right: 8px; padding-left: 8px; border-left-width: 0; }
.sidebar-collapsed .main-nav a.active { box-shadow: inset 3px 0 0 var(--red); }
.sidebar-collapsed .account { justify-content: center; padding-right: 8px; padding-left: 8px; }
.sidebar-collapsed .sidebar-toggle { left: 59px; }
.sidebar-collapsed .sidebar-toggle span { transform: rotate(225deg); }
.sidebar-collapsed .main { margin-left: 76px; }

.main { min-height: 100vh; margin-left: 244px; padding: 27px 32px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 auto 18px; padding: 0; }
.page-head > div { min-width: 0; }
.eyebrow, .section-kicker { margin: 0 0 4px; color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-head h1 { margin: 0; color: #202124; font-size: clamp(24px, 2.5vw, 30px); line-height: 1.15; }
.page-head p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--red); color: #fff; }
.button.primary:hover { background: var(--red-dark); }
.button.secondary { border-color: var(--line); background: #fff; color: #444; }
.button.secondary:hover { border-color: #c9c9c9; background: #fafafa; }
.button.danger { border-color: #d3918d; background: #fff; color: #a51e19; }
.button.danger:hover { border-color: var(--red); background: var(--red-soft); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.access-decision { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.access-decision select { min-height: 40px; min-width: 120px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.full { width: 100%; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 14px; }
.card { position: relative; display: grid; min-width: 0; min-height: 103px; grid-template-columns: 1fr auto; align-content: center; gap: 2px 12px; padding: 16px 18px; overflow: hidden; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; background: #fff; }
.card span, .card small { grid-column: 1; }
.card span { color: var(--muted); font-size: 11px; font-weight: 650; }
.card strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--red); font-size: 30px; line-height: 1; }
.card strong b { color: #888; font-size: 14px; font-weight: 600; }
.card small { color: #8a8a8a; font-size: 10px; }
.card-blue { border-left-color: var(--blue); }
.card-blue strong { color: var(--blue); }
.card-amber { border-left-color: var(--amber); }
.card-amber strong { color: var(--amber); }
.card-green { border-left-color: var(--green); }
.card-green strong { color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .72fr); align-items: start; gap: 14px; }
.dashboard-grid-single { grid-template-columns: 1fr; }
.panel { margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 4px 14px rgba(25, 30, 36, .025); }
.panel-head { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; color: #222; font-size: 17px; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.panel-count { flex: none; padding: 5px 9px; border-radius: 20px; background: #f1f2f3; color: #666; font-size: 10px; font-weight: 700; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; padding: 12px 15px; border-bottom: 1px solid #eee; background: #fafafa; }
.filters label { min-width: 165px; flex: 0 1 190px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 14px; padding: 20px 22px; }
.quick-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 17px 18px 19px; }
.form-grid label, .filters label, .small-form label, .stack label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.wide { grid-column: 1 / -1; }
.span-2 { grid-column: span 2; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #d8d8d8; border-radius: 8px; background: #fff; color: var(--ink); outline: none; }
input:hover, select:hover, textarea:hover { border-color: #bcbcbc; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 35, 26, .09); }
textarea { resize: vertical; }
.hint { margin: 0; padding: 13px 18px 0; color: var(--muted); font-size: 12px; }

.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid #eee; text-align: left; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
th { background: #fafafa; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
td { color: #4a4a4a; font-size: 12px; }
td strong, td small { display: block; }
td small { margin-top: 2px; color: #888; font-size: 10px; }
.prefix { color: #282828; font-size: 12px; }
[data-detail-row] { cursor: pointer; }
[data-detail-row]:hover { background: #fff9f7; }
[data-detail-row]:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.table-link { color: var(--red); font-size: 11px; font-weight: 750; text-decoration: none; }
.empty { padding: 38px 20px !important; color: var(--muted); text-align: center; }
.empty strong, .empty span { display: block; }
.empty strong { color: #444; font-size: 13px; }
.empty span { margin-top: 4px; font-size: 11px; }

.badge, .availability { display: inline-flex; width: max-content; align-items: center; padding: 4px 9px; border-radius: 12px; background: #ececec; color: #555; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.em_viagem { background: #e8f1fb; color: #24538a; }
.badge.retornando { background: #fff3df; color: #8a5810; }
.badge.agenciada { background: #f0edff; color: #5d4aa8; }
.badge.concluida, .availability.disponivel { background: #e4f4ea; color: #17653b; }
.badge.cancelada { background: var(--red-soft); color: var(--red); }
.availability.manutencao { background: #fff3df; color: #8a5810; }
.availability.inativo { background: #ececec; color: #666; }

.fleet-panel { margin-top: 0; }
.registration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.registration-grid .panel:last-child { grid-column: 1 / -1; }
.small-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 17px 20px; background: #fafafa; }
.small-form button { align-self: end; }
.inline-form { display: flex; align-items: center; gap: 6px; }
.inline-form select { min-width: 140px; }
.inline-form .button { min-height: 36px; padding: 6px 10px; }
.notice { margin-bottom: 16px; padding: 12px 15px; border-radius: 8px; }
.notice.error { background: var(--red-soft); color: #8f1712; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; margin: 0; padding: 14px 20px; }
.facts div { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.facts dd { margin: 0; color: #333; font-weight: 750; }
.timeline { margin: 0; padding: 8px 22px 22px; list-style: none; }
.timeline > li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.timeline > li:last-child { border-bottom: 0; }
.timeline-dot { width: 9px; height: 9px; margin-top: 5px; border: 2px solid var(--red); border-radius: 50%; background: var(--red-soft); }
.timeline strong, .timeline small { display: block; }
.timeline small { color: var(--muted); }
.timeline ul { margin: 6px 0 0; padding-left: 17px; color: var(--ink-soft); }

.login-body { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: var(--bg); }
.login-card { width: min(100%, 370px); padding: 34px 30px; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 12px; background: #fff; text-align: center; box-shadow: 0 12px 32px rgba(0, 0, 0, .06); }
.login-card img { height: 62px; width: auto; }
.login-card h1 { margin: 18px 0 5px; font-size: 20px; }
.login-card p, .login-card small { color: var(--muted); }
.stack { display: grid; gap: 14px; margin: 20px 0; text-align: left; }

/* A página operacional privilegia a tabela; filtros e inclusão ficam sob demanda. */
.operations-overview, .operations-panel { width: 100%; max-width: 1450px; margin-right: auto; margin-left: auto; }
.operations-overview { display: grid; grid-template-columns:minmax(210px,.8fr) minmax(470px,1.65fr) 190px; align-items: stretch; gap: 0; margin-bottom: 12px; padding: 17px 20px; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 11px; background: #fff; }
.overview-title { align-self: center; padding-right: 20px; }
.overview-title h1 { margin: 0; font-size: clamp(23px,2.2vw,29px); line-height: 1.1; }
.overview-title > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.overview-insights { display: grid; grid-template-columns: minmax(220px,.9fr) minmax(250px,1.15fr); align-items: center; min-width: 0; border-right: 1px solid #ededed; border-left: 1px solid #ededed; }
.overview-chart { min-width: 0; padding: 0 20px; }
.overview-chart + .overview-chart { border-left: 1px solid #ededed; }
.status-overview { display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; gap: 12px; }
.donut-chart svg { display: block; width: 76px; height: 76px; overflow: visible; }
.donut-chart circle { fill: none; transform: rotate(-90deg); transform-origin: 50% 50%; }
.donut-track { stroke: #ececec; stroke-width: 5; }
.donut-segment { stroke-width: 5; }
.donut-chart text { fill: var(--ink); font-size: 8px; font-weight: 800; text-anchor: middle; }
.donut-chart .donut-caption { fill: var(--muted); font-size: 4px; font-weight: 500; }
.status-programada { stroke: #667085; background: #667085; }.status-agenciada { stroke: #7459c8; background: #7459c8; }.status-em_viagem { stroke: #2563eb; background: #2563eb; }.status-retornando { stroke: #d18a1f; background: #d18a1f; }.status-concluida { stroke: #1e8e3e; background: #1e8e3e; }.status-cancelada { stroke: var(--red); background: var(--red); }
.chart-copy h2, .weekly-overview h2 { margin: 0 0 6px; font-size: 11px; }
.chart-copy ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.chart-copy li { display: grid; grid-template-columns: 7px minmax(0,1fr) 18px; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.chart-copy li i { width: 6px; height: 6px; border-radius: 2px; }
.chart-copy li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-copy li strong { color: var(--ink); text-align: right; }
.chart-copy .chart-empty { display: block; }
.weekly-overview header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.weekly-overview header h2 { margin-bottom: 1px; }
.weekly-overview header span { color: var(--muted); font-size: 9px; }
.weekly-overview header > strong { color: #667085; font-size: 15px; }
.weekly-chart { display: block; width: 100%; max-height: 72px; margin-top: 2px; }
.weekly-chart line { stroke: #d7d7d7; stroke-width: 1; }
.weekly-chart rect { fill: #98a2b3; }
.weekly-chart rect.current { fill: var(--red); }
.weekly-chart text { text-anchor: middle; }
.weekly-chart .chart-value { fill: #475467; font-size: 7px; font-weight: 700; }
.weekly-chart .chart-label { fill: #667085; font-size: 7px; }
.overview-summary { display: grid; align-content: center; gap: 8px; padding-left: 20px; }
.overview-summary article { display: grid; min-height: 48px; grid-template-columns: 45px 1fr; align-items: center; padding: 7px 11px; border-left: 3px solid #667085; border-radius: 7px; background: #f8f8f8; }
.overview-summary article.active { border-left-color: var(--blue); }
.overview-summary article strong { color: #344054; font-size: 23px; line-height: 1; }
.overview-summary article.active strong { color: var(--blue); }
.overview-summary article span { color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.2; }
.overview-summary .button { min-height: 38px; }
.operations-panel { margin-bottom: 0; box-shadow: none; }
.operations-panel-head { min-height: 74px; }
.operations-panel-head h2 { font-size: 18px; }
.results-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.table-toolbar { display: flex; align-items: end; gap: 9px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #fafafa; }
.table-toolbar label { display: grid; min-width: 145px; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.table-toolbar .search-field { min-width: 240px; flex: 1; }
.table-toolbar input, .table-toolbar select { min-height: 38px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 500; text-transform: none; }
.table-toolbar .button { min-height: 38px; }
.filter-actions { display: flex; gap: 7px; }
.button.quiet { min-height: 38px; padding-right: 10px; padding-left: 10px; color: var(--muted); }
.operations-table table { min-width: 940px; }
.operations-table th, .operations-table td { height: 52px; }
.operations-table td:nth-child(4) { min-width: 170px; white-space: normal; }

.modal { width: min(680px, calc(100% - 28px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 0; border-radius: 12px; background: transparent; box-shadow: 0 24px 70px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(22, 24, 28, .56); backdrop-filter: blur(2px); }
.modal-card { max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 12px; background: #fff; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-head p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.modal-close { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border: 0; border-radius: 50%; background: #f1f1f1; color: #666; font-size: 24px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 20px 22px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin: 3px -22px 0; padding: 14px 22px; border-top: 1px solid var(--line); }
.detail-modal { width: min(570px, calc(100% - 28px)); }
.detail-list { margin: 0; padding: 5px 22px 14px; }
.detail-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { max-width: 60%; margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; text-align: right; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px 20px; border-top: 1px solid var(--line); }
.detail-actions form { margin: 0 auto 0 0; }
.restore-form { padding: 0 20px 20px; }
#nova-programacao { width: min(540px, calc(100% - 28px)); }
#nova-programacao .modal-head { padding: 22px 28px 10px; border-bottom: 0; }
#nova-programacao .modal-head h2 { font-size: 25px; }
#nova-programacao .modal-form { gap: 13px 16px; padding: 9px 28px 22px; }
#nova-programacao .trip-form label, #nova-programacao .trip-picker label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
#nova-programacao .trip-form input, #nova-programacao .trip-form select { min-height: 43px; border-color: #d8d8d8; background: #fff; font-size: 14px; }
#nova-programacao .trip-form input:focus, #nova-programacao .trip-form select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 35, 26, .09); }
.trip-picker { position: relative; display: grid; gap: 5px; min-width: 0; }
.trip-picker small { color: var(--muted); font-size: 11px; }
.trip-picker-source[hidden], .trip-suggestions[hidden] { display: none; }
.trip-suggestions { position: absolute; z-index: 25; top: calc(100% + 2px); right: 0; left: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); }
.trip-option, .trip-option-empty { display: block; width: 100%; min-height: 0; padding: 10px 12px; border: 0; border-bottom: 1px solid #eee; background: #fff; color: var(--ink); font: inherit; text-align: left; }
.trip-option { cursor: pointer; }
.trip-option:hover, .trip-option.is-highlighted { background: var(--red-soft); color: var(--red-dark); }
.trip-option:last-child, .trip-option-empty:last-child { border-bottom: 0; }
.trip-option-empty { color: var(--muted); font-size: 12px; }
.trip-form-help { margin: -2px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
#nova-programacao .modal-actions { margin: 3px -28px -22px; padding: 16px 28px 22px; border-top: 0; }
#nova-programacao .modal-actions .primary { background: var(--red); color: #fff; }
#nova-programacao .modal-actions .primary:hover { background: var(--red-dark); }

@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .quick-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-form-grid label.wide { grid-column: span 2; }
  .quick-form-grid div.wide { grid-column: 1 / -1; }
  .operations-overview { grid-template-columns: minmax(0,1fr) 190px; }
  .overview-title { grid-column: 1; }
  .overview-summary { grid-row: 1; grid-column: 2; }
  .overview-insights { grid-row: 2; grid-column: 1 / -1; margin-top: 14px; padding-top: 14px; border-top: 1px solid #ededed; border-right: 0; border-left: 0; }
}

@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { min-height: 70px; padding: 11px 16px; }
  .brand img { width: 82px; height: 37px; }
  .main-nav { display: flex; overflow-x: auto; padding: 0 9px 9px; }
  .main-nav a { min-width: max-content; min-height: 39px; border-bottom: 3px solid transparent; border-left: 0; }
  .main-nav a.active { border-bottom-color: var(--red); border-left: 0; }
  .nav-icon { font-size: 17px; }
  .account { position: absolute; top: 10px; right: 12px; width: min(240px, 45vw); margin: 0; padding: 7px; border: 0; }
  .account-mark { width: 32px; height: 32px; }
  .main { margin-left: 0; padding: 22px 18px 45px; }
  .sidebar-toggle { display: none; }
  .sidebar-collapsed .sidebar { width: 100%; }
  .sidebar-collapsed .brand { justify-content: flex-start; padding: 11px 16px; }
  .sidebar-collapsed .brand img { width: 82px; }
  .sidebar-collapsed .brand > span, .sidebar-collapsed .main-nav a > span:last-child, .sidebar-collapsed .account-text { display: initial; }
  .sidebar-collapsed .main-nav { padding: 0 9px 9px; }
  .sidebar-collapsed .main-nav a { justify-content: flex-start; padding: 10px 13px; box-shadow: none; }
  .sidebar-collapsed .main { margin-left: 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .quick-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-form-grid label.wide, .quick-form-grid div.wide { grid-column: 1 / -1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .brand > span, .account-text { display: none; }
  .account { width: auto; }
  .main { padding: 17px 12px 35px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-head .button { width: 100%; }
  .cards { gap: 8px; }
  .card { min-height: 88px; padding: 13px; }
  .card strong { font-size: 25px; }
  .panel-head { min-height: 0; align-items: flex-start; padding: 14px 15px; }
  .panel-count { display: none; }
  .filters { padding: 12px; }
  .filters label { flex: 1 1 100%; }
  .filters .button { width: 100%; }
  .form-grid, .quick-form-grid, .small-form, .facts { grid-template-columns: 1fr; padding: 15px; }
  .wide, .quick-form-grid label.wide, .quick-form-grid div.wide { grid-column: 1; }
  .span-2 { grid-column: 1; }
  .registration-grid { display: block; }
  .table-scroll { max-width: calc(100vw - 26px); }
  .table-toolbar { align-items: stretch; flex-direction: column; padding: 12px; }
  .table-toolbar label, .table-toolbar .button { width: 100%; min-width: 0; }
  .filter-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .operations-overview { display: flex; flex-direction: column; padding: 15px; }
  .overview-title { padding-right: 0; }
  .overview-insights { grid-template-columns: 1fr; width: 100%; margin-top: 14px; }
  .overview-chart { padding: 14px 0; }
  .overview-chart + .overview-chart { border-top: 1px solid #ededed; border-left: 0; }
  .overview-summary { grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; padding: 14px 0 0; border-top: 1px solid #ededed; }
  .overview-summary .button { grid-column: 1 / -1; }
  .modal-form { grid-template-columns: 1fr; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .button { flex: 1; }
  .detail-actions { flex-direction: column-reverse; }
  .detail-actions .button { width: 100%; }
}
