/**
 * CellVision - Intelligent Sickle Cell Detection & Health Support Platform
 * Theme: Soft Blush Pink Page Background & Pastel Pink Sidebar
 * Palette: Pale pink-tinted surfaces, blush pinks, and original crimson red accents
 */

:root {
    --primary-crimson: #C82045;
    --primary-crimson-hover: #b0183b;
    --rose-red: #D93655;
    --rose-red-hover: #c42947;
    --soft-rose: #F08CA5;
    --soft-rose-light: #F7BAC8;
    --blush-pink: #FDE8ED;
    --blush-pink-hover: #F8D5DF;
    --background: #FCECEF;
    --white: #FFFFFF;
    --text: #321722;
    --text-light: #5A3D47;
    --muted: #805D67;
    --border: #F3C6D3;
    --border-light: #FAE8EE;
    --radius: 16px;
    --radius-sm: 9px;
    --shadow-sm: 0 2px 10px rgba(200, 32, 69, 0.05);
    --shadow-md: 0 6px 24px rgba(200, 32, 69, 0.09);
    --shadow-lg: 0 14px 38px rgba(200, 32, 69, 0.16);
    --success: #16845B;
    --success-bg: #EAF8F1;
    --warning: #B54708;
    --warning-bg: #FFF8EB;
    --warning-border: #FEDF89;
    --danger: #C82045;
    --danger-bg: #FCE8EE;
}

* {
    box-sizing: border-box;
}

/* Ensure the HTML `hidden` attribute always wins over component display rules
   (e.g. display:flex / display:grid), so JS show/hide toggles actually work. */
[hidden] {
    display: none !important;
}

body.app-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ========================================================= */
/* APP SHELL & LAYOUT                                        */
/* ========================================================= */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* 1. LEFT SIDEBAR (Pale Pink Theme) */
.sidebar {
    width: 260px;
    background: #F9DBE3;
    color: var(--text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--border);
    background: #F9DBE3;
}

/* 68x68 Circular Logo Frame */
.brand-logo-frame {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--soft-rose);
    box-shadow: 0 3px 10px rgba(200, 32, 69, 0.18);
    background: transparent;
}

.brand-logo-img {
    width: 110%;
    height: 110%;
    object-fit: cover;
    object-position: 30% center;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--primary-crimson);
    letter-spacing: -0.3px;
}

.brand-badge {
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-group-title {
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: 1.2px;
    color: var(--muted);
    padding: 14px 10px 6px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-light);
    font-size: 13.5px;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--blush-pink);
    color: var(--primary-crimson);
}

.nav-item.active {
    background: var(--primary-crimson);
    color: #FFFFFF;
    font-weight: 650;
    box-shadow: 0 4px 14px rgba(200, 32, 69, 0.3);
}

.nav-icon {
    font-size: 16px;
    line-height: 1;
    width: 20px;
    text-align: center;
}

.nav-label {
    flex: 1;
}

.nav-pill {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.live-pill {
    background: #10B981;
    color: #FFFFFF;
}

.nav-item.danger-item:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: #F9DBE3;
}

.model-info-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 600;
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    flex-shrink: 0;
}

/* ========================================================= */
/* MAIN WRAPPER & TOPBAR                                     */
/* ========================================================= */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--background);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 32px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.toggle-bar {
    width: 100%;
    height: 3px;
    background: var(--primary-crimson);
    border-radius: 2px;
}

.breadcrumb {
    font-size: 13.5px;
    color: var(--muted);
}

.breadcrumb-sep {
    margin: 0 6px;
    color: var(--soft-rose-light);
}

.breadcrumb-active {
    color: var(--primary-crimson);
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 650;
}

.status-checking {
    background: #F1F5F9;
    color: #64748B;
}

.status-online {
    background: var(--success-bg);
    color: var(--success);
}

.status-offline {
    background: var(--danger-bg);
    color: var(--danger);
}

.pill-dot {
    font-size: 9px;
}

.btn-topbar-action {
    padding: 7px 15px;
    background: var(--blush-pink);
    color: var(--primary-crimson);
    border: 1px solid var(--soft-rose);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s;
}

.btn-topbar-action:hover {
    background: var(--primary-crimson);
    color: #FFFFFF;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 5px;
    background: #FFFDFE;
    border: 1px solid var(--border);
    border-radius: 24px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-crimson);
    color: #FFFFFF;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 750;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.user-role {
    font-size: 10px;
    color: var(--muted);
}

