/**
 * SOP Manager Styles
 * Phase 5.4: Standard Operating Procedures
 * Apple Design System
 */

/* ==================== Page Layout ==================== */

.sop-page {
    padding: 0;
}

.sop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.sop-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
}

.sop-count {
    font-size: 14px;
    color: #6e6e73;
    margin-left: 8px;
}

.sop-header-actions {
    display: flex;
    gap: 10px;
}

/* ==================== Toolbar & Filters ==================== */

.sop-toolbar {
    margin-bottom: 20px;
}

.sop-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sop-filters select {
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    min-width: 140px;
}

.sop-filters select:focus {
    outline: none;
    border-color: #0071e3;
}

.sop-search-wrap {
    display: flex;
    gap: 6px;
}

.sop-search {
    min-width: 200px;
}

.sop-search-btn {
    padding: 8px 12px;
    background: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    cursor: pointer;
}

.sop-search-btn:hover {
    background: #e8e8ed;
}

/* ==================== SOP Cards Grid ==================== */

.sop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.sop-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: #0071e3;
}

.sop-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sop-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.sop-version {
    font-size: 12px;
    color: #6e6e73;
    background: #f5f5f7;
    padding: 2px 8px;
    border-radius: 4px;
}

.sop-card-body {
    margin-bottom: 16px;
}

.sop-card-category {
    font-size: 12px;
    color: #6e6e73;
    margin-bottom: 8px;
}

.sop-department {
    color: #8e8e93;
}

.sop-card-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.3;
}

.sop-card-desc {
    margin: 0;
    font-size: 13px;
    color: #6e6e73;
    line-height: 1.5;
}

.sop-card-footer {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #8e8e93;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.sop-card-steps,
.sop-card-duration,
.sop-card-trained {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== Empty State ==================== */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 16px;
    border: 2px dashed #e5e7eb;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1d1d1f;
}

.empty-state p {
    margin: 0 0 20px;
    color: #6e6e73;
    font-size: 14px;
}

/* ==================== Detail View ==================== */

.sop-detail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.sop-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sop-delete-btn {
    color: #dc2626 !important;
}

.sop-delete-btn:hover {
    background: #fef2f2 !important;
}

.sop-detail-header {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.sop-detail-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sop-version-badge {
    background: #f0f0f5;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6e6e73;
}

.sop-category-badge {
    background: #eef2ff;
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.sop-dept-badge {
    background: #f5f5f7;
    color: #6e6e73;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.sop-detail-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
}

.sop-detail-desc {
    margin: 0 0 16px;
    font-size: 15px;
    color: #6e6e73;
    line-height: 1.6;
}

.sop-detail-duration {
    font-size: 14px;
    color: #6e6e73;
    background: #f5f5f7;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
}

/* ==================== Steps Section ==================== */

.sop-steps-section,
.sop-skills-section,
.sop-completions-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.sop-steps-section h3,
.sop-skills-section h3,
.sop-completions-section h3 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
}

.sop-steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sop-step-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid #0071e3;
}

.sop-step-number {
    width: 32px;
    height: 32px;
    background: #0071e3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.sop-step-content {
    flex: 1;
}

.sop-step-title {
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.sop-step-desc {
    font-size: 13px;
    color: #6e6e73;
    margin-bottom: 8px;
    line-height: 1.5;
}

.sop-step-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #8e8e93;
}

.sop-step-safety {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fef3c7;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
}

.sop-no-steps,
.sop-no-completions {
    color: #8e8e93;
    font-size: 14px;
    padding: 12px;
    text-align: center;
}

/* ==================== Skills Requirements ==================== */

.sop-skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sop-skill-req {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f5f5f7;
    border-radius: 10px;
}

.sop-skill-name {
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
}

.sop-skill-level {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* ==================== Completions ==================== */

.sop-completions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sop-completion-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 13px;
}

.sop-completion-user {
    flex: 1;
    font-weight: 500;
    color: #1d1d1f;
}

.sop-completion-score {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.sop-completion-date {
    color: #8e8e93;
}

.sop-completion-confirmed {
    color: #22c55e;
    font-size: 12px;
}

/* ==================== Completions Matrix ==================== */

.sop-completions-matrix-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    margin-top: 20px;
}

.sop-completions-table {
    border-collapse: collapse;
    font-size: 13px;
    min-width: 100%;
}

.sop-completions-table th,
.sop-completions-table td {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: center;
}

.sop-completions-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.sop-completions-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: white !important;
    min-width: 180px;
    text-align: left;
}

