/* ============== Bohrium-Style CSS Variables ============== */
:root {
    /* Primary Colors - Subtle Bohrium Blue */
    --primary: #6B7B98;
    --primary-dark: #5A6A87;
    --primary-darker: #4A5A77;
    --primary-light: #F0F2F5;
    --primary-lighter: #F8F9FB;

    /* Accent Colors - Muted */
    --accent: #8B9BB5;
    --accent-light: #E8ECF2;

    /* Semantic Colors */
    --success: #5BAD7A;
    --success-light: #E8F5ED;
    --warning: #D4A054;
    --warning-light: #FDF6E9;
    --danger: #C97676;
    --danger-light: #FBEAEA;
    --purple: #9B8BB5;
    --purple-light: #F3F0F7;

    /* Gray Scale - Soft Neutral */
    --gray-50: #FAFBFC;
    --gray-100: #F4F5F7;
    --gray-200: #E8EAEE;
    --gray-300: #D4D8DE;
    --gray-400: #A0A8B4;
    --gray-500: #6E7787;
    --gray-600: #525B6A;
    --gray-700: #3D4451;
    --gray-800: #282D36;
    --gray-900: #1A1D23;

    /* Base */
    --white: #FFFFFF;
    --black: #000000;

    /* Layout */
    --sidebar-width: 56px;
    --sidebar-expanded-width: 240px;
    --patient-panel-width: 320px;
    --header-height: 56px;

    /* Gradients - Soft & Subtle */
    --gradient-sidebar: linear-gradient(180deg, #3D4451 0%, #525B6A 100%);
    --gradient-primary: linear-gradient(135deg, #6B7B98 0%, #8B9BB5 100%);
    --gradient-bg: linear-gradient(145deg, #FAFBFC 0%, #F4F5F7 50%, #F8F9FB 100%);

    /* Glassmorphism - Softer */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-bg-solid: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(228, 231, 236, 0.8);
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    --glass-blur: blur(16px);

    /* Shadows - Very Subtle */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.04);
    --shadow-glass: 0 4px 20px rgba(0, 0, 0, 0.05);

    /* Border Radius - More Rounded */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ============== Reset & Base ============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Source Sans 3', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* ============== IKSA Logo ============== */
.iksa-logo {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.5px;
}

.iksa-logo .logo-text {
    color: #ffffff;
}

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

/* ============== Login Page - Split Layout ============== */
.login-page {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background: var(--gradient-sidebar);
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
}

.login-left-content {
    max-width: 480px;
}

.login-left h1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin: 32px 0 16px;
}

.login-left>div>p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 40px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.feature-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.login-left-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.login-left-footer .dot {
    color: var(--accent);
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--white);
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-header {
    margin-bottom: 32px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.error-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--danger-light);
    border: 1px solid #FCA5A5;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.error-alert svg {
    width: 18px;
    height: 18px;
    color: var(--danger);
    flex-shrink: 0;
}

.error-alert .error-text {
    color: var(--danger);
    font-size: 13px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 14px;
    transition: all 0.2s;
    background: var(--white);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.password-toggle svg {
    position: static;
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.forgot-password {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.login-btn.primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.3);
}

.login-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.login-btn.primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.login-btn.sso {
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    border-radius: var(--radius-full);
}

.login-btn.sso:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.loading-indicator {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    min-height: 200px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.loading-text {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

.message.sending {
    opacity: 0.7;
}

.message-status {
    font-size: 11px;
    color: var(--gray-400);
    font-style: italic;
    margin-top: 4px;
    display: block;
}

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

.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.divider span {
    padding: 0 14px;
    color: var(--gray-400);
    font-size: 13px;
}

.login-footer-text {
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
    margin-top: 20px;
}

.demo-credentials {
    margin-top: 16px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px dashed var(--gray-300);
}

.demo-credentials p {
    font-size: 12px;
    color: var(--gray-500);
    font-family: 'SF Mono', Monaco, monospace;
}

/* ============== Dashboard Layout - Bohrium Style ============== */
.dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--gradient-bg);
    position: relative;
}

/* Decorative background elements */
.dashboard::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 50%;
    height: 60%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.dashboard::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -10%;
    width: 50%;
    height: 60%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ============== Left Sidebar - Bohrium Icon Navigation ============== */
.sidebar-nav-only {
    width: var(--sidebar-width);
    background: var(--glass-bg-solid);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: var(--shadow-glass);
}

.sidebar-brand {
    margin-bottom: 24px;
    padding: 8px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    width: 100%;
    padding: 0 8px;
}

.nav-item {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0 auto;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    transition: all 0.2s ease;
}

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

.nav-item:hover svg {
    color: var(--primary);
}

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

.nav-item.active svg {
    color: var(--primary);
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    width: 100%;
    padding: 16px 8px 0;
}

.nav-item.logout:hover {
    background: var(--danger-light);
}

.nav-item.logout:hover svg {
    color: var(--danger);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

.user-avatar-small:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

/* ============== Patient List Panel - Glassmorphism Style ============== */
.patient-list-panel {
    width: var(--patient-panel-width);
    background: var(--glass-bg-solid);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 50;
}

.panel-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.patient-count {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

.search-box {
    padding: 0 16px 16px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 28px;
    width: 16px;
    height: 16px;
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 10px 32px 10px 40px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 13px;
    background: var(--white);
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.clear-search {
    position: absolute;
    right: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search svg {
    position: static;
    width: 14px;
    height: 14px;
    color: var(--gray-400);
}

.clear-search:hover svg {
    color: var(--gray-600);
}

.patient-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

/* Patient Card - Glassmorphism Style */
.patient-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
    background: transparent;
}

.patient-card:hover {
    background: var(--white);
    border-color: var(--gray-200);
    box-shadow: var(--shadow-card);
}

.patient-card.selected {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.15);
}

.patient-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
}

.patient-avatar[data-status="active"]::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: var(--radius-full);
    border: 2px solid white;
}

.patient-info {
    flex: 1;
    min-width: 0;
}

.patient-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.patient-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.patient-time {
    font-size: 11px;
    color: var(--gray-400);
    flex-shrink: 0;
    margin-left: 8px;
}

.unread-badge {
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.patient-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.patient-meta svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.patient-preview {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

/* ============== Main Content - Glassmorphism Style ============== */
.main-content-scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: transparent;
    padding: 20px;
    z-index: 10;
}

/* Sticky Header - Glassmorphism Style */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    box-shadow: var(--shadow-glass);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    min-height: var(--header-height);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.patient-info-badge {
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
    padding: 8px 14px;
    background: var(--white);
    border-radius: var(--radius-full);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
}

.status-dot.connected {
    background: var(--success);
}

.status-dot.disconnected {
    background: var(--danger);
}

/* ============== Content Sections - Glassmorphism Card Style ============== */
.content-section {
    padding: 24px;
    margin-bottom: 20px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
}

.content-section:last-child {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 16px;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.section-header h3 svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.section-content {
    background: var(--white);
}

.placeholder-content {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
    font-size: 13px;
}

/* ============== Chat Section - Glassmorphism Style ============== */
#chat-section {
    padding: 24px;
    margin-bottom: 20px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
}

#chat-section .section-content {
    display: flex;
    flex-direction: column;
}

.chat-layout {
    display: flex;
    flex-direction: column;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    height: 450px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    max-height: 350px;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
}

.empty-state svg {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
}

/* Messages - Bohrium Chat Style */
.message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    max-width: 75%;
}

.message.user {
    margin-right: auto;
}

.message.agent,
.message.clinician {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    line-height: 1.6;
}

.message.user .message-bubble {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) 6px;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
}

