:root {
    --primary: #5A47E0;
    --primary-dark: #4836C7;
    --primary-light: #7B68EE;
    --secondary: #D2389D;
    --tertiary: #EF4C68;
    --dark: #18191F;
    --gray-dark: #474C55;
    --gray: #696F7C;
    --gray-light: #EBECF0;
    --light: #F9FAFC;
    --success: #20C933;
    --warning: #FFBD3D;
    --danger: #FF5C5C;
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

input, select, textarea, button {
    font-family: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    border: 1px solid var(--gray-light);
    outline: none;
    background: var(--white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(90,71,224,0.1);
}

input[type="checkbox"] {
    border: 1px solid var(--gray);
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

body {
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--tertiary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* Top Navigation */
.top-nav {
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-link {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.module-title {
    font-size: 20px;
    font-weight: 600;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: var(--light);
    border-radius: 20px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light);
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-light);
    color: var(--dark);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar-left {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.sidebar-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 13px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-light);
}

.btn-create-template {
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    border: 2px solid var(--primary);
    background: rgba(90,71,224,0.1);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-create-template:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90,71,224,0.3);
}

.btn-create-template span {
    font-size: 18px;
    font-weight: 700;
}

.antibody-btn {
    border-color: var(--primary);
    background: rgba(90,71,224,0.1);
}

.antibody-btn:hover {
    background: var(--primary);
}

.antigen-btn {
    border-color: var(--secondary);
    background: rgba(210,56,157,0.1);
    color: var(--secondary);
}

.antigen-btn:hover {
    background: var(--secondary);
    color: white;
}

.template-type-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.template-type-badge.antibody {
    background: rgba(90,71,224,0.2);
    color: var(--primary);
}

.template-type-badge.antigen {
    background: rgba(210,56,157,0.2);
    color: var(--secondary);
}

.templates-section {
    margin-bottom: 25px;
}

.templates-section h3 {
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-light);
}

.template-card.selected {
    border: 3px solid var(--primary);
    box-shadow: 0 6px 20px rgba(90,71,224,0.3);
}

.antigen-card.selected {
    border: 3px solid var(--secondary);
    box-shadow: 0 6px 20px rgba(210,56,157,0.3);
}

.template-badge.verified.antigen {
    background: rgba(210,56,157,0.2);
    color: var(--secondary);
}

.empty-msg {
    text-align: center;
    color: var(--gray);
    padding: 20px;
}

/* CDR IDs display */
.cdr-section {
    background: rgba(90,71,224,0.05);
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
}

.cdr-section h4 {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 8px;
}

.cdr-ids-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cdr-id {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(90,71,224,0.2);
    color: var(--primary);
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.template-id-value {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: var(--primary);
}

.cdr-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cdr-detail-table th {
    background: var(--light);
    padding: 8px;
    text-align: left;
    font-weight: 600;
}

.cdr-detail-table td {
    padding: 8px;
    border-bottom: 1px solid var(--gray-light);
}

.cdr-detail-table td:nth-child(2) {
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-weight: 600;
}

/* CDR Edit Modal */
.cdr-current-display {
    background: rgba(90,71,224,0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.cdr-current-display h4 {
    font-size: 13px;
    color: var(--gray-dark);
    margin-bottom: 8px;
}

.cdr-edit-section {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.cdr-edit-section h3 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--gray-light);
    padding-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--gray-light);
    border-radius: 6px;
    font-size: 14px;
}

.form-row input:focus {
    border-color: var(--primary);
    outline: none;
}

.rejected-template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255,92,92,0.05);
    border: 1px solid rgba(255,92,92,0.2);
    border-radius: 8px;
    margin-bottom: 10px;
}

.rejected-template-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rejected-template-info strong {
    color: var(--primary);
}

.rejected-by {
    font-size: 12px;
    color: var(--gray);
}

.btn-edit-rejected {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}

.btn-edit-rejected:hover {
    background: var(--primary-dark);
}

/* CDR Preview and Edit in Create Modal */
.cdr-preview-section {
    background: rgba(90,71,224,0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--primary);
}

.cdr-preview-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.cdr-preview-section h4 {
    font-size: 13px;
    margin: 15px 0 8px 0;
}

.cdr-comparison-section {
    background: rgba(210,56,157,0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--secondary);
}

.cdr-comparison-section h3 {
    color: var(--secondary);
    margin-bottom: 15px;
}

.cdr-comparison-section h4 {
    font-size: 14px;
    margin: 20px 0 10px 0;
    color: var(--dark);
}

.cdr-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.cdr-comparison-table th {
    background: var(--secondary);
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
}

.cdr-comparison-table th:first-child {
    width: 80px;
}

.cdr-comparison-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-light);
    font-size: 13px;
}

.cdr-comparison-table td.region-label {
    font-weight: 600;
    color: var(--dark);
}

.cdr-comparison-table td.seq-cell {
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-weight: 500;
}

.cdr-comparison-table .cdr-pos {
    display: block;
    font-size: 11px;
    color: var(--gray);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    margin-top: 2px;
}

.cdr-comparison-table tr:hover {
    background: var(--light);
}

.cdr-ids-display {
    margin-bottom: 15px;
}

.cdr-ids-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cdr-edit-inline {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.cdr-row-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.cdr-row-edit label {
    font-weight: 600;
    min-width: 50px;
}

.cdr-row-edit input {
    padding: 6px 10px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 14px;
}

.cdr-seq-preview {
    color: var(--primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    margin-left: 10px;
}

.fr-preview {
    margin-top: 15px;
}

.fr-info {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--gray);
}

.fr-info span {
    padding: 4px 10px;
    background: rgba(32,201,51,0.1);
    border-radius: 4px;
}

.info-text {
    color: var(--primary);
    font-size: 13px;
    margin-bottom: 15px;
}

/* Verification Modal - Full CDR Details */
.template-id-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.cdr-full-details {
    background: rgba(90,71,224,0.05);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.cdr-full-details h4 {
    color: var(--primary);
    margin-bottom: 12px;
}

.cdr-full-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cdr-full-table th {
    background: rgba(90,71,224,0.2);
    color: var(--dark);
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
}

.cdr-full-table td {
    padding: 8px;
    border-bottom: 1px solid var(--gray-light);
}

.cdr-full-table tr.cdr-row {
    background: rgba(90,71,224,0.05);
}

.cdr-full-table tr.fr-row {
    background: rgba(32,201,51,0.05);
}

.cdr-id-cell {
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-weight: 700;
}

.fr-id-cell {
    font-family: 'Courier New', monospace;
    color: var(--success);
    font-weight: 600;
}

.cdr-full-table .seq-cell {
    font-family: 'Courier New', monospace;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-data {
    color: var(--gray);
    text-align: center;
    padding: 20px;
}

.job-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    color: white;
}

.job-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.job-id {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.progress-steps {
    margin-bottom: 20px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    position: relative;
}

.step-item::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 50px;
    width: 2px;
    height: 20px;
    background: var(--gray-light);
}

.step-item:last-child::before {
    display: none;
}

.step-item:hover {
    background: var(--light);
}

.step-item.active {
    background: rgba(90,71,224,0.1);
}

.step-item.active .step-icon {
    background: var(--primary);
    color: white;
}

.step-item.completed .step-icon {
    background: var(--success);
    color: white;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.step-info {
    flex: 1;
}

.step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.step-desc {
    font-size: 12px;
    color: var(--gray);
}

/* Content Area */
.content-area {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    min-height: 600px;
}

#content-wrapper {
    max-width: 900px;
}

/* Right Sidebar */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-card, .stats-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    position: sticky;
    top: 90px;
}

.help-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark);
}

