:root {
  color-scheme: light;
  --bg: #eef3f1;
  --panel: #ffffff;
  --panel-soft: #f6f8f7;
  --ink: #151c1a;
  --muted: #66736f;
  --line: #d7e0dc;
  --line-strong: #bac8c3;
  --brand-dark: #111b18;
  --brand-mid: #24342f;
  --teal: #287b72;
  --teal-strong: #17645c;
  --teal-soft: #e3f2ef;
  --blue: #2f5fbc;
  --blue-soft: #e8effd;
  --amber: #a66b12;
  --amber-soft: #fff3d7;
  --red: #bd3b2f;
  --red-soft: #fdeae7;
  --green: #2d7f4f;
  --green-soft: #e6f4ec;
  --graphite: #26302d;
  --shadow: 0 20px 50px rgba(17, 27, 24, 0.09);
  --shadow-soft: 0 10px 28px rgba(17, 27, 24, 0.06);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(40, 123, 114, 0.1), transparent 34%),
    linear-gradient(180deg, #f8faf9 0, var(--bg) 320px);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, #111b18 0%, #18231f 52%, #101715 100%);
  color: #edf5f2;
  box-shadow: 10px 0 30px rgba(17, 27, 24, 0.14);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 18px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #34514a, #172522);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: #d34838;
}

.brand-block strong,
.brand-block span,
.brand-block small {
  display: block;
}

