/* VibeGuard - Security Scanner UI */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --success: #34d399;
    --warning: #eab308;
    --danger: #ef4444;
    --danger-light: #fca5a5;
    --orange: #f97316;
    --border: #1e293b;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

.hidden { display: none !important; }

/* Header */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #818cf8, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 500px;
    margin: 0 auto;
}

.logo {
    margin-bottom: 16px;
}

/* Upload Section */
.upload-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border);
}

.consent-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Tabs */
.upload-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.tab-btn:hover:not(.active) {
    color: var(--text-secondary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.drop-icon { margin-bottom: 12px; }

.drop-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.browse-link {
    color: var(--accent-light);
    text-decoration: underline;
}

.drop-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* Input */
.input-group {
    padding: 20px 0;
}

.text-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.text-input:focus {
    border-color: var(--accent);
}

.text-input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Scan Button */
.scan-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-top: 20px;
}

.scan-btn:hover:not(:disabled) {
    background: var(--accent-light);
    transform: translateY(-1px);
}

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

/* Scanning Animation */
.scanning-section {
    text-align: center;
    padding: 60px 0;
}

.scanner-animation {
    margin-bottom: 24px;
}

.scanner-ring {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-ring-inner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--bg-tertiary);
    border-bottom-color: var(--success);
    border-radius: 50%;
    animation: spin 0.6s linear infinite reverse;
}

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

.scanning-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin: 0 auto 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
}

.progress-detail {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.scanner-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.scanner-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.scanner-item.active {
    color: var(--accent-light);
    background: rgba(99, 102, 241, 0.1);
}

.scanner-item.done {
    color: var(--success);
}

.scanner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.scanner-item.active .scanner-dot {
    background: var(--accent);
    animation: pulse 1s infinite;
}

.scanner-item.done .scanner-dot {
    background: var(--success);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h2 {
    font-size: 24px;
}

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

.btn-primary {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-attack {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-attack:hover {
    background: #dc2626;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

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

/* Attack Section */
.attack-section {
    margin-top: 24px;
}

.attack-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.attack-header h2 {
    font-size: 20px;
}

.attack-count {
    font-size: 13px;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 2px 10px;
    font-weight: 600;
}

.attack-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attack-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    border-left: 3px solid var(--danger);
    animation: attackFadeIn 0.3s ease;
}

@keyframes attackFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.attack-severity-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attack-severity-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-light);
}

.attack-severity-badge.high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--orange);
}

.attack-severity-badge.medium {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.attack-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.attack-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.attack-evidence {
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
}

.attack-evidence-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.attack-evidence-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--danger-light);
    font-size: 12px;
    word-break: break-all;
}

.attack-steps {
    margin-bottom: 12px;
}

.attack-steps-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.attack-step {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 3px 0;
}

.attack-poc {
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.attack-poc-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.attack-poc pre {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--danger-light);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

.attack-impact {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 6px;
    padding: 10px 14px;
}

.attack-impact-label {
    font-size: 11px;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.attack-impact-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.attack-card-toggle {
    background: none;
    border: none;
    color: var(--accent-light);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 8px;
}

.attack-card-toggle:hover {
    color: var(--accent);
}

/* Score Card */
.score-card {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.score-circle svg {
    width: 120px;
    height: 120px;
}

.score-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 36px;
    font-weight: 800;
}

.score-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 20%);
    font-size: 12px;
    color: var(--text-muted);
}

.grade-badge {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
}

