/* Module screens: PPOŻ fire risk table, inspections, asset register, checklist rows. Loaded last. */

/* =============================================
   PPOÅ» â Fire Risk Table (PpozFireRiskStep)
   ============================================= */

.ppoz-risk-table-header {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 8px 8px 0 0;
    border: 1px solid rgba(0,0,0,0.08);
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(0,0,0,0.55);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.ppoz-risk-table-row {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    gap: 8px;
    min-height: 48px;
}

.ppoz-risk-col-hazard {
    flex: 1;
    min-width: 0;
}

.ppoz-risk-col-ps {
    flex-shrink: 0;
    width: 56px;
    text-align: center;
}

.ppoz-risk-col-r {
    flex-shrink: 0;
    width: 60px;
    display: flex;
    justify-content: center;
}

.ppoz-risk-col-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    width: 72px;
    justify-content: flex-end;
}

@media (max-width: 600px) {
    .ppoz-risk-col-ps {
        width: 44px;
    }
    .ppoz-risk-col-r {
        width: 48px;
    }
    .ppoz-risk-col-actions {
        width: 60px;
    }
}


/* =============================================
   INSPECTION MODULE
   ============================================= */

/* --- Type step grid --- */
.inspection-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.inspection-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    text-align: center;
}

.inspection-type-card:hover {
    border-color: #2D5A3D;
    background: #f0f7f2;
    box-shadow: 0 2px 12px rgba(45,90,61,0.10);
}

.inspection-type-card.active {
    border-color: #2D5A3D;
    background: #e8f5e9;
    box-shadow: 0 2px 12px rgba(45,90,61,0.14);
}

.inspection-type-icon {
    width: 52px;
    color: #2D5A3D;
    font-size: 28px;
    height: 52px;
    border-radius: 14px;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
}

.inspection-type-card.active .inspection-type-icon {
    background: #2D5A3D;
    color: #ffffff;
}

.inspection-type-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.inspection-type-desc {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.4;
}

/* --- Subtype grid --- */
.inspection-subtype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.inspection-subtype-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    text-align: center;
}

.inspection-subtype-card:hover {
    border-color: #2D5A3D;
    background: #f0f7f2;
}

.inspection-subtype-card.active {
    border-color: #2D5A3D;
    background: #e8f5e9;
}

.inspection-subtype-icon {
    width: 40px;
    color: #2D5A3D;
    font-size: 22px;
    height: 40px;
    border-radius: 10px;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
}

.inspection-subtype-card.active .inspection-subtype-icon {
    background: #2D5A3D;
    color: #ffffff;
}

/* --- Asset list (object step) --- */
.inspection-empty-assets {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    color: #999;
    text-align: center;
}

.inspection-asset-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inspection-asset-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    background: #fff;
}

.inspection-asset-info {
    flex: 1;
    min-width: 0;
}

.inspection-asset-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a1a1a;
}

.inspection-asset-subtitle {
    font-size: 0.78rem;
    color: #666;
    margin-top: 2px;
}

.inspection-asset-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* --- Checklist step: asset tabs --- */
.inspection-asset-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.inspection-asset-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    min-width: 90px;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}

.inspection-asset-tab:hover {
    border-color: #2D5A3D;
    background: #f0f7f2;
}

.inspection-asset-tab.active {
    border-color: #2D5A3D;
    background: #e8f5e9;
}

.inspection-tab-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a1a;
}

.inspection-tab-status {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #888;
}

.inspection-asset-tab.status-ok .inspection-tab-status {
    background: #e8f5e9;
    color: #2e7d32;
}

.inspection-asset-tab.status-nok .inspection-tab-status {
    background: #ffebee;
    color: #c62828;
}

.inspection-asset-tab.status-partial .inspection-tab-status {
    background: #fff8e1;
    color: #e65100;
}

/* --- Checklist section and items --- */
.inspection-checklist-section {
    margin-bottom: 20px;
}

.inspection-checklist-section-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}

.inspection-checklist-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.07);
    transition: background 0.15s;
}

.inspection-checklist-item.nok {
    border-color: rgba(198,40,40,0.2);
    background: #fff8f8;
}

