/* style-55-cmms-vehicle.css — FEAT-368-FE
   CMMS Vehicle page — prefix: cv-
   Dark-first; light overrides under body[data-theme="light"] */

/* ── Page shell ─────────────────────────────────────────────────────────────── */
.cv-page {
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.cv-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cv-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text, #e0e6ef);
}

/* ── Env pill ────────────────────────────────────────────────────────────────── */
.cv-env-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cv-env-prod {
    background: #1d4ed8;
    color: #fff;
}

.cv-env-uat {
    background: #b45309;
    color: #fff;
}

/* ── Search bar ──────────────────────────────────────────────────────────────── */
.cv-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cv-search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #3a3d4a;
    background: #23263a;
    color: #e0e6ef;
    font-size: 14px;
    outline: none;
}

.cv-search-input:focus {
    border-color: #4a9eff;
}

.cv-search-btn {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    background: #1d4ed8;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.cv-search-btn:hover {
    background: #2563eb;
}

.cv-search-dropdown {
    margin-bottom: 8px;
}

.cv-error-msg {
    color: #f87171;
    font-size: 13px;
    margin-bottom: 8px;
    min-height: 18px;
}

/* ── Blocks ──────────────────────────────────────────────────────────────────── */
.cv-blocks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.cv-block {
    min-height: 60px;
}

.cv-block-inner {
    background: #1e2028;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    padding: 16px;
}

.cv-block-inner.cv-block-error {
    border-color: #7f1d1d;
}

.cv-block-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted, #8899aa);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2d3a;
}