.help-content {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.6;
}

.help-content p {
    margin-bottom: 10px;
}

.help-content ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.stats-card {
    background: linear-gradient(135deg, rgba(90,71,224,0.05), rgba(210,56,157,0.05));
}

.stat-item {
    margin-bottom: 15px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90,71,224,0.3);
}

.btn-secondary {
    background: var(--light);
    color: var(--gray-dark);
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

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

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.help-text {
    font-size: 12px;
    color: var(--gray);
    margin-top: 5px;
}

.space-indicator {
    display: none;
    font-size: 12px;
    color: #e67e22;
    margin-top: 4px;
    font-weight: 500;
    animation: fadeInOut 2.5s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-4px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.rejected-notification-badge {
    display: none;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Cards */
.step-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.step-title-main {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.step-subtitle {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 25px;
}

/* Info Boxes */
.info-box {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.info-box.success {
    background: rgba(32,201,51,0.1);
    color: var(--success);
}

.info-box.warning {
    background: rgba(255,189,61,0.1);
    color: var(--warning);
}

.info-box.info {
    background: rgba(90,71,224,0.1);
    color: var(--primary);
}

/* Sequence Display */
.sequence-display {
    background: var(--light);
    border-radius: 10px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
}

/* Responsive */
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 250px 1fr;
    }
    
    .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-left {
        position: relative;
        top: 0;
    }
    
    .top-nav {
        padding: 0 15px;
    }
}

/* Verification & Template Cards */
.verification-card,
.template-card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(90,71,224,0.2);
}

.verification-card {
    cursor: default;
}

.verification-header,
.template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.verification-header h3,
.template-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

.verification-status {
    padding: 4px 12px;
    background: rgba(255,189,61,0.2);
    color: var(--warning);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.template-badge.verified {
    padding: 4px 12px;
    background: rgba(32,201,51,0.2);
    color: var(--success);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.verification-details,
.template-info {
    margin-bottom: 15px;
}

.detail-row,
.info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-row label,
.info-row .info-label {
    color: var(--gray);
    min-width: 100px;
}

.detail-row span,
.info-row .info-value {
    color: var(--dark);
    font-weight: 500;
}

.sequence-preview,
.template-preview {
    background: var(--light);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.seq-section,
.preview-item {
    margin-bottom: 10px;
}

.seq-section label {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
    display: block;
}

.seq-display {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--dark);
    word-break: break-all;
}

.verification-actions {
    border-top: 1px solid var(--gray-light);
    padding-top: 15px;
}

.verification-actions textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-success,
.btn-danger {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

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

.btn-success:hover {
    background: #18a728;
}

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

.btn-danger:hover {
    background: #e54444;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 10px;
}

.admin-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-light);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-dark);
}

/* Annotation Results */
.annotation-section {
    margin-top: 20px;
}

.annotation-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.annotation-method {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 20px;
}

.cdr-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cdr-chain h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--primary);
}

.cdr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cdr-table th,
.cdr-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--gray-light);
}

.cdr-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--gray-dark);
}

.cdr-row {
    background: rgba(90,71,224,0.1);
}

.cdr-row td:first-child {
    color: var(--primary);
    font-weight: 700;
}

.seq-cell {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
    max-width: 300px;
}

.id-cell {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--gray);
}

.sequence-display {
    margin-top: 20px;
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
}

.sequence-display h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--gray-dark);
}

.seq-block {
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
    white-space: pre-wrap;
    line-height: 1.8;
    padding: 10px;
    background: var(--light);
    border-radius: 6px;
    max-height: 160px;
    overflow-y: auto;
    overflow-x: hidden;
}

.seq-block label {
    font-weight: 600;
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

.seq-text {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
    line-height: 1.8;
    padding: 10px;
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 5px;
    max-height: 150px;
    overflow-y: auto;
}

.hotspot-section {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--gray-light);
}

.hotspot-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--primary);
}

.template-info-inline {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
}

.template-info-inline .label {
    font-weight: 600;
    color: var(--gray-dark);
}

.template-info-inline .seq-preview {
    font-family: 'Courier New', monospace;
    color: var(--gray);
}

.template-info-inline .cdr-ref {
    font-size: 12px;
    color: var(--secondary);
}

.hotspot-info-box {
    background: rgba(255, 189, 61, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.hotspot-info-box p {
    margin-bottom: 5px;
}

.required-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

.sequence-result {
    margin-top: 20px;
    background: var(--white);
    padding: 15px;
    border-radius: 10px;
}

.sequence-result h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--gray-dark);
}

.status-label {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 5px;
}

.validation-box .status-label {
    color: var(--white);
}