.message.agent .message-bubble,
.message.clinician .message-bubble {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 6px var(--radius-xl);
    box-shadow: 0 2px 12px rgba(67, 97, 238, 0.25);
}

.message-time {
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 4px;
}

.message.agent .message-time,
.message.clinician .message-time {
    text-align: right;
}

.message-agent-tag {
    font-size: 10px;
    color: var(--gray-400);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

/* Message Input - Glassmorphism Style */
.message-input-container {
    padding: 16px 24px;
    background: var(--white);
    border-top: 1px solid var(--gray-100);
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    transition: all 0.2s;
}

.input-row:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
    background: var(--white);
}

.attach-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: all 0.15s;
}

.attach-btn:hover {
    background: var(--gray-200);
}

.attach-btn svg {
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.attach-btn:hover svg {
    color: var(--primary);
}

.input-row input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    outline: none;
    color: var(--gray-800);
}

.input-row input::placeholder {
    color: var(--gray-400);
}

.char-count {
    font-size: 10px;
    color: var(--gray-400);
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.send-btn svg {
    width: 16px;
    height: 16px;
    color: white;
}

.send-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

.send-btn:not(:disabled):hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.4);
}

/* Attachment Preview */
.attachment-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.attachment-preview img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.attachment-preview .remove-btn {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
}

