/* =============================================
   CareMind - Modern Healthcare UI Design
   NO GRADIENTS - Solid Colors Only
   ============================================= */

/* Google Fonts - Plus Jakarta Sans */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Solid Colors - No Gradients */
    --primary: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #E0F2FE;

    --secondary: #10B981;
    --secondary-dark: #059669;
    --secondary-light: #D1FAE5;

    --accent: #8B5CF6;
    --accent-light: #EDE9FE;

    --warning: #F59E0B;
    --warning-light: #FEF3C7;

    --danger: #EF4444;
    --danger-light: #FEE2E2;

    /* Neutral Palette */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semantic */
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   Typography - BOLD Fonts
   ============================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
}

label {
    font-weight: 600;
}

strong,
b {
    font-weight: 700;
}

/* =============================================
   Layout
   ============================================= */
#app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    flex: 1;
    padding-bottom: 80px;
}

.page {
    display: none;
    padding: var(--space-6);
    flex-direction: column;
    gap: var(--space-6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   Loading Screen - NO GRADIENT
   ============================================= */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--space-4);
}

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

/* =============================================
   Navigation
   ============================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: var(--space-2) 0;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: var(--radius-lg);
}

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

.nav-btn.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-btn i,
.nav-btn svg {
    width: 22px;
    height: 22px;
}

/* =============================================
   Header
   ============================================= */
header {
    background: var(--surface);
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.header-content h1 {
    font-size: 1.25rem;
    font-weight: 800;
}

.user-greeting {
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
}

/* =============================================
   Buttons - Proportional Sizing
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.98);
}

/* Primary Button - SOLID COLOR */
/* Utility Classes */
.desktop-only {
    display: none !important;
}

/* Primary Button - SOLID COLOR */
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

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

/* Compact Button for headers */
.btn-compact {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-height: 32px;
    gap: 6px;
}

.btn-compact i,
.btn-compact svg {
    width: 16px;
    height: 16px;
}

/* Secondary Button - SOLID COLOR */
.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

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

.btn-text {
    background: none;
    color: var(--primary);
    font-weight: 700;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
}

.btn-icon:hover {
    background: var(--gray-100);
}

/* Small Button - Proportional */
.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    min-height: 36px;
    font-weight: 700;
}

/* Large Button */
.btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
    min-height: 52px;
}

.btn-block {
    width: 100%;
}

/* =============================================
   Cards - NO GRADIENT
   ============================================= */
.card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Stats Card - SOLID COLOR */
.stats-card {
    background: var(--primary);
    color: white;
    border: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.stat-item {
    text-align: center;
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

/* =============================================
   Forms
   ============================================= */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s;
    min-height: 48px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

/* =============================================
   Login Page - NO GRADIENT
   ============================================= */
#page-login {
    min-height: 100vh;
    background: var(--background);
    justify-content: center;
    align-items: center;
    padding: var(--space-6);
}

#page-login .container {
    width: 100%;
    max-width: 400px;
}

.logo-area {
    text-align: center;
    margin-bottom: var(--space-8);
}

.logo-area .logo-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: var(--space-4);
}

.logo-area h1 {
    font-size: 2rem;
    font-weight: 800;
}

.logo-area p {
    color: var(--text-secondary);
    font-weight: 600;
}

.auth-tabs {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: var(--space-6);
}

