/* Wizard side panels, missing panel, mobile steps bar, card menu and mobile navigation. Loaded after wizard.css. */

/* =============================================
   WIZARD MINI DASHBOARD (desktop right panel)
   ============================================= */

.wizard-mini-dashboard {
    width: 240px;
    min-width: 240px;
    background: #f7f8fa;
    border-left: 1px solid #e8ede9;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px 16px;
}

.mini-dash-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #66706a;
    margin-bottom: 16px;
}

.mini-dash-section {
    padding: 12px 0;
    border-bottom: 1px solid #eef3ef;
}

.mini-dash-counter {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a3d28;
}

.mini-dash-counter.counter-warn {
    color: #e65100;
}

.mini-dash-counter.counter-ok {
    color: #2D5A3D;
}

.mini-dash-nonconformity-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.78rem;
}

.mini-dash-nok-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mini-dash-nok-label {
    flex: 1;
    color: #444;
}

.mini-dash-nok-count {
    font-weight: 700;
    color: #1a1a1a;
}

.mini-dash-label {
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #66706a;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .wizard-mini-dashboard {
        display: none;
    }
}

/* =============================================
   AUDIT CARD – LEFT BORDER BY STATUS
   ============================================= */

.audit-card[data-status="Draft"]::before {
    background: #bbb;
    opacity: 1;
}

.audit-card[data-status="InProgress"]::before {
    background: #e65100;
    opacity: 1;
}

.audit-card[data-status="Ready"]::before {
    background: #2D5A3D;
    opacity: 1;
}

/* =============================================
   WIZARD MISSING PANEL
   ============================================= */

.wizard-missing-panel {
    background: #fff8f8;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: .875rem;
}

.wizard-missing-panel-title {
    font-weight: 600;
    color: #c62828;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.missing-item-text {
    color: #c62828;
    font-size: .85rem;
    display: block;
    padding: 2px 0;
}

.checklist-subitem {
    padding: 3px 0 3px 28px;
    border-bottom: 1px solid #f8f0f0;
}

.checklist-subitem:last-child {
    border-bottom: 1px solid #f0f4f0;
    margin-bottom: 2px;
}

.checklist-nav-btn {
    background: none;
    border: none;
    color: #c62828;
    text-decoration: underline;
    cursor: pointer;
    font-size: .8rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-align: left;
}

.checklist-nav-btn:hover {
    color: #b71c1c;
}

.step-missing-badge {
    background: #e53935;
    color: #fff;
    border-radius: 10px;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
}

/* =============================================
   WIZARD MOBILE STEPS BAR
   ============================================= */

.wizard-mobile-steps-bar {
    display: none;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid #e0e8e2;
    flex-shrink: 0;
}

.mobile-steps-scroll {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 12px 0;
    gap: 0;
    scrollbar-width: none;
}

.mobile-steps-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 8px 8px;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 56px;
    position: relative;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.mobile-step-item::after {
    content: '';
    position: absolute;
    top: 14px;
    right: -4px;
    width: 8px;
    height: 1px;
    background: #cdd8d0;
}

.mobile-step-item:last-child::after {
    display: none;
}

.mobile-step-item:hover {
    opacity: 0.85;
}

.mobile-step-item.active {
    opacity: 1;
}

.mobile-step-item.completed {
    opacity: 0.85;
}

.mobile-step-item.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.mobile-step-item.has-missing .mobile-step-circle {
    border-color: #ff9800;
    border-width: 2px;
}

/* Nonconformity status chips — compact on mobile */
@media (max-width: 600px) {
    .nonconformity-chips-row .mud-chip {
        font-size: 0.7rem !important;
        height: 24px !important;
        padding: 0 6px !important;
    }
    .nonconformity-chips-row .mud-chip .mud-chip-label {
        font-size: 0.7rem !important;
    }
    .nonconformity-chips-row .mud-chip .mud-icon-root {
        font-size: 14px !important;
        width: 14px !important;
        height: 14px !important;
    }
}

.mobile-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f4f1;
    border: 1.5px solid #cdd8d0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7a71;
    flex-shrink: 0;
}

.mobile-step-item.active .mobile-step-circle {
    background: #2D5A3D;
    border-color: #2D5A3D;
    color: #fff;
}

.mobile-step-item.completed .mobile-step-circle {
    background: #e8f5e9;
    border-color: rgba(45,90,61,0.3);
    color: #2D5A3D;
}

.mobile-step-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px 8px;
    background: linear-gradient(90deg, #1e4a2e 0%, #2D5A3D 100%);
}

.mobile-step-current-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

@media (max-width: 800px) {
    .wizard-mobile-steps-bar {
        display: flex;
    }

    .wizard-top-bar {
        display: none !important;
    }

    .wizard-progress-subbar {
        display: none !important;
    }
}

/* =============================================
   SECTION BLOCK (GeneralDataStep visual sections)
   ============================================= */

.section-block {
    border: 1px solid #e4ede4;
    border-radius: 10px;
    overflow: hidden;
}

.section-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(90deg, #f3f7f4 0%, #f8fbf8 100%);
    border-bottom: 1px solid #e4ede4;
    font-weight: 600;
    font-size: 0.9rem;
    color: #2D5A3D;
}