/* ========================================================= */
/* DISCLAIMER BANNER                                         */
/* ========================================================= */
.disclaimer-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 32px;
    background: var(--warning-bg);
    border-bottom: 1px solid var(--warning-border);
    color: var(--warning);
    font-size: 12.5px;
}

.disclaimer-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.disclaimer-text {
    line-height: 1.4;
}

/* ========================================================= */
/* PAGE CONTAINER & VIEW PANELS                              */
/* ========================================================= */
.page-container {
    flex: 1;
    padding: 30px 32px;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
}

.view-panel {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.view-panel.active {
    display: block;
}

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

.panel-header {
    margin-bottom: 22px;
}

.panel-header h2 {
    margin: 0 0 4px;
    font-size: 25px;
    color: var(--primary-crimson);
    font-weight: 800;
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    gap: 16px;
}

.panel-header-row h2,
.panel-header-row h3 {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--primary-crimson);
    font-weight: 800;
}

/* Common Card Panel */
.panel {
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}

.panel h2 {
    margin: 0 0 6px;
    color: var(--primary-crimson);
    font-size: 19px;
    font-weight: 750;
}

.panel h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 16.5px;
    font-weight: 750;
}

.muted {
    color: var(--muted);
    font-size: 13.5px;
}

.d-block {
    display: block;
}

/* Prototype Demo Banner */
.prototype-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--blush-pink);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--primary-crimson);
    font-size: 13px;
    margin-bottom: 22px;
}

.badge-tag {
    background: var(--primary-crimson);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 750;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* ========================================================= */
/* BUTTONS & CONTROLS                                        */
/* ========================================================= */
.primary-button,
.secondary-button,
.outline-button {
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.primary-button {
    background: var(--primary-crimson);
    color: #FFFFFF;
    width: 100%;
}

.primary-button:hover:not(:disabled) {
    background: var(--primary-crimson-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(200, 32, 69, 0.28);
}

.primary-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.secondary-button {
    background: var(--blush-pink);
    color: var(--primary-crimson);
    width: 100%;
    border: 1px solid var(--border);
}

.secondary-button:hover:not(:disabled) {
    background: var(--blush-pink-hover);
    border-color: var(--soft-rose);
}

.outline-button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.outline-button:hover {
    border-color: var(--primary-crimson);
    color: var(--primary-crimson);
}

.btn-inline {
    width: auto;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 6px;
    width: auto;
}

.btn-full {
    width: 100%;
}

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

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

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger-bg);
}

.btn-table {
    padding: 4px 12px;
    background: var(--blush-pink);
    border: 1px solid var(--border);
    color: var(--primary-crimson);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-table:hover {
    background: var(--primary-crimson);
    color: #FFFFFF;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary-crimson);
    font-size: 13.5px;
    font-weight: 650;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link-sm {
    color: var(--primary-crimson);
    font-size: 12px;
    text-decoration: none;
    font-weight: 650;
}

/* ========================================================= */
/* PAGE 1: HOME (REDESIGNED WITH SUBTLE RBC BACKGROUND)      */
/* ========================================================= */
.hero-section {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 42px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.hero-with-bg {
    background-color: #FCECEF;
    background-image: url('assets/rbc-hero-bg.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: right center;
}

.hero-content {
    max-width: 680px;
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    color: var(--rose-red);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 2px;
}

.hero-heading {
    margin: 12px 0;
    font-size: clamp(26px, 3.8vw, 38px);
    color: var(--text);
    line-height: 1.25;
    font-weight: 800;
}

.hero-heading span {
    color: var(--primary-crimson);
}

.hero-subtext {
    color: var(--text-light);
    font-size: 15.5px;
    line-height: 1.6;
    margin: 0 0 26px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.hero-btn {
    width: auto;
    padding: 12px 22px;
    font-size: 14px;
}

.hero-metrics-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 2;
}

.hero-stat-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.hero-stat-card h3 {
    margin: 0;
    font-size: 22px;
    color: var(--primary-crimson);
    font-weight: 800;
}

.hero-stat-card p {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--muted);
}

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

.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.feature-icon {
    font-size: 30px;
    margin-bottom: 12px;
}

.feature-card h3 {
    margin: 0 0 6px;
    color: var(--primary-crimson);
    font-size: 17px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 13.5px;
    flex: 1;
    margin: 0 0 14px;
}

.card-link {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: var(--primary-crimson);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.card-link:hover {
    text-decoration: underline;
}

/* ========================================================= */
/* PAGES 2 & 3: FORMS & AUTHENTICATION                       */
/* ========================================================= */
.form-container {
    max-width: 680px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    background: #FFFFFF;
    transition: border 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-crimson);
    box-shadow: 0 0 0 3px rgba(200, 32, 69, 0.12);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-light);
    margin: 6px 0;
}

.checkbox-group input {
    margin-top: 3px;
    accent-color: var(--primary-crimson);
}

.form-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.auth-box {
    margin-bottom: 0;
}

.form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
}

.remember-me input {
    accent-color: var(--primary-crimson);
}

/* ========================================================= */
/* PAGE 4: DASHBOARD (REDESIGNED: PIE/DOUGHNUT & CARDS)      */
/* ========================================================= */
.dashboard-greeting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.dashboard-greeting h2 {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 25px;
    font-weight: 800;
}

.dashboard-greeting h2 span {
    color: var(--primary-crimson);
}

.quick-status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
}

.status-indicator-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.kpi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.kpi-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 650;
}

