/* Fire Extinguisher Inspection Engine - the round.
   Loads after index.css and inprogress.css and only adds what the generic Assets screen
   does not have: the summary strip, scan row, mode toggle, unit line, due pills, the
   spares group, the step panel and the pick list. Cards reuse .asset-card so the
   deficiency module paints them. */

/* ---------- header ---------- */

.fx-section-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fx-header-actions { display: flex; gap: 8px; }
.fx-header-actions .btn { white-space: nowrap; }

.fx-frequency-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #dbeafe;
    color: #1e40af;
    vertical-align: middle;
}

/* ---------- summary strip ---------- */

.fx-summary {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 16px 0;
}

.fx-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: none;
    cursor: pointer;
}

.fx-chip:active { transform: scale(0.97); }
.fx-chip.active { outline: 2px solid #059669; outline-offset: -2px; }
.fx-chip-ok { background: #f0fdf4; color: #166534; }
.fx-chip-warn { background: #fef3c7; color: #92400e; }
.fx-chip-bad { background: #fee2e2; color: #991b1b; }
.fx-chip-info { background: #dbeafe; color: #1e40af; }

/* ---------- toolbar: scan + mode + filter ---------- */

.fx-toolbar { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 8px; }

/* The scan box shares the control row and takes whatever width is left after the
   mode toggle and the filter. Below phone width it drops to its own line. */
.fx-scan-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e1e8ef;
    border-radius: 8px;
    padding: 0 4px 0 12px;
}

@media (max-width: 600px) {
    .fx-scan-row { flex-basis: 100%; }
}

/* On the van page the scan row is a direct child of the (column) toolbar, where the
   220px basis above would become its HEIGHT. Size to content there. */
.fx-toolbar > .fx-scan-row { flex: 0 0 auto; }

.fx-scan-icon { color: #94a3b8; font-size: 16px; }

.fx-scan-input {
    flex: 1;
    border: none !important;
    box-shadow: none !important;
    padding: 7px 0;
    font-size: 16px;
    min-width: 0;
}

.fx-scan-go {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: #059669;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.fx-scan-go:active { transform: scale(0.95); }

.fx-toolbar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* The locations filter stands as tall as the Walk/Step toggle and the scan box beside it;
   the other two keep their natural height. */
.fx-toolbar-row .asset-filter-select { height: 38px; box-sizing: border-box; border-radius: 8px; font-size: 13px; padding: 0 28px 0 10px; }

.fx-mode-toggle {
    display: inline-flex;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.fx-mode-btn {
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fx-mode-btn.active { background: #059669; color: #ffffff; }

/* Collapse all / expand all: one button that flips. Same height as the toggle beside it. */
.fx-collapse-btn {
    height: 38px;
    width: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.fx-collapse-btn.active { background: #f1f5f9; color: #0f172a; }

/* ---------- walk: sections and cards ---------- */

.fx-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.fx-section-title span:last-child { font-weight: 500; text-transform: none; letter-spacing: 0; }

.asset-card.fx-card.fx-empty { border-style: dashed; }
.asset-card.fx-card.fx-empty.fx-required-empty { border-color: #fca5a5; }
.asset-card.fx-card.fx-scan-hit { box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.35); }

.fx-unit-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #1e293b;
    padding: 4px 0 8px;
    border-bottom: 1px solid #f1f5f9;
}

.fx-unit-line .fx-unit-type { font-weight: 700; }
.fx-unit-line .fx-unit-serial { color: #64748b; font-variant-numeric: tabular-nums; }
.fx-unit-line .fx-unit-meta { color: #94a3b8; font-size: 12px; }
.fx-unit-line .fx-unit-empty { color: #92400e; font-weight: 600; }

.fx-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.fx-pill-due { background: #fef3c7; color: #92400e; }
.fx-pill-overdue { background: #fee2e2; color: #991b1b; }
.fx-pill-ok { background: #f0fdf4; color: #166534; }
.fx-pill-info { background: #dbeafe; color: #1e40af; }
.fx-pill-neutral { background: #f1f5f9; color: #475569; }

.fx-warn-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
}

.fx-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
}

.fx-card-actions .btn { flex: 1; justify-content: center; }

.fx-annual-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    padding: 6px 10px;
    border: 1px dashed #3b82f6;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.fx-annual-toggle.active { background: #1d4ed8; color: #ffffff; border-style: solid; }

.fx-question-freq {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #94a3b8;
    margin-left: 4px;
}

/* ---------- spares group ---------- */

.fx-spare-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 8px 16px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.fx-spare-card .fx-unit-line { border-bottom: none; padding: 0; }

/* ---------- step panel ---------- */

.fx-step {
    margin: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.fx-step-head {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.fx-step-counter { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; }
.fx-step-title { font-size: 18px; font-weight: 700; color: #1e293b; margin: 2px 0 4px; }

.fx-step-question {
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.fx-step-control { padding: 0 16px 16px; }
.fx-step-control .answer-toggle-group { gap: 8px; }
.fx-step-control .answer-toggle-btn { flex: 1; padding: 14px 8px; font-size: 15px; }

.fx-step-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.fx-step-footer .btn { flex: 1; justify-content: center; }

.fx-step-done {
    padding: 24px 16px;
    text-align: center;
    color: #166534;
    font-weight: 600;
}

.fx-step-done i { font-size: 28px; display: block; margin-bottom: 8px; }

/* ---------- pick list ---------- */

.fx-pick-tabs { display: flex; gap: 6px; margin-bottom: 10px; }

.fx-pick-tab {
    flex: 1;
    padding: 8px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.fx-pick-tab.active { background: #059669; color: #ffffff; border-color: #059669; }

.fx-pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    background: #ffffff;
}

.fx-pick-row.active { border-color: #059669; background: #ecfdf5; }
.fx-pick-row .fx-unit-line { border-bottom: none; padding: 0; }
.fx-pick-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cbd5e1; flex-shrink: 0; }
.fx-pick-row.active .fx-pick-radio { border-color: #059669; background: #059669; box-shadow: inset 0 0 0 3px #ffffff; }

.fx-pick-empty { padding: 20px 12px; text-align: center; color: #64748b; font-size: 13px; }

/* ---------- forms ---------- */

.fx-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fx-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #1e293b; cursor: pointer; }
.fx-check input { width: 18px; height: 18px; }
.fx-help { font-size: 13px; color: #64748b; margin: 0 0 12px; }

.fx-muted {
    font-size: 12px;
    color: #64748b;
}

.fx-move-summary {
    padding: 8px 10px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
}

.btn-danger { background: #dc2626; color: #ffffff; }
.btn-danger:hover { background: #b91c1c; }

.status-option.fx-danger .status-option-name { color: #991b1b; }
.status-option[disabled] { opacity: 0.45; cursor: not-allowed; }

@media (min-width: 480px) {
    .fx-card-actions .btn { flex: 0 0 auto; }
}

/* ---------- Bulk Inspect ---------- */

/* body.fx-bulk while the Bulk mode is on. The tick replaces the reorder control; the chevron
   stays so a card can be peeked at without ticking it. Ineligible cards say why. */
.fx-bulk-tick { display: none; width: 24px; height: 24px; border-radius: 6px; border: 2px solid #cbd5e1; background: #ffffff; color: #ffffff; font-size: 12px; align-items: center; justify-content: center; flex: 0 0 auto; margin-right: 4px; }
.fx-bulk .fx-bulk-tick { display: inline-flex; }
.fx-bulk .fx-card .asset-reorder { display: none; }
.fx-bulk .fx-card.fx-bulk-selected { border-color: #059669; background: #ecfdf5; }
.fx-bulk .fx-card.fx-bulk-selected .fx-bulk-tick { background: #059669; border-color: #059669; }
.fx-bulk .fx-card.fx-bulk-ineligible .fx-bulk-tick { border-style: dashed; background: #f8fafc; }
.fx-bulk .fx-card.fx-bulk-ineligible .asset-card-header { cursor: not-allowed; }
.fx-bulk-why { display: none; margin: 0 12px 10px 48px; font-size: 11px; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 4px 8px; }
.fx-bulk .fx-card.fx-bulk-ineligible .fx-bulk-why { display: block; }
.fx-bulk .fx-card .asset-progress-badge.fx-bulk-left { background: #fef3c7; color: #92400e; }

.fx-bulk-bar { display: none; margin: 10px 16px 0; padding: 10px 12px; border-radius: 10px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; font-size: 12px; line-height: 1.45; }
.fx-bulk .fx-bulk-bar { display: block; }
.fx-bulk .fx-collapse-btn { display: none; }
.fx-bulk-bar b { color: #047857; }
.fx-bulk-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fx-bulk-quick button { height: 28px; padding: 0 9px; border-radius: 999px; border: 1px solid #a7f3d0; background: #ffffff; color: #047857; font-size: 12px; font-weight: 600; cursor: pointer; }

.fx-bulk-foot { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: #ffffff; border-top: 1px solid #e2e8f0; padding: 10px 16px; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 -8px 24px rgba(2,6,23,.08); }
.fx-bulk .fx-bulk-foot { display: flex; }
.fx-bulk-foot .fx-bulk-count { font-weight: 700; color: #0f172a; font-size: 15px; }
.fx-bulk-foot .fx-bulk-count small { display: block; font-weight: 500; color: #64748b; font-size: 11px; }
.fx-bulk #fxWalkContainer { padding-bottom: 90px; }
@media (min-width: 700px) { .fx-bulk-foot { left: 50%; right: auto; transform: translateX(-50%); width: 640px; border-radius: 12px 12px 0 0; } }

/* The two sheets reuse .status-sheet; these are only their inner rows. */
.fx-bulk-sheet { max-height: 85vh; }
.fx-bulk-sub { font-size: 12px; color: #64748b; }
.fx-bulk-q { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.fx-bulk-q .fx-bulk-qt { font-size: 12px; color: #334155; line-height: 1.35; }
.fx-bulk-q .fx-bulk-applies { display: block; font-size: 11px; color: #64748b; margin-top: 2px; }
.fx-bulk-q .fx-bulk-applies.lock { color: #92400e; }
.fx-bulk-q .answer-toggle-group.locked .answer-toggle-btn { color: #94a3b8; background: #f8fafc; cursor: not-allowed; }
.fx-bulk-q .answer-toggle-group.locked .answer-toggle-btn.on-unit { background: #fef3c7; color: #92400e; }
.fx-bulk-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #64748b; margin: 10px 0 2px; }
.fx-bulk-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.fx-bulk-line b { color: #0f172a; text-align: right; }
.fx-bulk-callout { margin-top: 10px; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.45; }
.fx-bulk-callout.warn { background: #fef3c7; color: #92400e; }
.fx-bulk-callout.info { background: #dbeafe; color: #1e40af; }
.fx-bulk-callout.ok { background: #ecfdf5; color: #047857; }
.fx-bulk-sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 12px; }