.attachment-preview .remove-btn:hover {
    color: var(--danger);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    margin: 0 24px 12px;
    border-radius: var(--radius-lg);
    width: fit-content;
}

.typing-indicator span:not(.typing-text) {
    width: 6px;
    height: 6px;
    background: var(--gray-400);
    border-radius: var(--radius-full);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

.typing-text {
    font-size: 11px;
    color: var(--gray-500);
    margin-left: 6px;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-3px);
    }
}

/* Upload Progress */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s;
}

#progress-text {
    font-size: 11px;
    color: var(--gray-500);
}

/* ============== Stats Grid - Glassmorphism Style ============== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-card);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glass);
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

/* ============== Tabs - Glassmorphism Style ============== */
.survey-tabs,
.document-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--white);
    padding: 4px;
    border-radius: var(--radius-full);
    width: fit-content;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.survey-tab,
.doc-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.survey-tab:hover,
.doc-tab:hover {
    color: var(--primary);
}

.survey-tab.active,
.doc-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

/* ============== Survey List - Glassmorphism Style ============== */
.survey-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.survey-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
    box-shadow: var(--shadow-card);
}

.survey-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glass);
}

.survey-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.survey-info p {
    font-size: 12px;
    color: var(--gray-500);
}

.survey-status {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.survey-status.completed {
    background: var(--success-light);
    color: var(--success);
}

.survey-status.pending {
    background: var(--warning-light);
    color: var(--warning);
}

/* ============== Documents Grid - Glassmorphism Style ============== */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.document-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-card);
}

.document-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glass);
}

.document-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.document-icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.document-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 11px;
    color: var(--gray-500);
}

/* ============== Scrollbar - Glassmorphism Style ============== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(67, 97, 238, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 97, 238, 0.35);
}

/* ============== Responsive ============== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content-scroll {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }

    .login-left {
        display: none;
    }

    .dashboard {
        flex-direction: column;
    }

    .dashboard::before,
    .dashboard::after {
        display: none;
    }

    .sidebar-nav-only {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 8px 12px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .sidebar-brand {
        margin-bottom: 0;
        margin-right: 16px;
    }

    .nav-menu {
        flex-direction: row;
        gap: 2px;
    }

    .sidebar-bottom {
        flex-direction: row;
        margin-top: 0;
        margin-left: auto;
        padding: 0;
        border-top: none;
    }

    .patient-list-panel {
        width: 100%;
        max-height: 35vh;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

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

    .main-content-scroll {
        padding: 12px;
    }

    .content-section {
        padding: 16px;
        margin-bottom: 12px;
    }

    .sticky-header {
        margin-bottom: 12px;
    }

    .main-header {
        padding: 12px 16px;
    }

    .messages-container {
        padding: 16px;
    }

    .message-input-container {
        padding: 12px 16px;
    }
}

/* ============== Animation Classes ============== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

.fade-in {
    animation: fadeIn 0.2s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* ============== Conversation Insights Panel ============== */
.insights-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.urgency-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 13px;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.urgency-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

.insight-card {
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s;
}

.insight-card:hover {
    box-shadow: var(--shadow-glass);
}

.insight-card h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.emotion-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    background: var(--gray-100);
    color: var(--gray-600);
}

.emotion-badge[data-emotion="anxious"] {
    background: var(--warning-light);
    color: #B45309;
}

.emotion-badge[data-emotion="frustrated"] {
    background: var(--danger-light);
    color: #B91C1C;
}