.selection-summary {
    background: rgba(90,71,224,0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.summary-label {
    font-weight: 600;
    color: var(--gray-dark);
}

.summary-value {
    color: var(--primary);
}

.primary-selected {
    background: rgba(90,71,224,0.15);
    border: 2px solid var(--primary);
}

.secondary-selected {
    background: rgba(210,56,157,0.1);
    border: 2px solid var(--secondary);
}

.template-badges {
    display: flex;
    gap: 5px;
}

.role-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
}

.role-badge.primary {
    background: var(--primary);
    color: white;
}

.role-badge.secondary {
    background: var(--secondary);
    color: white;
}

.template-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

.btn-small {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary-role {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-secondary-role {
    background: var(--secondary);
    color: white;
    border: none;
}

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

.secondary-templates-section {
    background: rgba(210,56,157,0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.secondary-templates-section h3 {
    color: var(--secondary);
    font-size: 16px;
    margin-bottom: 10px;
}

.secondary-template-card {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--gray-light);
}

.secondary-template-card h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.cdr-mini-table {
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.cdr-chain-mini {
    margin-bottom: 3px;
}

.template-summary {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.template-summary p {
    margin-bottom: 5px;
}

.detail-section h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.cdr-summary {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.cdr-summary h4 {
    color: var(--secondary);
    margin-bottom: 8px;
}

.cdr-list p {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    margin-bottom: 5px;
}

.sequence-preview {
    margin-top: 15px;
}

.sequence-preview h4 {
    color: var(--gray-dark);
    margin-bottom: 10px;
}

.info-text {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 10px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 5px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-search {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-clear {
    background: var(--gray);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.source-group {
    position: relative;
}

.source-desc {
    font-size: 12px;
    color: var(--gray);
    margin-top: 5px;
    padding: 8px;
    background: rgba(90,71,224,0.05);
    border-radius: 5px;
    min-height: 20px;
}

.template-info-box {
    background: rgba(90,71,224,0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

.info-item {
    flex: 1;
}

.info-item .label {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.info-item .value {
    font-size: 14px;
    color: var(--dark);
    font-weight: 600;
}

/* Mutation Suggestions */
.mutation-suggestion {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.mutation-suggestion.protected {
    background: rgba(255,189,61,0.1);
    border-color: rgba(255,189,61,0.3);
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.suggestion-header .position {
    font-weight: 700;
    color: var(--dark);
}

.region-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.region-tag.CDR1,
.region-tag.CDR2,
.region-tag.CDR3 {
    background: rgba(90,71,224,0.2);
    color: var(--primary);
}

.region-tag.FR1,
.region-tag.FR2,
.region-tag.FR3,
.region-tag.FR4 {
    background: var(--gray-light);
    color: var(--gray);
}

.original-aa {
    padding: 4px 10px;
    background: var(--gray-light);
    border-radius: 4px;
    font-weight: 600;
}

.protected-badge {
    padding: 4px 10px;
    background: rgba(255,189,61,0.2);
    color: var(--warning);
    border-radius: 4px;
    font-size: 12px;
}

.suggestion-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mutation-option {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: var(--light);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.mutation-option:hover {
    background: var(--primary);
    color: white;
}

.mutation-option.hydrophobic {
    border-left: 3px solid #5A47E0;
}

.mutation-option.polar {
    border-left: 3px solid #20C933;
}

.mutation-option.positive {
    border-left: 3px solid #D2389D;
}

.mutation-option.negative {
    border-left: 3px solid #EF4C68;
}

.protected-note {
    font-size: 13px;
    color: var(--warning);
}

.mutation-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    flex: 1;
    background: var(--light);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.stat-box .stat-label {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.stat-box .stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.selected-mutations-box {
    background: rgba(32,201,51,0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.selected-mutations-box h4 {
    font-size: 14px;
    margin-bottom: 10px;
}

#mutation-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.selected-mutation-item {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
}

/* Validation Results */
.validation-box {
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.validation-box.stable {
    background: rgba(32,201,51,0.1);
    border: 2px solid var(--success);
}

.validation-box.moderate {
    background: rgba(255,189,61,0.1);
    border: 2px solid var(--warning);
}

.validation-box.unstable {
    background: rgba(255,92,92,0.1);
    border: 2px solid var(--danger);
}

.stability-result h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.ddg-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.stability-status {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.validation-box.stable .stability-status {
    color: var(--success);
}

.validation-box.moderate .stability-status {
    color: var(--warning);
}

.validation-box.unstable .stability-status {
    color: var(--danger);
}

.recommendation {
    font-size: 14px;
    color: var(--gray-dark);
}

.mutations-summary {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.mutations-summary h4 {
    font-size: 14px;
    margin-bottom: 10px;
}

.mutations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.mutation-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
}

.mutation-pos {
    color: var(--gray);
}

.mutation-change {
    font-weight: 600;
}

.export-section {
    margin-bottom: 20px;
}

.export-section h4 {
    font-size: 14px;
    margin-bottom: 10px;
}

.export-section button {
    margin-right: 10px;
}

.error-text {
    color: var(--danger);
    margin-bottom: 20px;
}

/* Notification Button */
.notification-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,189,61,0.2);
    border: 2px solid var(--warning);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--dark);
}

.notification-btn:hover {
    background: rgba(255,189,61,0.3);
    transform: translateY(-2px);
}

.notification-icon {
    font-size: 16px;
}

.notification-badge {
    background: var(--warning);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.notification-text {
    font-size: 13px;
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--dark);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-light);
    color: var(--gray);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
    margin-top: 20px;
}

.verification-item {
    background: var(--light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.verification-item .verification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.verification-item h3 {
    font-size: 18px;
    color: var(--dark);
}

.verification-item .verification-status {
    padding: 4px 12px;
    background: rgba(255,189,61,0.2);
    color: var(--warning);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.verification-item .verification-details {
    margin-bottom: 15px;
}

.verification-item .sequence-preview {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.verification-item .verification-actions {
    border-top: 1px solid var(--gray-light);
    padding-top: 15px;
}

.verification-item textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    resize: vertical;
}

.verification-item .action-buttons {
    display: flex;
    gap: 10px;
}

/* Admin Dashboard */
.admin-dashboard {
    padding: 20px;
}

.admin-dashboard h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.admin-subtitle {
    color: var(--gray);
    margin-bottom: 30px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.admin-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--gray-light);
}

.admin-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 71, 224, 0.15);
}

.admin-card-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.admin-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.admin-card-desc {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 10px;
}

.admin-card-count {
    color: var(--primary);
    font-weight: 500;
}

.admin-card-action {
    color: var(--secondary);
    font-weight: 500;
}

.admin-stats {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--gray-light);
}

.admin-stats h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-box {
    background: var(--light);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.stat-box .stat-label {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.stat-box .stat-number {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
}

/* Admin Manager */
.admin-manager {
    padding: 10px;
}

.admin-manager h3 {
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--gray-light);
    padding-bottom: 10px;
}

.admin-add-section {
    background: var(--light);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.form-row input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
}

.admin-note {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 15px;
}

/* Source Item */
.source-item {
    background: var(--white);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.source-info strong {
    display: block;
    font-size: 16px;
}

.source-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.source-status.active {
    background: #e6f4ea;
    color: var(--success);
}

.source-status.inactive {
    background: #fce8e6;
    color: var(--danger);
}

.source-desc {
    color: var(--gray);
    font-size: 13px;
    margin-top: 5px;
}

.source-url {
    color: var(--gray);
    font-size: 12px;
    font-style: italic;
}

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

/* User Item */
.user-item {
    background: var(--white);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info strong {
    display: block;
}

.user-email {
    color: var(--gray);
    font-size: 13px;
    margin-left: 10px;
}

.user-role {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    font-weight: 500;
}

.user-role.admin {
    background: #e8e4f8;
    color: var(--primary);
}

.user-role.user {
    background: var(--gray-light);
    color: var(--gray);
}

.user-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    font-weight: 500;
}

.user-status.active {
    background: #e6f4ea;
    color: var(--success);
}

.user-status.inactive {
    background: #fce8e6;
    color: var(--danger);
}

.user-type-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    background: #e3f2fd;
    color: #1976d2;
}

.user-role-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    font-weight: 500;
}

.user-role-tag.researcher {
    background: #e3f2fd;
    color: #1976d2;
}

.user-role-tag.verifier {
    background: #f3e5f5;
    color: #7b1fa2;
}

.user-role-tag.admin {
    background: #e8e4f8;
    color: var(--primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.checkbox-group label:first-child {
    font-weight: 500;
    margin-right: 10px;
}

.edit-form {
    background: var(--light);
    border-radius: 8px;
    padding: 20px;
}

.edit-form .form-group {
    margin-bottom: 15px;
}

.edit-form .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
}

.edit-form .form-group input,
.edit-form .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 14px;
}

.edit-form .form-group input:disabled {
    background: var(--gray-light);
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

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

.btn-danger:hover {
    background: #e04848;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.icon {
    display: inline-block;
    vertical-align: middle;
}

.help-title svg {
    vertical-align: middle;
    margin-right: 8px;
}

.btn-secondary svg {
    vertical-align: middle;
    margin-right: 6px;
}

.btn-icon svg {
    vertical-align: middle;
}

.notification-btn svg {
    vertical-align: middle;
}

/* Scheme Tabs for Multi-Scheme CDR Display */
.scheme-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.scheme-tab {
    padding: 10px 20px;
    background: var(--gray-light);
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray);
    transition: all 0.2s;
}

.scheme-tab:hover {
    background: var(--primary-light);
    color: var(--white);
}

.scheme-tab.active {
    background: var(--primary);
    color: var(--white);
}

.scheme-content {
    padding: 20px 0;
}

.cdr-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.cdr-table th,
.cdr-table td {
    padding: 10px 12px;
    border: 1px solid var(--gray-light);
    text-align: left;
}

.cdr-table th {
    background: var(--gray-light);
    font-weight: 600;
}

.cdr-table .vh-row {
    background: rgba(90, 71, 224, 0.05);
}

.cdr-table .vl-row {
    background: rgba(210, 56, 157, 0.05);
}

.cdr-table .region-label {
    font-weight: 600;
    color: var(--primary);
}

.cdr-table .seq-cell {
    font-family: monospace;
    font-size: 14px;
}

.fr-ids-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--gray-light);
    border-radius: 8px;
}

.fr-ids-section h5 {
    margin-bottom: 10px;
    color: var(--gray-dark);
}

.fr-ids-row {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
}

.fr-id {
    font-size: 12px;
    color: var(--gray);
    background: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Scheme Cards Grid for CDR Comparison */
.scheme-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.scheme-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    border: 2px solid var(--gray-light);
    transition: all 0.2s;
}

.scheme-card:hover {
    border-color: var(--primary);
}

.scheme-card.selected {
    border-color: var(--primary);
    background: rgba(90,71,224,0.05);
}

.scheme-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.scheme-card-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.selected-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.scheme-cdr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.scheme-cdr-table th {
    background: var(--light);
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-dark);
}

.scheme-cdr-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-light);
}

.scheme-cdr-table .seq-cell {
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-size: 11px;
}

/* Manual Annotation Section */
.manual-annotation-section {
    background: rgba(255,189,61,0.08);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid var(--warning);
}

.manual-annotation-section h3 {
    color: var(--warning);
    margin-bottom: 15px;
}

.manual-cdr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.manual-cdr-chain h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

.manual-cdr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.manual-cdr-row .form-group {
    margin-bottom: 0;
}

.manual-cdr-row .form-group label {
    font-size: 12px;
}

.manual-cdr-row .form-group input {
    padding: 8px 10px;
    font-size: 13px;
}

/* AlphaFold Section */
.alphafold-section {
    background: rgba(32,197,94,0.08);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #22C55E;
}

.alphafold-section h3 {
    color: #22C55E;
    margin-bottom: 15px;
}

.btn-af3-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(34,197,94,0.4);
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}
.btn-af3-download:hover {
    background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
    box-shadow: 0 6px 20px rgba(34,197,94,0.55);
    transform: translateY(-2px);
}
.btn-af3-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34,197,94,0.3);
}

.alphafold-guide {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.alphafold-guide h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

.alphafold-guide ol {
    padding-left: 20px;
    margin: 10px 0;
}

.alphafold-guide li {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--gray-dark);
}

.alphafold-guide code {
    background: var(--light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--primary);
}

.alphafold-guide a {
    color: var(--primary);
    text-decoration: underline;
}

/* Binding Visualization Section */
.binding-viz-section {
    background: rgba(99,102,241,0.08);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    border: 2px solid #6366F1;
}

.binding-viz-section h3 {
    color: #6366F1;
    margin-bottom: 8px;
}

.binding-viz-section .info-text {
    margin-bottom: 15px;
    color: var(--gray-dark);
    font-size: 14px;
}

.binding-viz-guide {
    background: white;
    border-radius: 8px;
    padding: 15px;
}

.binding-viz-guide h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

.binding-viz-guide ol {
    padding-left: 20px;
    margin: 10px 0;
}

.binding-viz-guide li {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--gray-dark);
}

.binding-viz-guide code {
    background: var(--light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #6366F1;
}

/* Binding Visualization Reminder Box */
.binding-viz-reminder {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-left: 4px solid #0284c7;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
    animation: slideIn 0.3s ease-out;
}

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

.binding-viz-reminder .reminder-icon {
    font-size: 32px;
    flex-shrink: 0;
    line-height: 1;
}

.binding-viz-reminder h4 {
    color: #0369a1;
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
}

.binding-viz-reminder p {
    color: #0c4a6e;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.upload-section {
    margin-bottom: 15px;
}

.success-text {
    color: #22C55E;
    font-weight: 500;
    font-size: 14px;
}

#agent-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hotspot Sections */
.hotspot-section h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

@media (max-width: 1200px) {
    .scheme-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .scheme-cards-grid {
        grid-template-columns: 1fr;
    }
    .manual-cdr-grid {
        grid-template-columns: 1fr;
    }
}

/* Mutation Design - Required CDRs Section */
.required-cdrs-section {
    background: rgba(90,71,224,0.05);
    border: 1px solid rgba(90,71,224,0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.required-cdrs-section h4 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 10px;
}

.required-cdrs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.required-cdrs-chain h5 {
    font-size: 13px;
    color: var(--gray-dark);
    margin-bottom: 8px;
}

.cdr-req-item {
    font-size: 12px;
    padding: 4px 0;
    color: var(--dark);
}

.cdr-req-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.cdr-req-badge.mutable {
    background: rgba(32,201,51,0.2);
    color: var(--success);
}

.cdr-req-badge.hotspot {
    background: rgba(255,92,92,0.2);
    color: var(--danger);
}

.cdr-sim-value {
    font-weight: 700;
    font-size: 11px;
    margin-left: 6px;
}

.sim-bar-track {
    display: inline-block;
    width: 60px;
    height: 4px;
    background: var(--gray-light);
    border-radius: 2px;
    vertical-align: middle;
    margin-left: 4px;
    overflow: hidden;
}

.sim-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.2s ease, background 0.2s ease;
}

.similarity-section {
    background: rgba(32,201,51,0.05);
    border: 1px solid rgba(32,201,51,0.2);
    border-radius: 8px;
    padding: 10px 15px;
    margin: 10px 0;
}

.similarity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.similarity-row:last-child {
    margin-bottom: 0;
}

.sim-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
    min-width: 90px;
}

.sim-value {
    font-size: 14px;
    font-weight: 700;
    min-width: 50px;
}

.similarity-dashboard {
    background: linear-gradient(135deg, rgba(32,201,51,0.04), rgba(66,133,244,0.04));
    border: 1px solid rgba(32,201,51,0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
}

.sim-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sim-dash-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
}

.sim-dash-source {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(66,133,244,0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

.sim-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .sim-dash-grid {
        grid-template-columns: 1fr;
    }
}

.sim-dash-chain {
    background: var(--white);
    border-radius: 8px;
    padding: 14px;
    border: 1px solid rgba(0,0,0,0.06);
}

.sim-dash-overall {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sim-chain-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
}

.sim-dash-pct {
    font-size: 22px;
    font-weight: 700;
}

.sim-dash-details {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0,0,0,0.08);
}

.sim-detail-row {
    display: grid;
    grid-template-columns: 90px 1fr 1fr 60px;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 11px;
}

.sim-detail-label {
    font-weight: 700;
    color: var(--gray-dark);
}

.sim-detail-seq {
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sim-detail-seq code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 10px;
    background: rgba(0,0,0,0.04);
    padding: 1px 4px;
    border-radius: 3px;
}

.sim-badge-value {
    font-weight: 700;
    font-size: 13px;
    text-align: right;
}

/* Mutation Design - CDR Sequence View */
.mutation-legend {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    padding: 10px 15px;
    background: var(--light);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-dark);
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.legend-swatch.cdr { background: rgba(90,71,224,0.2); border: 1px solid var(--primary); }
.legend-swatch.hotspot { background: rgba(255,92,92,0.3); border: 1px solid var(--danger); }
.legend-swatch.mutated { background: var(--success); }
.legend-swatch.fr { background: var(--gray-light); border: 1px solid var(--gray-light); }

.mutation-summary {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-light);
}

.mutation-summary h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

#mutation-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.selected-mutation-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(32,201,51,0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: var(--dark);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    width: auto;
}

.primary-cdr-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--primary);
}

.primary-cdr-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.cdr-sequence-display {
    margin-bottom: 15px;
}

.seq-label {
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 5px;
    font-size: 13px;
}

.seq-display {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 10px;
    background: var(--light);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
}

.residue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 28px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    background: var(--gray-light);
    color: var(--gray);
    cursor: default;
    user-select: none;
}

.cdr-residue {
    background: rgba(90,71,224,0.15);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.cdr-residue.mutable {
    cursor: pointer;
    transition: all 0.15s;
}

.cdr-residue.mutable:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.15);
    z-index: 1;
}

