/* ==========================================================================
   Transfer Eval SaaS — Design System
   ========================================================================== */

/* --- Reset & Variables --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* EligibilityIQ brand — Navy #1D2A4D + Green #6A9739 (platform-wide, not per-tenant) */
    --primary-color: #1D2A4D;
    --secondary-color: #6A9739;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --verify-color: #2563eb;

    /* Neutrals */
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* --- Typography --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    min-height: 100vh;
    padding: var(--space-lg);
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
small { font-size: 0.85rem; color: var(--gray-600); }

/* --- Layout --- */
.page-container {
    max-width: 920px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-body {
    padding: var(--space-xl);
}

/* --- Header --- */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(255,255,255,0.08) 100%), var(--primary-color);
    color: white;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.site-header .brand-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.site-header .brand-text h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.site-header .brand-text p {
    font-size: 0.85rem;
    opacity: 0.85;
}

.site-header .header-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.25);
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: var(--space-md) var(--space-xl);
    color: var(--gray-500);
    font-size: 0.8rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-footer a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--primary-color);
}

.powered-by {
    opacity: 0.7;
    font-size: 0.75rem;
}

/* --- Form Sections --- */
.form-section {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--secondary-color);
    border-radius: 2px;
    flex-shrink: 0;
}

.form-section h3 .section-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 48, 87, 0.1);
}

.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-row .form-group {
    flex: 1;
}

/* --- Checkboxes --- */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    cursor: pointer;
    font-weight: 400;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(255,255,255,0.12) 100%), var(--primary-color);
    color: white;
    padding: 13px 28px;
}

.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(29, 42, 77, 0.3);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(29, 42, 77, 0.2);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
}

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

.btn-success:hover {
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-400);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-500);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    background: var(--gray-50);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(29, 42, 77, 0.06), var(--shadow-sm);
}

.drop-zone .drop-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    opacity: 0.35;
}

.drop-zone p {
    color: var(--gray-600);
    margin-bottom: var(--space-xs);
}

.drop-zone .file-name {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: var(--space-sm);
    background: rgba(29, 42, 77, 0.06);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
}

.drop-zone .file-name:empty {
    display: none;
}

.drop-zone .file-name:not(:empty)::before {
    content: "\2713 ";
    color: var(--success-color);
}

/* File-loaded state */
.drop-zone.has-file {
    border-style: solid;
    border-color: #6A9739;
    background: rgba(106, 151, 57, 0.06);
}
.drop-zone.has-file .drop-icon,
.drop-zone.has-file p,
.drop-zone.has-file > small,
.drop-zone.has-file .file-name { display: none !important; }
.drop-zone.has-file .file-loaded { display: flex !important; }

.drop-zone .file-loaded {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    width: 100%;
}
.drop-zone .file-loaded-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #6A9739;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.drop-zone .file-loaded-icon svg { color: #fff; }
.drop-zone .file-loaded-info {
    flex: 1; text-align: left; min-width: 0;
}
.drop-zone .file-loaded-name {
    font-weight: 600; font-size: 0.88rem; color: var(--gray-900);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drop-zone .file-loaded-meta {
    font-size: 0.75rem; color: var(--gray-500); margin-top: 2px;
}
.drop-zone .file-loaded-change {
    font-size: 0.78rem; color: var(--primary-color); font-weight: 500;
    white-space: nowrap;
}

#fileInput {
    display: none;
}

/* --- Mode Tabs --- */
.mode-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-md);
}

.mode-tab {
    flex: 1;
    padding: 12px var(--space-md);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    text-align: center;
    color: var(--gray-600);
    transition: all var(--transition-fast);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mode-tab-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.mode-tab-desc {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
}

.mode-tab:hover {
    color: var(--gray-800);
}

.mode-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.mode-tab.active .mode-tab-desc {
    opacity: 0.6;
    color: var(--gray-600);
}

/* --- LLM Badge --- */
.llm-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--success-color);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: var(--space-xs);
}

.llm-badge.unavailable {
    background: var(--danger-color);
}

/* --- Progress Indicator (replaces spinner) --- */
.progress-panel {
    display: none;
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
}

.progress-panel.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin-ring 0.9s linear infinite;
}

.progress-status {
    font-size: 1rem;
    color: var(--gray-600);
    transition: opacity 0.3s ease;
}

.progress-status.fade-in {
    animation: fade-in-text 0.4s ease;
}

@keyframes spin-ring {
    to { transform: rotate(360deg); }
}

@keyframes fade-in-text {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Context Bar (shown above results/review) --- */
.eval-context-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.eval-context-bar.show {
    display: flex;
}

.context-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--gray-600);
}

.context-file {
    font-weight: 600;
    color: var(--gray-800);
}

.context-sep {
    color: var(--gray-400);
}

/* --- Results Panel --- */
.results-panel {
    display: none;
}

.results-panel.show {
    display: block;
    animation: panel-enter 0.35s ease;
}