.kpi-val {
    font-size: 27px;
    font-weight: 800;
    color: var(--text);
    margin: 4px 0 2px;
}

.text-crimson {
    color: var(--primary-crimson) !important;
}

.kpi-subtext {
    font-size: 11.5px;
    color: var(--muted);
}

/* Dashboard Chart Row */
.dashboard-chart-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 22px;
}

.chart-panel {
    margin-bottom: 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-header h3 {
    margin: 0 0 2px;
    color: var(--primary-crimson);
    font-size: 17px;
}

.chart-badge {
    padding: 4px 12px;
    background: var(--blush-pink);
    color: var(--primary-crimson);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 750;
}

.chart-container-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 0;
}

.canvas-chart-box {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

#analysisDonutCanvas {
    max-width: 100%;
    max-height: 100%;
}

.chart-legend-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.dot-normal {
    background: #10B981;
}

.dot-sickle {
    background: #C82045;
}

.legend-info {
    display: flex;
    flex-direction: column;
}

.legend-title {
    font-size: 12.5px;
    color: var(--text-light);
    font-weight: 600;
}

.legend-val {
    font-size: 15px;
    color: var(--text);
    font-weight: 750;
}

.chart-empty-msg {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.tip-panel {
    background: #FFFDFE;
    border-left: 4px solid var(--primary-crimson);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 0;
}

.tip-body {
    font-size: 13.5px;
    color: var(--text-light);
    margin: 8px 0 16px;
}

.tip-body strong {
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

/* Recent Analyses Section (Card-Row Layout) */
.recent-analyses-panel {
    margin-bottom: 22px;
}

.recent-analyses-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.empty-analyses-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    background: #FFF9FB;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.recent-analysis-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: 0.15s;
    gap: 16px;
}

.recent-analysis-row:hover {
    border-color: var(--soft-rose);
    box-shadow: var(--shadow-sm);
}

.row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.row-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--blush-pink);
    flex-shrink: 0;
}

.row-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.row-pred-title {
    font-size: 14px;
    font-weight: 750;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-date {
    font-size: 11.5px;
    color: var(--muted);
}

.row-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.tag-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 750;
}

.tag-normal {
    background: var(--success-bg);
    color: var(--success);
}

.tag-sickle {
    background: var(--danger-bg);
    color: var(--danger);
}

.row-conf {
    font-size: 13.5px;
    font-weight: 750;
    color: var(--text);
}

/* ========================================================= */
/* PAGE 5: AI IMAGE ANALYSIS (TWO-STAGE WORKFLOW)            */
/* ========================================================= */
.upload-stage-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}

.stage-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--primary-crimson);
}

.stage-header p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13.5px;
}

.upload-area {
    display: flex;
    min-height: 160px;
    padding: 24px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--blush-pink);
    border: 2px dashed #E5A2B5;
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}

.upload-area:hover {
    background: #F8D8E2;
    border-color: var(--primary-crimson);
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--primary-crimson);
    background: #FFFFFF;
    font-size: 24px;
    box-shadow: 0 2px 6px rgba(200, 32, 69, 0.1);
}