.hotspot {
    background: rgba(255,92,92,0.25) !important;
    color: var(--danger) !important;
    border-color: var(--danger) !important;
    cursor: not-allowed !important;
    position: relative;
}

.hotspot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: var(--danger);
    transform: translate(-50%, -50%);
}

.mutated {
    background: var(--success) !important;
    color: white !important;
    border-color: var(--success) !important;
}

/* Secondary Comparison */
.secondary-comparison-section {
    margin: 20px 0;
}

.secondary-comparison-section h3 {
    color: var(--gray-dark);
    margin-bottom: 10px;
}

.secondary-antibody-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--gray-light);
    opacity: 0.85;
}

.secondary-antibody-card h4 {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 10px;
}

.secondary-sequence {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.secondary-sequence .seq-label {
    min-width: 25px;
    margin-bottom: 0;
}

.secondary-sequence .seq-display {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

.secondary-sequence .residue {
    width: 20px;
    height: 24px;
    font-size: 11px;
}

/* Mutation Picker Popup */
.mutation-picker {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 16px;
    z-index: 1000;
    min-width: 320px;
    max-width: 380px;
    max-height: 480px;
    overflow-y: auto;
    border: 2px solid var(--primary);
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-light);
}

.picker-header span {
    font-weight: 600;
    color: var(--primary);
}

.picker-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    width: auto;
}

