/* SupervisionRecords Styles */

.sr-container {
    padding: 1.5rem;
    color: #372562;
    position: relative;
}

/* Loading */
.sr-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.sr-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ec5f59;
    border-radius: 50%;
    animation: sr-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes sr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sr-loading p {
    color: #372562;
    font-size: 0.95rem;
}

/* Error */
.sr-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sr-retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

.sr-retry-btn:hover {
    background: #b91c1c;
}

/* Toolbar */
.sr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sr-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sr-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sr-section-title {
    color: #372562;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.sr-back-btn {
    background: #F0F7F5;
    color: #372562;
    border: 1px solid #97c1bc;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.sr-back-btn:hover {
    background: #97c1bc;
    color: white;
}

.sr-new-btn {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.sr-new-btn:hover {
    opacity: 0.9;
}

.sr-guide-btn {
    background: #F0F7F5;
    color: #372562;
    border: 1px solid #97c1bc;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.sr-guide-btn:hover {
    background: #97c1bc;
    color: white;
}

.sr-guide-btn.active {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

/* Empty State */
.sr-empty {
    text-align: center;
    padding: 3rem 2rem;
}

.sr-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.sr-empty p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Record List Table */
.sr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sr-table thead th {
    background: #F0F7F5;
    color: #372562;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #97c1bc;
}

.sr-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #372562;
    vertical-align: middle;
}

.sr-row {
    cursor: pointer;
    transition: background 0.15s;
}

.sr-row:hover {
    background: #f9fafb;
}

.sr-muted {
    color: #999;
}

/* Status Badges */
.sr-status-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sr-status-draft {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.sr-status-shared {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fdc758;
}

.sr-status-signed_off {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

/* Action Buttons in Table */
.sr-view-btn {
    background: #F0F7F5;
    color: #372562;
    border: 1px solid #97c1bc;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-right: 0.35rem;
}

.sr-view-btn:hover {
    background: #97c1bc;
    color: white;
}

.sr-signoff-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.sr-signoff-btn:hover {
    opacity: 0.9;
}

/* ---- Form Styles ---- */

.sr-form-container {
    max-width: 1100px;
}

.sr-form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.sr-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sr-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sr-form-field label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #372562;
}

.sr-full-width {
    grid-column: 1 / -1;
}

.sr-input {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #372562;
    background: white;
    transition: border-color 0.2s;
    font-family: inherit;
}

.sr-input:focus {
    outline: none;
    border-color: #97c1bc;
}

.sr-input:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.sr-textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #372562;
    background: white;
    resize: none;
    overflow: hidden;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
    min-height: 2.5em;
}

.sr-textarea:focus {
    outline: none;
    border-color: #97c1bc;
}

.sr-textarea:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Discussion Table */
.sr-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sr-section-header h4 {
    margin: 0;
    color: #372562;
    font-size: 1rem;
    font-weight: 600;
}

.sr-add-row-btn {
    background: #F0F7F5;
    color: #372562;
    border: 1px solid #97c1bc;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.sr-add-row-btn:hover {
    background: #97c1bc;
    color: white;
}

.sr-discussion-table-wrapper {
    overflow-x: auto;
}

.sr-discussion-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.sr-discussion-table thead th {
    background: linear-gradient(135deg, #372562 0%, #3d3470 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.65rem 0.5rem;
    text-align: left;
    white-space: normal;
    line-height: 1.3;
}

.sr-discussion-table tbody td {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    vertical-align: top;
}

.sr-col-num {
    width: 35px;
    text-align: center;
    font-weight: 600;
    color: #372562;
}

.sr-col-topic,
.sr-col-analysis,
.sr-col-actions {
    width: 30%;
}

.sr-col-remove {
    width: 35px;
    text-align: center;
}

.sr-remove-row-btn {
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.sr-remove-row-btn:hover {
    background: #fee2e2;
}

/* Signatures */
.sr-signatures {
    background: #f9fafb;
    border: 1px dashed #97c1bc;
}

/* Sign-off Info */
.sr-signoff-info {
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #372562;
}

.sr-signoff-icon {
    font-size: 1.2rem;
}

/* Form Actions */
.sr-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sr-btn-draft {
    background: #F0F7F5;
    color: #372562;
    border: 2px solid #97c1bc;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.sr-btn-draft:hover:not(:disabled) {
    background: #97c1bc;
    color: white;
}

.sr-btn-draft:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sr-btn-share {
    background: linear-gradient(135deg, #fdc758 0%, #d4a43a 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.sr-btn-share:hover:not(:disabled) {
    opacity: 0.9;
}

.sr-btn-share:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Save Messages */
.sr-save-success {
    background: #dcfce7;
    color: #16a34a;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.sr-save-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ---- Sign-Off Modal ---- */
.sr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.sr-modal {
    background: white;
    border-radius: 12px;
    width: 460px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.sr-modal-header {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.sr-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.sr-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sr-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.sr-modal-body {
    padding: 1.25rem;
    color: #372562;
    font-size: 0.95rem;
}

.sr-modal-body p {
    margin: 0 0 0.75rem 0;
}

.sr-modal-note {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.sr-modal-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.sr-btn-cancel {
    background: white;
    color: #372562;
    border: 1px solid #ccc;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.sr-btn-cancel:hover {
    background: #f5f5f5;
}

.sr-btn-signoff {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.sr-btn-signoff:hover:not(:disabled) {
    opacity: 0.9;
}

.sr-btn-signoff:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Reflection Guide Panel ---- */
.sr-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10001;
    display: flex;
    justify-content: flex-end;
}

.sr-guide-panel {
    width: 420px;
    max-width: 90vw;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: sr-slide-in 0.25s ease-out;
}

@keyframes sr-slide-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.sr-guide-header {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sr-guide-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.sr-guide-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sr-guide-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.sr-guide-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.sr-guide-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sr-guide-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.sr-guide-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.sr-guide-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.sr-guide-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
}

/* STAR section colours */
.sr-guide-situation {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
}

.sr-guide-situation .sr-guide-letter {
    color: #ec5f59;
}

.sr-guide-task {
    background: linear-gradient(135deg, #fdc758 0%, #d4a43a 100%);
    color: white;
}

.sr-guide-task .sr-guide-letter {
    color: #fdc758;
}

.sr-guide-action {
    background: linear-gradient(135deg, #97c1bc 0%, #6fa89a 100%);
    color: white;
}

.sr-guide-action .sr-guide-letter {
    color: #97c1bc;
}

.sr-guide-reflect {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
}

.sr-guide-reflect .sr-guide-letter {
    color: #7c3aed;
}

.sr-guide-prompt {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #372562;
    font-style: italic;
}

.sr-guide-questions {
    padding: 0.25rem 1rem 0.75rem 2rem;
    margin: 0;
    list-style: disc;
}

.sr-guide-questions li {
    font-size: 0.85rem;
    color: #372562;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.sr-guide-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .sr-container {
        padding: 1rem;
    }

    .sr-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .sr-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .sr-form-grid {
        grid-template-columns: 1fr;
    }

    .sr-form-actions {
        flex-direction: column;
    }

    .sr-guide-panel {
        width: 100%;
        max-width: 100vw;
    }

    .sr-table {
        font-size: 0.8rem;
    }

    .sr-table thead th,
    .sr-table tbody td {
        padding: 0.5rem 0.5rem;
    }
}

/* Signature Checkbox + Image */
.sr-signature-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #372562;
    font-weight: 500 !important;
    margin-top: 0.5rem;
}

.sr-signature-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #22c55e;
}

.sr-signature-box {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    background: #f9fafb;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.sr-signature-active {
    border-color: #22c55e;
    background: #f0fdf4;
}

.sr-signature-img {
    max-height: 50px;
    max-width: 200px;
    object-fit: contain;
}

.sr-signature-name {
    font-weight: 600;
    font-size: 1rem;
    color: #372562;
    font-style: italic;
}

.sr-signature-date {
    font-size: 0.75rem;
    color: #16a34a;
    font-weight: 600;
}

.sr-signature-pending {
    font-size: 0.8rem;
    color: #92400e;
    background: #fffbeb;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #fdc758;
    margin-top: 0.5rem;
    font-style: italic;
}