.preview-stage-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    width: 100%;
    overflow: hidden;
}

.preview-image-card {
    position: relative;
    display: block;
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    background: #FFFDFE;
}

.preview-image {
    display: block;
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    object-fit: contain;
}

.preview-filename-badge {
    position: absolute;
    bottom: 12px;
    left: 14px;
    background: rgba(50, 23, 34, 0.8);
    color: #FFFFFF;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.image-action-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 640px;
    flex-wrap: wrap;
}

.image-action-buttons button {
    flex: 1;
    min-width: 140px;
}

.btn-crop {
    background: #FFF0F4;
    color: var(--primary-crimson);
    border-color: var(--soft-rose);
}

/* Cropper Container */
.cropper-container {
    width: 100%;
    max-width: 640px;
    padding: 16px;
    background: #FFF7F9;
    border: 1px dashed var(--primary-crimson);
    border-radius: 12px;
    margin: 10px 0;
}

.canvas-wrap {
    overflow: auto;
    max-height: 240px;
    margin: 10px 0;
    text-align: center;
    background: #000000;
    border-radius: 8px;
}

#cropCanvas {
    cursor: crosshair;
    max-width: 100%;
}

.crop-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.status {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
}

.sample-buttons-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.sample-buttons-row .btn-sm {
    width: auto;
}

.heatmap-compact {
    margin-top: 10px;
}

.heatmap-compact-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.heatmap-compact-wrap {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFDFE;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    padding: 4px;
}

.heatmap-compact-wrap img {
    display: block;
    width: 100%;
    max-height: 128px;
    object-fit: contain;
    border-radius: 4px;
}

.heatmap-compact-wrap .cam-placeholder-box {
    padding: 12px 10px;
    font-size: 11px;
}

/* Stage B: 3-Column Results Layout */
.analysis-results-section {
    margin-top: 12px;
}

.placeholder-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 44px 20px;
    text-align: center;
    background: #FFFBFD;
    border: 1px dashed var(--border);
}

.placeholder-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.results-three-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr;
    gap: 20px;
}

.result-column-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.column-header h3 {
    margin: 0;
    font-size: 15.5px;
    color: var(--primary-crimson);
}

.column-badge {
    padding: 3px 9px;
    background: var(--blush-pink);
    color: var(--primary-crimson);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 750;
}

.card-img-wrap {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFDFE;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    padding: 6px;
}

.card-img-wrap img {
    display: block;
    width: 100%;
    max-height: 230px;
    object-fit: contain;
    border-radius: 6px;
}

.cam-placeholder-box {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    padding: 24px 16px;
    line-height: 1.5;
}

.column-caption {
    font-size: 11.5px;
    color: var(--muted);
    margin: 10px 0 0;
    line-height: 1.4;
}

/* Prediction Output Card (Column 3) */
.prediction-column-card {
    background: #FFFDFE;
    border-top: 4px solid var(--primary-crimson);
}

.prediction-output-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pred-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--muted);
    text-transform: uppercase;
}

.pred-title {
    margin: 4px 0 14px;
    font-size: 21px;
    font-weight: 800;
    color: var(--primary-crimson);
    line-height: 1.25;
}

.confidence-section {
    margin-bottom: 14px;
}

.confidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.confidence-value {
    color: var(--primary-crimson);
    font-size: 15px;
    font-weight: 800;
}

.confidence-track {
    height: 9px;
    overflow: hidden;
    background: var(--blush-pink);
    border-radius: 12px;
}

.confidence-fill {
    width: 0;
    height: 100%;
    background: var(--primary-crimson);
    border-radius: inherit;
    transition: width 0.4s ease;
}

.prob-breakdown-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 14px;
}

.prob-chip {
    padding: 8px 10px;
    background: #FFF7F9;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prob-chip span {
    font-size: 11px;
    color: var(--muted);
}

.prob-chip strong {
    font-size: 14.5px;
    color: var(--text);
}

.clinical-disclaimer-box {
    padding: 10px 12px;
    background: var(--blush-pink);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 12px 0 16px;
    font-size: 11.5px;
    color: var(--text-light);
    line-height: 1.45;
}

.disclaimer-title {
    display: block;
    font-weight: 750;
    color: var(--primary-crimson);
    margin-bottom: 2px;
}

.clinical-disclaimer-box p {
    margin: 0;
}

.prediction-actions {
    margin-top: auto;
}

