/* ============================================================
   app.css — Audit Workbench Styles
   ============================================================ */

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
}
.login-card {
    width: 100%;
    max-width: 380px;
}

/* --- Audit Layout --- */
.audit-page {
    padding-bottom: 56px; /* leave room for fixed score panel */
}

.audit-header {
    font-size: 0.9rem;
}

.audit-body {
    min-height: calc(100vh - 112px);
}

/* --- Section Sidebar --- */
.audit-sections {
    min-height: 100%;
    overflow-y: auto;
    max-height: calc(100vh - 112px);
    position: sticky;
    top: 56px;
}

.audit-sections .list-group-item {
    border-radius: 0;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 0.6rem 0.75rem;
}

.audit-sections .list-group-item.active {
    background-color: #0069d9;
    border-color: #0062cc;
    color: #fff;
}

.audit-sections .list-group-item:hover:not(.active) {
    background-color: #f0f4ff;
}

/* --- Section Panels --- */
.section-panel {
    display: none;
    scroll-margin-top: 116px; /* navbar (~56px) + audit header (~60px) */
}
.section-panel.active {
    display: block;
}

/* --- Notes Required state --- */
.notes-field.notes-required {
    border-color: #dc3545 !important;
}
.section-comment-field.sc-required {
    border-color: #dc3545 !important;
}

/* --- Prev/Next Nav Buttons --- */
.section-nav-btns {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.section-nav-btns.show {
    visibility: visible;
    opacity: 1;
}

/* --- Question Rows --- */
.question-row {
    transition: box-shadow 0.15s;
}
.question-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.question-text {
    font-size: 0.92rem;
    margin-bottom: 0.4rem !important;
}

/* --- Answer Radio Buttons (Bootstrap 4 compatible) --- */
.answer-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.answer-group .btn {
    min-width: 54px;
    transition: all 0.1s;
}
.answer-group .btn-outline-success.active,
.answer-group .btn-outline-success:active {
    background-color: #28a745;
    color: #fff;
}
.answer-group .btn-outline-danger.active,
.answer-group .btn-outline-danger:active {
    background-color: #dc3545;
    color: #fff;
}
.answer-group .btn-outline-secondary.active,
.answer-group .btn-outline-secondary:active {
    background-color: #6c757d;
    color: #fff;
}
.disabled-group .btn {
    pointer-events: none;
    opacity: 0.75;
}

/* Hide native radio inputs (Bootstrap 4 doesn't have .btn-check) */
.answer-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* --- Action Item --- */
.action-item-group {
    border-left: 3px solid #dc3545 !important;
}
.action-item-group small {
    font-size: 0.72rem;
}

/* --- Notes textarea auto-grow --- */
.notes-field {
    resize: none;
    overflow: hidden;
    min-height: 32px;
}

/* --- Score Panel --- */
.score-panel {
    z-index: 1030;
    font-size: 0.82rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.25);
}
.score-panel .badge {
    font-size: 0.8rem;
    padding: 0.3em 0.55em;
    min-width: 46px;
}

/* --- Badge sizes --- */
.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* --- Save indicator --- */
#saveIndicator {
    font-size: 0.75rem;
    transition: opacity 0.3s;
}

/* --- Dashboard table tweaks --- */
.table th {
    font-size: 0.78rem;
    white-space: nowrap;
}
.table td {
    font-size: 0.85rem;
    vertical-align: middle;
}

/* --- Responsive adjustments --- */
@media (max-width: 767px) {
    .audit-sections {
        max-height: none;
        position: static;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .audit-sections .list-group {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .audit-sections .list-group-item {
        flex-shrink: 0;
        white-space: nowrap;
        border-bottom: none;
    }
    .score-panel .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
}