.inspection-checklist-question {
    font-size: 0.88rem;
    color: #222;
    font-weight: 500;
    line-height: 1.4;
}

.inspection-answer-buttons {
    display: flex;
    gap: 6px;
}

.insp-answer-btn {
    flex: 1;
    padding: 5px 8px;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s, color 0.14s;
    font-family: inherit;
    text-align: center;
}

.insp-answer-btn--ok:hover,
.insp-answer-btn--ok.active {
    border-color: #2e7d32;
    background: #e8f5e9;
    color: #2e7d32;
}

.insp-answer-btn--nok:hover,
.insp-answer-btn--nok.active {
    border-color: #c62828;
    background: #ffebee;
    color: #c62828;
}

.insp-answer-btn--nd:hover,
.insp-answer-btn--nd.active {
    border-color: #757575;
    background: #f5f5f5;
    color: #424242;
}

.inspection-checklist-comment {
    margin-top: 2px;
}

.inspection-nok-detail {
    padding: 10px 12px;
    background: #fff8f8;
    border: 1px solid rgba(198,40,40,0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insp-risk-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(0,0,0,0.55);
    margin-bottom: 4px;
}

.inspection-risk-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.insp-risk-btn {
    padding: 4px 14px;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 20px;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.14s, background 0.14s;
}

.insp-risk-btn--low:hover,
.insp-risk-btn--low.active {
    border-color: #388e3c;
    background: #e8f5e9;
    color: #2e7d32;
}

.insp-risk-btn--med:hover,
.insp-risk-btn--med.active {
    border-color: #f57c00;
    background: #fff8e1;
    color: #e65100;
}

.insp-risk-btn--high:hover,
.insp-risk-btn--high.active {
    border-color: #c62828;
    background: #ffebee;
    color: #c62828;
}

/* --- Asset progress bar --- */
.inspection-asset-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inspection-progress-label {
    font-size: 0.78rem;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Schedule step presets --- */
.inspection-schedule-presets {
    margin-bottom: 4px;
}

.inspection-schedule-presets-label {
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 8px;
}

.inspection-preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inspection-preset-chip {
    padding: 5px 14px;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 20px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.14s, background 0.14s;
}

.inspection-preset-chip:hover {
    border-color: #2D5A3D;
    background: #f0f7f2;
}

.inspection-preset-chip.active {
    border-color: #2D5A3D;
    background: #e8f5e9;
    color: #2D5A3D;
}

@media (max-width: 600px) {
    .inspection-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .inspection-subtype-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .inspection-preset-chip {
        font-size: 0.78rem;
        padding: 4px 10px;
    }
}

/* ===== Asset Dashboard ===== */

.asset-dashboard-card {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}

.asset-dashboard-card:hover {
    background: #fafafa;
}

.asset-dashboard-card--expanded {
    background: #f5f9f6;
}

.asset-dashboard-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.asset-dashboard-history {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e8e8e8;
}

@media (max-width: 600px) {
    .asset-dashboard-card-header {
        flex-direction: column;
        gap: 6px;
    }
}

/* ===== Asset Library Picker ===== */

.asset-picker-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.12s;
    border-radius: 6px;
}

.asset-picker-item:hover {
    background: #f5f9f6;
}

.asset-picker-item--selected {
    background: #e8f5e9;
}

/* Small round status marker. Takes the text color unless a variant sets it. Used instead of colored emoji. */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    vertical-align: middle;
}

.status-dot--bad {
    color: #c62828;
}

.status-dot--warn {
    color: #e65100;
}

.status-dot--ok {
    color: #2e7d32;
}

/* Phone: the question gets the full width; the weight chip, info icon and camera go to the next line. */
@media (max-width: 600px) {
    .checklist-question-row {
        flex-wrap: wrap;
        row-gap: 6px !important;
    }

    .checklist-question-row > .mud-typography {
        flex-basis: 100% !important;
    }
}

/* Legal basis under a checklist question: quiet text, the full rule opens on click. */
.question-legal-basis {
    margin-top: 2px;
    font-size: 0.78rem;
    color: #5f6b66;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}