/* ========================================================= */
/* PAGE 6: MODEL PERFORMANCE                                 */
/* ========================================================= */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card {
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.metric-card p {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 650;
}

.metric-card h3 {
    margin: 0 0 4px;
    color: var(--primary-crimson);
    font-size: 28px;
    font-weight: 800;
}

.metric-card span {
    color: var(--muted);
    font-size: 11.5px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.metrics-table,
.confusion-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.metrics-table th,
.metrics-table td,
.confusion-table th,
.confusion-table td {
    padding: 12px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.confusion-table th,
.confusion-table td {
    text-align: center;
}

.metrics-table thead,
.confusion-table thead {
    background: var(--blush-pink);
    color: var(--primary-crimson);
    font-weight: 750;
}

.correct-cell {
    background: #EAF8F1;
    color: #16845B;
    font-weight: 750;
}

.error-cell {
    background: #FFF0F0;
    color: var(--danger);
    font-weight: 750;
}

.metrics-note {
    margin-top: 14px;
    color: var(--text);
    font-size: 13px;
    background: #FFF7F9;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-crimson);
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: #FFF7F9;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12.5px;
}

.spec-label {
    color: var(--muted);
}

.spec-val {
    color: var(--text);
    font-weight: 650;
}

/* ========================================================= */
/* PAGES 7 & 8: SYMPTOM ASSESSMENT & RESULTS                 */
/* ========================================================= */
.slider-wrap {
    background: #FFF7F9;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.form-range {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    accent-color: var(--primary-crimson);
    cursor: pointer;
}

.slider-indicators {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}

.slider-current-val {
    font-weight: 750;
    color: var(--primary-crimson);
    font-size: 13.5px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 6px;
}

.check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: #FFF7F9;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

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

.check-card input {
    accent-color: var(--primary-crimson);
}

.results-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

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

.results-status-badge {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 750;
}

.badge-warning {
    background: #FFFAEB;
    color: #B54708;
    border: 1px solid #FEDF89;
}

.badge-success {
    background: #EAF8F1;
    color: #16845B;
    border: 1px solid #A6F4C5;
}

.badge-danger {
    background: #FEF3F2;
    color: var(--danger);
    border: 1px solid #FECDCA;
}

.action-plan-box {
    margin: 20px 0;
    padding: 18px;
    background: #FFF2F6;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.action-plan-box h4 {
    margin: 0 0 10px;
    color: var(--primary-crimson);
    font-size: 14.5px;
}

.action-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text);
}

.emergency-alert-box {
    padding: 16px 18px;
    background: #FFF0F0;
    border: 1px solid #FECDCA;
    border-radius: 10px;
    color: var(--danger);
    margin-bottom: 22px;
}

.emergency-alert-box h4 {
    margin: 0 0 4px;
    font-size: 14.5px;
}

.emergency-alert-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.results-actions {
    display: flex;
    gap: 12px;
}

.results-actions button {
    width: auto;
}

/* ========================================================= */
/* PAGE 10: FIND A DOCTOR (WITH LOCATION SEARCH)             */
/* ========================================================= */
.doctor-search-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 22px;
}

.search-bar-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 15px;
    color: var(--muted);
}

.search-input-wrap .form-control {
    padding-left: 36px;
}

.geo-status-banner {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    margin-bottom: 12px;
    background: var(--blush-pink);
    color: var(--primary-crimson);
    border: 1px solid var(--border);
}

.filter-pills-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.filter-strip-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.pill-filter {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: 0.15s;
}

.pill-filter:hover {
    border-color: var(--primary-crimson);
    color: var(--primary-crimson);
}

.pill-filter.active {
    background: var(--primary-crimson);
    color: #FFFFFF;
    border-color: var(--primary-crimson);
}

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

.doctor-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.doctor-avatar {
    font-size: 36px;
    margin-bottom: 10px;
}

.doctor-card h3 {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.3;
}

.doctor-spec {
    color: var(--primary-crimson);
    font-size: 12.5px;
    font-weight: 700;
    margin: 0 0 8px;
}

.doctor-loc,
.doctor-hours,
.doctor-contact {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 5px;
    line-height: 1.4;
}

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

.doctor-actions button {
    flex: 1;
}

/* ========================================================= */
/* PAGE 11: HEALTH ASSISTANT CHATBOT                         */
/* ========================================================= */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 580px;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #FFF7F9;
    border-bottom: 1px solid var(--border);
}