.emotion-badge[data-emotion="curious"] {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.emotion-badge[data-emotion="celebrating"] {
    background: var(--success-light);
    color: #047857;
}

.emotion-badge[data-emotion="confused"] {
    background: var(--purple-light);
    color: #6D28D9;
}

.emotion-badge[data-emotion="neutral"] {
    background: var(--gray-100);
    color: var(--gray-600);
}

.escalation-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.escalation-badge[data-type="URGENT"] {
    background: var(--danger);
    color: white;
}

.escalation-badge[data-type="MEDICAL_REVIEW"] {
    background: var(--warning);
    color: white;
}

.escalation-badge[data-type="COACH_FOLLOWUP"] {
    background: var(--primary);
    color: white;
}

.insight-summary {
    font-size: 14px;
    color: var(--gray-800);
    line-height: 1.5;
    margin-bottom: 8px;
}

.insight-call-reason {
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
}

/* Opener Card */
.opener-card {
    background: var(--primary-lighter);
    border-color: var(--primary-light);
}

.opener-card h4 {
    color: var(--primary-dark);
}

.opener-text {
    font-size: 14px;
    color: var(--gray-700);
    font-style: italic;
    line-height: 1.5;
}

/* Quotes Card */
.quotes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quote-item {
    padding: 10px 12px;
    background: var(--gray-50);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.quote-text {
    font-size: 13px;
    color: var(--gray-700);
    font-style: italic;
    margin-bottom: 4px;
}

.quote-significance {
    font-size: 11px;
    color: var(--gray-500);
}

/* AI Context Card */
.ai-context-card {
    background: var(--accent-light);
    border-color: #BFDBFE;
}

.ai-context-card h4 {
    color: #1D4ED8;
}

.ai-info-shared,
.ai-guidance {
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.ai-info-shared ul,
.ai-guidance ul {
    margin-left: 16px;
    margin-top: 4px;
}

.ai-info-shared li,
.ai-guidance li {
    margin-bottom: 4px;
}

/* Needs Human Card */
.needs-human-card {
    background: var(--warning-light);
    border-color: #FDE68A;
}

.needs-human-card h4 {
    color: #B45309;
}

.needs-human-list {
    margin-left: 16px;
    font-size: 13px;
    color: var(--gray-700);
}

.needs-human-list li {
    margin-bottom: 6px;
}

/* Talking Points Card */
.talking-points-card {
    background: var(--success-light);
    border-color: #A7F3D0;
}

.talking-points-card h4 {
    color: #047857;
}

.talking-points-list {
    margin-left: 16px;
    font-size: 13px;
    color: var(--gray-700);
}

.talking-points-list li {
    margin-bottom: 6px;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
}

.talking-points-list li:hover {
    color: var(--primary);
}

/* Clinical Card */
.clinical-card {
    background: var(--purple-light);
    border-color: #DDD6FE;
}

.clinical-card h4 {
    color: #6D28D9;
}

.clinical-details {
    font-size: 13px;
    color: var(--gray-700);
}

.clinical-section {
    margin-bottom: 8px;
}

.clinical-section strong {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

/* Questions Card */
.questions-card {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.question-item {
    padding: 8px 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.question-text {
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.question-context {
    font-size: 11px;
    color: var(--gray-500);
}

.question-item.needs-human {
    border-left: 3px solid var(--warning);
}

/* Pillars Badges */
.pillars-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pillar-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    background: var(--gray-100);
    color: var(--gray-600);
}

.pillar-badge[data-pillar="Movement"] {
    background: #FEE2E2;
    color: #B91C1C;
}

.pillar-badge[data-pillar="Nutrition"] {
    background: #D1FAE5;
    color: #047857;
}

.pillar-badge[data-pillar="Sleep"] {
    background: #E0E7FF;
    color: #3730A3;
}

.pillar-badge[data-pillar="Mind"] {
    background: #FCE7F3;
    color: #9D174D;
}

.pillar-badge[data-pillar="Growth"] {
    background: #FEF3C7;
    color: #B45309;
}

.pillar-badge[data-pillar="Environment"] {
    background: #CFFAFE;
    color: #0E7490;
}