/* ========================================
   MANAGE COMPANIES PAGE STYLES
   ======================================== */

/* Colors and variables inherited from base.css */
/* Sidebar styles inherited from navigation.css */

/* Page root for scoping */
.page--manage-companies,
.page--runs-cis,
.page--runs-portfolio {
    --transition-speed: 0.3s;
}

.page--manage-companies .manage-main,
.page--runs-cis .manage-main,
.page--runs-portfolio .manage-main {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.page--manage-companies .header-top,
.page--runs-cis .header-top,
.page--runs-portfolio .header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ========================================
   HEADER
   ======================================== */

.page--manage-companies .back-link,
.page--runs-cis .back-link,
.page--runs-portfolio .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
    transition: transform var(--transition-speed);
}

.page--manage-companies .back-link:hover,
.page--runs-cis .back-link:hover,
.page--runs-portfolio .back-link:hover {
    transform: translateX(-4px);
}

/* ========================================
   ACTIONS SECTION
   ======================================== */

.actions-section {
    margin-bottom: 1.5rem;
}

.page--manage-companies .actions-header,
.page--runs-cis .actions-header,
.page--runs-portfolio .actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page--manage-companies .actions-header h2,
.page--runs-cis .actions-header h2,
.page--runs-portfolio .actions-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page--manage-companies .actions-buttons,
.page--runs-cis .actions-buttons,
.page--runs-portfolio .actions-buttons {
    display: flex;
    gap: 1rem;
}

/* Add Button */
.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed, 0.3s);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-add:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-add svg {
    width: 20px;
    height: 20px;
}

.page--manage-companies .btn-export,
.page--runs-cis .btn-export,
.page--runs-portfolio .btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-warning);
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.35);
}

.page--manage-companies .btn-export:hover,
.page--runs-cis .btn-export:hover,
.page--runs-portfolio .btn-export:hover {
    background: var(--color-warning-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(217, 119, 6, 0.45);
}

/* ========================================
   SEARCH AND FILTER
   ======================================== */

.page--manage-companies .search-filter-bar,
.page--runs-cis .search-filter-bar,
.page--runs-portfolio .search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page--manage-companies .search-input,
.page--runs-cis .search-input,
.page--runs-portfolio .search-input {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.page--manage-companies .search-input:hover,
.page--manage-companies .search-input:focus,
.page--runs-cis .search-input:hover,
.page--runs-cis .search-input:focus,
.page--runs-portfolio .search-input:hover,
.page--runs-portfolio .search-input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.page--manage-companies .filter-select,
.page--runs-cis .filter-select,
.page--runs-portfolio .filter-select {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-speed);
    min-width: 200px;
}

.page--manage-companies .filter-select:hover,
.page--manage-companies .filter-select:focus,
.page--runs-cis .filter-select:hover,
.page--runs-cis .filter-select:focus,
.page--runs-portfolio .filter-select:hover,
.page--runs-portfolio .filter-select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

/* ========================================
   COMPANIES TABLE
   ======================================== */

.companies-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.page--manage-companies .table-container,
.page--runs-cis .table-container,
.page--runs-portfolio .table-container {
    overflow-x: auto;
}

.page--manage-companies .companies-table,
.page--runs-cis .companies-table,
.page--runs-portfolio .companies-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.page--manage-companies .companies-table thead,
.page--runs-cis .companies-table thead,
.page--runs-portfolio .companies-table thead {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
}

/* Rounded corners on table header */
.page--manage-companies .companies-table thead,
.page--runs-cis .companies-table thead,
.page--runs-portfolio .companies-table thead {
    border-radius: 8px 8px 0 0;
}

.page--manage-companies .companies-table thead tr th:first-child,
.page--runs-cis .companies-table thead tr th:first-child,
.page--runs-portfolio .companies-table thead tr th:first-child {
    border-top-left-radius: 8px;
}

.page--manage-companies .companies-table thead tr th:last-child,
.page--runs-cis .companies-table thead tr th:last-child,
.page--runs-portfolio .companies-table thead tr th:last-child {
    border-top-right-radius: 8px;
}

/* Also round the bottom of the table */
.page--manage-companies .companies-table tbody tr:last-child td:first-child,
.page--runs-cis .companies-table tbody tr:last-child td:first-child,
.page--runs-portfolio .companies-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.page--manage-companies .companies-table tbody tr:last-child td:last-child,
.page--runs-cis .companies-table tbody tr:last-child td:last-child,
.page--runs-portfolio .companies-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.page--manage-companies .companies-table th,
.page--runs-cis .companies-table th,
.page--runs-portfolio .companies-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Column styling - let table auto-size */
.page--manage-companies .companies-table th,
.page--manage-companies .companies-table td,
.page--runs-cis .companies-table th,
.page--runs-cis .companies-table td,
.page--runs-portfolio .companies-table th,
.page--runs-portfolio .companies-table td {
    white-space: nowrap;
}

.page--manage-companies .companies-table th:nth-child(9),
.page--manage-companies .companies-table td:nth-child(9),
.page--runs-cis .companies-table th:nth-child(9),
.page--runs-cis .companies-table td:nth-child(9),
.page--runs-portfolio .companies-table th:nth-child(9),
.page--runs-portfolio .companies-table td:nth-child(9) {
    width: 80px;
}

/* Add title attribute on hover for full email visibility */
.page--manage-companies .companies-table td,
.page--runs-cis .companies-table td,
.page--runs-portfolio .companies-table td {
    position: relative;
}

.page--manage-companies .companies-table tbody tr,
.page--runs-cis .companies-table tbody tr,
.page--runs-portfolio .companies-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-speed);
}