.chat-bot-avatar {
    font-size: 26px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #FFFDFE;
}

.message {
    display: flex;
    max-width: 82%;
}

.msg-bot {
    align-self: flex-start;
}

.msg-user {
    align-self: flex-end;
}

.msg-bubble {
    padding: 11px 16px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
}

.msg-bot .msg-bubble {
    background: #FFFFFF;
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 2px 6px rgba(200, 32, 69, 0.04);
}

.msg-user .msg-bubble {
    background: var(--primary-crimson);
    color: #FFFFFF;
}

.prompt-pills {
    display: flex;
    gap: 8px;
    padding: 10px 18px;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    overflow-x: auto;
    white-space: nowrap;
}

.prompt-pill {
    padding: 5px 12px;
    background: var(--blush-pink);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 11.5px;
    font-weight: 650;
    color: var(--primary-crimson);
    cursor: pointer;
    transition: 0.15s;
    flex-shrink: 0;
}

.prompt-pill:hover {
    background: var(--primary-crimson);
    color: #FFFFFF;
}

.chat-input-bar {
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
}

.btn-send {
    width: 86px;
    flex-shrink: 0;
}

/* ========================================================= */
/* PAGE 12: MY REMINDERS                                     */
/* ========================================================= */
.reminders-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.reminder-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

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

.reminder-badge {
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 750;
}

.badge-med { background: #EAF8F1; color: #16845B; }
.badge-supp { background: #FFF0F4; color: var(--primary-crimson); }
.badge-hydro { background: #EFF8FF; color: #175CD3; }
.badge-clinic { background: #FDF4FF; color: #C026D3; }

.reminder-time {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.reminder-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.reminder-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.reminder-toggle input {
    accent-color: var(--primary-crimson);
}

/* ========================================================= */
/* PAGE 13: LEARN & EXPLORE                                  */
/* ========================================================= */
.learn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.learn-card {
    margin-bottom: 0;
}

.learn-topic {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--rose-red);
}

.learn-card h3 {
    margin: 6px 0 8px;
    font-size: 16.5px;
    color: var(--text);
}

.learn-card p {
    color: var(--text-light);
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0;
}

.learn-card-alert {
    grid-column: 1 / -1;
    background: #FFF7F9;
    border-left: 4px solid var(--danger);
}

/* ========================================================= */
/* PAGE 14: MY PROFILE                                       */
/* ========================================================= */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 22px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-avatar-lg {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--primary-crimson);
    color: #FFFFFF;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 750;
    margin-bottom: 12px;
}

.profile-card h3 {
    margin: 0 0 4px;
    font-size: 19px;
}

.tag-success {
    background: #EAF8F1;
    color: #16845B;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin: 6px 0 14px;
}

.profile-meta-list {
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    font-size: 13px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.meta-item span {
    color: var(--muted);
    font-size: 11.5px;
}

.meta-item strong {
    color: var(--text);
}

/* ========================================================= */
/* PAGES 15 & 16: SETTINGS, PRIVACY & SUPPORT                */
/* ========================================================= */
.settings-group {
    margin-bottom: 20px;
}

.status-text {
    font-size: 12.5px;
    margin-top: 8px;
}

.emergency-callout {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #FFF2F5;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-crimson);
    margin-bottom: 22px;
}

.emergency-icon {
    font-size: 38px;
    flex-shrink: 0;
}

.emergency-callout h3 {
    margin: 0 0 4px;
    color: var(--primary-crimson);
    font-size: 17px;
}

.emergency-callout p {
    margin: 0;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.5;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    margin-bottom: 0;
}

.faq-item h3 {
    margin: 0 0 6px;
    font-size: 15.5px;
    color: var(--primary-crimson);
}

.faq-item p {
    margin: 0;
    line-height: 1.55;
}

/* ========================================================= */
/* PAGE 17: LOGOUT MODAL CARD                                */
/* ========================================================= */
.logout-modal-card {
    max-width: 480px;
    margin: 50px auto;
    text-align: center;
    padding: 34px;
}

.logout-icon {
    font-size: 44px;
    margin-bottom: 14px;
}

.logout-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

/* ========================================================= */
/* 8. PERSISTENT FLOATING AI HEALTH ASSISTANT WIDGET         */
/* ========================================================= */
.floating-assistant-wrapper {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
}

/* Floating Action Button */
.floating-chat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--primary-crimson);
    color: #FFFFFF;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(200, 32, 69, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-chat-btn:hover {
    background: var(--primary-crimson-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 28px rgba(200, 32, 69, 0.42);
}

.floating-chat-btn:focus-visible {
    outline: 3px solid var(--soft-rose);
    outline-offset: 2px;
}

.chat-btn-icon {
    font-size: 18px;
    line-height: 1;
}

/* Slide-up Chat Panel */
.floating-chat-panel {
    position: fixed;
    bottom: 84px;
    right: 28px;
    width: 340px;
    height: 440px;
    max-height: calc(100vh - 110px);
    max-width: calc(100vw - 40px);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.floating-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary-crimson);
    color: #FFFFFF;
}

.floating-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-bot-avatar {
    font-size: 20px;
}

.floating-header-info strong {
    font-size: 13.5px;
    display: block;
    line-height: 1.2;
}

.floating-bot-sub {
    font-size: 10px;
    opacity: 0.9;
    display: block;
}

.btn-icon-close {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 12px;
    transition: 0.15s;
}

.btn-icon-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.floating-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #FFFDFE;
}

.f-msg {
    display: flex;
    max-width: 86%;
}

.f-msg-bot {
    align-self: flex-start;
}

.f-msg-user {
    align-self: flex-end;
}

.f-bubble {
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.45;
}

.f-msg-bot .f-bubble {
    background: #FFFFFF;
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(200, 32, 69, 0.04);
}

.f-msg-user .f-bubble {
    background: var(--primary-crimson);
    color: #FFFFFF;
}

.floating-prompt-pills {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    background: #FFF9FB;
    border-top: 1px solid var(--border-light);
    overflow-x: auto;
    white-space: nowrap;
}

.f-pill {
    padding: 4px 10px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 11px;
    font-weight: 650;
    color: var(--primary-crimson);
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.15s;
}

.f-pill:hover {
    background: var(--primary-crimson);
    color: #FFFFFF;
}

.floating-chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
}