.picker-original {
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--gray-dark);
    line-height: 1.6;
}

.picker-original strong {
    font-family: 'Courier New', monospace;
    font-size: 15px;
}

.picker-cat-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.picker-props {
    display: block;
    font-size: 11px;
    color: var(--gray);
    margin-top: 2px;
}

/* Secondary templates in picker */
.picker-secondary {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-light);
}

.picker-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    margin-bottom: 6px;
}

.picker-sec-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}

.picker-sec-name {
    min-width: 60px;
    font-weight: 600;
    color: var(--dark);
    font-size: 12px;
}

.picker-sec-aa {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 2px solid;
    cursor: pointer;
    transition: transform 0.1s;
}

.picker-sec-aa:hover {
    transform: scale(1.15);
}

.picker-sec-info {
    color: var(--gray);
    font-size: 12px;
    flex: 1;
}

.picker-sim-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

.picker-sim-badge.sim-high { background: #dcfce7; color: #166534; }
.picker-sim-badge.sim-med  { background: #fef9c3; color: #854d0e; }
.picker-sim-badge.sim-low  { background: #fee2e2; color: #991b1b; }

/* AA grid in picker */
.picker-aa-grid {
    max-height: 220px;
    overflow-y: auto;
}

.picker-aa-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 12px;
}

.picker-aa-row:hover { background: var(--light); }
.picker-aa-row.selected { background: rgba(34,197,94,0.12); }
.picker-aa-row.from-secondary { font-weight: 600; }

.picker-aa-code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 2px solid;
    flex-shrink: 0;
}

.picker-aa-name {
    min-width: 80px;
    color: var(--gray-dark);
}

.picker-aa-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
}

.picker-aa-bar .bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.2s;
}

.picker-aa-pct {
    font-size: 11px;
    color: var(--gray);
    min-width: 30px;
    text-align: right;
}

.picker-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-light);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-sm.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Alignment View */
.alignment-section {
    margin: 20px 0;
}

.alignment-section h3 {
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 10px;
}

.alignment-container {
    overflow-x: auto;
    background: var(--light);
    border-radius: 8px;
    padding: 12px;
}

.alignment-block {
    margin-bottom: 14px;
}

.align-row {
    display: flex;
    align-items: center;
    line-height: 1;
}

.align-label {
    min-width: 90px;
    max-width: 90px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    text-align: right;
    padding-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.primary-label { color: var(--primary); }
.sec-label { color: var(--gray-dark); }

.align-seq {
    display: flex;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Ruler */
.ruler-row { margin-bottom: 2px; }
.ruler-tick {
    display: inline-flex;
    width: 16px;
    justify-content: center;
    font-size: 9px;
    color: var(--gray);
}
.ruler-dot {
    display: inline-flex;
    width: 16px;
    justify-content: center;
    font-size: 9px;
    color: var(--gray-light);
}

/* AA cells in alignment */
.align-seq .aa-cell {
    display: inline-flex;
    width: 16px;
    height: 20px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    border-radius: 2px;
    transition: background 0.1s;
}

.align-seq .aa-cell.fr { color: var(--gray); }
.align-seq .aa-cell.cdr { color: var(--primary); background: rgba(90,71,224,0.08); }
.align-seq .aa-cell.hotspot { color: #dc2626; background: rgba(220,38,38,0.1); font-weight: 700; }
.align-seq .aa-cell.mutated { color: white; background: var(--success); font-weight: 700; border-radius: 3px; }
.align-seq .aa-cell.clickable { cursor: pointer; }
.align-seq .aa-cell.clickable:hover { background: rgba(90,71,224,0.25); transform: scale(1.15); }

/* Secondary row colors */
.secondary-row .aa-cell.match { color: var(--gray); }
.secondary-row .aa-cell.diff { color: #ea580c; background: rgba(234,88,12,0.1); font-weight: 700; }
.secondary-row .aa-cell.gap { color: var(--gray-light); }

/* Diff indicator row */
.diff-row { height: 12px; }
.diff-marker {
    display: inline-flex;
    width: 16px;
    height: 12px;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #ea580c;
}

/* Legend additions */
.legend-swatch.match { background: var(--gray-light); }
.legend-swatch.diff { background: rgba(234,88,12,0.3); }

/* Hotspot Results Section */
.hotspot-results-section {
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #22C55E;
}

.hotspot-results-section h3 {
    color: #22C55E;
    margin-bottom: 15px;
}

.hotspot-summary-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
}

.summary-stat {
    text-align: center;
}

.summary-stat .stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.summary-stat .stat-label {
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hotspot-detail-table {
    margin-bottom: 20px;
}

.hotspot-detail-table h4 {
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-light);
}

.hotspot-detail-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hotspot-detail-table th {
    background: var(--light);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-dark);
    font-size: 12px;
}

.hotspot-detail-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--gray-light);
}