.cv-empty-msg {
    color: var(--text-muted, #8899aa);
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

.cv-prompt {
    color: var(--text-muted, #8899aa);
    font-size: 13px;
    padding: 24px;
    text-align: center;
}

/* ── Hero block ──────────────────────────────────────────────────────────────── */
.cv-hero-plate {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #e0e6ef;
    margin-bottom: 10px;
}

.cv-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.cv-hero-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

/* ── Fields ──────────────────────────────────────────────────────────────────── */
.cv-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.cv-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cv-field-label {
    font-size: 11px;
    color: var(--text-muted, #8899aa);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.cv-field-value {
    font-size: 14px;
    color: #e0e6ef;
    font-weight: 500;
}

.cv-field-value.cv-muted {
    color: var(--text-muted, #8899aa);
    font-style: italic;
}

/* ── Expiry note ─────────────────────────────────────────────────────────────── */
.cv-expiry-note {
    margin-top: 10px;
    padding: 8px 12px;
    background: #1a2a3a;
    border-left: 3px solid #4a9eff;
    border-radius: 4px;
    font-size: 13px;
    color: #a0b4c8;
}

/* ── Status pills ────────────────────────────────────────────────────────────── */
.cv-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #2a2d3a;
    color: #c0c8d8;
}

.cv-substatus {
    background: #1e2d1e;
    color: #86efac;
}

.cv-pill-inferred {
    background: #3a3020;
    color: #d4a820;
    font-style: italic;
}

.cv-sev-1 { background: #1a2a1a; color: #86efac; }
.cv-sev-2 { background: #2a2a1a; color: #fde68a; }
.cv-sev-3 { background: #2a1a1a; color: #fca5a5; }
.cv-sev-4 { background: #3a0a0a; color: #f87171; font-weight: 700; }

.cv-pill-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.cv-export-btns {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: flex-end;
}

.cv-export-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #3a3d4a;
    border-radius: 4px;
    background: #23263a;
    color: #a0b4c8;
    cursor: pointer;
}

.cv-export-btn:hover {
    background: #2a2d4a;
    color: #e0e6ef;
}

.cv-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 500px;
}

.cv-table th {
    text-align: left;
    padding: 7px 10px;
    background: #161920;
    color: var(--text-muted, #8899aa);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #2a2d3a;
    white-space: nowrap;
}

.cv-table td {
    padding: 7px 10px;
    color: #c8d4e4;
    border-bottom: 1px solid #1a1d27;
    vertical-align: middle;
}

.cv-table tr:last-child td {
    border-bottom: none;
}

.cv-table tr:hover td {
    background: #1c1f2c;
}

/* ── Timeline block ──────────────────────────────────────────────────────────── */
.cv-timeline-group-header {
    background: #161920;
    color: var(--text-muted, #8899aa);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 6px 10px;
    border-bottom: 1px solid #2a2d3a;
}

.cv-timeline-remark {
    font-style: italic;
    color: var(--text-muted, #8899aa);
    max-width: 200px;
}

.cv-att-link {
    color: #4a9eff;
    text-decoration: none;
    font-size: 12px;
}

.cv-att-link:hover {
    text-decoration: underline;
}

.cv-timeline-trunc {
    font-size: 12px;
    color: var(--text-muted, #8899aa);
    font-style: italic;
    margin-top: 8px;
    text-align: right;
}

/* ── List table (FEAT-377) ───────────────────────────────────────────────────── */
.cv-list-plate-btn {
    background: none;
    border: none;
    padding: 0;
    color: #4a9eff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    letter-spacing: 0.5px;
}

.cv-list-plate-btn:hover {
    color: #7ab8ff;
    text-decoration: underline;
}

body[data-theme="light"] .cv-list-plate-btn {
    color: #1d4ed8;
}

body[data-theme="light"] .cv-list-plate-btn:hover {
    color: #1e40af;
}

/* ── 390 px responsive ───────────────────────────────────────────────────────── */
@media (max-width: 420px) {
    .cv-page { padding: 10px; }
    .cv-hero-plate { font-size: 22px; }
    .cv-fields,
    .cv-hero-fields { grid-template-columns: 1fr 1fr; }
    .cv-blocks { gap: 10px; }
}

/* ══ Light theme overrides ═════════════════════════════════════════════════════ */
body[data-theme="light"] .cv-page-title {
    color: #1e2028;
}

body[data-theme="light"] .cv-block-inner {
    background: #ffffff;
    border-color: #e2e8f0;
}

body[data-theme="light"] .cv-block-title {
    color: #6c757d;
    border-bottom-color: #e2e8f0;
}

body[data-theme="light"] .cv-hero-plate {
    color: #1e2028;
}

body[data-theme="light"] .cv-field-value {
    color: #212529;
}

body[data-theme="light"] .cv-field-value.cv-muted {
    color: #6c757d;
}

body[data-theme="light"] .cv-empty-msg,
body[data-theme="light"] .cv-prompt {
    color: #6c757d;
}

body[data-theme="light"] .cv-pill {
    background: #e9ecef;
    color: #495057;
}

body[data-theme="light"] .cv-pill-inferred {
    background: #fef3c7;
    color: #92400e;
}

body[data-theme="light"] .cv-sev-1 { background: #dcfce7; color: #166534; }
body[data-theme="light"] .cv-sev-2 { background: #fef9c3; color: #854d0e; }
body[data-theme="light"] .cv-sev-3 { background: #fee2e2; color: #991b1b; }
body[data-theme="light"] .cv-sev-4 { background: #fecaca; color: #7f1d1d; font-weight: 700; }

body[data-theme="light"] .cv-search-input {
    background: #ffffff;
    border-color: #ced4da;
    color: #212529;
}

body[data-theme="light"] .cv-search-input:focus {
    border-color: #1d4ed8;
}

body[data-theme="light"] .cv-table th {
    background: #f8f9fa;
    color: #6c757d;
    border-bottom-color: #e2e8f0;
}

body[data-theme="light"] .cv-table td {
    color: #374151;
    border-bottom-color: #f0f4f8;
}

body[data-theme="light"] .cv-table tr:hover td {
    background: #f8f9fa;
}

body[data-theme="light"] .cv-expiry-note {
    background: #eff6ff;
    border-left-color: #1d4ed8;
    color: #1e40af;
}

body[data-theme="light"] .cv-timeline-group-header {
    background: #f8f9fa;
    color: #6c757d;
}

body[data-theme="light"] .cv-timeline-remark {
    color: #6c757d;
}

body[data-theme="light"] .cv-att-link {
    color: #1d4ed8;
}

body[data-theme="light"] .cv-timeline-trunc {
    color: #6c757d;
}

body[data-theme="light"] .cv-export-btn {
    background: #f8f9fa;
    border-color: #ced4da;
    color: #374151;
}

body[data-theme="light"] .cv-export-btn:hover {
    background: #e9ecef;
    color: #1e2028;
}

body[data-theme="light"] .cv-error-msg {
    color: #dc2626;
}