.f-input {
    font-size: 12.5px;
    padding: 8px 12px;
}

.f-send-btn {
    width: 68px;
    padding: 8px 12px;
    font-size: 12.5px;
    flex-shrink: 0;
}

/* ========================================================= */
/* FOOTER                                                    */
/* ========================================================= */
.app-footer {
    padding: 22px 32px;
    background: var(--white);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-content {
    max-width: 1240px;
    margin: 0 auto;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-light);
}

.footer-disclaimer {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11.5px;
}

/* ========================================================= */
/* RESPONSIVE MEDIA QUERIES                                  */
/* ========================================================= */
@media (max-width: 1080px) {
    .kpi-grid,
    .metrics-grid,
    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-metrics-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-chart-row {
        grid-template-columns: 1fr;
    }

    .results-three-columns {
        grid-template-columns: 1fr 1fr;
    }

    .prediction-column-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(50, 23, 34, 0.45);
        z-index: 950;
    }

    .sidebar-toggle {
        display: flex;
    }

    .results-three-columns,
    .auth-layout,
    .feature-grid,
    .form-row,
    .reminders-grid,
    .learn-grid,
    .profile-layout,
    .specs-grid,
    .checkbox-grid,
    .search-bar-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 12px 18px;
    }

    .page-container {
        padding: 20px 16px;
    }

    .hero-section {
        padding: 28px 18px;
    }

    .floating-assistant-wrapper {
        bottom: 18px;
        right: 18px;
    }

    .floating-chat-panel {
        bottom: 74px;
        right: 18px;
    }
}

@media (max-width: 600px) {
    .kpi-grid,
    .metrics-grid,
    .doctors-grid,
    .hero-metrics-strip,
    .results-three-columns {
        grid-template-columns: 1fr;
    }

    .topbar-right .btn-topbar-action,
    .topbar-right .user-pill {
        display: none;
    }

    .chart-container-wrap {
        flex-direction: column;
        align-items: center;
    }

    .search-bar-row {
        flex-direction: column;
    }

    .search-bar-row button {
        width: 100%;
    }

    .floating-chat-panel {
        width: calc(100vw - 32px);
        height: min(420px, calc(100vh - 110px));
        right: 16px;
        left: 16px;
    }
}