/* ============================================================
   Incident Reporter – Stylesheet
   Uses default font-family/sizes, full width, no icons/images
   ============================================================ */

/* ---- Container ---- */
.ir-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ---- View Mode Header ---- */
.ir-view-header {
    padding: 20px 0;
}
.ir-view-header h2 {
    margin: 0 0 6px;
}
.ir-meta {
    color: #555;
    margin: 0 0 16px;
}
.ir-view-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Form sections ---- */
.ir-form {
    width: 100%;
}

.ir-section {
    width: 100%;
    padding: 20px;
    margin-bottom: 18px;
    box-sizing: border-box;
    background: #f8f9fa;
}

.ir-section-locked {
    background: #f9f9f9;
    border-color: #ddd;
}

.ir-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.ir-section h4 {
    font-weight: 900;
    margin-bottom: 5px;
    color: #2271b1;
}

.ir-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: #222;
    color: #fff;
    font-weight: bold;
    flex-shrink: 0;
}

.ir-instructions {
    margin: 0 0 16px;
    color: #555;
    line-height: 1.5;
}

/* ---- Incident type buttons ---- */
.ir-type-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.ir-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: 2px solid #2271b1;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    background: #fff;
    transition: background 0.15s, color 0.15s;
}
.ir-type-btn:first-child { border-radius: 0; }
.ir-type-btn.active,
.ir-type-btn:has(input:checked) {
    background: #222;
    color: #fff;
}
.ir-type-btn input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.ir-type-buttons.ir-locked .ir-type-btn {
    cursor: default;
}

/* ---- Field groups ---- */
.ir-field-group {
    margin-bottom: 14px;
    width: 100%;
}
.ir-field-group:last-child {
    margin-bottom: 0;
}
.ir-field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}
.ir-field-narrow {
    max-width: 220px;
}
.ir-field-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.ir-field-row .ir-field-group {
    flex: 1;
    min-width: 180px;
}

/* ---- Inputs ---- */
.ir-input,
.ir-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #bbb;
    background: #fff;
    font-size: 1em;
    font-family: inherit;
    box-sizing: border-box;
    border-radius: 0;
    outline: none;
    transition: border-color 0.15s;
}
.ir-input:focus,
.ir-textarea:focus {
    border-color: #222;
}
.ir-input.ir-locked,
.ir-textarea.ir-locked,
.ir-input[readonly],
.ir-textarea[readonly],
.ir-input[disabled],
.ir-textarea[disabled] {
    background: #f4f4f4;
    color: #555;
    border-color: #ddd;
    cursor: default;
}
.ir-textarea {
    resize: vertical;
    min-height: 80px;
}
.ir-input.ir-error,
.ir-textarea.ir-error {
    border-color: #c00;
}

/* ---- Witness block ---- */
.ir-witness-block {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
}
.ir-witness-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.ir-witness-block h4 {
    margin: 0 0 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #444;
}

/* ---- Required asterisk ---- */
.ir-required {
    color: #c00;
    margin-left: 2px;
}

/* ---- Submit ---- */
.ir-submit-wrap {
    padding: 20px 0;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.ir-submit-note {
    margin: 0;
    color: #666;
}

/* ---- Buttons ---- */
.ir-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    border: none;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}
.ir-btn:hover {
    background: #135e96;
    color: #fff;
    text-decoration: none;
}
.ir-btn-primary {
    background: #2271b1;
    color: #fff;
}
.ir-btn-secondary {
    background: #2271b1;
    color: #ffffff;
}
.ir-btn-secondary:hover {
    background: #135e96;
}
.ir-btn-outline {
    background: #6c757d;
    color: #ffffff;
    border: none;
}
.ir-btn-outline:hover {
    background: #5a6268;
}
.ir-btn-sm {
    padding: 5px 12px;
    font-size: 0.85em;
}
.ir-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Confirmation ---- */
.ir-confirmation {
    width: 100%;
}
.ir-confirmation-inner {
    padding: 32px;
    border: 2px solid #222;
    background: #fff;
}
.ir-confirmation-inner h2 {
    margin: 0 0 10px;
}
.ir-confirmation-inner p {
    margin: 0 0 10px;
    color: #333;
}
.ir-confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ---- Validation error box ---- */
.ir-errors {
    background: #fff5f5;
    border: 1px solid #c00;
    padding: 14px 18px;
    margin-bottom: 18px;
    color: #c00;
}
.ir-errors ul {
    margin: 6px 0 0 18px;
    padding: 0;
}
.ir-errors li {
    margin-bottom: 4px;
}

/* ---- Notice ---- */
.ir-notice {
    padding: 12px 18px;
    margin-bottom: 18px;
    border: 1px solid #bbb;
}
.ir-notice-success {
    background: #f0fff4;
    border-color: #2d8a4e;
    color: #1a5c33;
}

/* ---- Edit window notices ---- */
.ir-edit-window-notice {
    margin-left: auto;
    color: #888;
    font-style: italic;
    font-weight: 400;
}
.ir-edit-window-open {
    margin-left: auto;
    color: #2d8a4e;
    font-weight: 600;
}

/* ---- List ---- */
/* Assessments List */
.ir-reports-list {
    margin: 30px 0;
}

#reports-container {
    display: grid;
    gap: 15px;
}

.report-item {
    background: var(--rap-light);
    padding: 12px;
    border-left: 4px solid var(--rap-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-item:hover {
    box-shadow: var(--rap-shadow);
}

.report-item-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.report-item-info p {
    margin: 0;
    color: #666;
}

.report-item-actions {
    display: flex;
    gap: 8px;
}

.report-item-actions a {
    text-decoration: none;
}
/* ---- Type badge ---- */
.ir-type-badge {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid #555;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.ir-type-badge.ir-type-injury { border-color: #c00; color: #c00; }
.ir-type-badge.ir-type-near_miss { border-color: #b07000; color: #b07000; }
.ir-type-badge.ir-type-damage_to_property { border-color: #222; color: #222; }

/* ---- Error ---- */
.ir-error {
    color: #c00;
    font-style: italic;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .ir-section {
        padding: 16px;
    }
    .ir-field-row {
        flex-direction: column;
        gap: 0;
    }
    .ir-type-buttons {
        flex-direction: column;
    }
    .ir-type-btn {
        margin-right: 0;
        margin-bottom: -2px;
        justify-content: flex-start;
    }
    .ir-submit-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
    .ir-table th:nth-child(6),
    .ir-table td:nth-child(6) {
        display: none;
    }
}
