body { font-family: 'Montserrat', sans-serif; background: #0f0f0f; color: #fff; }
.gold { color: #FFD700; }
.gold-bg { background: linear-gradient(135deg, #D4AF37, #FFD700, #B8860B); }
.card { background: #1a1a1a; border: 1px solid #333; border-radius: 16px; transition: all 0.2s; position: relative; }
.card { transition: transform 0.15s ease, border-color 0.15s ease; }
.card:hover { border-color: #FFD700; transform: scaleY(1.0); }
.card.urgent,
#archive-page .arch-table tbody tr.urgent { background: linear-gradient(90deg, rgba(239, 68, 68, 0.16) 0%, #1a1a1a 45%); border-color: #333; }
.card.ready-collect,
#archive-page .arch-table tbody tr.ready-collect { background: linear-gradient(90deg, rgba(74, 222, 128, 0.14) 0%, #1a1a1a 45%); border-color: #333; }
.modal-bg { background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); }
.form-input { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 10px 12px; width: 100%; outline: none; }
.form-input:focus { border-color: #FFD700; }
label { display: block; font-size: 0.875rem; margin-bottom: 4px; color: #ccc; }
.list-editor { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 12px; min-height: 120px; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; background: #222; border-radius: 6px; margin-bottom: 6px; }
.stat-card { background: #1a1a1a; border: 1px solid #333; border-radius: 10px; padding: 8px 12px; min-width: 110px; }
.stat-value { font-size: 1.35rem; font-weight: 700; color: #FFD700; }
.stat-label { font-size: 0.75rem; color: #aaa; margin-top: 1px; }
.stat-gold { border: 1px solid #FFD700; }
.badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 9999px; }
.badge-urgent { background: #ef4444; color: white; }
.badge-courtesy { background: #22c55e; color: white; }
.badge-notes { background: #3b82f6; color: white; }
.badge-onsite { background: #166534; color: white; }
.badge-offsite { background: #7f1d1d; color: white; }
.badge-category { font-weight: 600; align-self: flex-end; width: 70%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-eta { background: #f59e0b; color: #000; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: #FFD700; }
.meta-highlight { font-size: 0.9rem; font-weight: 600; color: #FFD700; }
.gold-divider {
    width: 2px;
    background: linear-gradient(to bottom, transparent, #FFD700, transparent);
    align-self: stretch;
    margin: 0 12px;
    flex-shrink: 0;
}
.tile-row { font-size: 0.9rem; line-height: 1.5; }
.reg-row { font-size: 1.05rem; }
.issue-row { font-size: 0.9rem; }
.issue-row .label-bold { font-size: 1rem; }
.label-bold { font-weight: 600; color: #FFD700; font-size: inherit; margin-right: 2px; }
.value-normal { font-weight: 400; color: #ffffff; }
.settings-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #1a1a1a;
    border: 1px solid #FFD700;
    color: #FFD700;
    font-size: 1.25rem;
    transition: all 0.2s;
}
.settings-icon:hover {
    background: #FFD700;
    color: #000;
}
#cars-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.btn-reset {
    background: #555;
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #555;
    white-space: nowrap;
}
.btn-reset:hover {
    background: #444;
    border-color: #FFD700;
}
.onsite-toggle { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.onsite-yes { background: #166534; color: #fff; }
.onsite-no { background: #7f1d1d; color: #fff; }
.section-header {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFD700;
    margin: 2.5rem 0 1rem 0;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(90deg, #1a1a1a 0%, #222 100%);
    border-left: 5px solid #FFD700;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.include-unassigned {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #ccc;
    white-space: nowrap;
}
.include-unassigned input { accent-color: #FFD700; }

/* Multi-select filter fixes */
button[data-filter] {
    min-width: 200px;
    width: auto;
}
.filter-dropdown {
    z-index: 100;
    min-width: 200px;
}
.relative {
    position: relative;
    z-index: 10;
}
.relative:focus-within {
    z-index: 50;
}
.value-normal {
    font-weight: 400;
    color: #ffffff;
    word-break: break-word;
    overflow-wrap: anywhere;
}
/* Quick views + presets bar */
.view-bar-label { font-size: 0.8rem; color: #888; }
.view-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 9999px; font-size: 0.8rem;
    background: #1a1a1a; border: 1px solid #444; color: #ddd; cursor: pointer;
}
.view-chip:hover { border-color: #FFD700; }
.view-chip-active { background: #FFD700; color: #000; border-color: #FFD700; font-weight: 600; }
.view-chip-back { border-color: #FFD700; color: #FFD700; }
.view-chip-save { border-style: dashed; }
.view-chip-edit { opacity: .6; }
.view-chip-edit:hover { opacity: 1; }
.view-chip-pin { border-color: #FFD700; }
.view-chip-unpinned { opacity: .45; border-style: dashed; border-color: #666; }
.preset-delete { color: #f87171; font-weight: 700; padding-left: 2px; }
.preset-delete:hover { color: #fff; }

/* Vehicle status pill (colours live in STATUS_COLORS in cars-utils.js) */
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.01em;
    padding: 3px 11px; border-radius: 9999px; white-space: nowrap; line-height: 1.3;
    color: color-mix(in srgb, var(--sc) 70%, #fff);
    background: color-mix(in srgb, var(--sc) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--sc) 50%, transparent);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sc); flex-shrink: 0; }

/* Footer row: people + tags | due (centred) | days on site */
.card-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; font-size: 0.75rem; }
.people { font-size: 0.95rem; }
.people-label { font-weight: 700; color: #FFD700; }
.people-name { font-weight: 600; color: #fff; }
.tech-pill { display: inline-block; font-weight: 600; padding: 1px 10px; border-radius: 9999px; }
.footer-due { text-align: center; }

/* Parts ETA tag */
.badge-parts { background: #334155; color: #fff; }
.badge-parts-due { background: #facc15; color: #000; font-weight: 700; }

/* Due date (centred in the footer row) */
.due-line { text-align: center; font-size: 0.9rem; font-weight: 600; color: #ddd; white-space: nowrap; }
.due-line.due-amber { color: #fbbf24; }
.due-line.due-red { color: #f87171; }

/* Manage Lists tech colour picker */
.tech-color { width: 28px; height: 22px; padding: 0; border: 1px solid #555; border-radius: 4px; background: none; cursor: pointer; }
.tech-color-auto { color: #aaa; text-decoration: underline; }

/* In Progress: only the status pill gently pulses (opacity = cheap, GPU-composited) */
.status-pulse { animation: status-pulse 2s ease-in-out infinite; will-change: opacity; }
@keyframes status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .status-pulse { animation: none; } }

/* No Courtesy Car tag: maroon, distinct from the Urgent red */
.badge-no-courtesy { background: #881337; color: white; }

/* Modal "you have unsaved changes" nudge */

/* Copy reg button + selectable reg */
.reg-text { user-select: text; cursor: text; font-weight: 700; letter-spacing: 0.5px; }
.copy-reg { margin-left: 6px; color: #888; font-size: 0.8rem; padding: 2px 4px; border-radius: 4px; vertical-align: middle; }
.copy-reg:hover { color: #FFD700; background: #262626; }
.cars-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(10px);
    background: #222; color: #fff; border: 1px solid #FFD700; border-radius: 8px;
    padding: 6px 14px; font-size: 0.85rem; opacity: 0; pointer-events: none;
    transition: opacity 0.15s, transform 0.15s; z-index: 200;
}
.cars-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Quick edit on tiles: an invisible <select> sits over the badge / tech name */
.quick-edit { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.quick-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.quick-caret { font-size: 0.7rem; margin-left: 4px; opacity: 0.6; }
.quick-edit:hover .quick-caret { opacity: 1; }
.quick-select option { background: #1a1a1a; color: #fff; }

#car-modal input[type="date"] { color-scheme: dark; }
#car-modal input[type="date"]::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; }

#car-modal input[type="date"] { color-scheme: dark !important; }

@keyframes modal-pop-in  { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes modal-pop-out { from { transform: scale(1); opacity: 1; } to { transform: scale(0.6); opacity: 0; } }
#car-modal.flex > div { animation: modal-pop-in 0.22s ease-out; } 
#car-modal.closing > div { animation: modal-pop-out 0.15s ease-in forwards; }

.stat-card.stat-ready { border-color: #22c55e; }
.stat-card.stat-ready .stat-value { color: #22c55e; }
/* Edit modal footer: "Added by" stamp centred, Save on the right */
.modal-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.modal-footer #save-car { justify-self: end; }

/* Last edited stamp on tiles */
.edit-stamp { font-size: 0.65rem; color: #6b7280; margin-top: 2px; white-space: nowrap; }
/* Staged (unsaved) tile edits */
.quick-pending { outline: 1px dashed #FFD700; outline-offset: 2px; border-radius: 6px; }
.pending-box { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border: 1px solid rgba(255,215,0,0.45); background: rgba(255,215,0,0.06); border-radius: 8px; }
.pending-label { color: #e5e7eb; font-size: 0.72rem; }
.pending-save { background: #FFD700; color: #000; font-weight: 700; font-size: 0.7rem; padding: 2px 10px; border-radius: 6px; }
.pending-save:hover { filter: brightness(1.1); }
.pending-cancel { color: #9ca3af; font-size: 0.7rem; padding: 2px 8px; border-radius: 6px; }
.pending-cancel:hover { color: #fff; background: #333; }

#lists-modal > .lists-card { max-width: 56rem; }
/* Job card change log (car form) */
.car-history-btn { margin-top:4px; font-size:.75rem; font-weight:700; padding:3px 10px; border-radius:999px; border:1px solid var(--dp-border, #444); color:inherit; background:transparent; }
.car-history-btn:hover { background:var(--dp-hover, #262626); }
.car-history { border:1px solid var(--dp-border, #444); border-radius:12px; padding:10px 12px; max-height:260px; overflow-y:auto; display:flex; flex-direction:column; gap:10px; }
.car-history.hidden { display:none; }
.car-history-item { font-size:.82rem; line-height:1.35; padding-bottom:8px; border-bottom:1px solid var(--dp-border, #333); overflow-wrap:anywhere; }
.car-history-item:last-child { border-bottom:0; padding-bottom:0; }
.car-history-head { font-size:.72rem; font-weight:700; color:var(--dp-muted, #9ca3af); margin-bottom:3px; }
.car-history-old { white-space:pre-wrap; }

/* Reset only shows while a filter is on (cars-views.js toggles .hidden). */
#reset-filters.hidden, #m-sheet #reset-filters.hidden { display: none !important; }