.results-summary {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border: 1.5px solid var(--gray-200);
    border-top: 3px solid var(--secondary-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.results-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.results-header .check-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.results-header h3 {
    color: var(--gray-800);
    margin-bottom: 2px;
}

.results-header p {
    font-size: 0.85rem;
    color: var(--gray-600);
}

@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes panel-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Breakdown rows — compact list style */
.results-breakdown {
    margin-bottom: var(--space-md);
}

.breakdown-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

.breakdown-row + .breakdown-row {
    margin-top: 2px;
}

.breakdown-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.breakdown-label {
    flex: 1;
    color: var(--gray-700);
}

.breakdown-value {
    font-weight: 600;
    color: var(--gray-800);
    margin-left: var(--space-md);
    white-space: nowrap;
}

.breakdown-row.success { background: #f0fdf4; }
.breakdown-row.success .breakdown-dot { background: var(--success-color); }
.breakdown-row.success .breakdown-value { color: #15803d; }

.breakdown-row.warning { background: #fffbeb; }
.breakdown-row.warning .breakdown-dot { background: #f59e0b; }
.breakdown-row.warning .breakdown-value { color: #b45309; }

.breakdown-row.danger { background: #fef2f2; }
.breakdown-row.danger .breakdown-dot { background: var(--danger-color); }
.breakdown-row.danger .breakdown-value { color: #b91c1c; }

.breakdown-row.muted { background: var(--gray-50); }
.breakdown-row.muted .breakdown-dot { background: var(--gray-400); }
.breakdown-row.muted .breakdown-value { color: var(--gray-600); }

.results-advisory {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-style: italic;
    margin: var(--space-md) 0 var(--space-lg);
    line-height: 1.4;
}

/* Download buttons — gradient style from legacy app */
.results-downloads {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-link:hover {
    transform: translateY(-2px);
}

.download-link.docx {
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(255,255,255,.12) 100%), var(--primary-color);
}
.download-link.docx:hover {
    box-shadow: 0 5px 15px rgba(29, 42, 77, 0.35);
}

.download-link.csv {
    background: linear-gradient(135deg, var(--secondary-color) 0%, rgba(255,255,255,.12) 100%), var(--secondary-color);
}
.download-link.csv:hover {
    box-shadow: 0 5px 15px rgba(106, 151, 57, 0.35);
}

.download-link.new-eval {
    background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-700) 100%);
}
.download-link.new-eval:hover {
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

/* --- Review Panel --- */
.review-panel {
    display: none;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}

.review-panel.show {
    display: block;
    animation: panel-enter 0.35s ease;
}

.review-panel-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem 1.5rem;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}

.review-panel-header .review-icon {
    font-size: 1.1rem;
}

.review-panel-header h3 {
    color: #92400e;
    font-size: .88rem;
    font-weight: 600;
    margin: 0;
}

.review-panel-header .review-count {
    margin-left: auto;
    background: #fbbf24;
    color: #78350f;
    font-size: .75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
}

.review-panel .review-subtitle {
    color: var(--gray-600);
    font-size: .82rem;
    padding: .75rem 1.5rem 0;
    margin-bottom: 0;
}

.review-table-wrap {
    padding: .75rem 1.5rem 1rem;
    overflow-x: auto;
}

.review-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
}

.review-table th {
    background: #f8f9fa;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
    white-space: nowrap;
}

.review-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

.review-table tbody tr {
    background: #fff;
    transition: background .1s;
}

.review-table tbody tr:hover {
    background: #f8f9fa;
}

.review-table input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.84rem;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.review-table input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(29,42,77,.08);
}

.review-table .issue-text {
    color: #b45309;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

.review-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: .75rem 1.5rem 1.25rem;
    border-top: 1px solid #f1f3f5;
}

.btn-confirm {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 9px 22px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    transition: opacity .15s;
}

.btn-confirm:hover {
    opacity: .9;
}

.btn-skip {
    background: none;
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 8px 18px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    transition: all .15s;
}

.btn-skip:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-delete-row {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: color .15s;
}

.btn-delete-row:hover {
    color: #dc3545;
}

.review-row-flagged {
    background: #fffbeb !important;
}

.btn-delete-row:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* --- Queue Status --- */
.queue-status {
    display: none;
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
}

.queue-status.show {
    display: block;
}

.queue-status h4 {
    margin-bottom: var(--space-sm);
    color: var(--primary-color);
    font-size: 0.95rem;
}

.queue-list {
    list-style: none;
}

.queue-list li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.9rem;
}

.queue-list li:last-child {
    border-bottom: none;
}

/* --- Error --- */
.error-panel,
.error-card {
    background: #fef2f2;
    color: #991b1b;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
    border: 1px solid #fecaca;
    border-left: 4px solid var(--danger-color);
    font-size: 0.9rem;
    display: none;
}

/* --- Consent --- */
.consent-details {
    margin-top: var(--space-sm);
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.6;
    border: 1px solid var(--gray-200);
}

.consent-toggle {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.consent-toggle:hover {
    text-decoration: underline;
}

/* --- Tenant Selection Page --- */
.tenant-select-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1D2A4D 0%, #2a3d66 100%);
}

.tenant-select-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2xl);
    max-width: 560px;
    width: 100%;
    text-align: center;
}

.tenant-select-container h1 {
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    font-size: 1.8rem;
}

.tenant-select-container .subtitle {
    color: var(--gray-500);
    margin-bottom: var(--space-xl);
    font-size: 1rem;
}

.tenant-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.tenant-link {
    display: block;
    padding: var(--space-lg) var(--space-xl);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--gray-900);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

.tenant-link:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tenant-link .slug {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: var(--space-xs);
}

/* --- PII Preview Panel --- */
.pii-preview-panel {
    animation: fadeIn 0.3s ease;
}

.pii-summary-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.pii-summary-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    color: var(--primary-color);
}

.pii-summary-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.pii-summary-card > p {
    font-size: 0.88rem;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.pii-entity-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.pii-entity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
}

.pii-entity-badge.person { background: #fef3c7; color: #92400e; }
.pii-entity-badge.ssn { background: #fee2e2; color: #991b1b; }
.pii-entity-badge.dob { background: #fce7f3; color: #9d174d; }
.pii-entity-badge.email { background: #dbeafe; color: #1e40af; }
.pii-entity-badge.phone { background: #d1fae5; color: #065f46; }
.pii-entity-badge.address { background: #ede9fe; color: #5b21b6; }
.pii-entity-badge.id { background: #ffedd5; color: #9a3412; }

.pii-warnings {
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: #92400e;
}

.pii-preview-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
}

/* Force-preview banner */
.pii-force-banner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius-lg);
    color: #92400e;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
}
.pii-force-banner.blocked {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Verification status badge */
.pii-verification {
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
}
.pii-verification.passed { background: #d1fae5; color: #065f46; }
.pii-verification.failed { background: #fee2e2; color: #991b1b; }

/* Sanitized page thumbnail gallery */
.pii-thumbnail-gallery {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--space-sm);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.pii-page-card {
    border: none;
    border-radius: 0;
    overflow: hidden;
}
.pii-page-card + .pii-page-card {
    border-top: 1px solid var(--gray-200);
}
.pii-page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
    padding: 4px var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-100);
}
.pii-page-wrapper {
    position: relative;
    line-height: 0;
}
.pii-page-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: #888;
    font-size: 0.9rem;
    gap: 12px;
}
.pii-spinner-icon {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #1D2A4D;
    border-radius: 50%;
    animation: pii-spin 0.8s linear infinite;
}
@keyframes pii-spin {
    to { transform: rotate(360deg); }
}
.pii-page-img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.2s ease;
}
.pii-redact-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    z-index: 1;
}
.pii-redact-undo {
    background: #fff;
    border: 1px solid #dc2626;
    color: #dc2626;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.pii-redact-undo:hover {
    background: #fef2f2;
}
.pii-apply-btn {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}
.pii-apply-btn:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}
.pii-apply-btn:disabled {
    background: #9ca3af !important;
    border-color: #9ca3af !important;
    cursor: not-allowed;
}

/* Flag Missed PII section */
.pii-flag-section {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--gray-100);
}
.pii-flag-link {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-decoration: underline;
}
.pii-flag-link:hover { color: var(--gray-700); }
.pii-flag-form {
    margin-top: var(--space-sm);
}
.pii-flag-note {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: var(--space-xs);
}
.pii-flag-form textarea {
    width: 100%;
    font-size: 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    resize: vertical;
}

/* Sticky action bar — floats at bottom of viewport during scroll */
.pii-sticky-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    z-index: 10;
    margin: 0 calc(-1 * var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}
.pii-sticky-btn {
    padding: .5rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    font-size: .85rem;
    cursor: pointer;
}
.pii-sticky-cancel:hover { background: var(--gray-50); }
.pii-sticky-undo {
    border-color: #dc2626;
    color: #dc2626;
    font-weight: 600;
}
.pii-sticky-undo:hover { background: #fef2f2; }

/* Shared submit button for PII preview sticky bar (used by both Transfer Credit and NCAA) */
.eval-submit-btn {
    padding: .75rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .15s;
}
.eval-submit-btn:hover { opacity: .9; }
.eval-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

.pii-preview-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-200);
    margin-top: var(--space-sm);
}
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Universal Focus Ring --- */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
}

/* --- Shared Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes subtlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .6; }
}

/* --- Responsive --- */
@media (max-width: 640px) {
    body { padding: var(--space-sm); }
    .card-body { padding: var(--space-md); }
    .site-header { padding: var(--space-md); flex-direction: column; gap: var(--space-sm); }
    .form-row { flex-direction: column; gap: 0; }
    .results-stats { grid-template-columns: repeat(2, 1fr); }
    .results-downloads { flex-direction: column; }
    .site-footer { flex-direction: column; gap: var(--space-xs); }
}
