/* ══ COMPONENT WEAR TRACKER ══ */

.wear-edit-btn {
  position: absolute;
  top: 14px; right: 16px;
  display: flex; align-items: center; gap: 5px;
  background: transparent;
  border: 1px solid #2a3040; border-radius: 6px;
  padding: 4px 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: #7a8a9b; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  z-index: 2;
}
.wear-edit-btn:hover { border-color: #d4f542; color: #d4f542; background: rgba(212,245,66,0.05); }

.wear-empty {
  font-size: 12px; color: #2a3040;
  padding: 20px 0; text-align: center;
  font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.3px;
}
.wear-empty strong { color: #7a8a9b; }

/* ══ Summary banner ══ */
.wear-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 12px;
  background: #0d1015; border: 1px solid #1f2530; border-radius: 8px;
  flex-wrap: wrap;
}
.wear-summary-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 5px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.wear-summary-pill.overdue  { background: rgba(239,68,68,0.12); color: #ef4444; }
.wear-summary-pill.warning  { background: rgba(245,158,11,0.12); color: #f59e0b; }
.wear-summary-pill.ok       { background: rgba(212,245,66,0.08); color: #7a8a9b; }
.wear-summary-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.wear-summary-dot.red    { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.wear-summary-dot.amber  { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.wear-summary-dot.green  { background: #22c55e; }
.wear-summary-sep {
  width: 1px; height: 16px; background: #1f2530; flex-shrink: 0;
}
.wear-summary-stats {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 0.4px; color: #7a8a9b;
}
.wear-summary-breakdown {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 600; letter-spacing: 0.3px; color: #3a4558;
}

/* ══ Category multi-select nav ══ */
.wear-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 12px 0; margin-bottom: 14px;
  border-bottom: 1px solid #1f2530;
  position: sticky; top: 0; z-index: 1;
  background: #141820;
  flex-wrap: wrap;
}
.wear-cat-multi { position: relative; flex: 1; min-width: 160px; }
.wear-cat-toggle {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: #0d1015; border: 1px solid #2a3040; border-radius: 7px;
  padding: 5px 28px 5px 8px; min-height: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a8a9b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.15s;
}
.wear-cat-toggle:hover { border-color: #d4f542; }
.wear-cat-toggle.open  { border-color: #d4f542; box-shadow: 0 0 0 1px rgba(212,245,66,0.15); }
.wear-cat-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(212,245,66,0.1); border: 1px solid rgba(212,245,66,0.25); border-radius: 4px;
  padding: 2px 6px 2px 8px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: #d4f542; white-space: nowrap;
}
.wear-cat-pill-x {
  background: none; border: none; color: rgba(212,245,66,0.5); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 0 1px; transition: color 0.12s;
}
.wear-cat-pill-x:hover { color: #ef4444; }
.wear-cat-clear {
  background: none; border: 1px solid #2a3040; border-radius: 4px;
  color: #7a8a9b; cursor: pointer; margin-left: 2px;
  font-size: 13px; line-height: 1; padding: 2px 5px;
  transition: all 0.12s; flex-shrink: 0;
}
.wear-cat-clear:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }
.wear-cat-placeholder {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: #7a8a9b;
}
.wear-cat-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #141820; border: 1px solid #2a3040; border-radius: 8px;
  z-index: 50; max-height: 200px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.wear-cat-dropdown.open { display: block; }
.wear-cat-dropdown::-webkit-scrollbar       { width: 3px; }
.wear-cat-dropdown::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }
.wear-cat-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  color: #8899aa; cursor: pointer;
  border-bottom: 1px solid #1a1f28; transition: background 0.1s, color 0.1s;
}
.wear-cat-opt:last-child { border-bottom: none; }
.wear-cat-opt:hover { background: #1f2530; color: #dce3ed; }
.wear-cat-opt.selected { color: #d4f542; }
.wear-cat-check {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1.5px solid #2a3040; background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.12s;
}
.wear-cat-opt.selected .wear-cat-check {
  border-color: #d4f542; background: rgba(212,245,66,0.15);
}
.wear-cat-opt.selected .wear-cat-check::after {
  content: '✓'; font-size: 10px; color: #d4f542; line-height: 1;
}
/* ── Status filter buttons ── */
.wear-status-filter {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.wear-status-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  padding: 4px 10px; cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: #7a8a9b; transition: all 0.15s;
}
.wear-status-btn:hover { border-color: #7a8a9b; }
.wear-status-btn .wear-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; opacity: 0.5; transition: opacity 0.15s; }
.wear-status-btn:hover .wear-status-dot { opacity: 0.8; }
.wear-status-btn.active .wear-status-dot { opacity: 1; }
.wear-status-btn[data-status="red"].active   { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }
.wear-status-btn[data-status="amber"].active { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,0.08); }
.wear-status-btn[data-status="green"].active { border-color: #22c55e; color: #22c55e; background: rgba(34,197,94,0.08); }
.wear-cat-count {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 600; letter-spacing: 0.5px; color: #2a3040;
}

/* ══ Category section headers ══ */
.wear-cat-section { margin-bottom: 20px; }
.wear-cat-section:last-child { margin-bottom: 0; }
.wear-cat-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0 8px 0; margin-bottom: 10px;
  border-bottom: 1px solid #1f2530;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: #4a5568;
}
.wear-cat-section-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 16px; padding: 0 5px;
  background: #1a1f28; border: 1px solid #2a3040; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0; color: #3a4558;
}
.wear-cat-section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* ══ Wear tracker tabs (legacy, kept for alert-detail) ══ */
.wear-tabs {
  display: flex; gap: 4px;
  padding: 0 0 12px 0;
  border-bottom: 1px solid #1f2530;
  margin-bottom: 14px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 1;
  background: #141820;
}
.wear-tab {
  background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  padding: 4px 12px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: #7a8a9b; cursor: pointer; transition: all 0.15s;
}
.wear-tab:hover  { border-color: #d4f542; color: #d4f542; }
.wear-tab.active { border-color: #d4f542; color: #d4f542; background: rgba(212,245,66,0.07); }
.wear-tab-content {
  display: block;
}
@media (max-width: 700px) {
  .wear-cat-section-grid { grid-template-columns: 1fr !important; }
}

/* ══ Card header ══ */
.wear-item-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.wear-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  transition: box-shadow 0.3s;
}
.wear-status-dot.green  { background: #22c55e; }
.wear-status-dot.amber  { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.wear-status-dot.red    { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.wear-status-dot.neutral { background: #2a3040; }
.wear-item-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: 0.3px; color: #f0f4fa;
  transition: color 0.15s; flex: 1;
}
.wear-item-threshold {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 600; color: #5a6878; letter-spacing: 0.3px;
  transition: color 0.15s; margin-left: auto; flex-shrink: 0;
}

/* ══ Progress bars ══ */
.wear-bar-track {
  height: 10px; background: #1a1f2a; border-radius: 5px;
  overflow: hidden; transition: background 0.15s;
}
.wear-bar-fill {
  height: 100%; border-radius: 5px; background: #d4f542;
  transition: width 0.4s ease, opacity 0.15s;
}
.wear-bar-fill.glow-red   { box-shadow: 0 0 10px rgba(239,68,68,0.5); }
.wear-bar-fill.glow-amber { box-shadow: 0 0 8px rgba(245,158,11,0.4); }
.wear-bar-fill.glow-green { box-shadow: 0 0 6px rgba(212,245,66,0.25); }
.wear-bar-track-max { background: #131820; }
.wear-bar-fill-max  { background: #3a5278; }

.wear-side-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: #3d8c40; margin-bottom: 4px;
}
.wear-side-label-max { color: #3a5278; }
.wear-max-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: #3a5278; margin-bottom: 2px;
}

.wear-split-row {
  display: grid; grid-template-columns: 3fr 2fr; gap: 0 20px; align-items: start;
}
.wear-split-row.single { grid-template-columns: 1fr; }
.wear-split-divider { display: none; }
.wear-side { display: flex; flex-direction: column; gap: 5px; }

.wear-bar-row { display: flex; flex-direction: column; gap: 3px; margin-bottom: 5px; }
.wear-bar-row:last-of-type { margin-bottom: 0; }
.wear-bar-label {
  display: flex; align-items: baseline; gap: 4px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 0.3px; color: #8899aa;
}
.wear-bar-label .wear-bar-unit { color: #5a6878; font-weight: 600; font-size: 10px; }
.wear-prf-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: 0.3px; color: #8899aa; margin-top: 2px;
}
.wear-prf-label-max { color: #7a8fa8; opacity: 0.9; }

/* ── Wear item cards ── */
#wear-tracker-list .mileage-item,
#alert-detail-body .mileage-item {
  background: #0f1420;
  border: 1px solid #1f2530;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: default;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.2s;
}
/* Status-tinted left border */
#wear-tracker-list .mileage-item.status-red,
#alert-detail-body .mileage-item.status-red {
  border-left: 3px solid #ef4444;
  box-shadow: inset 2px 0 12px rgba(239,68,68,0.06), 0 2px 8px rgba(0,0,0,0.2);
}
#wear-tracker-list .mileage-item.status-amber,
#alert-detail-body .mileage-item.status-amber {
  border-left: 3px solid #f59e0b;
  box-shadow: inset 2px 0 12px rgba(245,158,11,0.05), 0 2px 8px rgba(0,0,0,0.2);
}
#wear-tracker-list .mileage-item.status-ok,
#alert-detail-body .mileage-item.status-ok {
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
#wear-tracker-list .mileage-item:hover,
#alert-detail-body .mileage-item:hover {
  background: #141a24;
  border-color: rgba(212,245,66,0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(212,245,66,0.08);
}
#wear-tracker-list .mileage-item:hover .wear-item-name,
#alert-detail-body .mileage-item:hover .wear-item-name      { color: #d4f542; }
#wear-tracker-list .mileage-item:hover .wear-item-threshold,
#alert-detail-body .mileage-item:hover .wear-item-threshold { color: #7a8a9b; }
#wear-tracker-list .mileage-item:hover .wear-bar-track,
#alert-detail-body .mileage-item:hover .wear-bar-track      { background: #232a38; }
#wear-tracker-list .mileage-item:hover .wear-bar-fill,
#alert-detail-body .mileage-item:hover .wear-bar-fill       { opacity: 1; filter: brightness(1.15); }

/* ══ SERVICE INTERVALS MODAL ══ */
.si-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 400;
}
.si-backdrop.open { display: block; }
.si-modal {
  display: none; position: fixed; top: 30px; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  width: min(1400px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 401; flex-direction: column; overflow: hidden;
}
.si-modal.open { display: flex; }

.si-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 16px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.si-header-left    { display: flex; align-items: center; gap: 14px; }
.si-header-actions { display: flex; align-items: center; gap: 10px; }
.si-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #dce3ed;
}
.si-subtitle {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 600; color: #d4f542; letter-spacing: 1px; text-transform: uppercase;
}
.si-btn-add-row {
  background: rgba(212,245,66,0.1); border: 1px solid rgba(212,245,66,0.3); border-radius: 7px;
  padding: 6px 14px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: #d4f542; cursor: pointer; transition: all 0.15s;
}
.si-btn-add-row:hover { background: rgba(212,245,66,0.18); }
.si-btn-save-tpl {
  background: transparent; border: 1px solid #2a3040; border-radius: 7px; padding: 6px 12px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: #7a8a9b; cursor: pointer; transition: all 0.15s;
}
.si-btn-save-tpl:hover { border-color: #d4f542; color: #d4f542; }
.si-btn-close {
  background: transparent; border: 1px solid #1f2530; border-radius: 7px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  color: #7a8a9b; font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.si-btn-close:hover { border-color: #ef4444; color: #ef4444; }

.si-template-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 22px;
  border-bottom: 1px solid #1f2530; background: #0d1015; flex-shrink: 0;
}
.si-template-divider { width: 1px; height: 18px; background: #2a3040; flex-shrink: 0; }
.si-template-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: #7a8a9b; white-space: nowrap;
}
.si-template-select {
  background: #0f1318; border: 1px solid #2a3040; border-radius: 6px; padding: 5px 10px;
  font-family: 'Barlow', sans-serif; font-size: 12px; color: #dce3ed;
  cursor: pointer; outline: none; min-width: 200px; transition: border-color 0.15s;
}
.si-template-select:focus { border-color: #d4f542; }
.si-template-select option { background: #141820; }
.si-template-del {
  background: transparent; border: 1px solid #1f2530; border-radius: 6px;
  padding: 5px 8px; font-size: 12px; color: #2a3040; cursor: pointer; transition: all 0.15s;
}
.si-template-del:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }
.si-status {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px; margin-left: 4px;
}

.si-table-wrap { flex: 1; min-height: 0; overflow: auto; padding: 0; }
.si-table-wrap::-webkit-scrollbar       { width: 4px; height: 4px; }
.si-table-wrap::-webkit-scrollbar-track { background: #0d1015; }
.si-table-wrap::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }

.si-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.si-table thead tr {
  position: sticky; top: 0; z-index: 10; background: #0d1015; border-bottom: 1px solid #2a3040;
}
.si-table th {
  padding: 10px 8px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: #7a8a9b; white-space: nowrap; text-align: center; border-right: 1px solid #1a1f28;
}
.si-table th:last-child { border-right: none; }
.si-col-num     { width: 40px; }
.si-col-cat     { width: 140px; text-align: left !important; padding-left: 14px !important; }
.si-col-name    { width: 200px; text-align: left !important; padding-left: 10px !important; }
.si-col-val     { width: 68px; }
.si-col-prf     { width: 120px; text-align: left !important; padding-left: 6px !important; }
.si-col-parts   { width: 220px; text-align: left !important; padding-left: 6px !important; }
.si-col-actions { width: 72px; }

/* ── Parts cell (pill display) ── */
.si-parts-cell {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  min-height: 28px; padding: 4px 6px; border-radius: 5px;
  cursor: pointer; border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.si-parts-cell:hover { border-color: #d4f542; background: rgba(212,245,66,0.04); }
.si-parts-pill {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(255,255,255,0.05); border: 1px solid #2a3040; border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 0.3px; color: #c0cce0; white-space: nowrap;
}
.si-parts-qty {
  color: #d4f542; font-weight: 700; font-size: 10px;
}
.si-parts-empty {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  color: #2a3040; letter-spacing: 0.3px;
}

/* ── Parts floating editor ── */
.si-parts-editor {
  position: fixed; z-index: 700;
  width: 320px;
  background: #141820; border: 1px solid #2a3040; border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  overflow: hidden;
}
.si-parts-editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 8px; border-bottom: 1px solid #1f2530;
}
.si-parts-editor-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #7a8a9b;
}
.si-parts-editor-close {
  background: none; border: none; color: #3a4558; font-size: 15px;
  cursor: pointer; padding: 0 2px; line-height: 1;
  transition: color 0.12s;
}
.si-parts-editor-close:hover { color: #ef4444; }
.si-parts-editor-rows {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px; max-height: 260px; overflow-y: auto;
}
.si-parts-editor-rows::-webkit-scrollbar       { width: 3px; }
.si-parts-editor-rows::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }
.si-parts-editor-row {
  display: flex; align-items: center; gap: 6px;
}
.si-pqty {
  width: 54px; flex-shrink: 0;
  background: #0f1318; border: 1px solid #2a3040; border-radius: 5px;
  padding: 5px 6px; color: #dce3ed; font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 600; text-align: center; outline: none;
  transition: border-color 0.15s;
}
.si-pqty:focus { border-color: #d4f542; }
.si-ppn {
  flex: 1; min-width: 0;
  background: #0f1318; border: 1px solid #2a3040; border-radius: 5px;
  padding: 5px 8px; color: #dce3ed; font-family: 'Barlow', sans-serif;
  font-size: 12px; outline: none;
  transition: border-color 0.15s;
}
.si-ppn:focus { border-color: #d4f542; }
.si-ppn::placeholder { color: #2a3040; font-size: 11px; }
.si-pqty::placeholder { color: #2a3040; }
.si-psvc-label {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; flex-shrink: 0; user-select: none;
}
.si-psvc-label input { display: none; }
.si-psvc-track {
  width: 28px; height: 16px; border-radius: 8px; flex-shrink: 0;
  background: #1a1f28; border: 1px solid #2a3040;
  position: relative; transition: background 0.15s, border-color 0.15s;
}
.si-psvc-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #3a4558; transition: left 0.15s, background 0.15s;
}
.si-psvc-label:has(input:checked) .si-psvc-track {
  background: rgba(74,200,164,0.15); border-color: #4ac8a4;
}
.si-psvc-label:has(input:checked) .si-psvc-track::after {
  left: calc(100% - 13px); background: #4ac8a4;
}
.si-psvc-text {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: #3a4558;
  transition: color 0.15s; line-height: 1;
}
.si-psvc-label:has(input:checked) .si-psvc-text { color: #4ac8a4; }

.si-parts-row-del {
  background: none; border: none; color: #2a3040; font-size: 14px;
  cursor: pointer; padding: 0 2px; line-height: 1; flex-shrink: 0;
  transition: color 0.12s;
}
.si-parts-row-del:hover { color: #ef4444; }

/* Service-only pill variant */
.si-parts-pill-svc {
  background: rgba(74,200,164,0.07); border-color: rgba(74,200,164,0.2); color: #8ab8b0;
}
.si-parts-pill-svc .si-parts-qty { color: #4ac8a4; }
.si-parts-svc-tag {
  font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 700;
  letter-spacing: 0.5px; color: #4ac8a4; opacity: 0.7;
  margin-left: 3px; flex-shrink: 0;
}
.si-parts-editor-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-top: 1px solid #1f2530;
}
.si-parts-editor-add {
  background: none; border: 1px solid #2a3040; border-radius: 5px;
  padding: 4px 10px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: #7a8a9b; cursor: pointer; transition: all 0.15s;
}
.si-parts-editor-add:hover { border-color: #d4f542; color: #d4f542; }
.si-parts-editor-done {
  background: rgba(212,245,66,0.1); border: 1px solid rgba(212,245,66,0.3); border-radius: 5px;
  padding: 4px 14px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: #d4f542; cursor: pointer; transition: all 0.15s;
}
.si-parts-editor-done:hover { background: rgba(212,245,66,0.18); }

.si-tip { position: relative; cursor: help; border-bottom: 1px dashed #2a3040; }
.si-tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1f2530; color: #dce3ed; padding: 4px 8px; border-radius: 5px;
  border: 1px solid #2a3040; font-size: 11px; font-weight: 600;
  letter-spacing: 0.3px; text-transform: none; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 100;
}
.si-tip:hover::after { opacity: 1; }

.si-table th:nth-child(9),
.si-table td:nth-child(9) { border-left: 2px solid #2a3040; }

.si-table tbody tr { border-bottom: 1px solid #141820; transition: background 0.1s; }
.si-table tbody tr:hover { background: #131720; }
.si-table td { padding: 6px 4px; vertical-align: middle; border-right: 1px solid #1a1f28; }
.si-table td:last-child { border-right: none; }

.si-row-num {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; color: #2a3040;
  text-align: center; font-weight: 700; user-select: none;
}
.si-input {
  background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 5px 7px;
  font-family: 'Barlow', sans-serif; font-size: 12px; color: #dce3ed;
  width: 100%; outline: none; box-sizing: border-box; transition: border-color 0.15s, background 0.15s;
}
.si-input:focus { border-color: #d4f542; background: rgba(212,245,66,0.04); }
.si-input::placeholder { color: #2a3040; font-size: 11px; }
.si-input-num { text-align: center; font-family: 'Barlow Condensed', sans-serif; font-size: 13px; }

.si-cat-wrap { position: relative; }
.si-cat-dropdown {
  display: none; position: absolute; top: calc(100% + 2px); left: 0; min-width: 160px;
  background: #141820; border: 1px solid #2a3040; border-radius: 7px; z-index: 600;
  max-height: 180px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.si-cat-dropdown.open { display: block; }
.si-cat-dropdown::-webkit-scrollbar       { width: 3px; }
.si-cat-dropdown::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }
.si-cat-option {
  padding: 7px 12px; font-family: 'Barlow', sans-serif; font-size: 12px;
  color: #8899aa; cursor: pointer; border-bottom: 1px solid #1a1f28;
  transition: background 0.1s, color 0.1s;
}
.si-cat-option:last-child { border-bottom: none; }
.si-cat-option:hover      { background: #1f2530; color: #dce3ed; }
.si-cat-option.new-cat    { color: #d4f542; font-style: italic; }

.si-row-actions { display: flex; align-items: center; justify-content: center; gap: 3px; }
.si-row-btn {
  background: transparent; border: none; cursor: pointer; color: #2a3040; font-size: 13px;
  width: 22px; height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; transition: all 0.12s;
}
.si-row-btn:hover     { background: #1f2530; color: #dce3ed; }
.si-row-btn.ins:hover { background: rgba(212,245,66,0.12); color: #d4f542; }
.si-row-btn.del:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

.si-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-top: 1px solid #1f2530; flex-shrink: 0;
}
.si-row-count {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: #2a3040;
}

/* ── Service log bar (select mode) ── */
.wear-log-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 0 4px;
  border-top: 1px solid #1f2530; flex-wrap: wrap;
}
.wear-action-select {
  background: #0f1318; border: 1px solid #2a3040; border-radius: 6px;
  padding: 5px 10px; color: #dce3ed; font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; outline: none; cursor: pointer;
}
.wear-confirm-btn {
  background: rgba(212,245,66,0.1); border: 1px solid rgba(212,245,66,0.3); border-radius: 6px;
  padding: 5px 14px; font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #d4f542;
  cursor: pointer; transition: all 0.15s;
}
.wear-confirm-btn:hover { background: rgba(212,245,66,0.2); }
.wear-cancel-btn {
  background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  padding: 5px 10px; 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;
}
.wear-cancel-btn:hover { border-color: #ef4444; color: #ef4444; }
.wear-select-cb { width: 14px; height: 14px; accent-color: #d4f542; cursor: pointer; flex-shrink: 0; }

/* ── Baseline bar ── */
.wear-baseline-bar { flex-wrap: wrap; gap: 6px 8px; }
.wear-baseline-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #3d8c40; white-space: nowrap;
  align-self: center;
}
.wear-baseline-label-max { color: #3a5278; }
.wear-baseline-label-current { color: #a07830; }
.wear-baseline-divider { width: 1px; height: 20px; background: #2a3040; align-self: center; flex-shrink: 0; }
.wear-baseline-input {
  background: #0f1318; border: 1px solid #2a3040; border-radius: 6px;
  padding: 4px 8px; color: #dce3ed;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  outline: none; transition: border-color 0.15s;
}
.wear-baseline-input:focus { border-color: #d4f542; }
.wear-baseline-input[type="date"] { width: 130px; color-scheme: dark; }
.wear-baseline-input-num { width: 80px; }

/* ── Select All button ── */
.wear-select-all-btn {
  background: transparent; border: 1px solid #2a3040; border-radius: 6px;
  padding: 5px 10px; font-family: 'Barlow Condensed', sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #8899aa;
  cursor: pointer; transition: all 0.15s;
}
.wear-select-all-btn:hover { border-color: #d4f542; color: #d4f542; }

/* ── Selectable card states ── */
.mileage-item.wear-item-selectable { cursor: pointer; }
.mileage-item.wear-item-selectable:hover {
  background: #141a24;
  border-color: rgba(212,245,66,0.25);
}
.mileage-item.wear-card-selected {
  background: rgba(212,245,66,0.05) !important;
  border-color: rgba(212,245,66,0.4) !important;
  box-shadow: 0 0 0 1px rgba(212,245,66,0.15), 0 2px 8px rgba(0,0,0,0.2) !important;
}

/* ── Wear Tracker expand modal ── */
.wt-expand-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 450;
}
.wt-expand-backdrop.open { display: block; }
.wt-expand-modal {
  display: none; position: fixed; top: 40px; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  width: min(1280px, calc(100vw - 40px));
  background: #0f1318; border: 1px solid #2a3040; border-radius: 16px;
  z-index: 451; flex-direction: column; overflow: hidden;
}
.wt-expand-modal.open { display: flex; }
.wt-expand-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.wt-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;
}
.wt-expand-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px;
}
.wt-expand-body::-webkit-scrollbar       { width: 3px; }
.wt-expand-body::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }
.wt-expand-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: start;
}
@media (max-width: 900px) {
  .wt-expand-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .wt-expand-grid { grid-template-columns: 1fr; }
}

/* Filter nav inside expanded modal */
#wt-expand-body > .wear-nav {
  position: sticky; top: 0; z-index: 2;
  background: #0b0f18; padding-bottom: 10px; margin-bottom: 6px;
}

/* Scope card styles into the expand modal too */
#wt-expand-body .mileage-item {
  background: #0f1420; border: 1px solid #1f2530; border-radius: 10px;
  padding: 12px 16px; cursor: default;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.2s;
}
#wt-expand-body .mileage-item.status-red  { border-left: 3px solid #ef4444; box-shadow: inset 2px 0 12px rgba(239,68,68,0.06), 0 2px 8px rgba(0,0,0,0.2); }
#wt-expand-body .mileage-item.status-amber { border-left: 3px solid #f59e0b; box-shadow: inset 2px 0 12px rgba(245,158,11,0.05), 0 2px 8px rgba(0,0,0,0.2); }
#wt-expand-body .mileage-item.status-ok   { box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
#wt-expand-body .mileage-item:hover { background: #141a24; border-color: rgba(212,245,66,0.25); box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(212,245,66,0.08); }
#wt-expand-body .mileage-item:hover .wear-item-name  { color: #d4f542; }
#wt-expand-body .mileage-item:hover .wear-bar-track  { background: #232a38; }
#wt-expand-body .mileage-item:hover .wear-bar-fill   { opacity: 1; filter: brightness(1.15); }

/* ── Last service card ── */
/* ── Service Log Container ─────────────────────────────────────────────────── */
#last-service-content {
  display: flex; flex-direction: column;
}

/* ── Service Log Entries (Last Service card + expand modal) ────────────────── */
.service-log-entry {
  display: flex; gap: 10px;
}

/* Timeline strip — dot + connecting line */
.sle-timeline {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; width: 9px; padding-top: 13px;
}
.sle-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #323e50; flex-shrink: 0;
  position: relative; z-index: 1;
  transition: all 0.2s;
}
.sle-latest .sle-dot {
  background: #4ac8a4;
  box-shadow: 0 0 7px rgba(74,200,164,0.5);
}
.sle-line {
  width: 1px; flex: 1; margin-top: 4px;
  background: linear-gradient(to bottom, #252d3a 60%, transparent);
}
.service-log-entry:last-child .sle-line { display: none; }

/* Card container */
.sle-card {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.018);
  border: 1px solid #1c222c;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.service-log-entry:last-child .sle-card { margin-bottom: 0; }
.sle-latest .sle-card {
  border-color: rgba(74,200,164,0.15);
  background: rgba(74,200,164,0.02);
  box-shadow: 0 0 20px rgba(74,200,164,0.03);
}
.sle-card:hover { border-color: #2a3545; }

/* Header row */
.service-log-header {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 7px;
}
.service-log-date {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; color: #dce3ed;
  letter-spacing: 0.4px;
}
.service-log-odo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10.5px; color: #4a5568; letter-spacing: 0.3px;
}
.service-log-del {
  margin-left: auto; background: transparent;
  border: 1px solid transparent; border-radius: 4px;
  color: #3a4555; font-size: 9px;
  padding: 1px 5px; cursor: pointer;
  line-height: 1; opacity: 0;
  transition: all 0.15s; flex-shrink: 0;
}
.service-log-entry:hover .service-log-del { opacity: 1; color: #5a6a7b; }
.service-log-del:hover { border-color: #ef4444; color: #ef4444; }

/* Items list */
.service-log-items { display: flex; flex-direction: column; gap: 3px; }
.service-log-item  { display: flex; align-items: center; gap: 8px; }

/* Action badges — premium */
.sli-action {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.7px; text-transform: uppercase;
  padding: 1.5px 7px; border-radius: 3px;
  flex-shrink: 0; min-width: 60px; text-align: center;
}
.sli-action-serviced {
  background: rgba(74,200,164,0.09); color: #4ac8a4;
  box-shadow: inset 0 0 10px rgba(74,200,164,0.05);
}
.sli-action-replaced {
  background: rgba(232,164,74,0.09); color: #e8a44a;
  box-shadow: inset 0 0 10px rgba(232,164,74,0.05);
}
.sli-action-inspected {
  background: rgba(122,143,168,0.07); color: #6b7d90;
}
.sli-name { font-family: 'Barlow', sans-serif; font-size: 12px; color: #7a8a9b; }

/* ── Light mode ── */
body.light-mode .si-backdrop { background: rgba(0,0,0,0.35); }
body.light-mode .si-modal { background: #ffffff; border-color: #dde2ec; }
body.light-mode .si-header { border-bottom-color: #e8ecf2; }
body.light-mode .si-title { color: #1a2030; }
body.light-mode .si-close:hover { background: #f0f3f8; color: #1a2030; }
body.light-mode .si-search { background: #f0f3f8; border-color: #dde2ec; color: #1a2030; }
body.light-mode .si-search::placeholder { color: #b0b8c4; }
body.light-mode .si-cat-chip { border-color: #dde2ec; color: #8899aa; }
body.light-mode .si-cat-chip:hover { border-color: #b0b8c4; color: #1a2030; }
body.light-mode .si-cat-chip.active { border-color: #5a7a00; color: #5a7a00; background: rgba(90,122,0,0.06); }
body.light-mode .si-cat-label { color: #8899aa; border-bottom-color: #e8ecf2; }
body.light-mode .si-item { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .si-item:hover { border-color: #b0b8c4; }
body.light-mode .si-item-name { color: #1a2030; }
body.light-mode .si-item-meta { color: #8899aa; }
body.light-mode .si-footer { border-top-color: #e8ecf2; }
body.light-mode .si-add-row { border-color: #dde2ec; }
body.light-mode .si-add-row:hover { border-color: #5a7a00; }
body.light-mode .si-input { background: #f0f3f8; border-color: #dde2ec; color: #1a2030; }
body.light-mode .si-input:focus { border-color: #5a7a00; }
body.light-mode .si-input::placeholder { color: #b0b8c4; }
body.light-mode .si-select { background: #f0f3f8; border-color: #dde2ec; color: #1a2030; }
body.light-mode .si-select option { background: #ffffff; }
body.light-mode .si-edit-item { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .si-edit-item-name { color: #1a2030; }
body.light-mode .service-log-entry { background: #f8f9fc; border-color: #dde2ec; }
body.light-mode .service-log-entry:hover { border-color: #b0b8c4; }
body.light-mode .service-log-date { color: #1a2030; }
body.light-mode .service-log-note { color: #8899aa; }
body.light-mode .sli-name { color: #6b7a8d; }