/* =============================================
   ReWire Therapist Dashboard - CSS
   Japanese-inspired Zen Design
   ============================================= */

:root {
    /* Zen Palette */
    --bg-paper: #FAF9F6;
    --bg-warm: #F5F4F0;
    --surface: #FFFFFF;
    
    /* Ink */
    --ink: #1A1A1A;
    --ink-medium: #4A4A4A;
    --ink-light: #8A8A8A;
    --ink-faint: #C5C5C5;
    --ink-whisper: #E8E8E8;
    
    /* Accents */
    --accent: #4A5568;
    --accent-warm: #9B8B7A;
    --sage: #7A8B7A;
    
    /* Therapist specific */
    --therapist-blue: #5B7B9A;
    --therapist-blue-light: rgba(91, 123, 154, 0.1);
    
    /* System */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --shadow-whisper: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.06);
    
    --nav-height: 70px;
    --spacing: 24px;
    
    /* Typography */
    --font-serif: 'Noto Serif', Georgia, serif;
    --font-sans: 'Noto Sans', -apple-system, sans-serif;
}

/* === RESET === */
*, *::before, *::after { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
}

html { font-size: 16px; }

body {
    font-family: var(--font-sans);
    background: var(--bg-paper);
    color: var(--ink);
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.7;
    font-weight: 400;
}

/* === SUBTLE TEXTURE === */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

/* === LAYOUT === */
.app-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 120px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.app-view.active {
    opacity: 1;
    visibility: visible;
}

.app-view::-webkit-scrollbar { display: none; }

.container {
    padding: 0 var(--spacing);
    max-width: 600px;
    margin: 0 auto;
}

/* === TYPOGRAPHY === */
.text-display {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 300;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.text-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
}

.text-body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink-medium);
}

.text-small {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--ink-light);
}

.text-label {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-light);
}

/* === HEADER === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 60px var(--spacing) 20px;
    max-width: 600px;
    margin: 0 auto;
}

.logo-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface);
    border-radius: 100px;
    box-shadow: var(--shadow-whisper);
}

.logo-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--therapist-blue);
}

.logo-text {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-btn {
    width: 44px;
    height: 44px;
    background: var(--surface);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-whisper);
    transition: all 0.2s ease;
}

.header-btn:hover {
    box-shadow: var(--shadow-soft);
}

.header-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--ink);
}

/* === WELCOME CARD === */
.welcome-card {
    background: var(--surface);
    margin: 0 var(--spacing) 24px;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.welcome-greeting {
    font-size: 0.875rem;
    color: var(--ink-light);
    margin-bottom: 4px;
}

.welcome-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 300;
    margin: 0;
    line-height: 1.2;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-paper);
    box-shadow: var(--shadow-whisper);
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--ink-light);
}

.divider {
    height: 1px;
    background: var(--ink-whisper);
    margin: 20px 0;
}

/* === QUICK STATS === */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

.quick-stat-value {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--ink);
    line-height: 1;
}

.quick-stat-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-top: 6px;
}

/* === SECTION HEADER === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 var(--spacing);
    margin-bottom: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--ink);
    margin: 0;
}

.section-link {
    font-size: 0.8125rem;
    color: var(--ink-light);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.section-link:hover {
    color: var(--ink);
}

/* === ATTENTION CARDS === */
.attention-list {
    padding: 0 var(--spacing);
    max-width: 600px;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attention-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-whisper);
    border: 1px solid var(--ink-whisper);
    cursor: pointer;
    transition: all 0.2s ease;
}

.attention-card:hover {
    box-shadow: var(--shadow-soft);
    border-color: transparent;
}

.attention-card.urgent {
    border-left: 3px solid var(--accent-warm);
}

.attention-card.positive {
    border-left: 3px solid var(--sage);
}

.attention-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.attention-patient {
    display: flex;
    align-items: center;
    gap: 12px;
}

.patient-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 0.875rem;
    color: var(--ink-light);
}

.patient-info h4 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    margin: 0 0 2px 0;
}

.patient-info span {
    font-size: 0.75rem;
    color: var(--ink-light);
}

.attention-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--bg-warm);
    color: var(--ink-light);
}

.attention-badge.urgent {
    background: rgba(155, 139, 122, 0.15);
    color: var(--accent-warm);
}

.attention-badge.positive {
    background: rgba(122, 139, 122, 0.15);
    color: var(--sage);
}

.attention-content {
    font-size: 0.9375rem;
    color: var(--ink-medium);
    line-height: 1.6;
    margin: 0;
}

.attention-meta {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--ink-light);
}

/* === PATIENT LIST === */
.patient-list {
    padding: 0 var(--spacing);
    max-width: 600px;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.patient-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-whisper);
    border: 1px solid var(--ink-whisper);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.patient-card:hover {
    box-shadow: var(--shadow-soft);
    border-color: transparent;
}

