:root {
    /* Clinical Tech-Noir Palette */
    --bg-obsidian: #050a14;
    --bg-navy: #0a1120;
    --glass-panel: rgba(16, 23, 39, 0.7);
    --glass-border: rgba(0, 243, 255, 0.2);

    --accent-cyan: #00f3ff;
    --accent-msg: #05d5e0;
    --alert-red: #ff2a6d;
    --success-green: #05ff00;

    --text-primary: #e0faff;
    --text-secondary: #7e8c9f;
    --text-muted: #4e5d6d;

    /* Spacing & sizing */
    --u-spacing: 24px;
    --u-radius: 4px;
    /* Clinical sharp edges */
}

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

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
.logo,
.tech-mono,
.stat-val {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.05em;
}

/* --- Layout: Dashboard --- */
body:not(.landing-page) {
    display: flex;
}

.sidebar {
    width: 240px;
    background: var(--glass-panel);
    border-right: 1px solid var(--glass-border);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 30px;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.logo-mark {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 60px;
    letter-spacing: 2px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    margin-bottom: 24px;
    text-decoration: none;
    transition: 0.2s;
    font-family: 'JetBrains Mono';
    font-size: 14px;
    padding: 10px;
    border-radius: 4px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.05);
}

.nav-icon {
    display: flex;
    align-items: center;
}

.nav-spacer {
    flex: 1;
}

.dashboard-container {
    flex: 1;
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* Header */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.breadcrumb .accent {
    color: var(--accent-cyan);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.credits-badge {
    font-family: 'JetBrains Mono';
    font-size: 12px;
    color: var(--accent-cyan);
    border: 1px solid var(--glass-border);
    padding: 4px 12px;
    border-radius: 99px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-cyan), #0066ff);
    color: var(--bg-obsidian);
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2px;
}

/* --- Glass Panels --- */
.glass-panel {
    background: var(--glass-panel);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: var(--u-radius);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

/* --- Upload Zone --- */
#drop-zone {
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
    border: 1px dashed var(--glass-border);
}

#drop-zone:hover {
    background: rgba(0, 243, 255, 0.05);
    border-color: var(--accent-cyan);
}

.icon-container {
    color: var(--accent-cyan);
    margin-bottom: 16px;
}

#drop-zone h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

#drop-zone p {
    color: var(--text-secondary);
    font-size: 14px;
}

.file-types {
    margin-top: 16px;
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono';
    letter-spacing: 1px;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    margin-top: 30px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.panel-header h3 {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Gauge */
.gauge-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.gauge {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge circle {
    fill: none;
    stroke-width: 6;
}

.gauge-bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.gauge-value {
    stroke: var(--alert-red);
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'JetBrains Mono';
    font-size: 40px;
    font-weight: 700;
}

.unit {
    font-size: 14px;
    color: var(--text-secondary);
}

.tech-badge {
    text-align: center;
    margin-top: 16px;
    font-family: 'JetBrains Mono';
    font-size: 14px;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

/* Ensemble Bars */
.ensemble-breakdown {
    margin-top: 40px;
}

.expert-row {
    font-family: 'JetBrains Mono';
    font-size: 11px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.expert-row span:first-child {
    width: 100px;
}

.tech-bar-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.tech-bar {
    height: 100%;
    background: var(--accent-cyan);
    width: 0%;
    transition: width 1s;
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* Evidence Tabs */
.tabs {
    display: flex;
    gap: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'JetBrains Mono';
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.1);
}

.tab-content {
    display: none;
}

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

.image-viewport {
    width: 100%;
    height: 400px;
    background: #000;
    margin-bottom: 16px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.image-viewport img {
    max-width: 100%;
    max-height: 100%;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: scan 3s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.explanation {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono';
    padding-left: 10px;
    border-left: 2px solid var(--accent-cyan);
}

/* Buttons */
.tech-btn {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 12px 24px;
    font-family: 'JetBrains Mono';
    font-weight: 700;
    cursor: pointer;
    margin-top: 24px;
    transition: 0.2s;
    width: 100%;
    text-transform: uppercase;
}

.tech-btn:hover {
    background: var(--accent-cyan);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

/* Landing Page Specifics */
.landing-page {
    position: relative;
    overflow: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo .accent-dot {
    color: var(--accent-cyan);
}

.tech-btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 8px 20px;
    font-size: 12px;
    font-family: 'JetBrains Mono';
    cursor: pointer;
}

.tech-btn-outline:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.hero-section {
    text-align: center;
    margin-top: 10vh;
}

.glitch-text {
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    color: var(--text-primary);
}

.hero-sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 60px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 60px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-sep {
    color: rgba(255, 255, 255, 0.1);
    font-family: 'JetBrains Mono';
    font-size: 24px;
}

.stat-val {
    font-size: 24px;
    color: var(--accent-cyan);
    font-weight: 700;
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono';
    letter-spacing: 2px;
    margin-top: 4px;
}

.tech-btn-lg {
    background: var(--accent-cyan);
    color: #000;
    border: none;
    padding: 16px 48px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'JetBrains Mono';
    cursor: pointer;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
}

.tech-btn-lg:hover {
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.4);
}

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

.modal-card {
    background: #0a1120;
    border: 1px solid var(--accent-cyan);
    width: 400px;
    padding: 40px;
    position: relative;
}

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

.modal-card h2 {
    font-size: 16px;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    text-align: center;
}

.instruction {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.tech-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono';
    margin-bottom: 20px;
    text-align: center;
}

.tech-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.tech-btn-full {
    width: 100%;
    background: var(--accent-cyan);
    color: #000;
    border: none;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Loader */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-obsidian);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.cyber-loader {
    width: 50px;
    height: 50px;
    border: 2px solid var(--accent-cyan);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* History Table */
.tech-table {
    width: 100%;
    border-collapse: collapse;
}

.tech-table th {
    text-align: left;
    font-family: 'JetBrains Mono';
    font-size: 11px;
    color: var(--text-muted);
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tech-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.mono-text {
    font-family: 'JetBrains Mono';
}

.badge.success {
    color: var(--success-green);
}

.badge.danger {
    color: var(--alert-red);
}

.small {
    font-size: 12px;
    color: var(--text-muted);
}

.badge.warning {
    color: #ff9900;
}