/* ══ PAGE: CAR DETAIL VIEW ══ */

.car-detail        { display: none; }
.car-detail.active { display: block; }

.detail-top-bar {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}

.detail-back {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid #1f2530; border-radius: 8px;
  padding: 7px 14px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: #7a8a9b; cursor: pointer; transition: all 0.15s;
}
.detail-back:hover { border-color: #7a8a9b; color: #dce3ed; }

/* ── Banner: three-zone card ── */
.detail-banner {
  position: relative; width: 100%; height: 260px; border-radius: 14px; overflow: hidden;
  border: 1px solid #1c2230; margin-bottom: 20px;
  display: flex; flex-direction: column; justify-content: flex-end;
}

/* Zone 1 — Photo (full-bleed background) */
.db-photo {
  position: absolute; inset: 0; z-index: 0; background: #0a0d14;
}
.db-photo-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  opacity: 0.06;
}
.db-photo-placeholder .material-symbols-outlined { font-size: 64px; }
.db-photo-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.75) brightness(0.8);
}
.db-photo-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, transparent 35%, rgba(9,11,14,0.55) 100%),
    radial-gradient(ellipse at 70% 50%, transparent 35%, rgba(0,0,0,0.25) 100%);
}

/* Zone 2 — Info bar (floats over photo) */
.db-info {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 16px 12px 16px;
  background: rgba(9,11,14,0.3);
  backdrop-filter: blur(2px);
}
/* Frosted pill around the identity block — shrinks to content */
.db-info-left {
  flex: 0 0 auto;
  background: rgba(9,11,14,0.72);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 10px 14px;
}
.db-brand {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: #2e3d4d;
  margin-bottom: 2px;
}
.db-carname {
  font-family: 'Barlow Condensed', sans-serif; font-size: 34px; font-weight: 900;
  color: #eef2f7; line-height: 1; letter-spacing: 0.5px; margin-bottom: 4px;
}
.db-meta {
  font-size: 11px; color: #2e3d4d; letter-spacing: 0.3px; margin-bottom: 10px;
}
.db-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.db-tag {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #1c2230; border-radius: 4px; padding: 2px 8px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  color: #4a5d6e; letter-spacing: 0.8px; text-transform: uppercase;
}
.db-tag .material-symbols-outlined { font-size: 12px; }
.db-tag.fuel { border-color: rgba(212,245,66,0.18); color: #8fa832; }

.db-banner-actions {
  position: absolute; top: 12px; left: 16px; z-index: 2;
  display: flex; gap: 6px;
}
.db-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(9,11,14,0.65); border: 1px solid rgba(255,255,255,0.08); border-radius: 7px;
  backdrop-filter: blur(10px);
  padding: 7px 14px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: #4a5d6e; cursor: pointer; transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.db-btn:hover          { border-color: #d4f542; color: #d4f542; }
.db-btn.danger:hover   { border-color: #ef4444; color: #ef4444; }
.db-btn .material-symbols-outlined { font-size: 13px; }

/* Zone 3 — Event ribbon */
.db-events {
  position: relative; z-index: 1;
  display: flex; align-items: center; height: 42px;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(5,7,12,0.55); overflow: hidden;
  backdrop-filter: blur(4px);
}
.db-events-label {
  flex-shrink: 0; padding: 0 12px 0 18px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; color: #1e2b38;
}
.db-events-scroller {
  flex: 1; overflow: hidden; display: flex; align-items: center; height: 100%;
  mask-image: linear-gradient(to right, transparent 0%, #000 16px, #000 calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 16px, #000 calc(100% - 32px), transparent 100%);
}

/* Event chips */
.dbt-track {
  display: flex; gap: 6px; padding: 0 32px 0 16px;
  cursor: grab; user-select: none; will-change: transform;
}
.dbt-track:active { cursor: grabbing; }
.dbt-card {
  flex-shrink: 0; display: flex; align-items: center;
  height: 26px; border-radius: 5px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  transition: opacity 0.15s;
}
.dbt-card:hover { opacity: 0.8; }
.dbt-card-type {
  padding: 0 7px; height: 100%; display: flex; align-items: center;
  background: var(--ev-color, #5a6678);
  font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase; color: rgba(0,0,0,0.75);
  flex-shrink: 0;
}
.dbt-card-name {
  padding: 0 8px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; color: #6a7d8e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px;
}
.dbt-card-sep { color: #1e2b38; font-size: 10px; flex-shrink: 0; }
.dbt-card-meta {
  padding-right: 8px; font-size: 10px; color: #2e3d4d;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px;
}

/* Remove button — top-right of photo, danger/destructive */
.db-remove-btn {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  display: flex; align-items: center; gap: 4px;
  background: rgba(9,11,14,0.65); border: 1px solid rgba(239,68,68,0.25);
  border-radius: 6px; padding: 5px 12px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: rgba(239,68,68,0.55);
  cursor: pointer; backdrop-filter: blur(10px);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.db-remove-btn .material-symbols-outlined { font-size: 13px; }
.db-remove-btn:hover {
  border-color: #ef4444; color: #ef4444;
  background: rgba(239,68,68,0.1);
}

/* At-track badge — inside photo zone (below remove btn when both visible) */
.detail-at-track-badge {
  position: absolute; top: 46px; right: 12px; z-index: 6;
  display: flex; align-items: center; gap: 5px;
  background: rgba(9,11,14,0.75); border: 1px solid rgba(34,197,94,0.3);
  border-radius: 6px; padding: 5px 10px 5px 8px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: #22c55e;
  text-decoration: none; backdrop-filter: blur(8px);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.detail-at-track-badge:hover { border-color: #22c55e; box-shadow: 0 0 14px rgba(34,197,94,0.2); }
.detail-at-track-dot {
  width: 5px; height: 5px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
  animation: at-track-pulse 1.6s ease-in-out infinite;
}
@keyframes at-track-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
  60%       { opacity: 0.7; box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* Dashboard grid */
.detail-dashboard {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: start;
  padding-bottom: 60px;
}
.dash-card {
  background: #141820; border: 1px solid #1f2530;
  border-radius: 14px; padding: 18px 20px; position: relative; overflow: hidden;
}
.dash-card-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #7a8a9b; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}
.dash-card-title-dot       { width: 6px; height: 6px; border-radius: 50%; background: #d4f542; flex-shrink: 0; }
.dash-card-title-dot.red   { background: #ef4444; }
.dash-card-title-dot.amber { background: #f59e0b; }
.dash-card-title-dot.blue  { background: #3b82f6; }

.dash-span-2 { grid-column: span 2; }
.dash-span-3 { grid-column: span 3; }
.dash-row-2  { grid-row: span 2; }

/* Top row: tyre stock + alerts, each 50% */
.detail-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
/* Fixed height for top row cards: ~1/3 of wear tracker max-height (614px / 3 ≈ 205px) */
#tyre-stock-card,
#service-alerts-card {
  min-height: 205px;
  max-height: 205px;
  overflow: hidden;
}
#service-alerts-card {
  overflow: visible; /* keep visible so alert-settings-popover isn't clipped */
}

/* Service Alerts */
#service-alerts-card {
  display: flex; flex-direction: column;
  overflow: visible; /* keep visible so alert-settings-popover isn't clipped */
}
.alert-scroll-wrap {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
#service-alerts-filter-bar { flex-shrink: 0; }
#service-alerts-list {
  flex: 1; overflow-y: auto; min-height: 0;
}
#service-alerts-list::-webkit-scrollbar       { width: 3px; }
#service-alerts-list::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* Wear tracker — 2-row span, scrollable items, sticky tabs */
#wear-tracker-card {
  display: flex; flex-direction: column;
  max-height: 614px; overflow: clip;
  align-self: stretch;
}
#wear-tracker-card .dash-card-title,
#wear-tracker-card .wear-edit-btn { flex-shrink: 0; }
#wear-tracker-list {
  flex: 1; overflow-y: auto; min-height: 0;
}
#wear-tracker-list::-webkit-scrollbar       { width: 3px; }
#wear-tracker-list::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }
#wear-log-bar-slot { flex-shrink: 0; }
/* Alert list */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; align-items: center; gap: 12px;
  background: #0f1318; border-radius: 9px; padding: 11px 14px;
  border: 1px solid transparent; transition: border-color 0.15s;
}
.alert-item:hover        { border-color: #1f2530; }
.alert-dot               { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alert-dot.critical      { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.alert-dot.warning       { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.alert-dot.info          { background: #3b82f6; }
.alert-dot.soon          { background: #f59e0b; box-shadow: 0 0 4px rgba(245,158,11,0.3); }
.alert-item-text         { flex: 1; font-size: 13px; color: #dce3ed; }
.alert-item-sub          { font-size: 11px; color: #7a8a9b; margin-top: 1px; }
.alert-item:hover        { border-color: #1f2530; cursor: pointer; }
.alert-badge             { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; border-radius: 5px; padding: 2px 7px; }
.alert-badge.critical    { background: rgba(239,68,68,0.15);  color: #ef4444; border: 1px solid rgba(239,68,68,0.25); }
.alert-badge.warning     { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.alert-badge.soon        { background: rgba(245,158,11,0.1);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.18); }
.alert-badge.ok          { background: rgba(34,197,94,0.1);   color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }

/* ── Alert filter bar ── */
.alert-filter-bar {
  display: flex; gap: 5px; flex-wrap: wrap; align-items: center;
  padding: 0 0 10px 0;
}
.alert-filter-pill {
  background: transparent; border: 1px solid #2a3040; border-radius: 20px;
  padding: 2px 9px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: #7a8a9b; cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.alert-filter-pill:hover                  { border-color: #7a8a9b; color: #8899aa; }
.alert-filter-pill.active                 { border-color: #d4f542; color: #d4f542; background: rgba(212,245,66,0.07); }
.alert-filter-pill.urg-overdue.active     { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.07); }
.alert-filter-pill.urg-vsoon.active,
.alert-filter-pill.urg-soon.active        { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,0.07); }
.alert-filter-divider                     { display: inline-block; width: 1px; height: 14px; background: #2a3040; flex-shrink: 0; margin: 0 1px; }

/* ── Alert expand modal ── */
.alert-expand-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 450;
}
.alert-expand-backdrop.open { display: block; }
.alert-expand-modal {
  display: none; position: fixed; top: 40px; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 451; flex-direction: column; overflow: hidden;
}
.alert-expand-modal.open { display: flex; }
.alert-expand-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.alert-expand-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase; color: #dce3ed;
  display: flex; align-items: center; gap: 8px;
}
.alert-expand-filter-wrap {
  padding: 12px 20px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.alert-expand-filter-wrap .alert-filter-bar { padding-bottom: 0; }
.alert-expand-list-wrap {
  flex: 1; min-height: 0; overflow-y: auto; padding: 12px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.alert-expand-list-wrap::-webkit-scrollbar       { width: 3px; }
.alert-expand-list-wrap::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* ── Alert detail modal ── */
.alert-detail-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 500;
}
.alert-detail-backdrop.open { display: block; }
.alert-detail-modal {
  display: none; position: fixed; top: 40px; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: min(580px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 501; flex-direction: column; overflow: hidden;
}
.alert-detail-modal.open { display: flex; }
.alert-detail-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.alert-detail-header-info { flex: 1; }
.alert-detail-name {
  font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-weight: 800;
  letter-spacing: 0.5px; color: #dce3ed; margin-bottom: 5px;
}
.alert-detail-meta {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; color: #7a8a9b;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.alert-detail-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.alert-detail-body::-webkit-scrollbar       { width: 3px; }
.alert-detail-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }
.alert-detail-parts-section {
  background: #111620; border: 1px solid #2a3040; border-radius: 10px; padding: 12px 14px;
}
.alert-detail-parts-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #7a8a9b; margin-bottom: 8px;
}
.alert-detail-parts-text {
  font-family: 'Barlow', sans-serif; font-size: 12px; color: #8899aa;
  white-space: pre-wrap; line-height: 1.6; margin: 0;
}

/* Service Alerts settings popover */
#service-alerts-card { position: relative; }
.alert-settings-popover {
  display: none; position: absolute; top: 44px; right: 16px; z-index: 200;
  background: #1a2030; border: 1px solid #2a3040; border-radius: 12px;
  padding: 16px 18px; width: 260px; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.alert-settings-popover.open { display: block; }
.alert-settings-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #7a8a9b; margin-bottom: 12px;
}
.alert-settings-section { margin-bottom: 12px; }
.alert-settings-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px;
}
.alert-settings-grid { display: flex; flex-direction: column; gap: 5px; }
.alert-settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.alert-settings-row span { font-size: 12px; color: #8899aa; width: 60px; }
.alert-settings-input {
  flex: 1; background: #0d1117; border: 1px solid #2a3040; border-radius: 6px;
  color: #dce3ed; font-size: 12px; padding: 4px 8px; outline: none;
}
.alert-settings-input:focus { border-color: #d4f542; }
.alert-settings-footer { display: flex; gap: 8px; margin-top: 12px; }
.alert-settings-save {
  flex: 1; background: #d4f542; color: #0d1117; border: none; border-radius: 7px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 6px; cursor: pointer;
}
.alert-settings-save:hover { background: #c8e83a; }
.alert-settings-cancel {
  flex: 1; background: transparent; color: #7a8a9b; border: 1px solid #2a3040;
  border-radius: 7px; font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 6px; cursor: pointer;
}
.alert-settings-cancel:hover { color: #dce3ed; border-color: #3a4558; }

/* Component wear / mileage */
.mileage-list           { display: flex; flex-direction: column; gap: 10px; }
.mileage-header         { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.mileage-label          { font-size: 12px; color: #8899aa; font-weight: 500; }
.mileage-value          { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700; color: #dce3ed; letter-spacing: 0.5px; }
.mileage-bar-track      { height: 4px; background: #1f2530; border-radius: 2px; overflow: hidden; }
.mileage-bar-fill       { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.mileage-bar-fill.green { background: #22c55e; }
.mileage-bar-fill.amber { background: #f59e0b; }
.mileage-bar-fill.red   { background: #ef4444; }

/* Stat tile */
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-size: 36px; font-weight: 900; color: #dce3ed; line-height: 1; letter-spacing: 1px; }
.stat-unit  { font-size: 13px; color: #7a8a9b; margin-top: 4px; }
.stat-trend { position: absolute; bottom: 18px; right: 20px; font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; opacity: 0.4; }

/* Mini chart placeholder */
.chart-placeholder { height: 80px; display: flex; align-items: flex-end; gap: 4px; padding-top: 8px; }
.chart-bar         { flex: 1; border-radius: 3px 3px 0 0; opacity: 0.25; background: #d4f542; transition: opacity 0.15s; }
.chart-bar:hover   { opacity: 0.5; }

/* Info rows */
.info-row             { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #1f2530; font-size: 13px; }
.info-row:last-child  { border-bottom: none; }
.info-row-label       { color: #7a8a9b; }
.info-row-value       { color: #dce3ed; font-weight: 500; font-family: 'Barlow Condensed', sans-serif; font-size: 14px; letter-spacing: 0.3px; }

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, #1a1f28 25%, #1f2530 50%, #1a1f28 75%);
  background-size: 200% 100%; animation: shimmer 1.8s infinite; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Coming soon label */
.coming-soon-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: #2a3040;
  white-space: nowrap; pointer-events: none;
}

/* ── Wear tracker categories ── */
.wear-category { margin-bottom: 14px; }
.wear-category:last-child { margin-bottom: 0; }
.wear-category-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: #2a3040; margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1a1f28;
}
/* Wear tracker tab layout fix */
#wear-tracker-list {
  display: block;
}
#wear-tracker-list .wear-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1f2530;
  margin-bottom: 14px;
}
#wear-tracker-list .wear-tab-content {
  display: block;
}
#wear-tracker-list .wear-cat-section-grid {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 700px) {
  #wear-tracker-list .wear-cat-section-grid { grid-template-columns: 1fr; }
}

/* ── Right column: Last Service + Recent Sessions ── */
.detail-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 614px;
  min-height: 0;
  overflow: clip;
  align-self: stretch;
}
#last-service-card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#last-service-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
#last-service-content::-webkit-scrollbar       { width: 3px; }
#last-service-content::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }
#recent-sessions-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#recent-sessions-card .dash-card-title {
  flex-shrink: 0;
}

/* ── Recent Sessions card ── */
#recent-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-left: 18px;
  position: relative;
}
#recent-sessions-list::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, #2a3040 0%, #1a1f28 80%, transparent 100%);
  border-radius: 1px;
}
#recent-sessions-list::-webkit-scrollbar       { width: 3px; }
#recent-sessions-list::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* ── Session filter bar ── */
.session-filter-bar {
  display: flex; gap: 4px; margin-bottom: 8px;
}
.session-filter-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase;
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: #4a5568; padding: 4px 12px; cursor: pointer;
  transition: all 0.2s ease;
}
.session-filter-btn:hover { color: #8b9ab2; background: rgba(26, 31, 40, 0.5); }
.session-filter-btn.active {
  background: #d4f542; color: #0d1117; border-color: #d4f542;
  box-shadow: 0 0 8px rgba(212, 245, 66, 0.15);
}

/* ── Session entry (timeline item) ── */
.session-entry {
  display: flex;
  align-items: stretch;
  position: relative;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* ── Timeline dot ── */
.session-timeline-dot {
  position: absolute;
  left: -18px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a3040;
  border: 2px solid #0d1117;
  z-index: 1;
  transition: all 0.2s;
}
.session-timeline-dot.type-race      { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.3); }
.session-timeline-dot.type-test      { background: #3b82f6; box-shadow: 0 0 6px rgba(59, 130, 246, 0.3); }
.session-timeline-dot.type-track     { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.3); }
.session-timeline-dot.type-endurance { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.3); }
.session-timeline-dot.type-shakedown { background: #6b7280; }
.session-timeline-dot.type-transport { background: #64748b; }
.session-timeline-dot.type-meeting   { background: #a855f7; box-shadow: 0 0 6px rgba(168, 85, 247, 0.3); }
.session-timeline-dot.type-other     { background: #7a8a9b; }

/* ── Session content (card body) ── */
.session-content {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  background: #0d1117;
  border: 1px solid #1a1f28;
  border-radius: 10px;
  transition: all 0.2s;
}
.session-entry:hover .session-content {
  border-color: #2a3040;
  background: #0f1419;
}

/* Type-based left accent — matches calendar colors */
.session-entry.type-race .session-content      { border-left: 3px solid #ef4444; }
.session-entry.type-test .session-content      { border-left: 3px solid #3b82f6; }
.session-entry.type-track .session-content     { border-left: 3px solid #22c55e; }
.session-entry.type-endurance .session-content { border-left: 3px solid #f59e0b; }
.session-entry.type-shakedown .session-content { border-left: 3px solid #6b7280; }
.session-entry.type-transport .session-content { border-left: 3px solid #64748b; }
.session-entry.type-meeting .session-content   { border-left: 3px solid #a855f7; }
.session-entry.type-other .session-content     { border-left: 3px solid #7a8a9b; }

/* Calendar events: dashed accent */
.session-entry.session-calendar .session-content { border-left-style: dashed; }

/* Past events */
.session-entry.session-past .session-content { opacity: 0.5; }
.session-entry.session-past:hover .session-content { opacity: 0.8; }

/* ── Live event glow ── */
.session-entry.session-live .session-content {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.08), inset 0 0 12px rgba(34, 197, 94, 0.03);
  animation: liveGlow 3s ease-in-out infinite;
}
.session-entry.session-live .session-timeline-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes liveGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.08), inset 0 0 12px rgba(34, 197, 94, 0.03); }
  50%      { box-shadow: 0 0 20px rgba(34, 197, 94, 0.15), inset 0 0 20px rgba(34, 197, 94, 0.05); }
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
  50%      { transform: scale(1.3); box-shadow: 0 0 14px rgba(34, 197, 94, 0.7); }
}

/* ── Session header ── */
.session-cal-icon { font-size: 12px; flex-shrink: 0; }
.session-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.session-name {
  font-size: 15px;
  font-weight: 700;
  color: #e8edf5;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

/* ── Type badge ── */
.session-type-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 8px;
  flex-shrink: 0;
  border: 1px solid;
  background: #1a1f28;
  color: #7a8a9b;
  border-color: #2a3040;
}
/* Type badge — matches calendar colors */
.session-type-tag.type-race      { background: rgba(239,68,68,0.18);   color: #ef4444; border-color: rgba(239,68,68,0.25); }
.session-type-tag.type-test      { background: rgba(59,130,246,0.18);  color: #60a5fa; border-color: rgba(59,130,246,0.25); }
.session-type-tag.type-track     { background: rgba(34,197,94,0.18);   color: #22c55e; border-color: rgba(34,197,94,0.25); }
.session-type-tag.type-endurance { background: rgba(245,158,11,0.18);  color: #f59e0b; border-color: rgba(245,158,11,0.25); }
.session-type-tag.type-shakedown { background: rgba(107,114,128,0.12); color: #9ca3af; border-color: rgba(107,114,128,0.25); }
.session-type-tag.type-transport { background: rgba(100,116,139,0.12); color: #94a3b8; border-color: rgba(100,116,139,0.25); }
.session-type-tag.type-meeting   { background: rgba(168,85,247,0.18);  color: #c084fc; border-color: rgba(168,85,247,0.25); }
.session-type-tag.type-other     { background: rgba(90,102,120,0.18);  color: #8899aa; border-color: rgba(90,102,120,0.25); }

/* ── Actions (edit/delete/log) ── */
.session-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.session-action-btn {
  background: transparent;
  border: 1px solid #2a3040;
  border-radius: 4px;
  color: #7a8a9b;
  font-size: 10px;
  padding: 2px 5px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.12s;
}
.session-action-btn:hover        { border-color: #7a8a9b; color: #dce3ed; }
.session-action-btn.delete:hover { border-color: #ef4444; color: #ef4444; }
.session-action-btn.edit {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 7px;
}
.session-action-btn.edit:hover { border-color: #60a5fa; color: #60a5fa; }
.session-action-btn.log {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 7px;
}
.session-action-btn.log:hover { border-color: #d4f542; color: #d4f542; }

/* ── Meta (date + location) ── */
.session-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.session-date  { font-size: 11px; color: #5a6a7b; }
.session-track {
  font-size: 11px;
  color: #8b9ab2;
  display: flex;
  align-items: center;
  gap: 4px;
}
.session-track::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  background: #ef4444;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Stats (stacked layout) ── */
.session-stats {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}
.session-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.session-stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px; font-weight: 700; color: #c8d1dc;
}
.session-stat-delta {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; color: #d4f542;
}

/* ── Legacy stats (expand modal) ── */
.session-readings { font-size: 12px; color: #8b9ab2; margin-top: 4px; }
.session-delta    { color: #d4f542; font-size: 11px; }
.session-sep      { color: #2a3040; margin: 0 4px; }

/* ── Comment ── */
.session-comment {
  font-size: 11px;
  color: #5a6a7b;
  margin-top: 4px;
  font-style: italic;
}

/* ── Status / Countdown ── */
.session-status {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  margin-top: 6px;
}
.session-status.status-live {
  color: #22c55e;
  animation: statusPulse 2s ease-in-out infinite;
}
.session-status.status-soon     { color: #f59e0b; }
.session-status.status-upcoming { color: #3b82f6; }
.session-status.status-recent   { color: #6b7280; }
.session-status.status-past     { color: #4b5563; }

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ── Sessions expand modal ── */
.sessions-expand-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 450;
}
.sessions-expand-backdrop.open { display: block; }
.sessions-expand-modal {
  display: none; position: fixed; top: 40px; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 451; flex-direction: column; overflow: hidden;
}
.sessions-expand-modal.open { display: flex; }
.sessions-expand-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.sessions-expand-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase; color: #dce3ed;
  display: flex; align-items: center; gap: 8px;
}
.sessions-expand-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  align-content: start;
}
.sessions-expand-body::-webkit-scrollbar       { width: 3px; }
.sessions-expand-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* Session expand card */
.session-expand-card {
  background: #111620; border: 1px solid #1f2530; border-radius: 12px;
  padding: 14px 16px; display: flex; gap: 12px; align-items: stretch;
  transition: border-color 0.15s;
}
.session-expand-card:hover { border-color: #2a3040; }
.session-expand-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.session-expand-name {
  font-size: 14px; font-weight: 600; color: #dce3ed;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-expand-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.session-expand-date  { font-size: 11px; color: #7a8a9b; }
.session-expand-track {
  font-size: 11px; color: #8899aa;
  display: flex; align-items: center; gap: 4px;
}
.session-expand-readings {
  font-size: 12px; color: #8b9ab2; margin-top: 2px;
}
.session-expand-comment {
  font-size: 11px; color: #7a8a9b; font-style: italic; margin-top: 2px;
}
.session-expand-track-visual {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 90px; border-left: 1px solid #1f2530; padding-left: 12px;
}
.session-track-svg {
  width: 80px; height: 60px;
  opacity: 0.4;
}
.session-track-svg-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: #2a3040;
  text-align: center; margin-top: 4px; line-height: 1.3;
  max-width: 80px; overflow: hidden;
}
.session-track-svg-placeholder {
  width: 80px; height: 60px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; opacity: 0.2;
}

/* ── Last service expand modal ── */
.ls-expand-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 450;
}
.ls-expand-backdrop.open { display: block; }
.ls-expand-modal {
  display: none; position: fixed; top: 40px; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 451; flex-direction: column; overflow: hidden;
}
.ls-expand-modal.open { display: flex; }
.ls-expand-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.ls-expand-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase; color: #dce3ed;
  display: flex; align-items: center; gap: 8px;
}
.ls-expand-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px;
  display: flex; flex-direction: column; gap: 0;
}
.ls-expand-body::-webkit-scrollbar       { width: 3px; }
.ls-expand-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

@media (max-width: 580px) {
  .sessions-expand-body { grid-template-columns: 1fr; }
  .session-expand-track-visual { display: none; }
}

/* ── + Add button in Recent Sessions title ── */
.session-add-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid #2a3040;
  border-radius: 5px;
  color: #7a8a9b;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.12s;
}
.session-add-btn:hover { border-color: #d4f542; color: #d4f542; }

.session-expand-btn {
  background: transparent;
  border: 1px solid #2a3040;
  border-radius: 5px;
  color: #7a8a9b;
  font-size: 11px;
  padding: 2px 5px;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0; line-height: 1;
}
.session-expand-btn:hover { border-color: #d4f542; color: #d4f542; }

/* ═══════════════════════════════════════════════════════════════════════════
   TYRE STOCK MODULE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Small card stats ── */
.ts-card-stats {
  display: flex; gap: 0; border: 1px solid #1f2530; border-radius: 10px; overflow: hidden;
}
.ts-card-stat {
  flex: 1; text-align: center; padding: 10px 8px;
  border-right: 1px solid #1f2530;
}
.ts-card-stat:last-child { border-right: none; }
.ts-card-stat-val {
  font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 900;
  color: #dce3ed; line-height: 1;
}
.ts-card-stat-lbl {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #7a8a9b; margin-top: 3px;
}

/* ── Main modal ── */
.ts-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 450;
}
.ts-backdrop.open { display: block; }

.ts-modal {
  display: none; position: fixed; top: 30px; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  width: min(1100px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 451; flex-direction: column; overflow: hidden;
}
.ts-modal.open { display: flex; }

.ts-modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px 14px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
  position: relative;
}
.ts-modal-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase; color: #dce3ed;
  display: flex; align-items: center; gap: 8px;
}
.ts-modal-header-btns { display: flex; align-items: center; gap: 8px; }
.ts-settings-btn {
  background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  color: #7a8a9b; font-family: 'Barlow Condensed', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 10px; cursor: pointer; transition: all 0.12s;
}
.ts-settings-btn:hover { border-color: #7a8a9b; color: #dce3ed; }

/* ── Wear settings popover ── */
.ts-wear-settings-popover {
  display: none; position: absolute; top: 50px; right: 60px; z-index: 10;
  background: #1a2030; border: 1px solid #2a3040; border-radius: 12px;
  padding: 16px 18px; width: 260px; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.ts-wear-settings-popover.open { display: block; }
.ts-wear-settings-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #7a8a9b; margin-bottom: 4px;
}
.ts-wear-settings-hint {
  font-size: 11px; color: #3a4558; margin-bottom: 12px;
}
.ts-wear-settings-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ts-wear-settings-row {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8899aa;
}
.ts-wear-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ts-wear-input {
  width: 52px; background: #0d1117; border: 1px solid #2a3040; border-radius: 6px;
  color: #dce3ed; font-size: 12px; padding: 3px 7px; outline: none;
}
.ts-wear-input:focus { border-color: #d4f542; }
.ts-wear-settings-footer { display: flex; gap: 8px; }
.ts-ws-save {
  flex: 1; background: #d4f542; color: #0d1117; border: none; border-radius: 7px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 6px; cursor: pointer;
}
.ts-ws-save:hover { background: #c8e83a; }
.ts-ws-cancel {
  flex: 1; background: transparent; color: #7a8a9b; border: 1px solid #2a3040;
  border-radius: 7px; font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 6px; cursor: pointer;
}
.ts-ws-cancel:hover { color: #dce3ed; border-color: #3a4558; }

/* ── Modal body split layout ── */
.ts-modal-body {
  flex: 1; min-height: 0; display: flex; overflow: hidden;
}
.ts-modal-left {
  width: 240px; flex-shrink: 0; border-right: 1px solid #1f2530;
  overflow-y: auto; padding: 16px 16px 20px;
  display: flex; flex-direction: column; gap: 0;
}
.ts-modal-left::-webkit-scrollbar       { width: 3px; }
.ts-modal-left::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.ts-modal-right {
  flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px 20px;
  display: flex; flex-direction: column;
}
.ts-modal-right::-webkit-scrollbar       { width: 3px; }
.ts-modal-right::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* ── Left panel: info block ── */
.ts-info-block {
  background: #111620; border: 1px solid #1f2530; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 16px;
}
.ts-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid #1a1f28; font-size: 12px;
}
.ts-info-row:last-child { border-bottom: none; }
.ts-info-row span { color: #7a8a9b; }
.ts-info-row strong {
  font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 700; color: #dce3ed;
}
/* stat block layout (redesigned left panel) */
.ts-info-stats {
  display: flex;
}
.ts-info-stat {
  flex: 1; text-align: center; padding: 4px 2px;
}
.ts-info-stat + .ts-info-stat { border-left: 1px solid #1a1f28; }
.ts-info-stat-val {
  font-family: 'Barlow Condensed', sans-serif; font-size: 24px; font-weight: 900;
  color: #dce3ed; line-height: 1;
}
.ts-info-stat-lbl {
  font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #3a4558;
  margin-top: 3px; display: flex; align-items: center; justify-content: center; gap: 3px;
}
.ts-info-dot {
  width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
}

/* ── Left panel: section label ── */
.ts-section-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #3a4558;
  margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #1a1f28;
}

/* ── Left panel: rim sets ── */
.ts-rim-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ts-rim-entry {
  background: #111620; border: 1px solid #1f2530; border-radius: 8px;
  padding: 8px 10px; transition: border-color 0.12s;
}
.ts-rim-entry:hover { border-color: #2a3040; }
.ts-rim-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px;
}
.ts-rim-name {
  font-size: 12px; font-weight: 600; color: #dce3ed;
}
.ts-rim-del {
  background: transparent; border: none; color: #3a4558; font-size: 10px;
  cursor: pointer; padding: 2px 4px; line-height: 1; transition: color 0.12s;
}
.ts-rim-del:hover { color: #ef4444; }
.ts-rim-mounted {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: #8899aa;
  cursor: pointer; padding: 3px 6px; border: 1px solid #2a3040; border-radius: 5px;
  transition: all 0.12s;
}
.ts-rim-mounted:hover { border-color: #7a8a9b; color: #dce3ed; }
.ts-rim-tyre-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.ts-rim-empty {
  font-size: 11px; color: #3a4558; cursor: pointer; padding: 3px 6px;
  border: 1px dashed #2a3040; border-radius: 5px; text-align: center;
  transition: all 0.12s;
}
.ts-rim-empty:hover { border-color: #d4f542; color: #d4f542; }
.ts-rim-empty-hint { font-size: 11px; color: #2a3040; text-align: center; padding: 8px 0; }

.ts-add-rim-btn {
  background: transparent; border: 1px dashed #2a3040; border-radius: 7px;
  color: #7a8a9b; font-family: 'Barlow Condensed', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 7px; width: 100%; cursor: pointer; transition: all 0.12s; margin-top: auto;
}
.ts-add-rim-btn:hover { border-color: #d4f542; color: #d4f542; }

/* ── Right panel: status groups + tyre cards ── */
.ts-sections {
  flex: 1; display: flex; flex-direction: column; gap: 20px; min-height: 0;
}
.ts-status-group {
  display: flex; flex-direction: column;
}
.ts-status-group-hdr {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #3a4558;
  display: flex; align-items: center; gap: 6px; padding-bottom: 8px;
}
.ts-group-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.ts-group-dot.dot-mounted  { background: #f59e0b; }
.ts-group-dot.dot-available { background: #22c55e; }
.ts-group-dot.dot-scrapped  { background: #ef4444; }
.ts-group-count {
  margin-left: auto; color: #2a3040; font-weight: 600;
}

.ts-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; align-content: start;
}

.ts-tyre-card {
  background: linear-gradient(180deg, #131920 0%, #111620 100%);
  border: 1px solid #1f2530; border-radius: 12px;
  padding: 10px 10px 8px; cursor: pointer;
  transition: transform 0.18s, box-shadow 0.22s, border-color 0.2s;
  display: flex; flex-direction: column; gap: 6px;
  user-select: none; position: relative;
}
.ts-tyre-card::before {
  content: ''; position: absolute; top: 0; left: 12px; right: 12px;
  height: 2px; border-radius: 0 0 2px 2px;
  background: var(--cat-color, transparent); opacity: 0.45;
}
.ts-tyre-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border-color: #2a3548;
}
/* Status variants */
.ts-status-mounted {
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.06), 0 2px 8px rgba(0,0,0,0.15);
}
.ts-status-mounted:hover {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 20px rgba(245, 158, 11, 0.1);
}
.ts-status-in_stock {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ts-status-scrapped {
  opacity: 0.4; border-color: rgba(239, 68, 68, 0.12);
}
.ts-status-scrapped:hover { opacity: 0.6; }

.ts-tyre-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding-left: 18px;
}
.ts-tyre-card-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; color: #dce3ed;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ts-tyre-card-badge {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid; white-space: nowrap; flex-shrink: 0; opacity: 0.7;
}
.ts-tyre-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0 4px;
}
.ts-tyre-ring {
  display: flex; align-items: center; justify-content: center;
}
.ts-tyre-ring svg { width: 100%; height: auto; display: block; }
.ts-tyre-card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.ts-tyre-card-compound {
  font-size: 9px; color: #4a5568;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.ts-tyre-card-wear {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
/* Status text (used by set detail modal) */
.ts-tyre-card-status {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; text-align: center;
}
.ts-tyre-card-status.mounted  { color: #f59e0b; }
.ts-tyre-card-status.in_stock { color: #22c55e; }
.ts-tyre-card-status.scrapped { color: #ef4444; }

/* ── Right panel footer ── */
.ts-right-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; flex-shrink: 0; gap: 8px;
}
.ts-add-sets-btn {
  background: #d4f542; color: #0d1117; border: none; border-radius: 8px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 10px 22px; cursor: pointer;
  transition: background 0.12s, box-shadow 0.15s;
  box-shadow: 0 2px 12px rgba(212, 245, 66, 0.15);
}
.ts-add-sets-btn:hover { background: #c8e83a; box-shadow: 0 4px 20px rgba(212, 245, 66, 0.25); }
.ts-comp-manage-btn {
  background: transparent; border: 1px solid #2a3040; border-radius: 8px;
  color: #7a8a9b; font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 9px 16px;
  cursor: pointer; transition: all 0.12s;
}
.ts-comp-manage-btn:hover { border-color: #3b82f6; color: #3b82f6; }

/* ── Assign tyre picker (inline in rim entry) ── */
.ts-assign-picker {
  margin-top: 6px; display: flex; flex-direction: column; gap: 4px;
}
.ts-assign-option {
  font-size: 11px; color: #8899aa; cursor: pointer; padding: 4px 6px;
  border: 1px solid #2a3040; border-radius: 5px; transition: all 0.12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ts-assign-option:hover { border-color: #d4f542; color: #d4f542; }
.ts-assign-cancel {
  font-size: 10px; color: #3a4558; cursor: pointer; text-align: center;
  padding: 3px; transition: color 0.12s;
}
.ts-assign-cancel:hover { color: #7a8a9b; }

/* ── Add Tyre Sets Modal ── */
.ts-add-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); z-index: 460;
}
.ts-add-backdrop.open { display: block; }
.ts-add-modal {
  display: none; position: fixed; top: 40px; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 461; flex-direction: column; overflow: hidden;
}
.ts-add-modal.open { display: flex; }
.ts-add-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.ts-add-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase; color: #dce3ed;
}
.ts-add-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.ts-add-body::-webkit-scrollbar       { width: 3px; }
.ts-add-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* ── Manage Compounds Modal ── */
.ts-comp-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); z-index: 460;
}
.ts-comp-backdrop.open { display: block; }
.ts-comp-modal {
  display: none; position: fixed; top: 40px; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 461; flex-direction: column; overflow: hidden;
}
.ts-comp-modal.open { display: flex; }
.ts-comp-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.ts-comp-body::-webkit-scrollbar       { width: 3px; }
.ts-comp-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.ts-comp-entry {
  display: flex; align-items: flex-start; gap: 10px;
  background: #111620; border: 1px solid #1f2530; border-radius: 9px; padding: 10px 12px;
}
.ts-comp-info { flex: 1; min-width: 0; }
.ts-comp-name {
  font-size: 13px; font-weight: 600; color: #dce3ed; margin-bottom: 3px;
}
.ts-comp-meta { font-size: 11px; color: #7a8a9b; }
.ts-comp-actions { display: flex; gap: 5px; flex-shrink: 0; align-items: flex-start; }
.ts-comp-edit-btn {
  background: transparent; border: 1px solid #2a3040; border-radius: 5px;
  color: #7a8a9b; font-size: 10px; padding: 3px 7px; cursor: pointer;
  transition: all 0.12s;
}
.ts-comp-edit-btn:hover { border-color: #3b82f6; color: #3b82f6; }
.ts-comp-del {
  background: transparent; border: 1px solid #2a3040; border-radius: 5px;
  color: #7a8a9b; font-size: 10px; padding: 3px 7px; cursor: pointer;
  transition: all 0.12s; flex-shrink: 0;
}
.ts-comp-del:hover { border-color: #ef4444; color: #ef4444; }

/* ── Set Detail Modal ── */
.ts-set-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); z-index: 460;
}
.ts-set-backdrop.open { display: block; }
.ts-set-modal {
  display: none; position: fixed; top: 40px; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 461; flex-direction: column; overflow: hidden;
}
.ts-set-modal.open { display: flex; }
.ts-set-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.ts-set-body::-webkit-scrollbar       { width: 3px; }
.ts-set-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* ── Shared form elements in tyre modals ── */
.ts-form-row {
  display: flex; flex-direction: column; gap: 5px;
}
.ts-form-row-inline {
  display: flex; gap: 10px;
}
.ts-form-row-inline .ts-form-row { flex: 1; }
.ts-form-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #7a8a9b;
}
.ts-form-input, .ts-form-select {
  background: #0d1117; border: 1px solid #2a3040; border-radius: 7px;
  color: #dce3ed; font-size: 13px; padding: 7px 10px; outline: none;
  width: 100%; transition: border-color 0.12s;
}
.ts-form-input:focus, .ts-form-select:focus { border-color: #d4f542; }
.ts-form-select option { background: #1a2030; }
.ts-form-hint {
  font-size: 11px; color: #3a4558; margin-top: -2px;
}
.ts-preview-list {
  display: flex; flex-wrap: wrap; gap: 5px; padding: 8px;
  background: #0d1117; border: 1px solid #2a3040; border-radius: 7px; min-height: 36px;
}
.ts-preview-tag {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; background: #1a2030; border: 1px solid #2a3040;
  border-radius: 4px; padding: 2px 7px; color: #8899aa;
}
.ts-btn-row {
  display: flex; gap: 10px; margin-top: 4px;
}
.ts-btn-primary {
  flex: 1; background: #d4f542; color: #0d1117; border: none; border-radius: 8px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 10px; cursor: pointer;
  transition: background 0.12s;
}
.ts-btn-primary:hover { background: #c8e83a; }
.ts-btn-primary:disabled { background: #2a3040; color: #7a8a9b; cursor: not-allowed; }
.ts-btn-secondary {
  flex: 1; background: transparent; color: #7a8a9b; border: 1px solid #2a3040;
  border-radius: 8px; font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 10px;
  cursor: pointer; transition: all 0.12s;
}
.ts-btn-secondary:hover { border-color: #7a8a9b; color: #dce3ed; }

/* ── Event assignment list ── */
.ts-event-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto;
}
.ts-event-champ-group { margin-bottom: 4px; }
.ts-event-champ-header {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #7a8a9b;
  padding: 4px 0 2px;
}
.ts-event-row {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; background: #141820; border: 1px solid #1f2530;
  border-radius: 6px;
}
.ts-event-name { flex: 1; font-size: 12px; color: #dce3ed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-btn-event-add {
  flex-shrink: 0; background: #d4f54222; color: #d4f542; border: 1px solid #d4f54255;
  border-radius: 5px; font-family: 'Barlow Condensed', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; cursor: pointer; transition: all 0.12s;
}
.ts-btn-event-add:hover { background: #d4f54244; }
.ts-btn-event-remove {
  flex-shrink: 0; background: transparent; color: #ef444488; border: 1px solid #ef444433;
  border-radius: 5px; font-family: 'Barlow Condensed', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; cursor: pointer; transition: all 0.12s;
}
.ts-btn-event-remove:hover { color: #ef4444; border-color: #ef4444; }

/* ── Tyre set individual tyre rows ── */
.ts-tyre-row {
  display: flex; align-items: center; gap: 12px;
  background: #111620; border: 1px solid #1f2530; border-radius: 8px;
  padding: 10px 12px;
}
.ts-tyre-row-pos {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #7a8a9b; width: 28px; flex-shrink: 0;
}
.ts-tyre-row-circle {
  width: 20px; height: 20px; border-radius: 50%; border: 3px solid #2a3040; flex-shrink: 0;
}
.ts-tyre-row-info { flex: 1; min-width: 0; }
.ts-tyre-row-wear {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700;
  color: #dce3ed;
}
.ts-tyre-wear-bar {
  height: 3px; background: #1f2530; border-radius: 2px; margin-top: 4px; overflow: hidden;
}
.ts-tyre-wear-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }
.ts-tyre-row-edit {
  background: transparent; border: 1px solid #2a3040; border-radius: 5px;
  color: #7a8a9b; font-family: 'Barlow Condensed', sans-serif; font-size: 9px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 3px 7px; cursor: pointer; flex-shrink: 0; transition: all 0.12s;
}
.ts-tyre-row-edit:hover { border-color: #d4f542; color: #d4f542; }

/* ── Category color picker ── */
.ts-color-palette {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0;
}
.ts-color-swatch {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.12s, transform 0.12s;
}
.ts-color-swatch:hover  { transform: scale(1.15); }
.ts-color-swatch.active { border-color: #fff; }

/* ── Multi-select checkbox on tyre cards ── */
.ts-tyre-card-check {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.ts-tyre-card:hover .ts-tyre-card-check,
.ts-tyre-card.ts-selected .ts-tyre-card-check { opacity: 1; }
.ts-checkbox {
  width: 16px; height: 16px; border-radius: 4px;
  border: 2px solid #3a4558; background: transparent;
  transition: all 0.12s; position: relative;
}
.ts-checkbox.checked {
  background: #d4f542; border-color: #d4f542;
}
.ts-checkbox.checked::after {
  content: '✓'; position: absolute; top: -1px; left: 2px;
  font-size: 11px; font-weight: 700; color: #0d1117;
}
.ts-tyre-card.ts-selected {
  border-color: #d4f54266;
  box-shadow: 0 0 0 1px #d4f54233, 0 4px 16px rgba(212, 245, 66, 0.08);
}

/* ── Selection action bar ── */
.ts-sel-bar {
  display: flex; align-items: center; gap: 10px;
  background: #1a2030; border: 1px solid #d4f54244;
  border-radius: 10px; padding: 10px 16px;
  margin-top: 8px; flex-shrink: 0;
  animation: ts-sel-bar-in 0.2s ease-out;
}
@keyframes ts-sel-bar-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ts-sel-count {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  color: #d4f542; letter-spacing: 0.5px; flex: 1;
}
.ts-sel-clear {
  background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  color: #7a8a9b; font-family: 'Barlow Condensed', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 5px 12px; cursor: pointer; transition: all 0.12s;
}
.ts-sel-clear:hover { border-color: #4a5568; color: #dce3ed; }
.ts-sel-action {
  background: #d4f542; color: #0d1117; border: none; border-radius: 6px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 16px; cursor: pointer; transition: all 0.12s;
  box-shadow: 0 2px 8px rgba(212, 245, 66, 0.15);
}
.ts-sel-action:hover { background: #c8e83a; box-shadow: 0 4px 16px rgba(212, 245, 66, 0.25); }

/* ── Bulk event picker modal ── */
.ts-bulk-event-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1060; backdrop-filter: blur(2px);
}
.ts-bulk-event-backdrop.open { display: block; }
.ts-bulk-event-modal {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #131920; border: 1px solid #1f2530; border-radius: 16px;
  width: 380px; max-height: 80vh; overflow-y: auto; z-index: 1061;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.ts-bulk-event-modal.open { display: flex; flex-direction: column; }
.ts-bulk-event-body { padding: 16px 20px 20px; overflow-y: auto; }
.ts-bulk-selected { margin-bottom: 4px; }
.ts-bulk-event-option { cursor: pointer; transition: all 0.12s; }
.ts-bulk-event-option:hover { border-color: #d4f54266; background: #1a2030; }
.ts-bulk-arrow {
  flex-shrink: 0; color: #3a4558; font-size: 14px; transition: color 0.12s;
}
.ts-bulk-event-option:hover .ts-bulk-arrow { color: #d4f542; }

@media (max-width: 700px) {
  .ts-modal-left  { display: none; }
  .ts-card-grid   { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .ts-bulk-event-modal { width: 90vw; }
}

/* ── Compound category dot in list view ── */
.ts-comp-cat-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block;
}
/* ── Compound category swatches (smaller than add-sets swatches) ── */
.ts-comp-swatch {
  width: 18px; height: 18px;
}

/* ── Add Rim Sets backdrop ── */
.ts-add-rim-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); z-index: 460;
}
.ts-add-rim-backdrop.open { display: block; }

/* ── Scrap bin ── */
.ts-scrap-bin {
  display: none; margin-top: 8px;
  border: 2px dashed #3a1010; border-radius: 8px;
  background: rgba(239,68,68,0.04); color: #ef4444;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; text-align: center;
  padding: 10px 8px; cursor: default;
  transition: background 0.15s, border-color 0.15s;
}
.ts-scrap-bin.ts-scrap-bin-visible { display: block; }
.ts-scrap-bin.ts-bin-hover {
  background: rgba(239,68,68,0.12); border-color: #ef4444;
}

/* ── Rim entry drag-over state ── */
.ts-rim-entry.ts-rim-drag-over {
  border-color: #d4f542;
  box-shadow: 0 0 0 1px #d4f54244, 0 4px 16px rgba(212,245,66,0.1);
}

/* ── Stock drop-zone unmount hint ── */
.ts-stock-dropzone { position: relative; }
.ts-unmount-hint {
  display: none; position: sticky; bottom: 0;
  margin-top: 8px; padding: 10px;
  border: 2px dashed #2a3040; border-radius: 8px;
  background: #0f1318; color: #3a4558;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; text-align: center;
  transition: all 0.15s;
}
.ts-unmount-hint.ts-unmount-hint-visible { display: block; }
.ts-unmount-hint.ts-unmount-hint-hover {
  border-color: #f59e0b; color: #f59e0b;
  background: rgba(245,158,11,0.06);
}
.ts-stock-dropzone.ts-stock-drop-active .ts-unmount-hint {
  border-color: #f59e0b; color: #f59e0b;
  background: rgba(245,158,11,0.06);
}

/* ── Card drag state ── */
.ts-tyre-card.ts-dragging { opacity: 0.4; transform: scale(0.96); }

/* ── Wear status badge on cards ── */
.ts-wear-badge {
  font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px; border: 1px solid; white-space: nowrap;
  flex-shrink: 0; opacity: 0.85;
}

/* ── 2x2 detail wear grid ── */
.ts-wear-grid-2x2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ts-wear-cell {
  background: #111620; border: 1px solid #1f2530; border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.ts-wear-cell-pos {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #7a8a9b; align-self: flex-start;
}
.ts-wear-cell-ring { display: flex; align-items: center; justify-content: center; }
.ts-wear-cell-text {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
}
.ts-wear-cell-bar {
  width: 100%; height: 3px; background: #1f2530; border-radius: 2px; overflow: hidden;
}
.ts-wear-cell .ts-tyre-row-edit {
  margin-top: 2px; font-size: 8px; padding: 2px 6px;
}

/* ── Bulk scrap button ── */
.ts-sel-scrap {
  background: transparent; border: 1px solid #ef444444; border-radius: 6px;
  color: #ef4444aa; font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 14px; cursor: pointer; transition: all 0.12s;
}
.ts-sel-scrap:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.06); }

/* ═══ LIGHT MODE ═══ */

/* Back button */
body.light-mode .detail-back { border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .detail-back:hover { border-color: #b0b8c4; color: #1a2030; }

/* Banner */
body.light-mode .detail-banner { background: #e8ecf2; border-color: #dde2ec; }
body.light-mode .detail-banner-id { color: #5a7a00; }
body.light-mode .dbt-card { background: rgba(255,255,255,0.82); border-color: rgba(0,0,0,0.09); }
body.light-mode .dbt-card-name { color: #1a2030; }
body.light-mode .dbt-card-meta { color: #8899aa; }
body.light-mode .detail-at-track-badge { background: rgba(255,255,255,0.88); border-color: rgba(34,197,94,0.4); }
body.light-mode .detail-tag.fuel { background: rgba(90,122,0,0.08); border-color: rgba(90,122,0,0.2); color: #5a7a00; }

/* Action buttons */
body.light-mode .detail-pdf-btn { background: rgba(255,255,255,0.85); border-color: #dde2ec; color: #1a2030; }
body.light-mode .detail-pdf-btn:hover { border-color: #5a7a00; color: #5a7a00; }
body.light-mode .detail-action-btn { background: rgba(255,255,255,0.85); border-color: #dde2ec; color: #1a2030; }
body.light-mode .detail-action-btn:hover { border-color: #5a7a00; color: #5a7a00; }
body.light-mode .detail-action-btn.danger:hover { border-color: #ef4444; color: #ef4444; }

/* Stat tiles */
body.light-mode .stat-value { color: #1a2030; }
body.light-mode .stat-unit { color: #8899aa; }
body.light-mode .chart-bar { background: #5a7a00; }

/* Info rows */
body.light-mode .info-row { border-bottom-color: #e8ecf2; }
body.light-mode .info-row-label { color: #8899aa; }
body.light-mode .info-row-value { color: #1a2030; }

/* Alert items */
body.light-mode .alert-item { background: #f8f9fc; }
body.light-mode .alert-item:hover { border-color: #dde2ec; }
body.light-mode .alert-item-text { color: #1a2030; }

/* Alert filter */
body.light-mode .alert-filter-pill { border-color: #dde2ec; color: #8899aa; }
body.light-mode .alert-filter-pill:hover { border-color: #b0b8c4; color: #6b7a8d; }
body.light-mode .alert-filter-pill.active { border-color: #5a7a00; color: #5a7a00; background: rgba(90,122,0,0.06); }
body.light-mode .alert-filter-divider { background: #dde2ec; }

/* Alert expand modal */
body.light-mode .alert-expand-modal { background: #ffffff; border-color: #dde2ec; }
body.light-mode .alert-expand-header { border-bottom-color: #e8ecf2; }
body.light-mode .alert-expand-title { color: #1a2030; }
body.light-mode .alert-expand-filter-wrap { border-bottom-color: #e8ecf2; }

/* Alert detail modal */
body.light-mode .alert-detail-modal { background: #ffffff; border-color: #dde2ec; }
body.light-mode .alert-detail-header { border-bottom-color: #e8ecf2; }
body.light-mode .alert-detail-name { color: #1a2030; }
body.light-mode .alert-detail-body::-webkit-scrollbar-thumb { background: #dde2ec; }
body.light-mode .alert-detail-parts-section { background: #f8f9fc; border-color: #dde2ec; }

/* Alert settings popover */
body.light-mode .alert-settings-popover { background: #ffffff; border-color: #dde2ec; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
body.light-mode .alert-settings-input { background: #f0f3f8; border-color: #dde2ec; color: #1a2030; }
body.light-mode .alert-settings-input:focus { border-color: #5a7a00; }
body.light-mode .alert-settings-row span { color: #6b7a8d; }
body.light-mode .alert-settings-cancel { border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .alert-settings-cancel:hover { color: #1a2030; border-color: #b0b8c4; }

/* Mileage bar */
body.light-mode .mileage-bar-track { background: #e8ecf2; }
body.light-mode .mileage-label { color: #6b7a8d; }
body.light-mode .mileage-value { color: #1a2030; }

/* Key metrics */
body.light-mode .km-metric-item { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .km-metric-item:hover { border-color: #b0b8c4; }
body.light-mode .km-metric-value { color: #1a2030; }
body.light-mode .km-manage-btn { border-color: #dde2ec; color: #b0b8c4; }
body.light-mode .km-manage-btn:hover { border-color: #8899aa; color: #6b7a8d; }

/* Session entries */
body.light-mode .session-content { background: #f8f9fc; border-color: #e8ecf2; }
body.light-mode .session-entry:hover .session-content { border-color: #dde2ec; background: #ffffff; }
body.light-mode .session-timeline-dot { background: #dde2ec; border-color: #ffffff; }
body.light-mode #recent-sessions-list::before { background: linear-gradient(to bottom, #dde2ec 0%, #e8ecf2 80%, transparent 100%); }
body.light-mode .session-filter-btn { color: #b0b8c4; }
body.light-mode .session-filter-btn:hover { color: #6b7a8d; background: rgba(0,0,0,0.03); }
body.light-mode .session-filter-btn.active { background: #5a7a00; color: #fff; border-color: #5a7a00; box-shadow: none; }
body.light-mode .ce-run-list-name { color: #6b7a8d; }

/* Skeleton shimmer */
body.light-mode .skeleton { background: linear-gradient(90deg, #e8ecf2 25%, #f0f3f8 50%, #e8ecf2 75%); background-size: 200% 100%; }

/* Wear tracker categories */
body.light-mode .wear-category-label { color: #b0b8c4; border-bottom-color: #e8ecf2; }

/* ── Tyre Stock Modal ── */
body.light-mode .ts-backdrop { background: rgba(0,0,0,0.35); }
body.light-mode .ts-modal { background: #ffffff; border-color: #dde2ec; }
body.light-mode .ts-modal-header { border-bottom-color: #e8ecf2; }
body.light-mode .ts-modal-title { color: #1a2030; }
body.light-mode .ts-settings-btn { border-color: #dde2ec; color: #8899aa; }
body.light-mode .ts-settings-btn:hover { border-color: #b0b8c4; color: #1a2030; }
body.light-mode .ts-modal-left { border-right-color: #e8ecf2; }
body.light-mode .ts-info-block { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .ts-info-row { border-bottom-color: #e8ecf2; }
body.light-mode .ts-info-row span { color: #8899aa; }
body.light-mode .ts-info-row strong { color: #1a2030; }
body.light-mode .ts-info-stat-val { color: #1a2030; }
body.light-mode .ts-info-stat-lbl { color: #8899aa; }
body.light-mode .ts-section-label { color: #8899aa; border-bottom-color: #e8ecf2; }
body.light-mode .ts-rim-entry { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .ts-rim-entry:hover { border-color: #b0b8c4; }
body.light-mode .ts-rim-name { color: #1a2030; }
body.light-mode .ts-rim-del { color: #b0b8c4; }
body.light-mode .ts-rim-mounted { border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .ts-rim-mounted:hover { border-color: #b0b8c4; color: #1a2030; }
body.light-mode .ts-rim-empty { border-color: #dde2ec; color: #b0b8c4; }
body.light-mode .ts-rim-empty:hover { border-color: #5a7a00; color: #5a7a00; }
body.light-mode .ts-rim-empty-hint { color: #b0b8c4; }
body.light-mode .ts-add-rim-btn { border-color: #dde2ec; color: #8899aa; }
body.light-mode .ts-add-rim-btn:hover { border-color: #5a7a00; color: #5a7a00; }
body.light-mode .ts-status-group-hdr { color: #8899aa; }
body.light-mode .ts-group-count { color: #b0b8c4; }
body.light-mode .ts-tyre-card { background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%); border-color: #dde2ec; }
body.light-mode .ts-tyre-card:hover { border-color: #b0b8c4; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
body.light-mode .ts-status-mounted { border-color: rgba(245,158,11,0.25); box-shadow: 0 0 8px rgba(245,158,11,0.06); }
body.light-mode .ts-tyre-card-label { color: #1a2030; }
body.light-mode .ts-tyre-card-compound { color: #8899aa; }
body.light-mode .ts-assign-option { border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .ts-assign-option:hover { border-color: #5a7a00; color: #5a7a00; }
body.light-mode .ts-assign-cancel { color: #b0b8c4; }
body.light-mode .ts-card-stats { border-color: #dde2ec; }
body.light-mode .ts-card-stat { border-right-color: #dde2ec; }
body.light-mode .ts-card-stat-val { color: #1a2030; }

/* Wear settings popover */
body.light-mode .ts-wear-settings-popover { background: #ffffff; border-color: #dde2ec; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
body.light-mode .ts-wear-settings-hint { color: #b0b8c4; }
body.light-mode .ts-wear-settings-row { color: #6b7a8d; }
body.light-mode .ts-wear-input { background: #f0f3f8; border-color: #dde2ec; color: #1a2030; }
body.light-mode .ts-wear-input:focus { border-color: #5a7a00; }
body.light-mode .ts-ws-cancel { border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .ts-ws-cancel:hover { color: #1a2030; border-color: #b0b8c4; }

/* Multi-select & bulk event picker */
body.light-mode .ts-checkbox { border-color: #b0b8c4; }
body.light-mode .ts-tyre-card.ts-selected { border-color: #8bb800; box-shadow: 0 0 0 1px #8bb80033; }
body.light-mode .ts-sel-bar { background: #f0f3f8; border-color: #8bb80044; }
body.light-mode .ts-sel-count { color: #5a7a00; }
body.light-mode .ts-sel-clear { border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .ts-sel-clear:hover { border-color: #b0b8c4; color: #1a2030; }
body.light-mode .ts-bulk-event-modal { background: #ffffff; border-color: #dde2ec; }
body.light-mode .ts-bulk-event-option:hover { background: #f0f3f8; border-color: #8bb80066; }
body.light-mode .ts-bulk-arrow { color: #b0b8c4; }
body.light-mode .ts-bulk-event-option:hover .ts-bulk-arrow { color: #5a7a00; }

/* Add Tyre Sets Modal */
body.light-mode .ts-add-backdrop { background: rgba(0,0,0,0.35); }
body.light-mode .ts-add-modal { background: #ffffff; border-color: #dde2ec; }
body.light-mode .ts-add-header { border-bottom-color: #e8ecf2; }
body.light-mode .ts-add-title { color: #1a2030; }

/* Manage Compounds Modal */
body.light-mode .ts-comp-backdrop { background: rgba(0,0,0,0.35); }
body.light-mode .ts-comp-modal { background: #ffffff; border-color: #dde2ec; }
body.light-mode .ts-comp-entry { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .ts-comp-name { color: #1a2030; }
body.light-mode .ts-comp-meta { color: #8899aa; }
body.light-mode .ts-comp-del { border-color: #dde2ec; color: #8899aa; }
body.light-mode .ts-comp-del:hover { border-color: #ef4444; color: #ef4444; }

/* Set Detail Modal */
body.light-mode .ts-set-backdrop { background: rgba(0,0,0,0.35); }
body.light-mode .ts-set-modal { background: #ffffff; border-color: #dde2ec; }

/* Tyre modal form elements */
body.light-mode .ts-form-label { color: #6b7a8d; }
body.light-mode .ts-form-input,
body.light-mode .ts-form-select { background: #f0f3f8; border-color: #dde2ec; color: #1a2030; }
body.light-mode .ts-form-input:focus,
body.light-mode .ts-form-select:focus { border-color: #5a7a00; }
body.light-mode .ts-form-select option { background: #ffffff; }
body.light-mode .ts-form-hint { color: #b0b8c4; }
body.light-mode .ts-preview-list { background: #f0f3f8; border-color: #dde2ec; }
body.light-mode .ts-preview-tag { background: #e8ecf2; border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .ts-btn-primary:disabled { background: #dde2ec; color: #8899aa; }
body.light-mode .ts-btn-secondary { border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .ts-btn-secondary:hover { border-color: #b0b8c4; color: #1a2030; }

/* Tyre set rows */
body.light-mode .ts-tyre-row { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .ts-tyre-row-circle { border-color: #dde2ec; }
body.light-mode .ts-tyre-row-wear { color: #1a2030; }
body.light-mode .ts-tyre-wear-bar { background: #e8ecf2; }
body.light-mode .ts-tyre-row-edit { border-color: #dde2ec; color: #8899aa; }
body.light-mode .ts-tyre-row-edit:hover { border-color: #5a7a00; color: #5a7a00; }
body.light-mode .ts-color-swatch.active { border-color: #1a2030; }

/* ── Scrap / restore / danger button ── */
.ts-btn-danger {
  flex: 1; background: transparent; color: #ef4444; border: 1px solid #3a1010;
  border-radius: 8px; font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 10px;
  cursor: pointer; transition: all 0.12s;
}
.ts-btn-danger:hover { background: #3a1010; color: #fca5a5; border-color: #ef4444; }

body.light-mode .ts-btn-danger { border-color: #fecaca; color: #dc2626; }
body.light-mode .ts-btn-danger:hover { background: #fef2f2; border-color: #dc2626; }

/* ── Scrapped toggle ── */
.ts-scrapped-toggle {
  background: transparent; border: 1px solid #2a3040; color: #5a6678;
  border-radius: 6px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px; padding: 6px 12px;
  cursor: pointer; transition: all 0.12s;
}
.ts-scrapped-toggle:hover { border-color: #5a6678; color: #8899aa; }

body.light-mode .ts-scrapped-toggle { border-color: #dde2ec; color: #8899aa; }
body.light-mode .ts-scrapped-toggle:hover { border-color: #b0b8c4; color: #6b7a8d; }

/* ── Usage history ── */
.ts-usage-summary {
  font-weight: 400; text-transform: none; letter-spacing: 0; color: #8899aa;
  font-size: 11px; margin-left: 6px;
}
.ts-usage-list {
  display: flex; flex-direction: column; gap: 8px;
}
.ts-usage-event {
  background: #0e1117; border: 1px solid #1f2530; border-radius: 8px;
  padding: 10px 12px; font-size: 12px;
}
.ts-usage-event-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 6px;
}
.ts-usage-event-name {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 13px; color: #dce3ed;
}
.ts-usage-track {
  font-size: 11px; color: #5a6678; margin-top: 2px;
}
.ts-usage-event-totals {
  display: flex; gap: 8px; font-size: 11px; color: #8899aa;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  white-space: nowrap;
}
.ts-usage-km { color: #22c55e; }
.ts-usage-runs {
  display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid #1a1f28; padding-top: 6px;
}
.ts-usage-run {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: #7a8a9b;
}
.ts-usage-run-name { flex: 1; }
.ts-usage-run-laps { color: #8899aa; font-weight: 600; }
.ts-usage-run-km { color: #22c55e; font-weight: 600; min-width: 60px; text-align: right; }
.ts-usage-no-km { color: #f59e0b; font-size: 10px; font-weight: 600; text-align: right; cursor: help; }

/* Light mode */
body.light-mode .ts-usage-event { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .ts-usage-event-name { color: #1a2030; }
body.light-mode .ts-usage-track { color: #8899aa; }
body.light-mode .ts-usage-event-totals { color: #6b7a8d; }
body.light-mode .ts-usage-km { color: #16a34a; }
body.light-mode .ts-usage-runs { border-color: #e8ecf2; }
body.light-mode .ts-usage-run { color: #6b7a8d; }
body.light-mode .ts-usage-run-laps { color: #4b5563; }

/* ── Tyre Stock card - mounted sets section ───────────────────────────────── */
#tyre-stock-card-body {
  overflow-y: auto;
  max-height: 260px;
}
#tyre-stock-card-body::-webkit-scrollbar       { width: 3px; }
#tyre-stock-card-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.ts-mounted-section {
  margin-top: 10px;
}
.ts-mounted-header {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #4a5a6b; margin-bottom: 6px;
}
.ts-mounted-grid {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.ts-mounted-chip {
  display: flex; align-items: center; gap: 5px;
  background: #141a24; border: 1px solid #2a3040; border-radius: 6px;
  padding: 4px 8px;
  width: calc(20% - 4px); min-width: 80px; box-sizing: border-box;
  overflow: hidden;
}
.ts-mounted-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.ts-mounted-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; color: #dce3ed;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ts-mounted-wear {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}

/* ── Wear item highlight (after clicking alert) ───────────────────────────── */
@keyframes wear-highlight-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(212,245,66,0); border-color: transparent; }
  30%     { box-shadow: 0 0 0 4px rgba(212,245,66,0.2), 0 0 20px rgba(212,245,66,0.15); border-color: rgba(212,245,66,0.6) !important; }
}
.mileage-item.wear-item-highlight {
  animation: wear-highlight-pulse 0.7s ease-out 3;
}

/* ── Wear item expanded detail panel ─────────────────────────────────────── */
.mileage-item.wear-item-expanded { border-color: rgba(212,245,66,0.15); }
.wear-part-detail {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid #1a2030;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.wpd-section {
  background: #0c1018; border: 1px solid #1a2030; border-radius: 6px;
  padding: 6px 10px; min-width: 110px;
}
.wpd-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #3a4a5b; margin-bottom: 5px;
}
.wpd-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.wpd-field  { display: flex; gap: 4px; align-items: baseline; }
.wpd-key    { font-size: 9px; color: #3a4a5b; text-transform: uppercase; letter-spacing: 0.5px; }
.wpd-val    {
  font-size: 12px; font-weight: 700; color: #dce3ed;
  font-family: 'Barlow Condensed', sans-serif;
}
.wpd-interval {
  font-size: 11px; font-weight: 600; color: #7a8a9b;
  background: #1a2030; border-radius: 4px; padding: 2px 6px;
}
.wpd-empty { font-size: 11px; color: #3a4a5b; padding: 2px 0; }

/* ── Part detail popup modal ─────────────────────────────────────────────── */
.wpd-popup-backdrop {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.35);
}
.wpd-popup {
  position: fixed; z-index: 8001;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #121820; border: 1px solid #1e2a38; border-radius: 10px;
  width: 520px; max-width: 94vw; max-height: 82vh; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.wpd-popup-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid #1a2030;
  position: sticky; top: 0; background: #121820; z-index: 1;
}
.wpd-popup-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 700; color: #dce3ed;
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wpd-popup-cat {
  font-size: 9px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: #3a4a5b;
}
.wpd-popup-close {
  background: none; border: none; color: #4a5a6b; font-size: 18px;
  cursor: pointer; padding: 0 2px; line-height: 1;
}
.wpd-popup-close:hover { color: #dce3ed; }
.wpd-popup-body {
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}

/* ── Interval progress bars inside popup ── */
.wpd-bar-row { margin-bottom: 6px; }
.wpd-bar-row:last-of-type { margin-bottom: 0; }
.wpd-bar-labels {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.wpd-bar-label-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 600; color: #8899aa;
}
.wpd-bar-unit { font-size: 10px; color: #5a6878; font-weight: 600; }
.wpd-bar-rem {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
}
.wpd-prf-note {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; color: #7a8a9b; margin-top: 8px; font-style: italic;
}
.wpd-prf-note-max { color: #3a5278; }
.wpd-title-max { color: #3a5278; }

/* ── Parts display inside popup ── */
.wpd-parts-group { margin-bottom: 8px; }
.wpd-parts-group:last-child { margin-bottom: 0; }
.wpd-parts-type {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: #7a8a9b; margin-bottom: 5px;
}
.wpd-parts-type-svc { color: #4ac8a4; }
.wpd-parts-list { display: flex; flex-wrap: wrap; gap: 4px; }
.wpd-parts-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.04); border: 1px solid #2a3040;
  border-radius: 4px; padding: 3px 8px;
  font-family: 'Barlow', sans-serif; font-size: 11px; color: #c0cce0;
}
.wpd-parts-pill-svc {
  background: rgba(74,200,164,0.06); border-color: rgba(74,200,164,0.2); color: #8ab8b0;
}
.wpd-parts-qty { color: #d4f542; font-weight: 700; font-size: 10px; font-family: 'Barlow Condensed', sans-serif; }
.wpd-parts-qty-svc { color: #4ac8a4; }

/* light mode */
body.light-mode .wpd-popup { background: #ffffff; border-color: #dde2ec; box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
body.light-mode .wpd-popup-header { background: #ffffff; border-bottom-color: #e8ecf2; }
body.light-mode .wpd-popup-name { color: #1a2030; }
body.light-mode .wpd-popup-close { color: #8899aa; }
body.light-mode .wpd-popup-close:hover { color: #1a2030; }
body.light-mode .wpd-popup-backdrop { background: rgba(0,0,0,0.15); }
body.light-mode .wpd-bar-label-text { color: #5a6878; }
body.light-mode .wpd-parts-pill { background: #f0f3f8; border-color: #dde2ec; color: #2a3040; }
body.light-mode .wpd-parts-pill-svc { background: rgba(74,200,164,0.08); border-color: rgba(74,200,164,0.3); color: #2a7060; }

/* ── "All" events filter bar ─────────────────────────────────────────────── */
.session-all-filters {
  display: flex; gap: 8px; padding: 0 0 8px; flex-shrink: 0;
}
.session-filter-select {
  background: #141a24; border: 1px solid #2a3040; border-radius: 6px;
  color: #8899aa; font-size: 11px; padding: 4px 8px;
  font-family: 'Barlow Condensed', sans-serif; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.session-filter-select:focus { outline: none; border-color: #3a4558; }

/* ── Event alert highlight in add-event modal ────────────────────────────── */
@keyframes ae-field-pulse {
  0%,100% { border-color: #2a3040; box-shadow: none; }
  50%      { border-color: rgba(239,68,68,0.7); box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }
}
.ae-field-highlight { animation: ae-field-pulse 0.5s ease 4 !important; }
body.light-mode .ts-usage-run-km { color: #16a34a; }

/* ── Session entry: clickable ────────────────────────────────────────────── */
.session-entry { cursor: pointer; }

/* ── Event detail modal ──────────────────────────────────────────────────── */
.ev-detail-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 480;
}
.ev-detail-backdrop.open { display: block; }
.ev-detail-modal {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 32px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 14px;
  z-index: 481; flex-direction: column; overflow: hidden;
}
.ev-detail-modal.open { display: flex; }
.ev-detail-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 16px 18px 14px; border-bottom: 1px solid #1a2030;
}
.ev-detail-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ev-detail-name {
  font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-weight: 800;
  color: #dce3ed; letter-spacing: 0.3px; line-height: 1.2;
}
.ev-detail-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-top: 2px; }
.ev-detail-close {
  background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  color: #7a8a9b; font-size: 11px; cursor: pointer; padding: 4px 7px; line-height: 1;
  transition: all 0.12s;
}
.ev-detail-close:hover { border-color: #ef4444; color: #ef4444; }
.ev-detail-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 9px; }
.evd-row { display: flex; gap: 10px; align-items: baseline; }
.evd-key {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #4a5a6b;
  width: 52px; flex-shrink: 0;
}
.evd-val { font-size: 12px; color: #8899aa; flex: 1; min-width: 0; }
.evd-stat {
  font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-weight: 800;
  color: #dce3ed; line-height: 1;
}
.evd-note .evd-val { font-style: italic; color: #6a7a8b; }
.evd-divider { height: 1px; background: #1a2030; margin: 3px 0; }
.evd-section-title .evd-key { color: #6a7a8b; }
.evd-session-row .evd-val { font-size: 11px; }

/* ── Tyre stock: event filters ── */
.ts-event-filters {
  display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap;
}
.ts-filter-select {
  flex: 1; min-width: 0; padding: 5px 8px;
  font-size: 11px; max-width: 160px;
}

/* ── Tyre stock: car share ── */
.ts-car-share-wrap { margin-top: 4px; }
.ts-car-share-list {
  display: flex; flex-direction: column; gap: 4px;
}
.ts-car-share-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #8899aa; cursor: pointer;
  padding: 5px 8px; border-radius: 6px; background: #0f1318;
  border: 1px solid #1f2530; transition: border-color 0.12s;
}
.ts-car-share-item:hover { border-color: #3a4558; }
.ts-car-share-cb { accent-color: #d4f542; }
.evd-tag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #7a8a9b; background: #1a2535; border-radius: 3px; padding: 1px 5px; margin-left: 5px; }

/* ════════════════════════════════════════════════════════════════════════════
   BRAKE STOCK
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Dashboard card body ── */
#brake-stock-card-body {
  overflow-y: auto; max-height: 200px;
}
#brake-stock-card-body::-webkit-scrollbar       { width: 3px; }
#brake-stock-card-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.bs-card-rows { display: flex; flex-direction: column; gap: 6px; }
.bs-card-row  {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
}
.bs-card-axle {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: #4a5a6b;
  width: 38px; flex-shrink: 0;
}
.bs-card-chip {
  font-size: 11px; color: #7a8a9b;
  background: #111620; border: 1px solid #1f2530; border-radius: 5px;
  padding: 1px 7px;
}
.bs-card-chip.muted { color: #4a5a6b; }

/* ── Backdrop ── */
.bs-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 450;
}
.bs-backdrop.open { display: block; }

/* ── Modal ── */
.bs-modal {
  display: none; position: fixed; top: 30px; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  width: min(1100px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 451; flex-direction: column; overflow: hidden;
}
.bs-modal.open { display: flex; }

.bs-modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px 14px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.bs-modal-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase; color: #dce3ed;
  display: flex; align-items: center; gap: 8px;
}

/* ── Modal body layout ── */
.bs-modal-body {
  flex: 1; min-height: 0; display: flex; overflow: hidden; position: relative;
}
.bs-modal-left {
  width: 200px; flex-shrink: 0; border-right: 1px solid #1f2530;
  overflow-y: auto; padding: 16px 12px 20px;
  display: flex; flex-direction: column; gap: 0;
}
.bs-modal-left::-webkit-scrollbar       { width: 3px; }
.bs-modal-left::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.bs-modal-right {
  flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 0;
}
.bs-modal-right::-webkit-scrollbar       { width: 3px; }
.bs-modal-right::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* ── Left sidebar nav ── */
.bs-nav {
  display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px;
}
.bs-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  background: transparent; border: none; color: #7a8a9b;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  text-align: left; transition: all 0.12s;
}
.bs-nav-item:hover { background: #111620; color: #dce3ed; }
.bs-nav-item.active { background: #111620; color: #dce3ed; }
.bs-nav-icon { font-size: 14px; opacity: 0.7; width: 16px; text-align: center; }
.bs-nav-label { flex: 1; }
.bs-nav-badge {
  font-size: 10px; color: #4a5a6b; background: #0d1117;
  border: 1px solid #1f2530; border-radius: 10px; padding: 0 6px; min-width: 18px;
  text-align: center;
}
.bs-nav-item.active .bs-nav-badge { color: #8899aa; border-color: #2a3040; }

/* ── Sidebar stats block ── */
.bs-sidebar-stats { padding: 10px 4px; }
.bs-sidebar-stat-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: #3a4558;
  margin-bottom: 6px;
}
.bs-sidebar-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0; font-size: 11px;
}
.bs-sidebar-stat-key { color: #5a6a7b; }
.bs-sidebar-stat-val { color: #8899aa; font-weight: 600; }

/* ── Right panel: page header ── */
.bs-page-header { margin-bottom: 16px; }
.bs-page-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase; color: #dce3ed;
}

/* ── Axle sections ── */
.bs-axle-section { margin-bottom: 28px; }
.bs-axle-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #1a2030;
}
.bs-axle-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: #4a5a6b;
}
.bs-add-btn {
  background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  color: #7a8a9b; font-family: 'Barlow Condensed', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 3px 10px; cursor: pointer; transition: all 0.12s;
}
.bs-add-btn:hover { border-color: #d4f542; color: #d4f542; }

.bs-items-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
}
.bs-empty-hint {
  font-size: 12px; color: #3a4558; padding: 10px 0; grid-column: 1/-1;
}

/* ── Item cards ── */
.bs-item-card {
  background: #111620; border: 1px solid #1f2530; border-radius: 10px;
  padding: 10px 12px; cursor: pointer; transition: all 0.12s;
  display: flex; flex-direction: column; gap: 8px;
}
.bs-item-card:hover { border-color: #3a4558; background: #131820; }

.bs-item-card-top {
  display: flex; align-items: center; gap: 8px;
}
.bs-wear-bar-wrap {
  flex: 1; height: 3px; background: #1f2530; border-radius: 2px; overflow: hidden;
}
.bs-wear-bar { height: 100%; border-radius: 2px; transition: width 0.3s; }
.bs-item-wear {
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.bs-wear-label { font-size: 9px; font-weight: 600; opacity: 0.8; }

.bs-item-status {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px;
  white-space: nowrap;
}
.bs-status-mounted  { background: #1a3040; color: #60a5fa; }
.bs-status-stock    { background: #0f1f0f; color: #4ade80; }
.bs-status-scrapped { background: #1f1010; color: #6b7280; }

.bs-item-card-body { display: flex; flex-direction: column; gap: 2px; }
.bs-item-detail {
  font-size: 12px; color: #dce3ed;
}
.bs-item-detail.muted { color: #5a6a7b; font-size: 11px; }
.bs-item-notes {
  font-size: 11px; color: #4a5a6b; margin-top: 2px; font-style: italic;
}

/* ── Form panel (slide in from right) ── */
.bs-form-panel {
  display: none; position: absolute; top: 0; right: 0; bottom: 0;
  width: 300px; background: #0d1117; border-left: 1px solid #2a3040;
  flex-direction: column; overflow: hidden; z-index: 2;
}
.bs-form-panel.open { display: flex; }

.bs-form-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.bs-form-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase; color: #dce3ed;
}
.bs-form-body {
  flex: 1; overflow-y: auto; padding: 14px 16px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.bs-form-body::-webkit-scrollbar       { width: 3px; }
.bs-form-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.bs-form-row { display: flex; flex-direction: column; gap: 4px; }
.bs-form-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: #4a5a6b;
}
.bs-form-input {
  background: #0f1318; border: 1px solid #2a3040; border-radius: 6px;
  color: #dce3ed; font-size: 12px; padding: 6px 9px; outline: none;
  font-family: inherit; width: 100%; box-sizing: border-box;
}
.bs-form-input:focus { border-color: #d4f542; }
select.bs-form-input { cursor: pointer; }
.bs-form-textarea { resize: vertical; min-height: 56px; }

.bs-form-footer { display: flex; gap: 8px; margin-top: 4px; }
.bs-save-btn {
  flex: 1; background: #d4f542; color: #0d1117; border: none; border-radius: 7px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 8px; cursor: pointer;
}
.bs-save-btn:hover { background: #c8e83a; }
.bs-delete-btn {
  background: transparent; color: #ef4444; border: 1px solid #3a1010;
  border-radius: 7px; font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 8px 14px; cursor: pointer; transition: all 0.12s;
}
.bs-delete-btn:hover { background: #1f0808; border-color: #ef4444; }

/* ── Sidebar footer / manage compounds button ── */
.bs-sidebar-footer { margin-top: auto; padding-top: 16px; }
.bs-manage-compounds-btn {
  width: 100%; background: transparent; border: 1px solid #2a3040; border-radius: 7px;
  color: #5a6a7b; font-family: 'Barlow Condensed', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 7px 10px; cursor: pointer; transition: all 0.12s; text-align: center;
}
.bs-manage-compounds-btn:hover { border-color: #7a8a9b; color: #dce3ed; }

/* ── Item name ── */
.bs-item-name {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; color: #dce3ed; margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════════════════════
   BRAKE STOCK: BATCH ADD MODAL
   ════════════════════════════════════════════════════════════════════════════ */
.bs-add-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 460;
}
.bs-add-backdrop.open { display: block; }

.bs-add-modal {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  background: #0f1318; border: 1px solid #2a3040; border-radius: 14px;
  z-index: 461; flex-direction: column; overflow: hidden;
}
.bs-add-modal.open { display: flex; }

.bs-add-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.bs-add-modal-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase; color: #dce3ed;
}

.bs-add-body {
  overflow-y: auto; padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.bs-add-body::-webkit-scrollbar       { width: 3px; }
.bs-add-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.bs-add-subtitle {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #5a6a7b;
}
.bs-add-form-row { display: flex; flex-direction: column; gap: 4px; }
.bs-add-form-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: #4a5a6b;
}
.bs-add-input, .bs-add-select {
  background: #0d1117; border: 1px solid #2a3040; border-radius: 6px;
  color: #dce3ed; font-size: 12px; padding: 7px 10px; outline: none;
  font-family: inherit; width: 100%; box-sizing: border-box;
}
.bs-add-input:focus, .bs-add-select:focus { border-color: #d4f542; }
select.bs-add-select { cursor: pointer; }
.bs-add-hint { font-size: 11px; color: #3a4558; }

.bs-add-row-inline { display: flex; gap: 12px; }
.bs-add-row-inline .bs-add-form-row { flex: 1; }

.bs-manage-btn {
  flex: none; background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  color: #7a8a9b; font-family: 'Barlow Condensed', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 7px 12px; cursor: pointer; white-space: nowrap; transition: all 0.12s;
}
.bs-manage-btn:hover { border-color: #7a8a9b; color: #dce3ed; }

/* ════════════════════════════════════════════════════════════════════════════
   BRAKE STOCK: COMPOUND LIBRARY MODAL
   ════════════════════════════════════════════════════════════════════════════ */
.bs-comp-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 460;
}
.bs-comp-backdrop.open { display: block; }

.bs-comp-modal {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  background: #0f1318; border: 1px solid #2a3040; border-radius: 14px;
  z-index: 461; flex-direction: column; overflow: hidden;
}
.bs-comp-modal.open { display: flex; }

.bs-comp-body {
  overflow-y: auto; padding: 0;
  display: flex; flex-direction: column;
}
.bs-comp-body::-webkit-scrollbar       { width: 3px; }
.bs-comp-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* Tabs */
.bs-comp-tabs {
  display: flex; border-bottom: 1px solid #1f2530; flex-shrink: 0;
  padding: 0 18px;
}
.bs-comp-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: #5a6a7b; font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 10px 14px; cursor: pointer; transition: all 0.12s; margin-bottom: -1px;
}
.bs-comp-tab:hover { color: #dce3ed; }
.bs-comp-tab.active { color: #dce3ed; border-bottom-color: #d4f542; }

/* Compound list */
.bs-comp-list { padding: 12px 18px; display: flex; flex-direction: column; gap: 6px; }
.bs-comp-empty { font-size: 12px; color: #3a4558; padding: 8px 0; }

.bs-comp-row {
  background: #111620; border: 1px solid #1f2530; border-radius: 8px;
  overflow: hidden;
}
.bs-comp-row-info {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 9px 12px; cursor: pointer; gap: 10px; flex: 1;
}
.bs-comp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.bs-comp-row-info { flex: 1; min-width: 0; }
.bs-comp-row-info:hover { background: #131820; }
.bs-comp-row-name {
  font-size: 12px; color: #dce3ed; font-weight: 600;
}
.bs-comp-row-meta {
  font-size: 11px; color: #4a5a6b; margin-top: 1px;
}
.bs-comp-del-btn {
  flex: none; background: transparent; border: none; color: #3a4558;
  font-size: 12px; padding: 9px 12px; cursor: pointer; transition: color 0.12s;
  line-height: 1; align-self: flex-start;
}
.bs-comp-del-btn:hover { color: #ef4444; }

.bs-comp-edit-form { width: 100%; border-top: 1px solid #1a2030; }
.bs-comp-form-inner { padding: 12px 14px; }
.bs-comp-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-bottom: 12px;
}
.bs-comp-field { display: flex; flex-direction: column; gap: 3px; }
.bs-comp-field-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: #3a4558;
}
.bs-comp-input {
  background: #0d1117; border: 1px solid #2a3040; border-radius: 5px;
  color: #dce3ed; font-size: 12px; padding: 5px 8px; outline: none;
  font-family: inherit; width: 100%; box-sizing: border-box;
}
.bs-comp-input:focus { border-color: #d4f542; }
.bs-comp-form-footer {
  display: flex; gap: 8px; justify-content: flex-end;
}

/* New compound form */
.bs-comp-new {
  border-top: 1px solid #1f2530; padding: 16px 18px 18px;
  flex-shrink: 0;
}
.bs-comp-new-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #4a5a6b; margin-bottom: 10px;
}
.evd-time { color: #5a6a7b; font-size: 10px; margin-left: 4px; }

/* ── Brake item selected state ── */
.bs-item-card.bs-item-selected {
  border-color: #d4f54266;
  box-shadow: 0 0 0 1px #d4f54233, 0 4px 16px rgba(212,245,66,0.08);
}

/* ── Brake Part Detail Modal ── */
.bs-detail-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 460; backdrop-filter: blur(2px);
}
.bs-detail-backdrop.open { display: block; }

.bs-detail-modal {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  background: #0f1318; border: 1px solid #2a3040; border-radius: 14px;
  z-index: 461; flex-direction: column; overflow: hidden;
}
.bs-detail-modal.open { display: flex; }

.bs-detail-body {
  flex: 1; overflow-y: auto; padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 0;
}
.bs-detail-body::-webkit-scrollbar       { width: 3px; }
.bs-detail-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.bs-detail-header-row {
  display: flex; align-items: flex-start; gap: 16px;
}
.bs-detail-wear-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0;
}
.bs-detail-wear-text {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700;
}
.bs-detail-info { flex: 1; min-width: 0; }
.bs-detail-meta {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #4a5a6b; margin-bottom: 4px;
}
.bs-detail-line { font-size: 12px; color: #8899aa; line-height: 1.5; }
.bs-detail-line.muted { color: #4a5a6b; }

.bs-detail-event-list {
  display: flex; flex-direction: column; gap: 0; margin-top: 4px;
  max-height: 280px; overflow-y: auto;
}
.bs-detail-event-list::-webkit-scrollbar       { width: 3px; }
.bs-detail-event-list::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

/* ── Brake Bulk Event Modal ── */
.bs-bulk-event-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 470; backdrop-filter: blur(2px);
}
.bs-bulk-event-backdrop.open { display: block; }

.bs-bulk-event-modal {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  background: #0f1318; border: 1px solid #2a3040; border-radius: 14px;
  z-index: 471; flex-direction: column; overflow: hidden;
}

/* ══ Detail page — sticky top bar with collapsing banner (mobile & tablet) ══ */
@media (max-width: 1023px) {

  /* Sticky bar that always stays visible */
  .detail-top-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #090b0e;
    margin-bottom: 12px;
    padding: 10px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
  }
  .detail-top-bar.bar-scrolled {
    border-bottom-color: #1a2030;
  }

  /* Car name that fades in between the two buttons when banner collapses */
  .detail-top-carname {
    flex: 1;
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #eef2f7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
  }
  .detail-top-bar.bar-scrolled .detail-top-carname {
    opacity: 1;
    transform: translateY(0);
  }

  /* Banner collapses smoothly on scroll */
  .detail-banner {
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                margin-bottom 0.35s ease;
    overflow: hidden;
  }
  #car-detail.banner-collapsed .detail-banner {
    height: 0 !important;
    opacity: 0;
    margin-bottom: 0;
  }
}
.bs-bulk-event-modal.open { display: flex; }