.patient-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.patient-card-info h4 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    margin: 0 0 2px 0;
}

.patient-card-info span {
    font-size: 0.75rem;
    color: var(--ink-light);
}

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

.activity-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.activity-dots {
    display: flex;
    gap: 3px;
}

.activity-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-whisper);
}

.activity-dot.active {
    background: var(--sage);
}

.patient-card-arrow svg {
    width: 16px;
    height: 16px;
    fill: var(--ink-faint);
}

/* === BOTTOM NAVIGATION === */
.bottom-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.bottom-container > * {
    pointer-events: auto;
}

.nav-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: var(--surface);
    border-radius: 100px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--ink-whisper);
}

.nav-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ink-faint);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nav-item:hover:not(.active) {
    color: var(--ink-light);
}

.nav-item.active {
    background: var(--ink);
    color: white;
}

/* === PATIENT DETAIL VIEW === */
.detail-header {
    padding: 60px var(--spacing) 20px;
    max-width: 600px;
    margin: 0 auto;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    color: var(--ink-light);
    cursor: pointer;
    margin-bottom: 20px;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: var(--ink);
}

.back-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.detail-patient {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow-soft);
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--ink-light);
}

.detail-patient-info h1 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 4px 0;
}

.detail-patient-info span {
    font-size: 0.875rem;
    color: var(--ink-light);
}

/* === SUMMARY CARD === */
.summary-card {
    background: var(--surface);
    margin: 0 var(--spacing) 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.summary-section {
    margin-bottom: 20px;
}

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

.summary-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-warm);
    margin-bottom: 8px;
}

.summary-label.sage {
    color: var(--sage);
}

.summary-label.blue {
    color: var(--therapist-blue);
}

.summary-text {
    font-family: var(--font-serif);
    font-size: 0.9375rem;
    color: var(--ink-medium);
    margin: 0;
    line-height: 1.7;
}

/* === ACTIVITY VISUALIZATION === */
.activity-viz {
    background: var(--surface);
    margin: 0 var(--spacing) 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-whisper);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.activity-viz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.activity-viz-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
}

.activity-viz-period {
    font-size: 0.75rem;
    color: var(--ink-light);
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

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

.week-day-label {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--ink-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.week-day-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.week-day-cell.level-1 {
    background: rgba(122, 139, 122, 0.2);
}

.week-day-cell.level-2 {
    background: rgba(122, 139, 122, 0.4);
}

.week-day-cell.level-3 {
    background: var(--sage);
}

.week-day-cell.today {
    border: 2px solid var(--ink);
}

.activity-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.6875rem;
    color: var(--ink-light);
}

.legend-scale {
    display: flex;
    gap: 3px;
}

.legend-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* === SUGGESTIONS CARD === */
.suggestions-card {
    background: var(--surface);
    margin: 0 var(--spacing) 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-whisper);
    border: 1px solid var(--ink-whisper);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.suggestions-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    margin: 0 0 4px 0;
}

.suggestions-subtitle {
    font-size: 0.75rem;
    color: var(--ink-light);
}

.suggestion-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--ink-whisper);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.suggestion-item:first-child {
    padding-top: 0;
}

.suggestion-text {
    font-size: 0.9375rem;
    color: var(--ink);
    margin: 0 0 4px 0;
}

.suggestion-meta {
    font-size: 0.75rem;
    color: var(--ink-light);
}

.suggestion-toggle {
    width: 44px;
    height: 24px;
    background: var(--ink-whisper);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.suggestion-toggle.active {
    background: var(--sage);
}

.suggestion-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.suggestion-toggle.active::after {
    transform: translateX(20px);
}

/* === NOTES SECTION === */
.notes-section {
    margin: 0 var(--spacing) 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.notes-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-whisper);
    border: 1px solid var(--ink-whisper);
}

.notes-card:focus-within {
    border-color: var(--therapist-blue);
    box-shadow: var(--shadow-soft);
}

.notes-textarea {
    width: 100%;
    border: none;
    background: none;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink);
    resize: none;
    outline: none;
    min-height: 100px;
}

.notes-textarea::placeholder {
    color: var(--ink-faint);
}

.notes-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--ink-whisper);
    margin-top: 12px;
}

.notes-hint {
    font-size: 0.75rem;
    color: var(--ink-light);
}

.notes-save {
    padding: 8px 16px;
    background: var(--ink);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notes-save:hover {
    background: #333;
}

.notes-save:disabled {
    background: var(--ink-faint);
    cursor: not-allowed;
}

/* === INSIGHT BOX === */
.insight-box {
    background: var(--bg-warm);
    padding: 16px;
    border-radius: var(--radius-md);
    border-left: 2px solid var(--accent-warm);
    margin-top: 16px;
}

.insight-box.blue {
    border-left-color: var(--therapist-blue);
}

.insight-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-warm);
    margin-bottom: 8px;
}