.hotspot-detail-table .pos-cell {
    font-weight: 600;
    color: var(--dark);
    font-family: 'Courier New', monospace;
}

.hotspot-detail-table .aa-cell {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: var(--primary);
}

.hotspot-detail-table .score-cell {
    font-weight: 600;
    color: var(--secondary);
}

.hotspot-detail-table .partner-cell {
    font-size: 12px;
    color: var(--gray);
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.strict {
    background: rgba(255,92,92,0.15);
    color: var(--danger);
}

.status-badge.relaxed {
    background: rgba(255,189,61,0.15);
    color: var(--warning);
}

.status-badge.weak {
    background: var(--gray-light);
    color: var(--gray);
}

.hotspot-row.strict {
    background: rgba(255,92,92,0.03);
}

.hotspot-row.relaxed {
    background: rgba(255,189,61,0.03);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-light);
    transition: 0.2s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: var(--success);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(18px);
}

@media (max-width: 900px) {
    .hotspot-summary-bar {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .hotspot-summary-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Verification Modal - Rich Details */
.verification-sequences {
    margin: 12px 0;
}

.verification-sequences details {
    margin-bottom: 8px;
}

.verification-sequences summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 0;
}

.verification-sequences pre.seq-block {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: var(--light);
    padding: 10px;
    border-radius: 6px;
    word-break: break-all;
    white-space: pre-wrap;
    margin: 6px 0 0 0;
    max-height: 120px;
    overflow-y: auto;
    color: var(--dark);
}

.detail-row.full-width {
    flex-direction: column;
    gap: 4px;
}

.cdr-full-details {
    margin: 12px 0;
}

.cdr-full-details h4 {
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 10px;
}

.scheme-section {
    margin-bottom: 15px;
}

.scheme-label {
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 6px;
    padding: 4px 10px;
    background: rgba(90,71,224,0.08);
    border-radius: 4px;
    display: inline-block;
}

.cdr-full-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 10px;
}

.cdr-full-table th {
    background: var(--light);
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-dark);
    font-size: 12px;
}

.cdr-full-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--gray-light);
}

.cdr-full-table .cdr-row td {
    background: rgba(90,71,224,0.04);
    font-weight: 500;
}

.cdr-full-table .fr-row td {
    color: var(--gray);
    font-size: 12px;
}

.cdr-full-table .seq-cell {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scheme Tabs in Detail Modal */
.scheme-tabs {
    display: flex;
    gap: 6px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.scheme-tab {
    padding: 4px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    background: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--gray);
    transition: all 0.15s;
}

.scheme-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.scheme-tab:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.modal-select-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-light);
}

.detail-meta p {
    margin: 4px 0;
    font-size: 14px;
}

.cdr-id-inline {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--gray);
    margin-right: 4px;
}

/* Step header with inline button */
.step-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.btn-outline {
    padding: 6px 14px;
    border: 1.5px solid var(--primary);
    border-radius: 6px;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    width: auto;
}

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

/* Alignment chunks — visual grouping per line */
.align-chunk {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.align-chunk:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* AF3 JSON download section */
.af3-download-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(90, 71, 224, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(90, 71, 224, 0.15);
}

.af3-download-section .btn-primary {
    white-space: nowrap;
    flex-shrink: 0;
}

.af3-info {
    font-size: 12px;
    color: var(--gray);
}

/* Browse Library button */
.browse-lib-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 4px;
}
.browse-lib-btn:hover {
    text-decoration: underline;
}

/* Extra-large modal for library browser */
.modal-xlarge {
    max-width: 1000px;
    width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
}

/* Library search bar */
.lib-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.lib-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}
.lib-count {
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
}

/* Library table */
.lib-table-wrap {
    overflow-x: auto;
}
.lib-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.lib-table th {
    text-align: left;
    padding: 8px 10px;
    background: var(--light);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-dark);
    white-space: nowrap;
}
.lib-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.lib-table tbody tr:hover {
    background: rgba(90, 71, 224, 0.04);
}
.lib-name {
    font-weight: 600;
}
.lib-seq {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge-verified { background: rgba(34,197,94,0.15); color: #16a34a; }
.badge-pending  { background: rgba(234,179,8,0.15); color: #ca8a04; }
.badge-rejected { background: rgba(239,68,68,0.15); color: #dc2626; }
.badge-pdb {
    background: rgba(59,130,246,0.15);
    color: #2563eb;
    margin-left: 4px;
}

/* Library detail view */
.btn-back {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 0;
    margin-bottom: 12px;
}
.btn-back:hover { text-decoration: underline; }

.lib-detail h3 {
    margin-bottom: 8px;
}
.lib-detail h3 code {
    font-size: 12px;
    color: var(--gray);
    margin-left: 8px;
}
.lib-detail p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--gray-dark);
}
.lib-aliases {
    font-style: italic;
}
.lib-desc {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--light);
    border-radius: 6px;
}
.lib-seq-block {
    margin-top: 16px;
}
.lib-seq-block h4 {
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--dark);
}
.seq-pre {
    background: var(--light);
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

/* Small button */
.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    color: var(--primary);
}
.btn-sm:hover {
    background: var(--light);
}

/* PDB upload group */
.pdb-upload-group input[type="file"] {
    font-size: 12px;
}
.pdb-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pdb-row input[type="file"] { flex: 0 0 auto; }
.pdb-source-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
}
.field-hint {
    font-size: 11px;
    color: var(--gray);
    margin-top: 4px;
}

/* Browse Library button in sidebar */
.browse-lib-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 4px;
}
.browse-lib-btn:hover { text-decoration: underline; }

/* Extra-large modal for library browser */
.modal-xlarge {
    max-width: 1100px;
    width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
}

/* Library browser search bar */
.lib-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.lib-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}
.lib-count {
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
}

/* Library table */
.lib-table-wrap { overflow-x: auto; }
.lib-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.lib-table th {
    text-align: left;
    padding: 8px 10px;
    background: var(--light);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-dark);
    white-space: nowrap;
}
.lib-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.lib-table tbody tr:hover { background: rgba(90,71,224,0.03); }
.lib-name { font-weight: 600; }
.lib-seq {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge-verified { background: rgba(34,197,94,0.15); color: #16a34a; }
.badge-pending  { background: rgba(234,179,8,0.15); color: #ca8a04; }
.badge-rejected { background: rgba(239,68,68,0.15); color: #dc2626; }
.badge-pdb {
    background: rgba(59,130,246,0.15);
    color: #2563eb;
    margin-left: 4px;
}

/* Library detail view */
.btn-back {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 0;
    margin-bottom: 12px;
}
.btn-back:hover { text-decoration: underline; }

.lib-detail h3 {
    margin-bottom: 8px;
}
.lib-detail h3 code {
    font-size: 12px;
    color: var(--gray);
    margin-left: 8px;
}
.lib-detail p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--gray-dark);
}
.lib-aliases { font-style: italic; }
.lib-desc {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--light);
    border-radius: 6px;
}
.lib-seq-block {
    margin-top: 16px;
}
.lib-seq-block h4 {
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--dark);
}
.seq-pre {
    background: var(--light);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

/* Small button */
.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: white;
    border-radius: 4px;
    cursor: pointer;
}
.btn-sm:hover { background: rgba(90,71,224,0.08); }