.brand-block strong {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.brand-block span {
  margin-top: 2px;
  color: #aebbb7;
  font-size: 0.82rem;
}

.brand-block small {
  margin-top: 6px;
  color: #e4ece9;
  font-size: 0.78rem;
  font-weight: 750;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 12px;
  background: transparent;
  color: #cfdbd7;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.is-active {
  border-color: rgba(255, 255, 255, 0.5);
  background: #eef7f4;
  color: #17211f;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.source-box {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.source-box span,
.source-box small,
.metric-label,
.eyebrow,
.hint {
  color: var(--muted);
}

.source-box span,
.source-box strong,
.source-box small {
  display: block;
}

.source-box span {
  color: #aebbb7;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.source-box strong {
  margin: 4px 0;
  color: #ffffff;
}

.source-box small {
  color: #aebbb7;
}

.main {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.workspace {
  display: grid;
  gap: 20px;
}

.section-band,
.form-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.section-band {
  padding: 18px;
}

.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 24px;
  overflow: hidden;
  border: 1px solid rgba(23, 100, 92, 0.22);
  border-radius: var(--radius);
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(22, 41, 37, 0.94), rgba(33, 67, 61, 0.94)),
    linear-gradient(90deg, rgba(211, 72, 56, 0.14), transparent);
  box-shadow: var(--shadow);
  color: #ffffff;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 13px);
  pointer-events: none;
}

.hero-copy,
.mat-preview {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd9d5;
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-hero h2 {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.03;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 720px;
  margin: 14px 0 0;
  color: #dbe8e4;
  font-size: 1rem;
  line-height: 1.55;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.hero-tags span {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 750;
}

.mat-preview {
  display: grid;
  align-content: center;
  justify-items: end;
  min-height: 220px;
}

.mat-card {
  position: absolute;
  display: grid;
  gap: 10px;
  width: 178px;
  height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px 28px 18px 18px;
  padding: 20px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.08) 0 2px, transparent 2px 12px),
    linear-gradient(160deg, #253d38, #0f1917);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.mat-card span {
  width: 72%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.mat-card span:nth-child(2) {
  width: 54%;
}

.mat-card span:nth-child(3) {
  width: 34%;
  background: #d34838;
}

.mat-card-front {
  right: 46px;
  top: 24px;
  transform: rotate(8deg);
}

.mat-card-back {
  right: 96px;
  top: 74px;
  transform: rotate(-8deg) scale(0.9);
  opacity: 0.82;
}

.hero-mini-metrics {
  align-self: end;
  justify-self: end;
  min-width: 170px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(8px);
}

.hero-mini-metrics strong,
.hero-mini-metrics span {
  display: block;
}

.hero-mini-metrics strong {
  font-size: 2rem;
  line-height: 1;
}

.hero-mini-metrics span {
  margin-top: 5px;
  color: #dbe8e4;
  font-size: 0.8rem;
  font-weight: 750;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbfa);
  box-shadow: var(--shadow-soft);
}

.metric:nth-child(1) {
  border-top: 4px solid var(--red);
}

.metric:nth-child(2) {
  border-top: 4px solid var(--teal);
}

.metric:nth-child(3) {
  border-top: 4px solid var(--blue);
}

.metric:nth-child(4) {
  border-top: 4px solid var(--amber);
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  line-height: 1;
  color: var(--graphite);
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.metric-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.38fr) minmax(0, 0.62fr);
  gap: 18px;
  align-items: start;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head h2,
.form-panel h2,
.list-panel h2 {
  margin: 0;
  color: var(--graphite);
  font-size: 1.05rem;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.stage-list,
.activity-list,
.bar-list,
.match-list {
  display: grid;
  gap: 10px;
}

.stage-row,
.activity-row,
.match-row {
  display: grid;
  gap: 8px;
  border: 1px solid transparent;
  border-top-color: var(--line);
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fafcfc);
}

.stage-row:first-child,
.activity-row:first-child,
.match-row:first-child {
  border-top-color: transparent;
}

.stage-top,
.activity-top,
.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-top strong,
.match-top strong {
  overflow-wrap: anywhere;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebe8;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 170px) 1fr 44px;
  align-items: center;
  gap: 10px;
}

.bar-label {
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebe8;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.bar-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.form-panel {
  padding: 18px;
}

.entry-form {
  display: grid;
  gap: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-grid .wide,
.entry-form .wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 39px;
  border: 1px solid #ccd8d4;
  border-radius: 7px;
  padding: 9px 10px;
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  min-height: 38px;
  border-radius: 7px;
  padding: 8px 12px;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.primary-button {
  border: 1px solid var(--teal-strong);
  background: linear-gradient(180deg, var(--teal), var(--teal-strong));
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(23, 100, 92, 0.18);
}

.secondary-button {
  border: 1px solid #c2d1cc;
  background: #ffffff;
  color: var(--ink);
}

.danger-button {
  border: 1px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.list-panel {
  min-width: 0;
  overflow: hidden;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px) auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 16px;
  background:
    linear-gradient(180deg, #ffffff, var(--panel-soft));
}

.list-body {
  display: grid;
  gap: 0;
}

.vehicle-row,
.contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px;
  background: #ffffff;
  transition: background 0.16s ease;
}

.vehicle-row:first-child,
.contact-row:first-child {
  border-top: 0;
}

.vehicle-row:hover,
.contact-row:hover {
  background: #fbfdfc;
}

.vehicle-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vehicle-title strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.vehicle-details summary {
  display: inline-flex;
  list-style: none;
  outline: none;
  cursor: pointer;
}

.vehicle-details summary::-webkit-details-marker {
  display: none;
}

.vehicle-name-link {
  border-bottom: 2px solid rgba(40, 123, 114, 0.25);
}

.vehicle-details summary:hover .vehicle-name-link,
.vehicle-details summary:focus-visible .vehicle-name-link {
  border-color: var(--teal);
  color: var(--teal);
}

.expanded-details {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section h3 {
  margin: 0;
  font-size: 0.9rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.detail-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fbfdfc;
}

.detail-grid dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.detail-notes {
  display: grid;
  gap: 7px;
}

.detail-notes p {
  margin: 0;
  border-left: 3px solid var(--teal);
  padding: 8px 10px;
  background: var(--teal-soft);
  color: #25413c;
}

.market-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.market-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #c7d4d0;
  border-radius: 7px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.market-links a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.empty-inline {
  color: var(--muted);
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.32fr);
  gap: 18px;
  align-items: start;
}

.calendar-main {
  overflow: auto;
}

.calendar-toolbar,
.calendar-add-form {
  display: grid;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background:
    linear-gradient(180deg, #ffffff, var(--panel-soft));
}

.calendar-toolbar {
  grid-template-columns: 1fr 180px;
}

.calendar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.calendar-nav strong {
  margin-left: 6px;
  font-size: 1.15rem;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 1.25rem;
}

.calendar-add-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}

.calendar-add-form .wide {
  grid-column: span 2;
}

.calendar-custom-panel {
  border-bottom: 1px solid var(--line);
  padding: 0 16px 14px;
  background: var(--panel-soft);
}

.calendar-custom-panel summary {
  min-height: 42px;
  padding: 12px 0;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.calendar-custom-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.calendar-custom-form .wide {
  grid-column: span 2;
}

.calendar-grid {
  display: grid;
  grid-template-columns: 68px repeat(7, minmax(150px, 1fr));
  min-width: 1120px;
}

.calendar-time-head,
.calendar-day-head,
.calendar-time,
.calendar-cell {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.calendar-day-head {
  display: grid;
  gap: 4px;
  min-height: 68px;
  border-right: 0;
  border-bottom: 0;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
  color: var(--ink);
  text-align: left;
}

.calendar-day-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-day-head strong {
  font-size: 1.45rem;
  line-height: 1;
}

.calendar-day-head.is-selected {
  background: linear-gradient(180deg, var(--teal-soft), #f7fbfa);
}

.calendar-day-head.is-today strong {
  color: var(--teal);
}

.calendar-time {
  min-height: 112px;
  padding: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.calendar-cell {
  min-height: 112px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.9);
}

.calendar-cell:hover {
  background: #f7fbf9;
}

.calendar-event {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
  border: 1px solid #79aaa3;
  border-radius: 7px;
  padding: 7px;
  background:
    linear-gradient(180deg, #3b8d82, #286f67);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(47, 130, 120, 0.2);
}

.calendar-event[draggable="true"] {
  cursor: grab;
}

.calendar-event[draggable="true"]:active {
  cursor: grabbing;
}

.calendar-event.is-active {
  outline: 3px solid rgba(37, 99, 235, 0.24);
}

.calendar-drag-handle {
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 2px 7px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.calendar-event-main {
  display: grid;
  gap: 2px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.calendar-event-main strong,
.calendar-event-main span,
.calendar-event-main small {
  overflow-wrap: anywhere;
}

.calendar-event-main span,
.calendar-event-main small,
.calendar-event p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
}

.calendar-event-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.calendar-event-controls input {
  min-height: 30px;
  padding: 4px 6px;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.95);
}

.calendar-event p {
  margin: 0;
}

.tiny-button {
  min-height: 30px;
  padding: 4px 7px;
}

.map-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.map-frame {
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.map-frame iframe {
  width: 100%;
  height: 300px;
  border: 0;
}

.route-list {
  display: grid;
  gap: 8px;
}

.route-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.route-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fbfdfc;
}

.route-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-selected {
  display: grid;
  gap: 8px;
}

.calendar-location-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel-soft);
}

.calendar-location-editor .wide {
  grid-column: 1 / -1;
}

.calendar-selected h3 {
  margin: 0;
  font-size: 0.9rem;
}

.calendar-selected .detail-grid {
  grid-template-columns: 1fr;
}

.route-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--panel-soft);
}

.route-item strong,
.route-item span,
.route-item small {
  display: block;
  overflow-wrap: anywhere;
}

.route-item span,
.route-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.route-item a,
.secondary-link {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.vehicle-meta,
.compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.vehicle-meta span,
.compact-meta span {
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-end;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid rgba(66, 80, 76, 0.08);
  background: #eef2f0;
  color: #42504c;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.badge.good {
  background: var(--green-soft);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.danger {
  background: var(--red-soft);
  color: var(--red);
}

.badge.info {
  background: var(--blue-soft);
  color: var(--blue);
}

.empty-state {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

td {
  overflow-wrap: anywhere;
}

.table-actions {
  width: 1%;
  white-space: nowrap;
}

.contact-name {
  display: grid;
  gap: 4px;
}

.contact-name strong {
  overflow-wrap: anywhere;
}

.contact-name span {
  color: var(--muted);
}

.match-row {
  padding: 14px 0 0;
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.candidate {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-soft);
}

.candidate strong,
.candidate span {
  display: block;
  overflow-wrap: anywhere;
}

.candidate span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid #c8d6d2;
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.muted {
  color: var(--muted);
}

.nowrap {
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .brand-block {
    max-width: 360px;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .mat-preview {
    min-height: 190px;
    justify-items: start;
  }

  .mat-card-front {
    left: 74px;
    right: auto;
  }

  .mat-card-back {
    left: 20px;
    right: auto;
  }

  .hero-mini-metrics {
    justify-self: end;
  }

  .dashboard-grid,
  .split-grid,
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .vehicle-row,
  .contact-row {
    display: grid;
  }

  .dashboard-hero {
    padding: 20px;
  }

  .dashboard-hero h2 {
    font-size: 2rem;
  }

  .mat-preview {
    min-height: 160px;
  }

  .mat-card {
    width: 142px;
    height: 108px;
  }

  .mat-card-front {
    left: 62px;
    top: 20px;
  }

  .mat-card-back {
    left: 8px;
    top: 60px;
  }

  .hero-mini-metrics {
    min-width: 145px;
  }

  .nav-list,
  .metric-grid,
  .field-grid,
  .list-toolbar,
  .detail-grid,
  .candidate-list {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .calendar-toolbar,
  .calendar-add-form,
  .calendar-custom-form,
  .calendar-location-editor,
  .route-settings,
  .route-summary {
    grid-template-columns: 1fr;
  }

  .calendar-add-form .wide,
  .calendar-custom-form .wide,
  .calendar-location-editor .wide {
    grid-column: auto;
  }

  .map-panel {
    position: static;
  }

  .bar-row {
    grid-template-columns: 110px 1fr 38px;
  }
}
