:root {
    --bg-main: #f0f2f5;
    --sidebar: rgba(255, 255, 255, 0.7);
    --accent: #FF4B4B;
    --primary: #2D3436;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    color: var(--primary);
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #FF4B4B, #FF8E53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-item {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 500;
    color: #636e72;
}

.nav-item.active {
    background: white;
    box-shadow: var(--shadow);
    color: var(--accent);
}

.stats-card {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.2rem;
    border-radius: 16px;
    margin-top: auto;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.workspace {
    max-width: 1200px;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.field {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3436;
}

input,
select {
    padding: 0.8rem;
    border: 1px solid #dfe6e9;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
}

.field.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.full-width {
    grid-column: 1 / -1;
    background: rgba(0, 0, 0, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
}

.form-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.btn-primary {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(to right, #FF4B4B, #FF8E53);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(255, 75, 75, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 75, 75, 0.4);
}

/* Results Area */
.hidden {
    display: none !important;
}

.diagnosis-hero {
    background: linear-gradient(135deg, #FF9A9E 0%, #FAD0C4 99%, #FAD0C4 100%);
    border-radius: 24px;
    padding: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #2D3436;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-icon {
    font-size: 5rem;
    opacity: 0.8;
}

.urgency-tag {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-content h2 {
    font-size: 3rem;
    margin: 0.5rem 0;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.info-card {
    height: 100%;
}

.medical-text {
    line-height: 1.6;
    color: #444;
}

/* Metrics */
.metrics-grid {
    margin-top: 1.5rem;
}

.metric {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.metric span {
    width: 150px;
    font-weight: 600;
}

.bar {
    flex: 1;
    height: 10px;
    background: #dfe6e9;
    border-radius: 10px;
    overflow: hidden;
}

.bar div {
    height: 100%;
    background: var(--accent);
    border-radius: 10px;
    transition: 1s ease-out;
}

/* Loading Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner-box {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #dfe6e9;
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

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

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

/* Manual Tab & Utils */
.code-textarea {
    width: 100%;
    height: 300px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    padding: 1rem;
    background: #2d3436;
    color: #00cec9;
    border-radius: 12px;
    margin: 1rem 0;
    resize: vertical;
}

.sub-text {
    font-size: 0.9rem;
    color: #636e72;
    margin-bottom: 0.5rem;
}

.sidebar nav {
    flex: 1;
}

.nav-item {
    cursor: pointer;
}