/* PDB upload hint */
.pdb-upload-group .help-text,
.field-hint {
    font-size: 11px;
    color: var(--gray);
    margin-top: 4px;
}

/* Nav button (My Jobs etc.) */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--dark);
    font-size: 13px;
    cursor: pointer;
    margin-right: 8px;
}
.nav-btn:hover { background: var(--light); }
.nav-btn svg { opacity: 0.7; }

/* Saved badge on Step 5 */
.saved-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(34,197,94,0.12);
    color: #16a34a;
    margin-bottom: 16px;
}
.saved-badge code {
    background: rgba(34,197,94,0.15);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}
.saved-badge.warn {
    background: rgba(234,179,8,0.12);
    color: #ca8a04;
}

/* My Jobs table */
.myjobs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.myjobs-table th {
    text-align: left;
    padding: 8px 10px;
    background: var(--light);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-dark);
    white-space: nowrap;
}
.myjobs-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.myjobs-table tbody tr:hover { background: rgba(90,71,224,0.04); }

/* My Jobs detail view */
.job-detail-section {
    margin-top: 16px;
}
.job-detail-section h4 {
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--dark);
}
.job-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin-bottom: 16px;
    font-size: 13px;
}
.job-meta span { color: var(--gray); }
.energy-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.energy-badge.stable   { background: rgba(34,197,94,0.15); color: #16a34a; }
.energy-badge.moderate { background: rgba(234,179,8,0.15); color: #ca8a04; }
.energy-badge.unstable { background: rgba(239,68,68,0.15); color: #dc2626; }
.empty-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    font-size: 14px;
}
.job-export-btns {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Energy color classes for My Jobs table cells */
.energy-stable   { color: #16a34a; font-weight: 600; }
.energy-moderate { color: #ca8a04; font-weight: 600; }
.energy-unstable { color: #dc2626; font-weight: 600; }

/* Job energy box in detail view */
.job-energy-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 13px;
}
.job-energy-box.energy-stable   { background: rgba(34,197,94,0.08); }
.job-energy-box.energy-moderate { background: rgba(234,179,8,0.08); }
.job-energy-box.energy-unstable { background: rgba(239,68,68,0.08); }
.ddg-val {
    font-size: 18px;
    font-weight: 700;
}
.energy-label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.energy-rec {
    color: var(--gray-dark);
    font-size: 12px;
}
.date-cell {
    white-space: nowrap;
    font-size: 12px;
    color: var(--gray);
}

/* Auto-Mutation Engine Styles */
.mutation-mode-tabs {
    display: flex;
    gap: 0;
    margin: 16px 0 20px 0;
    border-bottom: 2px solid var(--gray-light);
}
.mode-tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}
.mode-tab:hover {
    color: var(--primary);
}
.mode-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(90,71,224,0.05);
}

.auto-mutation-config {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}
.auto-mutation-config h4 {
    margin-bottom: 16px;
    font-size: 16px;
}
.config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.config-item label {
    display: block;
    font-size: 12px;
    color: var(--gray-dark);
    margin-bottom: 6px;
}
.config-item select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.secondary-templates-section {
    margin: 20px 0;
    padding: 16px;
    background: rgba(90,71,224,0.03);
    border-radius: 8px;
}
.secondary-templates-section h5 {
    font-size: 14px;
    margin-bottom: 8px;
}
.secondary-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}
.secondary-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.secondary-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}
.secondary-checkbox-label input[type="checkbox"]:checked + span {
    color: var(--primary);
}

.hotspot-reminder {
    padding: 12px 16px;
    background: rgba(34,197,94,0.08);
    border-radius: 8px;
    font-size: 13px;
    color: #16a34a;
    margin: 16px 0;
}

.btn-large {
    padding: 14px 32px;
    font-size: 15px;
}

.batch-saved {
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(34,197,94,0.1);
    border-radius: 8px;
    font-size: 13px;
}
.batch-saved code {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.auto-mutation-results {
    margin: 24px 0;
}
.auto-mutation-results h4 {
    font-size: 16px;
    margin-bottom: 8px;
}
.sort-info {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 16px;
}

.candidates-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.candidate-card {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}
.candidate-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(90,71,224,0.1);
}
.candidate-card.selected {
    border-color: var(--primary);
    background: rgba(90,71,224,0.05);
}

.candidate-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.candidate-select {
    display: flex;
    align-items: center;
    gap: 8px;
}
.candidate-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
}
.candidate-rank {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}
.candidate-score.overall {
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
}
.candidate-id {
    font-size: 12px;
    color: var(--gray);
    background: var(--gray-light);
    padding: 4px 8px;
    border-radius: 4px;
}

.candidate-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.metric-item {
    display: flex;
    flex-direction: column;
    padding: 6px 10px;
    background: var(--gray-light);
    border-radius: 6px;
    min-width: 60px;
}
.metric-label {
    font-size: 10px;
    color: var(--gray);
    text-transform: uppercase;
}
.metric-value {
    font-size: 14px;
    font-weight: 600;
}

.candidate-mutations {
    margin-bottom: 12px;
}
.mutations-count {
    font-size: 12px;
    color: var(--gray-dark);
    margin-bottom: 6px;
}
.mutations-detail summary {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
}
.mutations-list {
    padding: 8px 0;
}
.mutation-item-auto {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
}
.mut-pos {
    font-weight: 600;
    color: var(--primary);
}
.mut-change {
    color: var(--gray-dark);
}
.mut-region {
    font-size: 11px;
    color: var(--gray);
    background: var(--gray-light);
    padding: 2px 6px;
    border-radius: 3px;
}
.mut-rationale {
    color: var(--gray);
    font-size: 11px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.candidate-seq-preview {
    margin-bottom: 12px;
}
.seq-preview-content {
    padding: 8px 0;
}
.seq-item {
    margin: 4px 0;
    font-size: 12px;
}
.seq-item code {
    font-size: 11px;
    background: var(--gray-light);
    padding: 4px 8px;
    border-radius: 4px;
    display: block;
    margin-top: 4px;
    word-break: break-all;
}

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

/* Auto-Candidate Validation Step 5 */
.auto-candidates-validation {
    margin: 20px 0;
}

.candidate-validation-card {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.candidate-validation-card:hover {
    border-color: var(--primary);
}

.candidate-validation-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-light);
}
.candidate-validation-header .candidate-rank {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}
.candidate-validation-header .overall-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

.candidate-validation-metrics .metric-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.candidate-validation-metrics .metric {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: var(--gray-light);
    border-radius: 8px;
}
.candidate-validation-metrics .metric .label {
    font-size: 12px;
    color: var(--gray);
}
.candidate-validation-metrics .metric .val {
    font-size: 14px;
    font-weight: 600;
}