.tab-btn {
    flex: 1;
    padding: var(--space-3);
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.error-message {
    background: var(--danger-light);
    color: var(--danger);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
}

/* =============================================
   Dashboard
   ============================================= */
.dashboard-card {
    margin-bottom: var(--space-4);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

/* Badge */
.badge {
    display: inline-flex;
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--text-secondary);
}

.badge-success {
    background: var(--secondary-light);
    color: var(--secondary-dark);
}

/* =============================================
   Medication List
   ============================================= */
.medication-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.medication-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.med-time {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 60px;
}

.med-info {
    flex: 1;
}

.med-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.med-dosage {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Take Button */
.take-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-light);
    border: 2px solid var(--secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.take-btn:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

.take-btn:hover i,
.take-btn:hover svg {
    color: white !important;
}

.take-btn i,
.take-btn svg {
    width: 24px;
    height: 24px;
}

/* Medication Status */
.med-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.med-status i,
.med-status svg {
    width: 18px;
    height: 18px;
}

.med-status.taken {
    color: var(--secondary);
}

.med-status.skipped {
    color: var(--warning);
}

/* Medication Item States */
.medication-item.taken {
    background: var(--secondary-light);
    border-color: var(--secondary);
}

.medication-item.skipped {
    background: var(--warning-light);
    border-color: var(--warning);
    opacity: 0.8;
}

/* =============================================
   Check-in Wizard - CENTERED
   ============================================= */
.wizard-container {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-6) 0;
}

.wizard-step h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: var(--space-6);
    text-align: center;
}

.feeling-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    width: 100%;
}

.feeling-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4);
    min-width: 70px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.5rem;
    font-weight: 700;
}

.feeling-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.feeling-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* Centered Card in Wizard */
.wizard-step .card {
    width: 100%;
    max-width: 400px;
    text-align: left;
}

.wizard-step .form-group {
    text-align: left;
}

.header-actions {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-bottom: var(--space-4);
}

/* Stepper Centered */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin: var(--space-4) 0;
}

.stepper-value {
    font-size: 1.25rem;
    font-weight: 800;
    min-width: 100px;
    text-align: center;
}

/* Button Group Centered */
.btn-group {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
}

.quality-btn {
    flex: 1;
    max-width: 120px;
    padding: var(--space-3);
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.quality-btn:hover,
.quality-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-4) 0;
}

/* Range Input */
input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: var(--space-2);
}

/* Success Content */
.success-content {
    text-align: center;
    padding: var(--space-8);
}

.success-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
}

/* =============================================
   Charts
   ============================================= */
.chart-container {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-bottom: var(--space-6);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.chart-tabs {
    display: flex;
    gap: var(--space-2);
}

.chart-tab {
    padding: var(--space-2) var(--space-3);
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
}

.chart-tab.active {
    background: var(--primary);
    color: white;
}

.chart-canvas-wrapper {
    position: relative;
    height: 200px;
}

/* Medication Matrix (GitHub Style) */
.medication-matrix {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
}

.matrix-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: fit-content;
}

.matrix-label {
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 60px;
    max-width: 60px;
    text-align: right;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.matrix-cells {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.matrix-cell {
    width: 12px;
    height: 12px;
    background: var(--gray-200);
    border-radius: 2px;
    flex-shrink: 0;
}

.matrix-cell.taken {
    background: var(--secondary);
}

.matrix-cell.missed {
    background: var(--danger-light);
}

.matrix-legend {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-4);
    font-size: 0.75rem;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* =============================================
   Biometrics
   ============================================= */
.biometric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.biometric-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    cursor: pointer;
}

.bio-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bio Icons - SOLID Colors */
.bio-icon.red {
    background: #FEE2E2;
    color: #DC2626;
}

.bio-icon.pink {
    background: #FCE7F3;
    color: #DB2777;
}

.bio-icon.blue {
    background: #DBEAFE;
    color: #2563EB;
}

.bio-icon.green {
    background: #D1FAE5;
    color: #059669;
}

.bio-icon svg {
    width: 24px;
    height: 24px;
}

.bio-info {
    flex: 1;
}

.bio-info label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.bio-value {
    font-size: 1.1rem;
    font-weight: 800;
}

.add-indicator {
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

/* =============================================
   Chat - Mira (Female Doctor)
   ============================================= */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    max-height: 600px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

.chat-welcome {
    text-align: center;
    padding: var(--space-8) var(--space-4);
}

/* Doctor Avatar - Female Doctor */
.doctor-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-size: 40px;
    border: 3px solid var(--primary);
}

.bot-avatar {
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-size: 32px;
}

.chat-welcome h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.chat-welcome p {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-message.user .message-avatar {
    background: var(--gray-100);
}

.message-bubble {
    max-width: 75%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-weight: 500;
}

.chat-message.bot .message-bubble {
    background: var(--primary-light);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message.user .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.quick-questions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.quick-question-btn {
    padding: var(--space-3) var(--space-4);
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.quick-question-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.chat-input-area {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.chat-input-area input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 500;
}

.btn-send {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-send:hover {
    background: var(--primary-dark);
}

/* =============================================
   Profile
   ============================================= */
.profile-header {
    text-align: center;
    padding: var(--space-6);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
}

.profile-avatar svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
}

.profile-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
}

.profile-header p {
    color: var(--text-secondary);
    font-weight: 600;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
}

.setting-row span {
    font-weight: 600;
}

/* Toggle Switch */
.switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s;
}

.switch input:checked+.slider {
    background: var(--primary);
}

.switch input:checked+.slider::before {
    transform: translateX(24px);
}

/* =============================================
   Modals
   ============================================= */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
}

.modal-body {
    padding: var(--space-6);
}

/* =============================================
   Toast
   ============================================= */
.toast-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 2000;
}