.page--manage-companies .companies-table tbody tr:hover,
.page--runs-cis .companies-table tbody tr:hover,
.page--runs-portfolio .companies-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.page--manage-companies .companies-table td,
.page--runs-cis .companies-table td,
.page--runs-portfolio .companies-table td {
    padding: 1.25rem 1rem;
    color: var(--text-secondary);
}

.company-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.assessment-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-complete {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-partial {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-not-started {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-dnr {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Did Not Respond badge next to company name */
.dnr-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 6px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* Run Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.status-in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.status-complete {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.status-archived {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Assessment Type Badges */
.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
}

.type-badge.type-portfolio {
    background: rgba(139, 92, 246, 0.1);
    color: var(--portfolio-primary);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.type-badge.type-cis {
    background: rgba(16, 185, 129, 0.1);
    color: var(--cis-primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.type-badge.type-both {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Run Name Link */
.run-name-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.run-name-link:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* View Results Button */
.btn-icon.btn-view {
    background: rgba(16, 185, 129, 0.1);
    color: var(--cis-primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-icon.btn-view:hover {
    background: var(--cis-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.page--manage-companies .table-actions,
.page--runs-cis .table-actions,
.page--runs-portfolio .table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-icon:hover {
    transform: translateY(-2px);
}

.btn-icon.btn-edit {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-icon.btn-edit:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-icon.btn-responses {
    background: rgba(16, 185, 129, 0.1);
    color: var(--cis-primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-icon.btn-responses:hover {
    background: var(--cis-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-icon.btn-survey {
    background: rgba(139, 92, 246, 0.1);
    color: var(--portfolio-primary);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.btn-icon.btn-survey:hover {
    background: var(--portfolio-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-icon.btn-cis {
    background: rgba(6, 182, 212, 0.1);
    color: var(--color-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.btn-icon.btn-cis:hover {
    background: var(--color-cyan);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.btn-icon.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-icon.btn-delete:hover {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state svg {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ========================================
   MODAL
   ======================================== */

.page--manage-companies .modal,
.page--runs-cis .modal,
.page--runs-portfolio .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.page--manage-companies .modal.active,
.page--runs-cis .modal.active,
.page--runs-portfolio .modal.active {
    display: flex;
}

.page--manage-companies .modal-content,
.page--runs-cis .modal-content,
.page--runs-portfolio .modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

.page--manage-companies .modal-small,
.page--runs-cis .modal-small,
.page--runs-portfolio .modal-small {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page--manage-companies .modal-header,
.page--runs-cis .modal-header,
.page--runs-portfolio .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.page--manage-companies .modal-header h2,
.page--runs-cis .modal-header h2,
.page--runs-portfolio .modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page--manage-companies .modal-close,
.page--runs-cis .modal-close,
.page--runs-portfolio .modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--transition-speed);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page--manage-companies .modal-close:hover,
.page--runs-cis .modal-close:hover,
.page--runs-portfolio .modal-close:hover {
    color: var(--text-primary);
}

.page--manage-companies .modal-body,
.page--runs-cis .modal-body,
.page--runs-portfolio .modal-body {
    padding: 2rem;
}

.page--manage-companies .modal-form,
.page--runs-cis .modal-form,
.page--runs-portfolio .modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-input {
    padding: 0.875rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.form-input:hover {
    border-color: var(--accent-primary);
}

.form-input:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.delete-warning {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.delete-note {
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.page--manage-companies .modal-footer,
.page--runs-cis .modal-footer,
.page--runs-portfolio .modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: var(--color-danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: toastSlideIn 0.3s ease-out;
}

.toast.show {
    display: flex;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    background: var(--color-success);
}

.toast.error .toast-icon {
    background: var(--color-danger);
}

.toast.success .toast-icon::before {
    content: '✓';
    color: white;
    font-weight: bold;
}

.toast.error .toast-icon::before {
    content: '✕';
    color: white;
    font-weight: bold;
}

#toastMessage {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .manage-container {
        padding: 1rem;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .actions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-filter-bar {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .companies-table {
        display: block;
        overflow-x: auto;
    }

    .table-actions {
        flex-direction: column;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* ========================================
   RESPONSES PAGE STYLES
   ======================================== */

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Status Badges - Simple color variants */
.status-badge.success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon.danger {
    color: var(--color-danger);
}

.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Modal Large */
.page--manage-companies .modal-large,
.page--runs-cis .modal-large,
.page--runs-portfolio .modal-large {
    max-width: 900px;
    max-height: 90vh;
}

.page--manage-companies .modal-large .modal-body,
.page--runs-cis .modal-large .modal-body,
.page--runs-portfolio .modal-large .modal-body {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

/* Survey Form */
.survey-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.survey-domain {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
}

.domain-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.survey-question {
    margin-bottom: 1rem;
}

.survey-question:last-child {
    margin-bottom: 0;
}

.question-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.question-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

/* Rating Options */
.rating-options {
    display: flex;
    gap: 0.5rem;
}

.rating-option {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.rating-option input {
    display: none;
}

.rating-option span {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    transition: all 0.2s ease;
}

.rating-option input:checked + span {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.rating-option:hover span {
    border-color: var(--accent-primary);
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.form-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.form-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
}

.slider-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
}

/* Form Help Text */
.form-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ========================================
   EXPANDABLE SURVEY ROWS
   ======================================== */

.name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-expand {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.btn-expand:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-expand svg {
    transition: transform 0.2s ease;
}

.btn-expand.expanded svg {
    transform: rotate(90deg);
}

tr.expanded {
    background: var(--bg-tertiary);
}

tr.expanded-row {
    background: var(--bg-secondary);
}

tr.expanded-row td {
    padding: 0;
    border-top: none;
}

.expanded-content {
    padding: 1rem 1.5rem 1rem 3rem;
    border-left: 3px solid var(--accent-primary);
    margin-left: 1rem;
}

.expanded-description {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.expanded-description.no-description {
    font-style: italic;
    color: var(--text-muted);
}

.expanded-companies h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.company-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.company-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.85rem;
}

.company-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 0.5rem;
}

.company-score {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.score-high {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success);
}

.score-medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}

.score-low {
    background: rgba(249, 115, 22, 0.2);
    color: var(--color-orange);
}

.score-critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
}

/* Type badges for survey types */
.type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.type-portfolio {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-info);
}

.type-cis {
    background: rgba(139, 92, 246, 0.2);
    color: var(--portfolio-primary);
}

.type-both {
    background: rgba(236, 72, 153, 0.2);
    color: var(--color-pink);
}

/* Textarea in modal */
textarea.form-input {
    resize: vertical;
    min-height: 80px;
}