.candidate-mutations-list {
    margin: 16px 0;
}
.candidate-mutations-list h5 {
    font-size: 14px;
    margin-bottom: 8px;
}
.mutations-grid-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mut-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(90,71,224,0.08);
    border-radius: 4px;
    font-size: 12px;
}
.mut-chain {
    font-weight: 600;
    color: var(--primary);
}
.mut-pos {
    color: var(--gray-dark);
}
.mut-arrow {
    color: var(--gray);
}
.mut-to {
    color: var(--success);
}
.mut-region-tag {
    font-size: 10px;
    padding: 2px 4px;
    background: var(--gray-light);
    border-radius: 2px;
}

.candidate-sequences {
    margin: 16px 0;
}
.candidate-sequences details {
    margin: 8px 0;
}
.candidate-sequences summary {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}
.seq-display {
    font-size: 11px;
    background: var(--gray-light);
    padding: 10px;
    border-radius: 6px;
    word-break: break-all;
    margin-top: 8px;
}

.candidate-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
}

/* Step 4 Combined Layout */
.step4-combined .template-info-box.compact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
}
.step4-combined .template-info-box.compact span {
    font-size: 13px;
}

.mutation-section, .auto-section {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.section-header h3 {
    font-size: 16px;
}
.section-status {
    font-size: 12px;
    color: var(--gray);
    background: var(--gray-light);
    padding: 4px 10px;
    border-radius: 12px;
}

.mutation-legend.compact {
    display: flex;
    gap: 16px;
    font-size: 11px;
    margin-bottom: 12px;
}
.mutation-legend.compact .swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 4px;
}

.alignment-section.compact h4 {
    font-size: 13px;
    margin: 10px 0 6px 0;
}

.selected-mutations-list {
    background: rgba(90,71,224,0.05);
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 12px;
}
.selected-mutations-list h5 {
    font-size: 12px;
    margin-bottom: 6px;
}
.mutations-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mut-tag {
    font-size: 11px;
    padding: 3px 8px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
}
.mut-tag .remove-x {
    background: none;
    border: none;
    color: white;
    margin-left: 4px;
    cursor: pointer;
    font-size: 12px;
}
.more-tag {
    font-size: 11px;
    color: var(--gray);
}

/* Auto Config Inline */
.auto-config-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.auto-config-inline select {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    min-width: 80px;
}
.secondary-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.secondary-checkbox-label.small {
    font-size: 11px;
    padding: 4px 8px;
}
.batch-id-tag {
    font-size: 11px;
    color: var(--success);
    margin-bottom: 10px;
}

/* Auto Candidates Compact */
.auto-candidates-compact {
margin-top: 12px;
 }

.scores-legend {
     background: var(--gray-light);
     border: 1px solid var(--gray);
     border-radius: 6px;
     padding: 10px 12px;
     margin-bottom: 12px;
     font-size: 11px;
 }
 .scores-legend .legend-title {
     margin-bottom: 8px;
     color: var(--dark);
 }
 .scores-legend .legend-item {
     margin-bottom: 4px;
     color: var(--gray-dark);
 }
 .scores-legend .legend-item:last-child {
     margin-bottom: 0;
 }
 .scores-legend .legend-note {
     margin-top: 8px;
     padding-top: 6px;
     border-top: 1px solid var(--gray);
     color: var(--primary);
 }
 .scores-legend strong {
     color: var(--dark);
 }

.candidates-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.candidates-header-row .header-title {
     font-size: 13px;
     font-weight: 600;
 }
 .candidates-header-row .header-info {
     font-size: 11px;
     color: var(--gray);
     margin-left: 10px;
 }

.candidates-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.candidate-compact-card {
    background: var(--gray-light);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.candidate-compact-card:hover {
    background: var(--white);
    border-color: var(--gray);
}
.candidate-compact-card.selected {
    background: rgba(90,71,224,0.1);
    border-color: var(--primary);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.select-label {
    display: flex;
    align-items: center;
    gap: 6px;
}
.select-label input {
    width: 14px;
    height: 14px;
}
.rank-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}
.score-badge {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
}

.card-metrics {
    display: flex;
    gap: 6px;
    font-size: 10px;
    color: var(--gray-dark);
    margin-bottom: 6px;
}
.card-metrics .mut-count {
     color: var(--gray);
 }
 .card-metrics .mut-count.below-target {
     color: var(--danger);
     font-weight: 600;
 }

.card-actions {
    display: flex;
    gap: 4px;
}
.btn-tiny {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 4px;
    background: var(--white);
    border: 1px solid var(--gray-light);
    cursor: pointer;
}
.btn-tiny:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Proceed Selection Panel */
.proceed-selection-panel {
    background: linear-gradient(135deg, rgba(90,71,224,0.08) 0%, rgba(212,56,157,0.08) 100%);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
}
.proceed-selection-panel h4 {
    font-size: 14px;
    margin-bottom: 12px;
}

.proceed-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.proceed-option {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    flex: 1;
    min-width: 150px;
}
.proceed-option:hover {
    border-color: var(--gray);
}
.proceed-option.active {
    border-color: var(--primary);
    background: rgba(90,71,224,0.05);
}
.proceed-option label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}
.proceed-option input[type="radio"] {
    width: 16px;
    height: 16px;
}
.option-label {
    font-size: 13px;
    font-weight: 600;
}
.option-count {
    font-size: 11px;
    color: var(--gray);
}

/* Candidate Detail Modal */
.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: 1000;
}
.candidate-detail-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-light);
}
.modal-header h3 {
    font-size: 18px;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-light);
}

.detail-scores {
    margin-bottom: 16px;
}
.score-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      padding: 4px 0;
      font-size: 13px;
  }
 .score-label {
     color: var(--gray);
 }
 .score-val {
     font-weight: 600;
 }
 .score-val.overall {
     font-size: 16px;
     color: var(--success);
 }
 .score-note {
     font-size: 11px;
     color: var(--gray);
     margin-left: 4px;
 }
 .score-explain {
     font-size: 10px;
     color: var(--gray);
     margin-left: 8px;
     font-style: italic;
  }
  .metric-detail {
      font-size: 11px;
      color: var(--gray);
      margin-top: 2px;
      margin-bottom: 6px;
      padding: 6px 8px;
      background: var(--bg, #f9f9fb);
      border-radius: 4px;
      line-height: 1.5;
      border-left: 2px solid var(--gray-light, #e0e0e0);
      flex-basis: 100%;
  }

.detail-mutations {
    margin: 16px 0;
}
.detail-mutations h4 {
    font-size: 14px;
    margin-bottom: 8px;
}
.mutations-table {
    max-height: 200px;
    overflow-y: auto;
}
.mut-row {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--gray-light);
}
.mut-row .mut-chain {
    font-weight: 600;
    color: var(--primary);
}
.mut-row .mut-rationale {
    color: var(--gray);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-sequences {
    margin: 16px 0;
}
.detail-sequences h4 {
    font-size: 14px;
    margin-bottom: 8px;
}
.detail-sequences details {
    margin: 6px 0;
}
.detail-sequences summary {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
}
.detail-sequences .seq-display {
    font-size: 11px;
    background: var(--gray-light);
    padding: 8px;
    border-radius: 4px;
    word-break: break-all;
}