.toast {
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
}

/* =============================================
   Empty States
   ============================================= */
.empty-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
}

.empty-state-sm {
    padding: var(--space-4);
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
}

/* =============================================
   Page Headers
   ============================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Time Inputs */
.time-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.time-inputs input {
    width: auto;
    min-width: 120px;
}

/* Alerts */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.alert-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--warning-light);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--warning);
}

/* Utilities */
.text-danger {
    color: var(--danger) !important;
}

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

.mb-4 {
    margin-bottom: var(--space-4);
}

.mt-4 {
    margin-top: var(--space-4);
}

/* =============================================
   Split Login Page Styles
   ============================================= */
.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-brand-col {
    display: none;
    /* Hidden on mobile */
    background: var(--primary);
    color: white;
    justify-content: center;
    align-items: center;
    padding: var(--space-8);
}

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

.brand-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-4);
}

.brand-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.brand-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: var(--space-8);
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
    margin: 0 auto;
    width: fit-content;
    text-align: left;
}

.brand-features span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    font-size: 1.1rem;
}

.login-form-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: var(--gray-50);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.mobile-only {
    display: block;
}

/* =============================================
   Chat Message Markdown Styles
   ============================================= */
.message-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.message-content em {
    font-style: italic;
}

.message-content code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-dark);
}

.message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.message-content li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.message-content h3,
.message-content h4 {
    font-weight: 700;
    margin: 1rem 0 0.5rem 0;
    color: var(--text-primary);
}

.message-content h3 {
    font-size: 1.1rem;
}

.message-content h4 {
    font-size: 1rem;
}

/* =============================================
   Health Page Mobile Styles
   ============================================= */
#page-health {
    overflow-x: hidden;
    max-width: 100vw;
}

.biometric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    width: 100%;
}

.biometric-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    cursor: pointer;
    transition: all 0.2s;
}

.biometric-card:hover {
    transform: translateY(-2px);
}

.bio-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bio-icon i,
.bio-icon svg {
    width: 24px;
    height: 24px;
}

.bio-icon.red {
    background: var(--danger-light);
    color: var(--danger);
}

.bio-icon.pink {
    background: #fce7f3;
    color: #ec4899;
}

.bio-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.bio-icon.green {
    background: var(--success-light);
    color: var(--success);
}

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

.bio-info label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

.bio-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.add-indicator {
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

/* Undo button style */
.undo-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.undo-btn:hover {
    background: var(--gray-100);
}

.undo-btn i,
.undo-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile health page fix */
@media (max-width: 767px) {
    #page-health {
        overflow-x: hidden !important;
        padding: var(--space-4);
    }

    .biometric-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2);
    }

    .biometric-card {
        padding: var(--space-3);
    }

    .bio-icon {
        width: 40px;
        height: 40px;
    }

    .bio-icon i,
    .bio-icon svg {
        width: 20px;
        height: 20px;
    }

    .bio-value {
        font-size: 1rem;
    }
}