.sop-completions-table th.sticky-col {
    z-index: 4;
    background: #f9fafb !important;
}

.sop-matrix-header {
    cursor: pointer;
    max-width: 150px;
}

.sop-matrix-header:hover {
    background: #eef2ff !important;
}

.sop-matrix-title {
    display: block;
    font-size: 11px;
    line-height: 1.3;
}

.sop-cell {
    min-width: 80px;
}

.sop-cell.completed {
    background: #dcfce7;
    color: #166534;
    font-weight: 500;
}

.sop-cell.not-completed {
    background: #f9fafb;
    color: #d1d5db;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #1d1d1f;
}

.user-position {
    font-size: 11px;
    color: #6e6e73;
}

/* ==================== Modal Styles ==================== */

.sop-modal-wide {
    max-width: 95vw !important;
    width: 95vw;
    max-height: 95vh;
    height: 95vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sop-modal-body {
    flex: 1;
    overflow-y: auto;
}

.sop-form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.sop-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.sop-form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sop-form-section-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.sop-form-hint {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 8px;
}

/* Step Builder */
.sop-step-builder-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 10px;
}

.sop-step-builder-num {
    width: 28px;
    height: 28px;
    background: #0071e3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 6px;
}

.sop-step-builder-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sop-step-builder-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sop-step-builder-meta input {
    flex: 1;
    min-width: 100px;
}

.sop-step-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 6px;
}

.sop-step-remove:hover {
    background: #fecaca;
}

/* Skill Req Builder */
.sop-skill-builder-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

/* ==================== Buttons ==================== */

.btn-primary {
    background: #0071e3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0077ED;
}

.btn-secondary {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
    padding: 10px 20px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e8e8ed;
}

.btn-outline {
    background: transparent;
    color: #0071e3;
    border: 1px solid #0071e3;
    padding: 10px 20px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #0071e3;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    background: #0071e3;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-small:hover {
    background: #0077ED;
}

/* ==================== Form Inputs ==================== */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    .sop-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sop-grid {
        grid-template-columns: 1fr;
    }

    .sop-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .sop-filters select,
    .sop-search-wrap {
        width: 100%;
    }

    .sop-detail-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .form-row {
        flex-direction: column;
    }

    .sop-step-builder-meta {
        flex-direction: column;
    }

    .sop-modal-wide {
        max-width: 95vw !important;
        margin: 10px;
    }
}

/* ==================== Image Annotator ==================== */

