:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --text-color: #111827;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --error-color: #ef4444;
    --success-color: #10b981;
    --border-color: #e5e7eb;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* --- Layout --- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background-color: var(--sidebar-bg);
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: white;
}

.sidebar-header h2 span {
    color: #818cf8;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.nav-title {
    padding: 1.5rem 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #4b5563;
    letter-spacing: 0.05em;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #9ca3af;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-hover);
    color: white;
}

.sidebar-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    padding: 2rem 3rem;
    overflow-y: auto;
    background-color: var(--bg-color);
}

.main-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.user-info strong {
    color: var(--text-color);
}

.btn-logout {
    font-size: 0.875rem;
    color: var(--error-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: #fee2e2;
    border-color: #fecaca;
}

/* --- UI Components --- */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

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

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.auth-logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 2rem;
    color: var(--sidebar-bg);
}

.auth-logo span {
    color: var(--primary-color);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    background-color: #f9fafb;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.data-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.row-inactive {
    background-color: #f9fafb;
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background-color: #f3f4f6;
    color: #374151;
}

.badge-info {
    background-color: #e0e7ff;
    color: #4338ca;
}

.badge-primary {
    background-color: #e0e7ff;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

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

.btn-secondary:hover {
    background-color: #f9fafb;
}

.btn-icon {
    padding: 0.5rem;
    color: var(--text-muted);
    background: transparent;
    border-radius: 6px;
}

.btn-icon:hover {
    background-color: #f3f4f6;
    color: var(--primary-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Utils */
.text-error {
    color: var(--error-color);
}

.text-success {
    color: var(--success-color);
}

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

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.btn-full {
    width: 100%;
}

/* Custom: Radio Selection Evolution (GMFCS Form) */
.radio-container {
    display: inline-block;
    cursor: pointer;
    font-size: 0.8125rem;
    user-select: none;
}

.radio-container input {
    display: none;
}

.checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    width: 38px;
    background-color: #f3f4f6;
    border-radius: 50%;
    font-weight: 700;
    color: #4b5563;
    transition: all 0.2s;
}

.radio-container:hover .checkmark {
    background-color: #e5e7eb;
}

.radio-container input:checked~.checkmark {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
}

/* Clinical Comparison Indicators */
.comp-col {
    flex: 1;
}

.comp-vs {
    font-size: 1.25rem;
    font-weight: 900;
    color: #d1d5db;
    padding: 0 2rem;
}

.text-right {
    text-align: right;
}

/* --- Landing Page --- */
.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5rem;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

.landing-logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: -0.05em;
}

.landing-logo span {
    color: #818cf8;
}

.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5rem;
    background: #0f172a;
    overflow: hidden;
}

.hero-content {
    max-width: 650px;
    z-index: 5;
    color: white;
}

.hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.05;
    margin-bottom: 2rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.hero-image-bg {
    position: absolute;
    right: 0;
    top: 0;
    width: 55%;
    height: 100%;
    background-image: url('../img/hero_neuroflow.png');
    background-size: cover;
    background-position: center;
    mask-image: linear-gradient(to left, black 50%, transparent);
    -webkit-mask-image: linear-gradient(to left, black 50%, transparent);
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

.btn-hero {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
}

.features-section {
    padding: 10rem 5rem;
    background: white;
}

.section-title {
    max-width: 800px;
    margin: 0 auto 6rem;
    text-align: center;
}

.section-title h2 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 1.5rem;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.feature-card {
    padding: 3rem;
    border-radius: 2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    background: white;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.cta-section {
    padding: 8rem 5rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    text-align: center;
    color: white;
}

.cta-content h2 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 2rem;
    letter-spacing: -0.05em;
}

.cta-content p {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-inline: auto;
}

.landing-footer {
    padding: 4rem 5rem;
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    border-top: 1px solid #1e293b;
}

@media (max-width: 1024px) {
    .hero-section {
        padding: 6rem 2rem;
        height: auto;
        min-height: 100vh;
    }

    .hero-image-bg {
        opacity: 0.3;
        width: 100%;
        mask-image: none;
        -webkit-mask-image: none;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-section,
    .cta-section {
        padding: 6rem 2rem;
    }

    .landing-nav {
        padding: 1.5rem 2rem;
    }
}