:root {
  --bg: #05070a;
  --surface: #0d1218;
  --surface-muted: #151d26;
  --text: #f4f8fc;
  --muted: #93a4b8;
  --line: rgba(124, 168, 205, 0.22);
  --blue: #25a8ff;
  --blue-dark: #0b74d1;
  --cyan: #18e5ff;
  --black: #020305;
  --charcoal: #0a0f14;
  --green: #16875a;
  --amber: #b76b00;
  --red: #bd2d2d;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.34);
  --glow: 0 0 32px rgba(37, 168, 255, 0.18), 0 0 54px rgba(24, 229, 255, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: #111922;
  color: #f7fbff;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand small,
.sidebar-card small {
  color: #aab8c6;
}

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

.nav-list a {
  padding: 11px 12px;
  border-radius: 8px;
  color: #c8d4df;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #3be08f;
  box-shadow: 0 0 0 4px rgba(59, 224, 143, 0.16);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1,
.panel h2,
.section-toolbar h2,
.quote-intro h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions,
.section-toolbar,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(430px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.global-search span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.global-search input {
  min-height: 36px;
  border: 0;
  padding: 0;
  outline: 0;
}

.global-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.quick-actions button,
.segmented button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

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

.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  background: var(--surface-muted);
  color: var(--text);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
}

.icon-button {
  width: 42px;
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.mobile-menu {
  display: none;
}

.page {
  display: none;
}

.active-page {
  display: block;
}

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

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

.metric-card,
.panel,
.table-panel,
.form-panel,
.vehicle-card,
.timeline-card,
.photo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

button.metric-card {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

button.metric-card:hover {
  border-color: rgba(20, 99, 255, 0.5);
  transform: translateY(-1px);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 7px;
  font-size: 1.65rem;
}

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

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

.span-2 {
  grid-column: span 2;
}

.panel {
  padding: 18px;
}

.panel h3 {
  margin: 12px 0 10px;
}

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

.stack-list,
.activity-list,
.timeline-cards,
.security-list {
  display: grid;
  gap: 10px;
}

.list-item,
.activity-item,
.security-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.record-trigger {
  width: 100%;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.list-item strong,
.list-item span,
.activity-item strong,
.activity-item span,
.security-list strong,
.security-list span {
  display: block;
}

.list-item span,
.activity-item span,
.security-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.quick-actions button {
  min-height: 54px;
  padding: 0 10px;
  background: #f2f6fb;
  color: var(--text);
}

.section-toolbar {
  margin-bottom: 14px;
}

.compact-toolbar {
  justify-content: flex-start;
  margin-top: -4px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.filter-bar input,
.filter-bar select {
  min-height: 40px;
}

.filter-result-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.muted-copy {
  margin: 4px 0 0;
  color: var(--muted);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(560px, 100%);
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.table-panel {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f9fbfd;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.clickable-row,
.clickable-card {
  cursor: pointer;
}

.clickable-row:hover,
.clickable-card:hover,
.record-trigger:hover {
  background: #f4f8ff;
}

.selected-row,
.selected-record {
  outline: 2px solid rgba(20, 99, 255, 0.42);
  outline-offset: -2px;
  background: #f0f6ff !important;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 260px;
}

.row-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.row-actions button:hover {
  border-color: rgba(20, 99, 255, 0.45);
  color: var(--blue-dark);
}

.row-actions .danger-link,
.danger-link {
  color: var(--red);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.blue {
  background: #e9f0ff;
  color: var(--blue-dark);
}

.badge.green {
  background: #e7f7ef;
  color: var(--green);
}

.badge.amber {
  background: #fff3db;
  color: var(--amber);
}

.badge.red {
  background: #ffecec;
  color: var(--red);
}

.payment-unpaid,
.followup-needed {
  background: #fff3db;
  color: var(--amber);
}

.payment-deposit-paid,
.followup-scheduled {
  background: #e9f0ff;
  color: var(--blue-dark);
}

.payment-paid-in-full,
.followup-completed {
  background: #e7f7ef;
  color: var(--green);
}

.payment-refunded,
.followup-ignored {
  background: #ffecec;
  color: var(--red);
}

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

.vehicle-card,
.timeline-card,
.photo-card {
  padding: 16px;
}

.vehicle-card h3,
.timeline-card h3,
.photo-card h3 {
  margin: 0 0 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.detail-grid div {
  padding: 10px;
  border-radius: 8px;
  background: #f6f9fc;
}

.detail-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button {
  min-height: 34px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--blue);
  color: #fff;
}

.hidden {
  display: none !important;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 8px;
}

.calendar-day {
  min-height: 132px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calendar-day strong {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-job {
  display: block;
  width: 100%;
  border: 0;
  margin-top: 8px;
  padding: 7px;
  border-radius: 8px;
  background: #e9f0ff;
  color: var(--blue-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.calendar-job.status-green {
  background: #e7f7ef;
  color: var(--green);
}

.calendar-job.status-amber {
  background: #fff3db;
  color: var(--amber);
}

.calendar-job.status-red {
  background: #ffecec;
  color: var(--red);
}

.calendar-empty {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
  font-weight: 700;
}

.pipeline-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
}

.pipeline-column {
  min-height: 520px;
  border: 1px solid rgba(124, 168, 205, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 25, 34, 0.96), rgba(8, 13, 18, 0.98));
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.pipeline-column header {
  padding: 14px;
  border-bottom: 1px solid rgba(124, 168, 205, 0.16);
}

.pipeline-column h3 {
  margin: 0;
  color: #fff;
  font-size: 0.98rem;
}

.pipeline-column header span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.pipeline-dropzone {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 455px;
  padding: 12px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.pipeline-dropzone.drag-over {
  background: rgba(24, 229, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(24, 229, 255, 0.28);
}

.pipeline-card {
  border: 1px solid rgba(124, 168, 205, 0.22);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(37, 168, 255, 0.08), rgba(2, 3, 5, 0.08)),
    rgba(2, 3, 5, 0.36);
  color: var(--text);
  cursor: grab;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.pipeline-card:active {
  cursor: grabbing;
}

.pipeline-card.dragging {
  opacity: 0.62;
}

.pipeline-card:hover {
  border-color: rgba(24, 229, 255, 0.55);
  box-shadow: var(--glow), 0 12px 26px rgba(0, 0, 0, 0.26);
}

.pipeline-card strong,
.pipeline-card span {
  display: block;
}

.pipeline-card strong {
  color: #fff;
}

.pipeline-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pipeline-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.pipeline-card-meta small {
  min-height: 28px;
  border-radius: 8px;
  padding: 6px;
  background: rgba(37, 168, 255, 0.08);
  color: #bdeaff;
  font-weight: 800;
  text-align: center;
}

.pipeline-empty {
  display: grid;
  place-items: center;
  min-height: 86px;
  border: 1px dashed rgba(124, 168, 205, 0.25);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.sms-list {
  display: grid;
  gap: 10px;
}

.sms-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(124, 168, 205, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(37, 168, 255, 0.07), rgba(2, 3, 5, 0.08)),
    rgba(2, 3, 5, 0.32);
}

.sms-item strong,
.sms-item span {
  display: block;
}

.sms-item strong {
  color: #fff;
}

.sms-item span {
  margin-top: 4px;
  color: var(--muted);
}

.sms-item p {
  margin: 10px 0 0;
  color: #d8e9f6;
  line-height: 1.45;
}

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.quote-intro {
  padding: 28px;
  border-radius: 8px;
  background: #111922;
  color: #fff;
  box-shadow: var(--shadow);
}

.quote-intro h2 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.02;
}

.quote-intro p:not(.eyebrow) {
  color: #c8d4df;
  font-size: 1.03rem;
}

.site-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.site-buttons a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.site-buttons a:first-child {
  background: var(--blue);
}

.form-panel,
.modal-form {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 14px;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend {
  padding: 0 6px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
}

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

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

.checkbox-field label {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px;
  border-radius: 8px;
  background: #f6f9fc;
  color: var(--text);
  font-weight: 700;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
}

.confirmation {
  min-height: 22px;
  color: var(--green);
  font-weight: 800;
}

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

.detailing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.detailing-summary-card {
  border: 1px solid rgba(124, 168, 205, 0.22);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(37, 168, 255, 0.08), rgba(2, 3, 5, 0.1)),
    rgba(2, 3, 5, 0.28);
}

.detailing-summary-card span,
.detailing-summary-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.detailing-summary-card strong {
  display: block;
  margin: 6px 0;
  color: #fff;
  font-size: 1.7rem;
}

.photo-thumb {
  height: 145px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 99, 255, 0.88), rgba(17, 25, 34, 0.78)),
    repeating-linear-gradient(45deg, #c9d4df 0 12px, #eff4f8 12px 24px);
}

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

.gallery-stats span {
  border-radius: 8px;
  padding: 8px;
  background: rgba(37, 168, 255, 0.1);
  color: #bdeaff;
  font-weight: 800;
  text-align: center;
}

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

.bar-chart {
  display: grid;
  gap: 12px;
}

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

.bi-card {
  border: 1px solid rgba(124, 168, 205, 0.22);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(37, 168, 255, 0.08), rgba(2, 3, 5, 0.1)),
    rgba(2, 3, 5, 0.28);
}

.bi-card span,
.bi-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.bi-card strong {
  display: block;
  margin: 7px 0;
  color: #fff;
  font-size: 1.35rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 90px;
  gap: 12px;
  align-items: center;
}

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

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.import-form textarea {
  min-height: 210px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.import-results {
  display: grid;
  gap: 12px;
}

.result-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.record-dialog {
  width: min(980px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(17, 25, 34, 0.55);
}

.modal-form header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-form header h2 {
  margin: 0;
}

.modal-form header button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.record-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.record-context-grid section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.record-context-grid h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

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

.mini-item {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

button.mini-item {
  cursor: pointer;
}

button.mini-item:hover {
  border-color: rgba(20, 99, 255, 0.45);
  background: #f4f8ff;
}

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

.mini-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #111922;
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  pointer-events: none;
  box-shadow: var(--shadow);
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Perfection Detail brand layer */
body {
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 168, 255, 0.14), transparent 30%),
    radial-gradient(circle at 86% 8%, rgba(24, 229, 255, 0.1), transparent 28%),
    linear-gradient(135deg, var(--black), var(--bg) 44%, #071019);
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at center, rgba(37, 168, 255, 0.18), transparent 34%),
    #020305;
  color: var(--text);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.app-loader img {
  width: min(210px, 52vw);
  filter: drop-shadow(0 0 22px rgba(37, 168, 255, 0.36));
}

.app-loader strong {
  font-size: 1.35rem;
}

.app-loader span {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.app-ready .app-loader {
  visibility: hidden;
  opacity: 0;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(37, 168, 255, 0.12), transparent 28%),
    #05080c;
  border-right: 1px solid rgba(24, 229, 255, 0.13);
}

.brand {
  align-items: center;
}

.brand-mark.logo-mark {
  width: 56px;
  height: 56px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(37, 168, 255, 0.32);
  box-shadow: var(--glow);
}

.brand-mark.logo-mark img {
  width: 76px;
  max-width: none;
}

.brand strong {
  color: #fff;
  font-size: 0.98rem;
}

.brand small {
  color: #8fdfff;
  font-size: 0.68rem;
  line-height: 1.25;
  text-transform: uppercase;
}

.nav-list a:hover,
.nav-list a.active {
  background: linear-gradient(90deg, rgba(37, 168, 255, 0.22), rgba(24, 229, 255, 0.08));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.sidebar-card,
.global-search,
.metric-card,
.panel,
.table-panel,
.form-panel,
.vehicle-card,
.timeline-card,
.photo-card,
.filter-result-panel,
dialog {
  border-color: rgba(124, 168, 205, 0.22);
  background: linear-gradient(180deg, rgba(16, 25, 34, 0.96), rgba(8, 13, 18, 0.98));
  box-shadow: var(--shadow);
}

.topbar {
  padding: 14px;
  border: 1px solid rgba(124, 168, 205, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.74);
  box-shadow: var(--shadow);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.topbar-title img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(37, 168, 255, 0.32));
}

.topbar-title h1 {
  color: #fff;
}

.eyebrow {
  color: var(--cyan);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(37, 168, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(37, 168, 255, 0.14), rgba(24, 229, 255, 0.04) 42%, rgba(255, 255, 255, 0.03)),
    #05080c;
  box-shadow: var(--glow), var(--shadow);
}

.hero-copy {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-copy img {
  width: min(180px, 28vw);
  max-height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(37, 168, 255, 0.34));
}

.hero-copy h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  line-height: 1.02;
}

.hero-copy p:last-child {
  margin: 8px 0 0;
  color: #b8c7d7;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.hero-stats button {
  min-height: 106px;
  border: 1px solid rgba(37, 168, 255, 0.24);
  border-radius: 8px;
  padding: 14px;
  background: rgba(2, 3, 5, 0.46);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.hero-stats button:hover,
button.metric-card:hover,
.mini-item:hover,
.row-actions button:hover {
  border-color: rgba(24, 229, 255, 0.58);
  box-shadow: 0 0 0 1px rgba(24, 229, 255, 0.08), var(--glow);
}

.hero-stats span,
.metric-card span {
  color: #9fb4c7;
}

.hero-stats strong {
  display: block;
  margin-top: 9px;
  color: #fff;
  font-size: 1.8rem;
}

button.metric-card {
  background:
    linear-gradient(180deg, rgba(37, 168, 255, 0.08), rgba(2, 3, 5, 0.16)),
    var(--surface);
}

.metric-card strong,
.panel h2,
.section-toolbar h2,
.quote-intro h2,
.vehicle-card h3,
.timeline-card h3,
.photo-card h3 {
  color: #fff;
}

input,
select,
textarea {
  border-color: rgba(124, 168, 205, 0.25);
  background: rgba(2, 3, 5, 0.36);
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #6f8295;
}

th {
  background: rgba(37, 168, 255, 0.08);
}

td,
th {
  border-bottom-color: rgba(124, 168, 205, 0.16);
}

.list-item,
.activity-item,
.security-list div,
.detail-grid div,
.result-row,
.mini-item,
.record-context-grid section,
.calendar-day,
.quick-actions button,
.checkbox-field label,
.site-buttons a,
.photo-card {
  background: rgba(2, 3, 5, 0.28);
  border-color: rgba(124, 168, 205, 0.18);
}

.quick-actions button:hover,
.clickable-row:hover,
.clickable-card:hover,
.record-trigger:hover {
  background: rgba(37, 168, 255, 0.11);
}

.selected-row,
.selected-record {
  outline-color: rgba(24, 229, 255, 0.5);
  background: rgba(37, 168, 255, 0.14) !important;
}

.primary-button {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #03101a;
}

.primary-button:hover {
  background: linear-gradient(135deg, #48b9ff, #58f0ff);
}

.secondary-button,
.ghost-button,
.icon-button,
.row-actions button {
  border-color: rgba(124, 168, 205, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.global-results {
  background: #05080c;
}

.photo-thumb {
  background:
    linear-gradient(135deg, rgba(37, 168, 255, 0.85), rgba(24, 229, 255, 0.22)),
    repeating-linear-gradient(45deg, #0b151d 0 12px, #101d28 12px 24px);
}

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

  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    transform: translateX(-105%);
    transition: 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: grid;
    place-items: center;
  }

  .metrics-grid,
  .metrics-grid.compact,
  .content-grid,
  .card-grid,
  .quote-layout,
  .photo-grid,
  .detailing-summary-grid,
  .record-context-grid,
  .filter-bar,
  .bi-grid,
  .dashboard-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
  }

  .global-search {
    width: 100%;
  }

  .topbar-title {
    align-items: flex-start;
  }

  .topbar-title img {
    width: 42px;
    height: 42px;
  }

  .topbar-actions a,
  .section-toolbar button,
  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .metrics-grid,
  .metrics-grid.compact,
  .content-grid,
  .card-grid,
  .quote-layout,
  .photo-grid,
  .detailing-summary-grid,
  .record-context-grid,
  .filter-bar,
  .bi-grid,
  .dashboard-hero,
  .hero-stats,
  .split-list,
  .form-grid,
  .checkbox-field div {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy img {
    width: min(190px, 72vw);
  }

  .pipeline-board {
    grid-auto-columns: minmax(260px, 86vw);
  }

  .pipeline-card-meta {
    grid-template-columns: 1fr;
  }

  .sms-item {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .quote-intro {
    padding: 22px;
  }

  .site-buttons,
  .quick-actions {
    grid-template-columns: 1fr;
  }

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