.annotator-modal {
    max-width: 95vw !important;
    width: 95vw;
    max-height: 95vh;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

.annotator-modal .modal-body {
    flex: 1;
    overflow-y: auto;
}

.annotator-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f5f5f7;
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.annotator-tools {
    display: flex;
    gap: 6px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    border-color: #0071e3;
    background: #f0f7ff;
}

.tool-btn.active {
    border-color: #0071e3;
    background: #0071e3;
    color: white;
}

.annotator-colors {
    display: flex;
    gap: 6px;
}

.color-btn {
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #1d1d1f;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #1d1d1f;
}

.annotator-actions {
    display: flex;
    gap: 8px;
}

.annotator-canvas-wrapper {
    background: #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    flex: 1;
    overflow: auto;
}

.annotator-canvas-wrapper canvas {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Step Image Preview */
.sop-step-image-section {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.sop-step-image-preview {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    cursor: pointer;
}

.sop-step-image-preview:hover {
    border-color: #0071e3;
}

.btn-image {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-image:hover {
    background: #e8e8ed;
}

.btn-image.has-image {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

/* Detail view image */
.sop-step-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.sop-step-image:hover {
    transform: scale(1.02);
}

/* Image modal for full view */
.image-fullview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    cursor: zoom-out;
}

.image-fullview-modal img {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .annotator-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .annotator-tools,
    .annotator-colors,
    .annotator-actions {
        justify-content: center;
    }
}

/* ==================== TWI Table ==================== */

.twi-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
}

.twi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.twi-table th {
    background: #1d1d1f;
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.twi-table th small {
    font-weight: 400;
    opacity: 0.7;
}

.twi-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 12px;
    vertical-align: top;
}

.twi-table tr:last-child td {
    border-bottom: none;
}

.twi-table tr:hover td {
    background: #f9fafb;
}

.twi-num {
    font-weight: 700;
    text-align: center;
    color: #0071e3;
    font-size: 16px;
    width: 40px;
}

.twi-action strong {
    display: block;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.twi-desc {
    color: #6e6e73;
    font-size: 12px;
    margin-top: 4px;
}

.twi-safety {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.twi-keypoints, .twi-reasons {
    font-size: 13px;
    color: #1d1d1f;
    line-height: 1.4;
    white-space: pre-line;
}

.twi-empty {
    color: #d2d2d7;
}

.twi-tools, .twi-time {
    font-size: 12px;
    color: #6e6e73;
    white-space: nowrap;
}

.twi-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

.twi-thumb:hover {
    transform: scale(1.1);
}

.twi-col-num { width: 40px; }
.twi-col-action { min-width: 180px; }
.twi-col-keypoints { min-width: 160px; }
.twi-col-reasons { min-width: 140px; }
.twi-col-tools { width: 100px; }
.twi-col-time { width: 70px; }
.twi-col-photo { width: 80px; }

/* ==================== PPE Selector ==================== */

.ppe-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ppe-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
}

.ppe-chip input {
    display: none;
}

.ppe-chip.active {
    border-color: #0071e3;
    background: #eff6ff;
}

.ppe-chip:hover {
    border-color: #0071e3;
}

.ppe-label {
    font-size: 12px;
}

/* PPE Badges in detail */
.sop-ppe-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ppe-title {
    font-size: 12px;
    color: #6e6e73;
    font-weight: 600;
}

.ppe-badge {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f5f5f7;
    border-radius: 8px;
}

/* Detail timing & authors */
.sop-detail-timing {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.sop-detail-timing span {
    font-size: 13px;
    color: #6e6e73;
}

.sop-detail-authors {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 12px;
    color: #6e6e73;
}

.sop-steps-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.sop-steps-section-header h3 {
    margin: 0;
}

/* TWI Step Builder Fields */
.sop-step-twi-fields {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.sop-step-twi-fields textarea {
    flex: 1;
    font-size: 12px;
    min-height: 40px;
}

/* ==================== Quiz UI ==================== */

.quiz-questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.quiz-question-item {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 10px;
    align-items: flex-start;
}

.quiz-q-num {
    font-weight: 700;
    color: #0071e3;
    min-width: 24px;
}

.quiz-q-text {
    font-size: 14px;
    color: #1d1d1f;
}

.quiz-q-step {
    font-size: 11px;
    color: #6e6e73;
    margin-top: 2px;
}

.quiz-assignments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-assignment-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 13px;
}

.quiz-assign-status {
    font-size: 12px;
    font-weight: 500;
}

.quiz-assign-status.completed { color: #22c55e; }
.quiz-assign-status.pending { color: #f59e0b; }

.quiz-assign-score {
    font-weight: 700;
    color: #0071e3;
    font-size: 14px;
}

.quiz-my-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
}

.quiz-my-title {
    font-weight: 600;
    color: #1d1d1f;
}

.quiz-my-result {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-my-comment {
    font-size: 12px;
    color: #6e6e73;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quiz-answer-item {
    margin-bottom: 16px;
}

.quiz-answer-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1d1d1f;
    margin-bottom: 6px;
}

.quiz-answer-label small {
    font-weight: 400;
    color: #6e6e73;
}

/* Mobile TWI table */
@media (max-width: 600px) {
    .twi-table {
        font-size: 11px;
    }

    .twi-table th, .twi-table td {
        padding: 6px 8px;
    }

    .twi-col-reasons, .twi-col-tools {
        display: none;
    }

    .sop-step-twi-fields {
        flex-direction: column;
    }

    .ppe-chip {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* ==================== SOP Import from Document ==================== */

.import-procedures-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.import-procedure-card {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.import-procedure-card:hover {
    background: #f0f7ff;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.import-procedure-card strong {
    display: block;
    color: #1e293b;
}

.import-procedure-card p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