.insight-box.blue .insight-label {
    color: var(--therapist-blue);
}

.insight-text {
    font-family: var(--font-serif);
    font-size: 0.9375rem;
    font-style: italic;
    color: var(--ink-medium);
    margin: 0;
    line-height: 1.6;
}

/* === RESOURCES VIEW === */
.resources-header {
    padding: 80px var(--spacing) 24px;
    max-width: 600px;
    margin: 0 auto;
}

.resources-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 300;
    margin: 0 0 8px 0;
}

.resources-subtitle {
    font-size: 0.9375rem;
    color: var(--ink-light);
    margin: 0;
}

.resource-section {
    margin: 0 var(--spacing) 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.resource-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-bottom: 16px;
}

.resource-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-whisper);
    border: 1px solid var(--ink-whisper);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resource-card:hover {
    box-shadow: var(--shadow-soft);
    border-color: transparent;
}

.resource-card:last-child {
    margin-bottom: 0;
}

.resource-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.resource-card-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    margin: 0 0 4px 0;
}

.resource-card-meta {
    font-size: 0.75rem;
    color: var(--ink-light);
}

.resource-card-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-card-icon svg {
    width: 18px;
    height: 18px;
    fill: var(--ink-medium);
}

.resource-card-desc {
    font-size: 0.875rem;
    color: var(--ink-medium);
    margin: 0;
    line-height: 1.5;
}

/* === FAB === */
.fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--ink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 50;
    transition: all 0.2s ease;
    border: none;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

.fab svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.open {
    transform: translateY(0);
}

.modal-header {
    padding: 20px var(--spacing);
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--ink-whisper);
    position: relative;
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--ink-whisper);
    border-radius: 2px;
}

.modal-close {
    position: absolute;
    right: var(--spacing);
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--bg-warm);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close svg {
    width: 16px;
    height: 16px;
    fill: var(--ink);
}

.modal-content {
    padding: 24px var(--spacing) 40px;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 8px 0;
    text-align: center;
}

.modal-subtitle {
    font-size: 0.9375rem;
    color: var(--ink-light);
    margin: 0 0 24px 0;
    text-align: center;
}

/* === FORMS === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-warm);
    border: 1px solid var(--ink-whisper);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--ink);
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--therapist-blue);
    background: var(--surface);
}

.form-input::placeholder {
    color: var(--ink-faint);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--ink);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #333;
}

.btn-primary:disabled {
    background: var(--ink-faint);
    cursor: not-allowed;
}

/* === SETTINGS PANEL === */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-overlay.open {
    opacity: 1;
    visibility: visible;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 90vw;
    background: var(--surface);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.settings-panel.open {
    transform: translateX(0);
}

.settings-header {
    padding: 60px var(--spacing) 20px;
    border-bottom: 1px solid var(--ink-whisper);
    position: relative;
}

.settings-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
}

.settings-close {
    position: absolute;
    top: 60px;
    right: var(--spacing);
    width: 40px;
    height: 40px;
    background: var(--bg-warm);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close svg {
    width: 18px;
    height: 18px;
    fill: var(--ink);
}

.settings-section {
    padding: 20px var(--spacing);
    border-bottom: 1px solid var(--ink-whisper);
}

.settings-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-bottom: 16px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.settings-item-label {
    font-size: 0.9375rem;
    color: var(--ink);
}

.settings-toggle {
    width: 44px;
    height: 24px;
    background: var(--ink-whisper);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.settings-toggle.active {
    background: var(--sage);
}

.settings-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.settings-toggle.active::after {
    transform: translateX(20px);
}

.settings-signout {
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: 1px solid var(--ink-whisper);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--ink-light);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.settings-signout:hover {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
}

/* === LOGIN VIEW === */
.login-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing);
}

.login-card {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.login-logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--therapist-blue);
}

.login-logo-text {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
}

.login-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 300;
    margin: 0 0 8px 0;
    text-align: center;
}

.login-subtitle {
    font-size: 0.9375rem;
    color: var(--ink-light);
    margin: 0 0 32px 0;
    text-align: center;
}

.login-error {
    background: rgba(155, 139, 122, 0.15);
    color: var(--accent-warm);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: none;
}

.login-error.show {
    display: block;
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 12px;
    background: var(--bg-warm);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-tab.active {
    background: var(--ink);
    color: white;
}

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

.login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--ink-light);
}

.login-link a {
    color: var(--therapist-blue);
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}

/* === LOADING & TOAST === */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--ink-whisper);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(250, 249, 246, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 400;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--ink);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.9375rem;
}

/* === UTILITIES === */
.hidden { display: none !important; }