/* =============================================
   SAVE STATUS BAR – fade animations
   ============================================= */

@keyframes ssbFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes ssbFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes saveIconPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ssb-fade-in {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: ssbFadeIn 0.3s ease forwards;
}

.ssb-fade-out-fast {
    animation: ssbFadeOut 0.4s ease forwards;
}

.save-icon-pulse {
    animation: saveIconPulse 1.2s ease-in-out infinite;
}

.ssb-saving-anim {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ssb-saving-text {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.ssb-saved-anim {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ssb-saved-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.ssb-saved-flash {
    color: #2D5A3D;
    font-weight: 600;
}

.ssb-compact-time {
    font-size: 0.72rem;
    color: #8a9e8e;
}

.ssb-lastsaved {
    display: flex;
    align-items: center;
}

.ssb-error-text {
    color: #c62828;
}

.ssb-offline-compact {
    display: flex;
    align-items: center;
}

.save-status--compact {
    display: flex;
    align-items: center;
    min-width: 40px;
}

/* =============================================
   SNACKBAR – mobile full-width override
   ============================================= */

@media (max-width: 600px) {
    .mud-snackbar-location-bottom-right {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 0 !important;
    }

    .mud-snackbar-location-bottom-right .mud-snackbar {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
}

/* =============================================
   AUDIT CARD – bottom sheet menu
   ============================================= */

.card-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
}

.card-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 8px 0 env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

.bottom-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.bottom-sheet-item:hover {
    background: #f5f5f5;
}

.bottom-sheet-item--danger {
    color: #d32f2f;
}

.bottom-sheet-cancel {
    padding: 16px 24px;
    text-align: center;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bottom-sheet-cancel:hover {
    background: #f5f5f5;
}

@media (min-width: 601px) {
    .card-bottom-sheet {
        position: absolute;
        bottom: auto;
        left: auto;
        right: 0;
        top: 100%;
        border-radius: 8px;
        width: 220px;
        padding: 4px 0;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }

    .bottom-sheet-item {
        padding: 12px 16px;
        font-size: 0.875rem;
    }

    .bottom-sheet-cancel {
        padding: 12px 16px;
        font-size: 0.875rem;
    }

    .card-menu-overlay {
        display: none;
    }
}

/* =============================================
   DASHBOARD – CTA button & section header
   ============================================= */

.btn-continue-audit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #2D5A3D;
    color: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    margin-top: 12px;
    transition: background 0.15s ease, transform 0.12s ease;
}

.btn-continue-audit:hover {
    background: #245035;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dashboard-see-all {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2D5A3D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
}

.dashboard-see-all:hover {
    text-decoration: underline;
}

/* =============================================
   MOBILE NAVIGATION – bottom sheet
   ============================================= */

/* Hide the desktop sidebar on mobile */
@media (max-width: 599px) {
    .desktop-only-drawer {
        display: none !important;
    }
}

/* Backdrop overlay */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    animation: mobileNavFadeIn 0.2s ease;
}

@keyframes mobileNavFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Bottom sheet panel */
.mobile-nav-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #2D5A3D 0%, #1e4a2e 100%);
    border-radius: 18px 18px 0 0;
    z-index: 1201;
    padding: 0 0 env(safe-area-inset-bottom, 0);
    /* The menu is taller than short phone screens; without this its top items are off screen. */
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: mobileNavSlideUp 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28);
}

@keyframes mobileNavSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Drag handle */
.mobile-nav-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 10px auto 6px;
}

/* Nav links container */
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 4px 12px 0;
}

/* Individual nav link */
.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: background 0.15s ease;
    position: relative;
}

.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.mobile-nav-item.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 600;
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: linear-gradient(180deg, #A5D6A7 0%, #4CAF50 100%);
    border-radius: 0 2px 2px 0;
}

/* Cancel button */
.mobile-nav-cancel {
    display: block;
    width: calc(100% - 24px);
    margin: 8px 12px;
    padding: 13px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mobile-nav-cancel:hover {
    background: rgba(255, 255, 255, 0.16);
}

.mobile-nav-logout-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: calc(100% - 24px);
    margin: 4px 12px 0;
    padding: 12px 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-nav-logout-btn:hover {
    background: rgba(255, 80, 80, 0.12);
    color: #ff8a80;
}

/* .audit-card already has position:relative (line 207) – required for desktop sheet popover */

/* ── PPOŻ Fire Risk Register ────────────────────────── */
.fire-risk-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fire-risk-item {
    border: 1px solid rgba(0,0,0,0.10);
}

.fire-risk-item-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.fire-risk-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 2px;
}

.fire-risk-title-col {
    flex: 1;
    min-width: 0;
}

.fire-risk-score-col {
    flex-shrink: 0;
    min-width: 60px;
}

.fire-risk-actions {
    flex-shrink: 0;
    display: flex;
    gap: 2px;
    align-items: center;
}

.fire-risk-scores {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-top: 6px;
    margin-top: 4px !important;
}

.fire-risk-score-label {
    font-size: 10px;
    color: rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.fire-risk-score-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(0,0,0,0.78);
}