.score-breakdown {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.breakdown-item {
    padding: 8px 16px;
    border-radius: 8px;
    text-align: center;
    min-width: 70px;
}

.breakdown-item .count {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.breakdown-item .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-item.critical { background: rgba(239,68,68,0.12); color: #ef4444; }
.breakdown-item.high { background: rgba(249,115,22,0.12); color: #f97316; }
.breakdown-item.medium { background: rgba(234,179,8,0.12); color: #eab308; }
.breakdown-item.low { background: rgba(34,197,94,0.12); color: #22c55e; }

/* Stack Info */
.stack-info {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stack-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stack-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Must Fix Banner */
.must-fix-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--danger-light);
}

.must-fix-banner.empty { display: none; }

/* Findings */
.findings-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.category-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-count {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    color: var(--text-muted);
}

.finding-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
    border-left: 4px solid;
    cursor: pointer;
    transition: all 0.2s;
}

.finding-card:hover {
    background: #243044;
}

.finding-card.sev-critical { border-left-color: #ef4444; }
.finding-card.sev-high { border-left-color: #f97316; }
.finding-card.sev-medium { border-left-color: #eab308; }
.finding-card.sev-low { border-left-color: #22c55e; }

.finding-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.finding-name {
    font-weight: 600;
    font-size: 14px;
}

.finding-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge-critical { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-high { background: rgba(249,115,22,0.15); color: #f97316; }
.badge-medium { background: rgba(234,179,8,0.15); color: #eab308; }
.badge-low { background: rgba(34,197,94,0.15); color: #22c55e; }

.finding-file {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-bottom: 6px;
}

.finding-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
}

.finding-expand {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.finding-card.expanded .finding-expand {
    display: block;
}

.expand-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.expand-fix {
    font-size: 13px;
    color: var(--success);
    background: rgba(34,211,153,0.06);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.expand-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 4px;
    overflow-x: auto;
    color: var(--text-muted);
}

.expand-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.expand-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.expand-btn:hover {
    background: #475569;
}

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

.expand-btn.primary:hover {
    background: var(--accent-light);
}

/* Deploy Guide */
.deploy-guide-section {
    margin-top: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border);
}

.deploy-guide-section h2 {
    margin-bottom: 20px;
}

.deploy-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.deploy-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 15px;
    margin-bottom: 6px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.step-command {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--success);
}

.step-variables {
    list-style: none;
    padding: 0;
}

.step-variables li {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: var(--bg-primary);
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.deploy-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.deploy-option {
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.deploy-option strong {
    color: var(--text-primary);
}

.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.checklist li::before {
    content: "\2610  ";
    margin-right: 8px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.guide-title {
    font-size: 20px;
    margin-bottom: 16px;
}

.guide-why {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 8px;
}

.guide-step {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
}

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

.guide-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.guide-step-title {
    font-weight: 600;
    font-size: 14px;
}

.guide-step-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.guide-step-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.guide-step-command {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--success);
}

/* Confirmation page */
.confirmation-box {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.confirmation-box h1 {
    margin: 16px 0 8px;
}

.confirmation-box > p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.confirmation-text {
    text-align: left;
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.confirmation-text ul {
    margin: 10px 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.confirmation-text li {
    margin-bottom: 6px;
}

.warning {
    color: var(--warning);
    font-size: 13px;
    margin-top: 12px;
}

/* Responsive */
@media (max-width: 640px) {
    .hero h1 { font-size: 28px; }
    .score-card { flex-direction: column; text-align: center; }
    .score-breakdown { justify-content: center; }
    .results-header { flex-direction: column; }
    .action-buttons { width: 100%; }
    .action-buttons .btn-primary,
    .action-buttons .btn-secondary { flex: 1; text-align: center; }
    .api-key-row { flex-direction: column; }
    .api-key-input-wrap { width: 100%; }
}

/* Hero top row */
.hero-top {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.settings-toggle {
    position: absolute;
    right: 0;
    top: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle:hover {
    color: var(--accent-light);
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
}

.settings-toggle.active {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent);
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
    animation: slideDown 0.25s ease;
}

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

.settings-header {
    margin-bottom: 24px;
}

.settings-header h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.settings-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.api-key-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-key-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.2s;
}

.api-key-row:focus-within {
    border-color: var(--accent);
}

.api-key-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.api-key-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    color: white;
}

.github-icon { background: #24292e; }
.gitlab-icon { background: #fc6d26; }
.openai-icon { background: #10a37f; }
.sentry-icon { background: #362d59; }
.stripe-icon { background: #635bff; }
.custom-key-icon { background: var(--bg-tertiary); color: var(--text-secondary); }

.api-key-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.api-key-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.api-key-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 360px;
}

.api-key-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}

.api-key-input:focus {
    border-color: var(--accent);
}

.api-key-input::placeholder {
    color: var(--text-muted);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
}

.api-key-toggle-vis {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.api-key-toggle-vis:hover {
    color: var(--text-secondary);
}

.api-key-status {
    font-size: 12px;
    flex-shrink: 0;
    min-width: 20px;
}

.api-key-status.saved { color: var(--success); }
.api-key-status.error { color: var(--danger); }

/* Custom keys section */
.custom-keys-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.custom-keys-section h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.custom-key-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.custom-key-row .api-key-name-input {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    width: 140px;
    flex-shrink: 0;
}

.custom-key-row .api-key-name-input:focus {
    border-color: var(--accent);
}

.custom-key-row .api-key-name-input::placeholder {
    color: var(--text-muted);
}

.custom-key-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.custom-key-delete:hover {
    color: var(--danger);
}

.btn-add-key {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px dashed var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.btn-add-key:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(99, 102, 241, 0.04);
}

/* Settings actions */
.settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-save-keys {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-keys:hover {
    background: var(--accent-light);
}

.btn-delete-all {
    padding: 10px 16px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-all:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.save-status {
    font-size: 13px;
    margin-left: auto;
}

.save-status.success { color: var(--success); }
.save-status.error { color: var(--danger); }
