/* assets/css/components.css - UI-Komponenten */

/* Skip-to-content link (Accessibility) */
.skip-to-content {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    z-index: 10000;
    background: var(--navy-600, #1e3a5f);
    color: white;
    border-radius: var(--radius-sm, 6px);
    text-decoration: none;
    font-weight: 600;
}
.skip-to-content:focus {
    position: fixed;
    top: 16px;
    left: 16px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
}

/* Global keyboard focus indicator */
.trigger-card:focus-visible,
.button:focus-visible,
.mood-emoji:focus-visible,
.feeling-item:focus-visible,
.wizard-emoji-item:focus-visible,
.wizard-tag:focus-visible,
.wizard-btn:focus-visible,
.tag-chip:focus-visible,
.theme-tile:focus-visible,
.fab:focus-visible,
.dropdown-menu a:focus-visible {
    outline: 2px solid var(--teal-400, #2dd4bf);
    outline-offset: 2px;
}

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.calendar-day {
    min-height: 60px;
    padding: 4px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.calendar-day:hover {
    background: var(--navy-50, #f0f4f8);
}
.calendar-day-empty {
    border: none;
    cursor: default;
}
.calendar-day-today {
    background: var(--teal-50, #e6fffa);
    border-color: var(--teal-400, #2dd4bf);
}
.calendar-day-selected {
    background: var(--navy-100, #d2dce6);
    border-color: var(--navy-400, #486581);
}
.calendar-day-number {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: 2px;
}
.calendar-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
}
.calendar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Calendar detail entries */
.cal-entry {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--card-bg, white);
    border-radius: var(--radius-sm, 6px);
}
.cal-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.cal-entry-time {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.cal-entry-module {
    font-weight: 600;
    font-size: var(--text-sm);
    flex: 1;
}
.cal-entry-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.cal-entry:hover .cal-entry-actions {
    opacity: 1;
}
.cal-entry .entry-action-btn {
    opacity: 1;
}
.cal-entry-body {
    font-size: var(--text-sm);
    color: var(--text-primary);
    margin-left: 24px;
}
.cal-entry-notes {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
    margin-left: 24px;
    line-height: 1.4;
}

/* Goals settings */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.module-goal label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.module-goal input {
    text-align: center;
}

/* Form Validation */
.input-error { border-color: var(--mood-1) !important; }
.input-error + .form-error-text::before,
.form-error-text::before {
    content: '⚠ ';
}
.form-error-text { color: var(--mood-1); font-size: var(--text-sm); display: block; margin-top: 8px; font-weight: 500; }

/* Theme Tiles */
.theme-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.theme-tile {
    width: 90px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}
.theme-tile:hover {
    transform: scale(1.05);
}
.theme-tile-active {
    border-color: var(--teal-500);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}
.theme-tile-preview {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
    min-height: 24px;
    align-items: center;
}
.theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
}
.theme-tile-label {
    font-size: var(--text-sm);
    font-weight: 600;
}

/* Header */
header {
    padding: var(--spacing-lg);
    backdrop-filter: var(--glass-blur);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 50px;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.header-nav {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

/* Icon Buttons */
.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    color: var(--teal-600);
    position: relative;
}

.icon-button:hover {
    background: var(--navy-50);
}

.icon-button:active {
    transform: scale(0.95);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--teal-500);
    color: white;
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Dropdown Menus */
.dropdown-menu {
    position: fixed;
    background: var(--surface, #ffffff);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-sm);
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--navy-50);
    color: var(--navy-700);
}

.dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background: var(--border, #e2e8f0);
}

.dropdown-item-logout {
    color: #EF4444;
}
.dropdown-item-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #DC2626;
}

/* Greeting Section */
.greeting-section {
    margin-bottom: var(--spacing-xl);
}

.greeting-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.greeting {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--navy-700);
    margin-bottom: 0;
}

.greeting-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.date-info {
    color: var(--text-secondary);
    font-size: var(--text-base);
}

.weather-info {
    color: var(--text-secondary);
    font-size: var(--text-base);
    display: flex;
    align-items: center;
    gap: 6px;
}

.weather-info:empty {
    display: none;
}

@media (max-width: 600px) {
    .greeting-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .greeting-meta {
        align-items: flex-start;
    }
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: 40px;
}

.stat-card {
    background: var(--surface, #ffffff);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

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

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

.stat-title {
    font-size: var(--text-base);
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-icon {
    color: var(--navy-600);
}

.stat-value {
    font-size: var(--text-4xl);
    font-weight: 800;
    color: var(--navy-700);
    margin-bottom: 5px;
}

.stat-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Section Title */
.section-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--navy-700);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Engagement Row (Streak + Wochenrückblick) */
.engagement-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.streak-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 140px;
}

.weekly-summary-card {
    min-width: 0;
}

@media (max-width: 600px) {
    .engagement-row {
        grid-template-columns: 1fr;
    }
}

/* Quick Entry Section Spacing */
.quick-entry-section {
    margin-bottom: 40px;
}

/* Entry Cards */
.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* === Trigger Cards === */
.trigger-card {
    background: var(--surface, #ffffff);
    border-radius: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
}

.trigger-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.trigger-card:active {
    transform: scale(0.98);
}

.trigger-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.trigger-card-name {
    font-weight: 600;
    font-size: var(--text-base);
}

.trigger-card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted, var(--text-secondary));
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trigger-card-plus {
    color: var(--text-muted, var(--text-secondary));
    flex-shrink: 0;
}

.trigger-card:hover .trigger-card-plus {
    color: var(--teal-500);
}

/* === Bottom Sheet Modal === */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s;
    display: none;
}

.bottom-sheet-overlay.visible {
    display: block;
    opacity: 1;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface, white);
    border-radius: 20px 20px 0 0;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0);
    pointer-events: none;
}

.bottom-sheet.open {
    transform: translateY(0);
    pointer-events: auto;
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--navy-200, #DDD);
    border-radius: 2px;
    margin: 10px auto 0;
}

.bottom-sheet-header {
    padding: 16px 20px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border, #F3F4F6);
}

.bottom-sheet-title {
    font-weight: 600;
    font-size: var(--text-lg);
    flex: 1;
}

.bottom-sheet-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-muted, var(--text-secondary));
    transition: background 0.15s;
}

.bottom-sheet-close:hover {
    background: var(--navy-50, #F3F4F6);
}

.bottom-sheet-body {
    padding: 16px 20px 20px;
    min-height: 180px;
}

.bottom-sheet-body > .wizard-step:first-child {
    padding-top: 4px;
}

/* Sleep Flow-Auswahl */
.flow-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flow-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: none;
    text-align: left;
    width: 100%;
}

.flow-option:hover {
    border-color: var(--module-color, #0D9488);
    background: var(--navy-50, #F9FAFB);
}

.flow-option-emoji {
    font-size: var(--text-2xl);
}

.flow-option-text {
    flex: 1;
}

.flow-option-label {
    font-weight: 600;
    font-size: var(--text-base);
}

.flow-option-desc {
    font-size: var(--text-sm);
    color: var(--text-muted, var(--text-secondary));
}

.flow-option-meta {
    font-size: var(--text-xs);
    color: var(--teal-600);
    font-weight: 600;
    margin-top: 2px;
}

.flow-hint {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    padding: 4px 12px 4px 48px;
    margin-top: -4px;
    font-style: italic;
}

.flow-option-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.flow-option-disabled:hover {
    border-color: var(--border, #E5E7EB);
    background: none;
}

/* Desktop: Bottom Sheet wird zentriertes Modal */
@media (min-width: 769px) {
    .bottom-sheet {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
        pointer-events: none;
        max-width: 440px;
        width: 90%;
        border-radius: 20px;
        max-height: 80vh;
        transition: transform 0.25s, opacity 0.25s;
    }
    .bottom-sheet.open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
    }
}

/* Hydration total in bottom sheet */
.bottom-sheet-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border, #F3F4F6);
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-step-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.wizard-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--navy-200);
    transition: all 0.3s ease;
}

.wizard-step-dot.active {
    width: 10px;
    height: 10px;
    transform: scale(1.1);
}

.wizard-step-dot.completed {
    background: var(--teal-400);
}

.wizard-step {
    padding: 12px 0 16px;
    animation: wizardFadeIn 0.25s ease;
}

.wizard-step-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Wizard Buttons (Pill-Buttons) */
.wizard-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.wizard-btn {
    padding: 10px 20px;
    border-radius: var(--radius-full);
    border: 2px solid var(--navy-200);
    background: var(--surface, #ffffff);
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 80px;
    text-align: center;
}

.wizard-btn:hover {
    border-color: var(--teal-400);
    background: var(--navy-50);
    transform: translateY(-1px);
}

.wizard-btn:active {
    transform: translateY(0);
}

.wizard-btn .wizard-btn-emoji {
    font-size: var(--text-lg);
}

/* Wizard Emoji Row */
.wizard-emoji-row {
    display: flex;
    justify-content: space-around;
    gap: 4px;
}

.wizard-emoji-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border, #e2e8f0);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 52px;
    text-align: center;
}

.wizard-emoji-item:hover {
    background: var(--navy-50);
    border-color: var(--navy-200);
    transform: translateY(-2px);
}

.wizard-emoji-item:active {
    transform: scale(0.95);
    background: var(--navy-100);
}

.wizard-emoji-item .wizard-emoji {
    font-size: var(--text-3xl);
    line-height: 1;
}

.wizard-emoji-item .wizard-emoji-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
}

/* Wizard Tags */
.wizard-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.wizard-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    background: var(--surface, #ffffff);
    border: 2px solid var(--navy-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: all 0.2s;
    user-select: none;
}

.wizard-tag:hover {
    border-color: var(--teal-400);
    background: var(--navy-50);
}

.wizard-tag.selected {
    border-color: var(--teal-500);
    background: var(--navy-100);
    color: var(--navy-700);
    font-weight: 600;
}

.wizard-tags-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.wizard-tags-actions .wizard-save-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-md, 12px);
    justify-content: center;
}

.wizard-next-btn {
    border: 2px solid currentColor;
    background: transparent !important;
    font-weight: 600;
}

/* Wizard Text Input */
.wizard-text-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--navy-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all 0.2s ease;
    background: var(--surface, #ffffff);
    box-sizing: border-box;
}

.wizard-text-input:focus {
    outline: none;
    border-color: var(--teal-400);
    box-shadow: 0 0 0 3px rgba(26, 59, 92, 0.1);
}

.wizard-text-extra {
    margin-top: 10px;
}

.wizard-text-extra label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.wizard-text-submit {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.wizard-text-submit .wizard-save-btn,
.wizard-time-submit .wizard-save-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-md, 12px);
    justify-content: center;
}

.wizard-text-submit .button,
.wizard-time-submit .button {
    min-width: 120px;
}

/* Wizard Time Pair */
.wizard-time-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wizard-time-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.wizard-time-group .wizard-time-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--navy-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: var(--surface, #ffffff);
    box-sizing: border-box;
}

.wizard-time-group .wizard-time-input:focus {
    outline: none;
    border-color: var(--teal-400);
    box-shadow: 0 0 0 3px rgba(26, 59, 92, 0.1);
}

.wizard-time-submit {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

/* Wake Detail Groups */
.wake-details-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 50vh;
    overflow-y: auto;
}
.wake-detail-group {
    border: 1px solid var(--navy-200, #c3cdd9);
    border-radius: var(--radius-md, 10px);
    padding: 12px;
    background: var(--surface, #ffffff);
}
.wake-detail-header {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.wake-detail-row {
    margin-bottom: 10px;
}
.wake-detail-row label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.wake-detail-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.wizard-btn-sm {
    padding: 6px 12px !important;
    font-size: var(--text-sm) !important;
    min-width: auto !important;
}
.wake-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wizard-chip {
    padding: 6px 10px;
    border-radius: var(--radius-full, 50px);
    border: 1.5px solid var(--navy-200, #c3cdd9);
    background: var(--surface, #ffffff);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: all 0.15s;
}
.wizard-chip.selected {
    font-weight: 600;
}
.wake-detail-time {
    max-width: 140px;
}
.wizard-date-error {
    color: var(--error, #e74c3c);
    font-size: var(--text-sm);
    margin-top: 6px;
}
.wake-details-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wake-detail-summary-line {
    font-size: var(--text-sm);
    padding: 6px 8px;
    background: var(--navy-50, #f0f4f8);
    border-radius: var(--radius-sm, 6px);
}

/* Wizard Quick Pick */
.wizard-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.wizard-quick-pick {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 2px solid var(--navy-200);
    background: var(--surface, #ffffff);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.wizard-quick-pick:hover {
    border-color: var(--teal-400);
    background: var(--navy-50);
}

.wizard-custom-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.wizard-custom-input input {
    flex: 1;
    padding: 8px 14px;
    border: 2px solid var(--navy-200);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    background: var(--surface, #ffffff);
}

.wizard-custom-input input:focus {
    outline: none;
    border-color: var(--teal-400);
}

/* Wizard Navigation */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
}

.wizard-back {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.wizard-back:hover {
    color: var(--text-primary);
    background: var(--navy-50);
}

.wizard-skip {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.wizard-skip:hover {
    color: var(--teal-600);
    background: var(--navy-50);
}

/* Wizard Footer (Hydration Total — used in bottom-sheet) */
.wizard-footer-text {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.wizard-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--navy-100);
    border-radius: 3px;
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Wizard Saving State */
.wizard-saving {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 10px;
    color: var(--text-secondary);
    font-size: var(--text-base);
}

.wizard-saving .loading {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Wizard Animations */
@keyframes wizardFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes wizardFadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

@keyframes wizardSaved {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.wizard-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 8px;
    animation: wizardSaved 0.3s ease;
}

.wizard-success-icon {
    font-size: var(--text-3xl);
}

.wizard-success-text {
    font-weight: 600;
    color: var(--teal-600, #0D9488);
}

/* Wizard Drink Hint (Koffein/Alkohol) */
.wizard-drink-hint-text {
    margin-top: 12px;
    text-align: center;
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: var(--radius-md, 10px);
    background: var(--amber-50, #FFFBEB);
    border: 1px solid var(--amber-200, #FDE68A);
    background: var(--surface-elevated, #f8fafc);
}

/* Wizard Notes Toggle */
.wizard-notes-toggle {
    margin-top: 14px;
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 10px;
}
.wizard-notes-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: none;
    border: none;
    padding: 6px 0;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-family: inherit;
}
.wizard-notes-btn:hover {
    color: var(--text-primary);
}
.wizard-notes-area {
    display: none;
    margin-top: 6px;
}
.wizard-notes-toggle.expanded .wizard-notes-area {
    display: block;
}

/* Edit Form (flat layout) */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px 0 16px;
    max-height: 60vh;
    overflow-y: auto;
}
.edit-form-section {
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 12px;
    margin-top: 4px;
}

.edit-form-section-title {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.edit-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.edit-form-group .form-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.edit-scale-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.edit-scale-wrap .form-range {
    flex: 1;
    min-width: 120px;
}
.edit-scale-wrap .range-value {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}
.edit-scale-wrap .scale-labels {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* Emoji Row in Edit Form */
.edit-emoji-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.emoji-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 10px;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm, 8px);
    background: var(--glass-bg, #fff);
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 56px;
    -webkit-tap-highlight-color: transparent;
}
.emoji-option:hover {
    border-color: var(--teal-400, #2dd4bf);
    background: var(--navy-50, #f0f4f8);
}
.emoji-option.selected {
    border-color: var(--teal-500, #14b8a6);
    background: var(--navy-100, #d9e2ec);
    box-shadow: 0 0 0 1px var(--teal-500, #14b8a6);
}
.emoji-option-icon {
    font-size: var(--text-2xl);
    line-height: 1;
}
.emoji-option-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
}
.emoji-option.selected .emoji-option-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* Edit Form: Computed Value (read-only) */
.edit-computed-value {
    padding: 8px 12px;
    background: var(--navy-50, #f0f4f8);
    border-radius: var(--radius-sm, 6px);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--text-base);
}

/* Edit Form: Button Row */
.edit-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* Wizard Success: Wetter-Info */
.wizard-success-weather {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Kalender: Mondphase + Wetter im Tag */
.calendar-day-weather {
    display: flex;
    gap: 2px;
    font-size: var(--text-xs);
    position: absolute;
    bottom: 2px;
    right: 2px;
}
/* Timeline: Wetter-Badge */
.timeline-weather-badge {
    font-size: var(--text-xs);
    margin-left: 4px;
    opacity: 0.7;
}

.cal-weather-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--navy-50, #f0f4f8);
    border-radius: var(--radius-sm, 6px);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.entry-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--glass-shadow);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.entry-card form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.entry-card form > :last-child {
    margin-top: auto;
}

.entry-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.entry-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.entry-title h3 {
    font-size: var(--text-xl);
    color: var(--navy-700);
    margin-bottom: 2px;
}

.entry-title p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: var(--text-base);
}

.form-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--navy-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--surface, #ffffff);
}

.form-input:focus {
    outline: 2px solid var(--teal-500);
    outline-offset: 1px;
    border-color: var(--teal-400);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

select.form-input {
    cursor: pointer;
}

/* Buttons */
.button {
    padding: 12px 28px;
    min-height: 44px;
    border-radius: var(--radius-full);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.button-primary {
    background: var(--teal-500);
    color: white;
}

.button-primary:hover {
    background: var(--teal-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.button-secondary {
    background: var(--teal-500);
    color: white;
}

.button-secondary:hover {
    background: var(--teal-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mood Scale */
.mood-scale {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.mood-scale-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.mood-item {
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    min-width: 35px;
}

.mood-scale-4 .mood-item {
    height: 90px;
    flex-direction: column;
    gap: 8px;
    padding: 15px 10px;
}

.mood-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mood-item.selected {
    border-color: var(--teal-600);
    transform: scale(1.1);
}

/* Quality Slider */
.quality-slider-container {
    position: relative;
    margin-top: 20px;
    padding-bottom: 20px;
}

.quality-slider {
    width: 100%;
    height: 16px;
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, 
        #E85A2E 0%, 
        #F49275 30%, 
        #FFD153 50%, 
        #53C47A 70%, 
        #217B3D 100%);
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface, #ffffff);
    border: 3px solid var(--teal-500);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.quality-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface, #ffffff);
    border: 3px solid var(--teal-500);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 12px;
}

.slider-labels span {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

/* Feeling Grid */
.feeling-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.feeling-item {
    background: var(--surface, #ffffff);
    border: 2px solid var(--navy-200);
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    min-height: 48px;
    min-width: 48px;
}

.feeling-item:hover {
    border-color: var(--teal-400);
    background: var(--navy-50);
}

.feeling-item.selected {
    border-color: var(--teal-500);
    background: var(--navy-100);
    transform: scale(1.05);
}

.feeling-item i {
    color: var(--teal-600);
}

.feeling-item span {
    font-size: var(--text-xs);
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.1;
}

/* Recent Entries */
.recent-entries {
    background: var(--surface, white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.entry-list {
    margin-top: 20px;
}

.entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--navy-100);
}

.entry-item:last-child {
    border-bottom: none;
}

.entry-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.entry-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.entry-time {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.entry-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease, background 0.15s ease;
}

.entry-item:hover .entry-action-btn {
    opacity: 1;
}

.entry-delete-btn:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.08);
}

/* Mobile: always show action buttons */
@media (max-width: 768px) {
    .entry-action-btn {
        opacity: 0.6;
    }
}

/* Time Inputs */
.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--navy-200);
    border-radius: 50%;
    border-top-color: var(--teal-600);
    animation: spin 1s linear infinite;
}

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

/* Toast/Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface, #ffffff);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--teal-500);
}

.toast.error {
    border-left: 4px solid var(--mood-1);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== Modal System ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-lg);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface, #ffffff);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h3 {
    margin: 0;
    color: var(--navy-700);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    color: var(--text-secondary);
    transition: color 0.2s ease;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--navy-50);
}

.modal-body {
    padding: var(--spacing-lg);
}

/* ========== Login Specific ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.login-card {
    background: var(--surface, #ffffff);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    height: 48px;
    margin-bottom: var(--spacing-md);
    transition: transform 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.login-logo:active {
    transform: scale(0.95);
}

/* Dev Mode Active State */
.dev-mode-active .login-logo {
    animation: devPulse 2s infinite;
    filter: hue-rotate(180deg);
}

@keyframes devPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.login-header h1 {
    color: var(--navy-700);
    margin-bottom: var(--spacing-sm);
}

.login-header p {
    color: var(--text-secondary);
}

.login-form {
    margin-bottom: var(--spacing-lg);
}

.form-hint {
    display: block;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-top: var(--spacing-xs);
}

.button-large {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--text-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.login-footer {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Dev Warning Box */
.dev-warning {
    background: var(--navy-50);
    border-left: 4px solid var(--navy-500);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-sm);
    color: var(--navy-700);
}

.magic-link-container {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    word-break: break-all;
    font-family: monospace;
    font-size: var(--text-sm);
}

/* ========== Button States (Erweiterung) ========== */
.button-loading {
    position: relative;
    color: transparent !important;
}

.button-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.button-success {
    background: var(--teal-500) !important;
}

.button-error {
    background: var(--mood-1) !important;
}

/* ========== Responsive Anpassungen ========== */
/* Füge zu responsive.css hinzu */
@media (max-width: 768px) {
    .modal {
        padding: var(--spacing-md);
    }
    
    .modal-content {
        margin: var(--spacing-md);
        max-height: calc(100vh - 2 * var(--spacing-md));
    }
    
    .login-card {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .login-header h1 {
        font-size: var(--text-2xl);
    }

    .login-logo {
        height: 40px;
    }
}

/* ========== Entry Card v2 (Modul-gesteuert) ========== */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.entry-card {
    min-height: auto;
    padding: 0;
    overflow: hidden;
}

.entry-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.entry-card-header:hover {
    background: rgba(26, 59, 92, 0.04);
}

.entry-card-header h3 {
    flex: 1;
    font-size: var(--text-lg);
    margin: 0;
}

.entry-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.entry-toggle:hover {
    background: var(--navy-50);
}

.entry-card-body {
    padding: 0 20px 20px;
}

.entry-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.entry-title {
    font-weight: 600;
    font-size: var(--text-base);
}

.entry-details {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ========== Scale/Range ========== */
.scale-container {
    margin-top: 8px;
}

.form-range {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #E85A2E, #FFD153, #217B3D);
    outline: none;
}

.form-range-inverted {
    background: linear-gradient(to right, #217B3D, #FFD153, #E85A2E);
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface, #ffffff);
    border: 3px solid var(--teal-500);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.range-value {
    display: inline-block;
    margin-left: 12px;
    font-weight: 700;
    color: var(--navy-700);
    font-size: var(--text-xl);
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* ========== Mood Grid (Emoji Scale) ========== */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.mood-grid .mood-item {
    flex-direction: column;
    height: auto;
    padding: 10px 6px;
    background: var(--surface, #ffffff);
    color: var(--text-primary);
    border: 2px solid var(--navy-100);
    border-radius: var(--radius-md);
    min-width: 0;
}

.mood-grid .mood-item:hover {
    border-color: var(--navy-300);
    transform: translateY(-2px);
}

.mood-grid .mood-item.selected {
    border-color: var(--teal-500);
    background: var(--navy-50);
    transform: scale(1.05);
}

.mood-emoji {
    font-size: var(--text-2xl);
}

.mood-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========== Tags (Multi-Select Chips) ========== */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--surface, #ffffff);
    border: 2px solid var(--navy-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: all 0.2s;
    user-select: none;
}

.tag-chip:hover {
    border-color: var(--teal-400);
    background: var(--navy-50);
}

.tag-chip.selected {
    border-color: var(--teal-500);
    background: var(--navy-100);
    color: var(--navy-700);
    font-weight: 600;
}

/* ========== Trends Section ========== */
.trends-section {
    background: var(--surface, white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.trend-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.trend-tab {
    padding: 8px 20px;
    border: 2px solid var(--navy-200);
    border-radius: var(--radius-full);
    background: var(--surface, white);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all 0.2s;
    color: var(--text-secondary);
}

.trend-tab:hover {
    border-color: var(--teal-400);
}

.trend-tab.active {
    background: var(--teal-500);
    border-color: var(--teal-500);
    color: white;
}

/* Simple Chart (CSS-basiert) */
.simple-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 150px;
    padding-bottom: 24px;
    position: relative;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.chart-val {
    font-size: var(--text-xs);
    font-weight: 700;
    color: white;
    padding-top: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.chart-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========== Settings ========== */
.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.settings-section {
    background: var(--surface, #ffffff);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

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

.settings-danger {
    border: 2px solid #FEE2E2;
}

.button-danger {
    background: #EF4444;
    color: white;
}

.button-danger:hover {
    background: #DC2626;
}

.button-sm {
    padding: 6px 14px;
    font-size: var(--text-sm);
}

/* Module List in Settings */
.module-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--navy-50);
}

.module-item:last-child {
    border-bottom: none;
}

.module-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.module-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--teal-500);
}

/* Subscription Info in Settings */
.subscription-info {
    padding: 20px;
}

.sub-current {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sub-tier {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sub-tier-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-base);
}

.sub-tier-free { background: var(--navy-50); color: var(--navy-600); }
.sub-tier-plus { background: var(--teal-100); color: var(--teal-600); }
.sub-tier-pro { background: var(--navy-200); color: var(--navy-700); }
.sub-tier-admin { background: #FEE2E2; color: #DC2626; }

.sub-expires {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.sub-features {
    display: flex;
    gap: 20px;
    font-size: var(--text-base);
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.sub-credits {
    font-size: var(--text-base);
    color: var(--text-primary);
}

.sub-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.module-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Connection Items */
.connection-item {
    margin-bottom: 12px;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.connection-status {
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.connection-status.active {
    background: #D1FAE5;
    color: #065F46;
}

.connection-status.revoked {
    background: #FEE2E2;
    color: #991B1B;
}

.connection-modules {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 8px;
}

.connection-access {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

.connect-form h3 {
    margin-bottom: 16px;
}

/* ========== Practitioner Dashboard ========== */
.practitioner-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.practitioner-code {
    display: flex;
    align-items: center;
    gap: 12px;
}

.code-label {
    color: var(--text-secondary);
    font-size: var(--text-base);
}

.code-value {
    background: var(--navy-50);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--navy-700);
    letter-spacing: 2px;
}

.practitioner-meta {
    display: flex;
    gap: 20px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.patient-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.patient-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

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

.patient-since {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.patient-modules {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.module-badge {
    background: var(--navy-50);
    color: var(--navy-700);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ========== Legal Pages ========== */
.legal-page {
    max-width: 800px;
    padding-bottom: 40px;
}

.legal-close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-md);
    position: sticky;
    top: 99px;
    z-index: 50;
    padding: var(--spacing-sm) 0;
    background: var(--bg-primary);
}

.button-sm {
    padding: 6px 14px;
    font-size: var(--text-sm);
    gap: 4px;
}

/* ========== App Footer ========== */
.app-footer {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    margin-top: var(--spacing-xl);
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.app-footer a {
    color: var(--text-secondary);
    margin: 0 8px;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: var(--teal-600);
}

.legal-page h1 {
    margin-bottom: 8px;
}

.legal-date {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.legal-page section {
    margin-bottom: 32px;
}

.legal-page h2 {
    font-size: var(--text-xl);
    margin-bottom: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--navy-100);
}

.legal-page h3 {
    font-size: var(--text-lg);
    margin: 16px 0 8px;
}

.legal-page ul {
    padding-left: 24px;
    margin-bottom: 12px;
}

.legal-page li {
    margin-bottom: 6px;
    line-height: 1.6;
}

/* ========== Helpers ========== */
.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-top: 12px;
}

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

.text-danger {
    color: #EF4444;
}

.pause-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Stat Row (Practitioner View) */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--navy-50);
}

.stat-row:last-child {
    border-bottom: none;
}

/* Form textarea */
.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    position: relative;
    bottom: auto;
    right: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { border-left-color: var(--teal-500); }
.toast-error { border-left-color: #EF4444; }
.toast-warning { border-left-color: #F59E0B; }
.toast-info { border-left-color: var(--teal-500); }

/* ========== Admin Dashboard ========== */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin Chart */
.admin-chart {
    min-height: 200px;
}

.admin-chart .simple-chart {
    height: 180px;
}

/* Admin Table */
.admin-table-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-table-header {
    display: grid;
    grid-template-columns: 2fr 100px 80px 70px 100px 110px 50px;
    gap: 12px;
    padding: 10px 16px;
    background: var(--navy-50);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--navy-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.admin-table-row {
    display: grid;
    grid-template-columns: 2fr 100px 80px 70px 100px 110px 50px;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--navy-50);
    font-size: var(--text-sm);
    align-items: center;
}

.admin-table-row:last-child {
    border-bottom: none;
}

.admin-table-row:hover {
    background: rgba(26, 59, 92, 0.03);
}

@media (max-width: 768px) {
    #userTable {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table-header,
    .admin-table-row {
        min-width: 650px;
    }
}

.admin-table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--navy-50);
}

/* Admin Badges */
.admin-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: capitalize;
}

.admin-badge-admin {
    background: #FDE68A;
    color: #92400E;
}

.admin-badge-practitioner {
    background: #A7F3D0;
    color: #065F46;
}

.admin-badge-user {
    background: var(--navy-100);
    color: var(--navy-700);
}

.admin-badge-free {
    background: var(--navy-50);
    color: var(--text-secondary);
}

.admin-badge-plus {
    background: #DBEAFE;
    color: #1E40AF;
}

.admin-badge-pro {
    background: var(--navy-50, #EDE9FE);
    color: #6D28D9;
}

.admin-editable-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: opacity 0.15s;
}

.admin-editable-badge:hover {
    opacity: 0.8;
}

.admin-editable-badge .admin-edit-icon {
    opacity: 0;
    width: 12px;
    height: 12px;
    color: var(--text-secondary);
    transition: opacity 0.15s;
}

.admin-editable-badge:hover .admin-edit-icon {
    opacity: 1;
}

.admin-inline-select {
    padding: 2px 6px;
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    cursor: pointer;
}

/* Admin Heatmap */
.admin-heatmap {
    display: grid;
    grid-template-columns: 28px repeat(24, 1fr);
    gap: 2px;
    min-width: 400px;
}

.admin-heatmap-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    min-width: 10px;
}

.admin-heatmap-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Admin Subscription Bar */
.admin-sub-bar {
    display: flex;
    height: 28px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}
.admin-sub-segment {
    transition: width 0.5s;
    min-width: 2px;
}
.admin-sub-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.admin-sub-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
}
.admin-sub-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Admin Content Tabs */
.admin-content-tab {
    opacity: 0.6;
    transition: opacity 0.2s;
}
.admin-content-tab.active {
    opacity: 1;
    background: var(--navy-600) !important;
    color: white !important;
}

/* Admin Sparkline */
.admin-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 32px;
}

.admin-sparkline-bar {
    flex: 1;
    min-width: 2px;
    border-radius: 1px 1px 0 0;
    transition: height 0.3s;
}

/* Admin Metric */
.admin-metric {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.admin-metric-value {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--navy-700);
    line-height: 1;
}

.admin-metric-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ===== Trend Module Tabs ===== */
.trend-module-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.trend-module-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: var(--surface, #ffffff);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.trend-module-tab:hover {
    border-color: var(--navy-300);
    color: var(--teal-600);
}

.trend-module-tab.active {
    background: var(--navy-50);
    border-color: var(--teal-400);
    color: var(--navy-700);
    font-weight: 600;
}

/* ===== Correlation Card ===== */
.correlation-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: var(--text-sm);
    margin-top: 12px;
}

.correlation-positive {
    background: var(--teal-50, #ECFDF5);
    color: #065F46;
}

.correlation-negative {
    background: #FEF2F220;
    color: #EF4444;
}

.correlation-neutral {
    background: var(--navy-50, #F9FAFB);
    color: var(--text-secondary);
}

/* ===== Profile Page ===== */
.profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--navy-50);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-details h3 {
    font-size: var(--text-xl);
    margin-bottom: 4px;
}

.profile-details p {
    margin: 2px 0;
    font-size: var(--text-sm);
}

/* ===== Photo Capture ===== */
.photo-capture-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px;
    border: 2px dashed var(--border, #E5E7EB);
    border-radius: 16px;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    width: 100%;
    transition: border-color 0.2s;
}

.photo-capture-btn:hover {
    border-color: var(--navy-300);
}

.photo-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 12px;
}

.photo-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Onboarding ===== */
.onboarding-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.onboarding-step {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.onboarding-step.active {
    display: block;
}

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

.onboarding-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.onboarding-step h1 {
    font-size: var(--text-3xl);
    color: var(--navy-700);
    margin-bottom: 12px;
}

.onboarding-step h2 {
    font-size: var(--text-2xl);
    margin-bottom: 24px;
}

.onboarding-step p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    margin-bottom: 32px;
}

.onboarding-modules {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    text-align: left;
}

.onboarding-module-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--surface, #ffffff);
    cursor: pointer;
    transition: all 0.2s;
}

.onboarding-module-item.selected {
    border-color: var(--teal-400);
    background: var(--navy-50);
}

.onboarding-module-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--teal-500);
    flex-shrink: 0;
}

.onboarding-module-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.onboarding-module-text strong {
    display: flex;
    align-items: center;
    gap: 8px;
}

.onboarding-module-text small {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.onboarding-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--navy-100);
    color: var(--navy-700);
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.onboarding-nav {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.onboarding-profile-form {
    text-align: left;
    max-width: 480px;
    margin: 0 auto;
}

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

.onboarding-profile-form .form-group {
    margin-bottom: 12px;
}

.onboarding-profile-form .form-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

@media (max-width: 480px) {
    .onboarding-profile-form .form-row {
        grid-template-columns: 1fr;
    }
}

.onboarding-dot.completed {
    background: var(--navy-300);
}

.onboarding-btn {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, #1A3B5C, #14B8A6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.onboarding-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 59, 92, 0.3);
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border, #E5E7EB);
    transition: background 0.3s;
}

.onboarding-dot.active {
    background: var(--teal-500);
}

/* ===== Offline Banner ===== */
.offline-banner {
    display: none;
    background: #FEF3C7;
    color: #92400E;
    text-align: center;
    padding: 6px;
    font-size: var(--text-sm);
}

.is-offline .offline-banner {
    display: block;
}

/* ===== Reminder Settings ===== */
.reminder-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
}

.reminder-setting span {
    font-weight: 500;
}

.reminder-setting select,
.reminder-setting input[type="time"] {
    padding: 6px 10px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-size: var(--text-base);
}

/* ===== Icon Size Classes ===== */
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 28px; height: 28px; }
.icon-2xl { width: 32px; height: 32px; }

/* ===== Custom Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--surface, #ffffff);
    border-radius: 16px;
    padding: 28px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalSlideUp 0.2s ease;
}

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

.modal-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-message {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-input-wrap {
    margin-bottom: 20px;
}

.modal-input-wrap .form-input {
    width: 100%;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    min-width: 90px;
    padding: 10px 20px !important;
    font-size: var(--text-base) !important;
}

/* ===== Skeleton Loader ===== */
.skeleton {
    background: linear-gradient(90deg, var(--navy-50, #f0f0f0) 25%, var(--navy-100, #e0e0e0) 50%, var(--navy-50, #f0f0f0) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    width: 60%;
    margin: 4px 0;
}

.skeleton-value {
    height: 1.8em;
    width: 80px;
    margin: 4px 0;
}

.skeleton-bar {
    height: 100%;
    width: 100%;
    border-radius: 4px;
}

.stat-empty .stat-value {
    opacity: 0.4;
}

.stat-empty .stat-subtitle {
    font-style: italic;
}

/* ===== Inline Validation ===== */
.wizard-field-hint {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: 4px;
}

.wizard-field-error {
    color: #EF4444;
    font-size: var(--text-sm);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wizard-text-input.invalid,
.wizard-time-input.invalid {
    border-color: #EF4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

/* ===== Dropdown overflow fix ===== */
.dropdown-menu {
    max-width: calc(100vw - 20px);
}

/* ===== Chart Enhancements ===== */
.chart-y-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    padding-right: 6px;
    flex-shrink: 0;
}

.chart-wrapper {
    display: flex;
    align-items: stretch;
}

.chart-unit {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-align: right;
    margin-bottom: 4px;
}

/* ===== Consent Banner ===== */
.consent-banner {
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border-left: 4px solid var(--navy-500);
    background: var(--glass-bg);
}

.consent-banner h3 {
    margin: 0 0 8px 0;
    color: var(--navy-600);
}

.consent-status p {
    margin-bottom: 8px;
}

/* ===== Export Page ===== */
.export-container {
    max-width: 900px;
}

.export-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

.export-section {
    margin-bottom: 32px;
}

.export-section h2 {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--glass-border);
}

.export-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.export-table th,
.export-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.export-table th {
    background: var(--navy-50);
    font-weight: 600;
    color: var(--navy-700);
}

.export-table tr:hover {
    background: var(--glass-bg);
}

.export-stats {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.print-only {
    display: none;
}

/* Print Styles */
@media print {
    .no-print,
    header,
    .offline-banner,
    .dropdown-menu,
    footer {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .export-print-header {
        text-align: center;
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 2px solid #333;
    }

    .export-print-header h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .export-print-header p {
        font-size: 12px;
        color: #666;
    }

    .export-container {
        max-width: 100%;
        padding: 0;
    }

    .export-table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .export-section {
        page-break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }
}

/* ===== Correlations UI ===== */
.correlation-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.corr-module-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.corr-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--surface, #ffffff);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: all 0.15s;
    user-select: none;
}

.corr-chip input[type="checkbox"] {
    display: none;
}

.corr-chip.active {
    background: var(--teal-50, #f0fdfa);
    border-color: var(--teal-400, #2dd4bf);
    color: var(--teal-700, #0f766e);
}

.corr-chip:hover {
    border-color: var(--teal-300, #5eead4);
}

.corr-period-tabs {
    display: flex;
    gap: 4px;
    background: var(--navy-50, #f0f4f8);
    border-radius: var(--radius-sm, 6px);
    padding: 3px;
}

.corr-period-tab {
    flex: 1;
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary, #718096);
    cursor: pointer;
    transition: all 0.15s;
}

.corr-period-tab.active {
    background: var(--surface, #fff);
    color: var(--text-primary, #1a202c);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.corr-results-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.corr-result-card {
    padding: 12px 16px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border, #e2e8f0);
    background: var(--surface, #ffffff);
}

.corr-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.corr-result-modules {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-primary, #1a202c);
}

.corr-result-value {
    font-family: monospace;
    font-weight: 700;
    font-size: var(--text-base);
}

.corr-strong-pos .corr-result-value { color: #16a34a; }
.corr-mod-pos .corr-result-value { color: #22c55e; }
.corr-weak .corr-result-value { color: var(--text-secondary, #718096); }
.corr-neutral .corr-result-value { color: var(--text-secondary, #718096); }
.corr-mod-neg .corr-result-value { color: #f97316; }
.corr-strong-neg .corr-result-value { color: #ef4444; }

.corr-mini-bar {
    margin-bottom: 6px;
}

.corr-mini-bar-bg {
    position: relative;
    height: 6px;
    background: linear-gradient(to right, #EF4444, #F59E0B, #e5e7eb, #86efac, #22C55E);
    border-radius: 3px;
}

.corr-mini-bar-marker {
    position: absolute;
    top: -3px;
    width: 12px;
    height: 12px;
    background: var(--navy-600, #1e3a5f);
    border: 2px solid var(--surface, #fff);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.corr-result-footer {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--text-secondary, #718096);
}

.corr-result-label {
    font-weight: 500;
}

.corr-result-insight {
    margin-top: 6px;
    font-size: var(--text-sm);
    color: var(--text-secondary, #718096);
    font-style: italic;
    line-height: 1.4;
}

/* Correlation Heatmap */
.corr-heatmap-container {
    margin-bottom: 16px;
}
.corr-heatmap {
    display: grid;
    gap: 2px;
}
.corr-heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    transition: transform 0.1s;
    min-height: 36px;
}
.corr-heatmap-cell:hover {
    transform: scale(1.05);
    z-index: 1;
}
.corr-heatmap-label {
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Drill-Down from chart click */
.drill-down-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.drill-down-entries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.drill-down-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    font-size: var(--text-sm);
}
.drill-down-time {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    min-width: 38px;
    flex-shrink: 0;
}
.drill-down-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drill-down-note {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-style: italic;
}

/* Summary tabs */
.summary-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
}
.summary-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border, #e2e8f0);
    background: transparent;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.summary-tab:hover {
    background: var(--navy-50, #f0f4f8);
}
.summary-tab.active {
    background: var(--navy-600, #1a3b5c);
    color: white;
    border-color: var(--navy-600);
}

/* Weather emoji in recent entries */
.entry-weather {
    font-size: var(--text-sm);
    color: var(--text-secondary, #718096);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== Hydration Slider ========== */
.hydration-slider-wrap {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.hydration-slider-label {
    font-size: var(--text-base);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.hydration-amount-display {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--text-lg);
    margin-left: auto;
}

.hydration-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--navy-100, #d9e2ec);
    outline: none;
    cursor: pointer;
}

.hydration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--teal-500, #14b8a6);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}

.hydration-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--teal-500, #14b8a6);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* ========== FAB (Floating Action Button) ========== */
.fab {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: calc(24px + env(safe-area-inset-right, 0px));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.fab.fab-open {
    transform: rotate(45deg);
}

.fab i {
    width: 28px;
    height: 28px;
}

.fab-menu {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 899;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.fab-menu.fab-menu-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface, white);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-full, 100px);
    cursor: pointer;
    font-weight: 500;
    font-size: var(--text-base);
    box-shadow: var(--shadow-sm);
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    color: var(--text-primary);
}

.fab-menu-item:hover {
    border-color: var(--teal-400, #2dd4bf);
    background: var(--navy-50, #f0f4f8);
}

.fab-menu-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.fab-overlay {
    position: fixed;
    inset: 0;
    z-index: 898;
    display: none;
}

.fab-overlay.visible {
    display: block;
}

/* Hide FAB when bottom sheet is open */
.bottom-sheet.open ~ .fab,
.bottom-sheet.open ~ .fab-menu {
    display: none;
}

/* ========== Stat Progress Bar ========== */
.stat-progress {
    width: 100%;
    height: 4px;
    background: var(--navy-100, #d9e2ec);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.stat-progress-bar {
    height: 100%;
    background: var(--teal-500, #14b8a6);
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* ========== Module Settings Cards ========== */
.module-settings-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 12px);
    background: var(--surface, white);
    transition: border-color 0.15s;
}

.module-settings-card.active {
    border-color: var(--teal-400, #2dd4bf);
}

.module-settings-card-icon {
    font-size: var(--text-xl);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.module-settings-card-info {
    flex: 1;
    min-width: 0;
}

.module-settings-card-name {
    font-weight: 600;
    font-size: var(--text-base);
}

.module-settings-card-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

.module-settings-card input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    accent-color: var(--teal-500, #14b8a6);
}

/* ========== Goal Cards ========== */
.goal-group {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
}

.goal-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: var(--navy-50, #f0f4f8);
}

.goal-group-title {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.goal-group-body {
    padding: 4px 0;
}

.goal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.goal-row:last-child {
    border-bottom: none;
}

.goal-row-label {
    font-size: var(--text-base);
    color: var(--text-primary);
}

.goal-row-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.goal-input-sm {
    width: 80px !important;
    text-align: center;
    padding: 6px 8px;
    font-weight: 600;
}

.goal-row-unit {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    min-width: 45px;
}

.goal-card-icon {
    font-size: var(--text-xl);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ========== Reminder Cards ========== */
.reminder-card {
    padding: 14px 16px;
    background: var(--surface, white);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 12px);
}

.reminder-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reminder-card-title {
    font-weight: 600;
    font-size: var(--text-base);
}

.reminder-card-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ========== Weather Toggle ========== */
.weather-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface, white);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 12px);
}

.weather-toggle-info {
    flex: 1;
}

.weather-toggle-title {
    font-weight: 600;
    font-size: var(--text-base);
}

.weather-toggle-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--navy-200, #bcccdc);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.toggle-switch input:checked + .toggle-slider {
    background: var(--teal-500, #14b8a6);
}

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

/* ========== Entry Edit Button ========== */
.entry-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease, background 0.15s ease;
}

.entry-item:hover .entry-edit-btn {
    opacity: 1;
}

.entry-edit-btn:hover {
    color: var(--teal-500);
    background: var(--navy-50, #f0f4f8);
}

.entry-item {
    cursor: pointer;
    transition: background 0.15s;
}

.entry-item:hover {
    background: var(--navy-50, #f0f4f8);
    border-radius: var(--radius-sm, 8px);
}

/* ========== Dashboard v2: Action-First ========== */

/* Greeting + Streak */
.dashboard-greeting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.dashboard-greeting h1 {
    margin: 0 0 4px 0;
    font-size: var(--text-4xl);
}
.dashboard-greeting .date-info {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.streak-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--navy-50, #f0f4f8);
    border-radius: 20px;
    font-weight: 700;
    font-size: var(--text-lg);
    color: #F59E0B;
    white-space: nowrap;
}
[data-theme="dark"] .streak-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
}

/* Mood Quick-Tap */
.mood-quicktap {
    text-align: center;
    padding: 16px;
    margin-bottom: 16px;
}
.mood-quicktap-label {
    display: block;
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.mood-quicktap-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.mood-emoji {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: transform 0.15s, background 0.15s;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.mood-emoji-icon {
    font-size: var(--text-4xl);
    line-height: 1;
}
.mood-emoji-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}
.mood-emoji:hover {
    transform: scale(1.2);
    background: var(--navy-50, #f0f4f8);
}
.mood-emoji:active,
.mood-emoji-active {
    transform: scale(1.3);
    background: var(--teal-50, #e6fffa);
}
.mood-emoji-pulse {
    animation: moodPulse 0.5s ease-out;
}
@keyframes moodPulse {
    0% { transform: scale(1.3); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1.3); }
}
.mood-emoji-disabled {
    pointer-events: none;
    opacity: 0.5;
}

.mood-logged {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: var(--text-xl);
    padding: 8px;
    color: var(--teal-600, #0d9488);
}
.mood-logged span {
    font-size: var(--text-base);
    font-weight: 500;
}

/* Mood Note Area */
.mood-note-area {
    margin-top: 12px;
    text-align: left;
}
.mood-note-area .mood-note-success {
    font-size: var(--text-base);
    color: var(--teal-600, #0d9488);
    font-weight: 500;
    margin-bottom: 8px;
}
.mood-note-area textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm, 6px);
    font-size: var(--text-base);
    resize: none;
    min-height: 60px;
    font-family: inherit;
    background: var(--surface, #ffffff);
    color: var(--text-primary);
}
.mood-note-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* Context Card Buttons */
.context-card-action {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}
.context-card-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md, 10px);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.context-card-btn:hover {
    transform: scale(1.03);
}
.context-card-btn:active {
    transform: scale(0.97);
}
.bedtime-btn {
    background: var(--navy-100, #1A3B5C);
    color: #fff;
}
.wakeup-btn {
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    color: #1a1a2e;
}
/* Sleep Action Grid */
.sleep-action-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.interruption-btn {
    background: var(--surface-elevated, #fff);
    color: var(--text-primary);
    border: 1px solid var(--border, #e2e8f0);
}
.getup-btn {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: #fff;
}
.secondary-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 6px 12px;
    font-family: inherit;
    text-align: center;
}
.secondary-action-btn:hover {
    color: var(--text-primary);
}
.awake-info {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-align: center;
}
/* Interruption Inline Flow */
.interruption-inline {
    text-align: center;
}
.reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 4px 0;
}
.reason-chip {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--surface-elevated, #fff);
    cursor: pointer;
    font-size: var(--text-sm);
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.reason-chip.selected {
    background: var(--navy-100, #1A3B5C);
    color: #fff;
    border-color: var(--navy-100, #1A3B5C);
}
.duration-chips {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 4px 0;
}
.duration-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--surface-elevated, #fff);
    cursor: pointer;
    font-size: var(--text-sm);
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.duration-chip.selected {
    background: var(--navy-100, #1A3B5C);
    color: #fff;
    border-color: var(--navy-100, #1A3B5C);
}
.hydration-btn {
    background: var(--teal-50, #e6fffa);
    color: var(--teal-700, #0f766e);
    border: 1px solid var(--teal-200, #99f6e4);
}

/* Hydration Context Card Progress */
.hydration-progress {
    position: relative;
    height: 6px;
    background: var(--border, #e2e8f0);
    border-radius: 3px;
    margin: 20px 0 12px;
}
.hydration-progress-bar {
    height: 100%;
    background: #0EA5E9;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.hydration-progress-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}
.hydration-quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}
.hydration-type-btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--teal-200, #99f6e4);
    background: var(--teal-50, #e6fffa);
    color: var(--teal-700, #0f766e);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.hydration-type-btn:active {
    transform: scale(0.95);
}
.hydration-repeat-btn {
    background: var(--teal-100, #ccfbf1);
    font-weight: 600;
}
.hydration-more-btn {
    background: var(--surface-elevated, #fff);
    color: var(--text-secondary);
    border-color: var(--border, #e2e8f0);
}
.hydration-amount-label {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    width: 100%;
    text-align: center;
}
.hydration-amount-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}
.nutrition-btn {
    background: var(--surface-elevated, #fff);
    color: var(--text-primary);
    border: 1px solid var(--border, #e2e8f0);
}

/* Module Chips */
.module-chips {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.module-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--card-bg, white);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    position: relative;
}
.module-chip:hover {
    background: var(--navy-50, #f0f4f8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.module-chip:active {
    transform: scale(0.98);
}
.module-chip-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.module-chip-name {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.module-chip-value {
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chip-empty {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: var(--text-xs) !important;
}
.module-chip-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--teal-500, #14b8a6);
    color: white;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.module-chip:hover .module-chip-add {
    opacity: 1;
}

/* Today Timeline */
.today-timeline {
    margin-bottom: 20px;
}
.timeline-entries {
    position: relative;
}
.timeline-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    position: relative;
}
.timeline-dot {
    position: absolute;
    left: -25px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.timeline-time {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    min-width: 38px;
    flex-shrink: 0;
}
.timeline-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.timeline-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.timeline-title {
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.timeline-details {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.timeline-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.timeline-entry:hover .timeline-actions {
    opacity: 1;
}
/* Timeline: Hover edit visible only on desktop */
@media (hover: hover) {
    .timeline-module-detail:hover .timeline-actions {
        opacity: 1;
    }
}
/* On touch devices, hide hover actions (use swipe instead) */
@media (hover: none) {
    .timeline-module-detail .timeline-actions {
        display: none;
    }
}

.timeline-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: var(--text-base);
}

/* Grouped Timeline */
.timeline-grouped {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.timeline-group-header {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}
.timeline-module-row {
    background: var(--card-bg, white);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm, 6px);
    overflow: hidden;
}
.timeline-module-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.timeline-module-summary:hover {
    background: var(--navy-50, #f0f4f8);
}
.timeline-module-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--text-secondary);
}
.timeline-module-name {
    font-size: var(--text-base);
    font-weight: 500;
    min-width: 80px;
}
.timeline-module-count {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.timeline-module-agg {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    flex: 1;
    text-align: right;
}
.timeline-module-details {
    border-top: 1px solid var(--border, #e2e8f0);
}
.timeline-module-detail {
    position: relative;
    overflow: hidden;
}
.timeline-detail-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 40px;
    transition: transform 0.2s ease;
    background: var(--card-bg, white);
    position: relative;
    z-index: 1;
}
.timeline-module-detail + .timeline-module-detail {
    border-top: 1px solid var(--border-light, #f1f5f9);
}
.timeline-detail-time {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    min-width: 38px;
    flex-shrink: 0;
}
.timeline-detail-text {
    font-size: var(--text-sm);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.timeline-detail-note {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-left: 6px;
    font-style: italic;
}
.timeline-module-detail .timeline-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
    margin-left: auto;
}
.timeline-module-detail .entry-action-btn {
    opacity: 1;
}

/* Sleep Viz Container */
.sleep-viz-container {
    position: relative;
    padding: 0 14px 8px 40px;
}
.sleep-mini-timeline-wrapper {
    cursor: pointer;
}

/* Sleep Insights Link */
.sleep-insights-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    color: var(--primary, #3B82F6);
    text-decoration: none;
    margin-top: 4px;
}

/* Calendar View Tabs — Segmented Control */
.calendar-view-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: var(--bg-secondary, #f0f0f0);
    border-radius: 10px;
    padding: 3px;
}
.calendar-view-tab {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.calendar-view-tab.active {
    background: var(--navy-100, #1A3B5C);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Calendar List View */
.calendar-list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.calendar-list-day {
    margin-bottom: 4px;
}
.calendar-list-day-header {
    font-weight: 600;
    font-size: var(--text-base);
    padding: 4px 0 8px;
    border-bottom: 1px solid var(--border, #eee);
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Swipe actions (mobile) */
.timeline-swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    z-index: 0;
}
.swipe-btn {
    width: 60px;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.swipe-edit {
    background: var(--teal-500, #14b8a6);
}
.swipe-delete {
    background: #EF4444;
}
/* Hide swipe buttons on desktop */
@media (hover: hover) {
    .timeline-swipe-actions {
        display: none;
    }
}

/* Dark theme */
[data-theme="dark"] .timeline-module-row {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .timeline-module-summary:hover {
    background: var(--navy-100, #2d3748);
}
[data-theme="dark"] .timeline-detail-inner {
    background: var(--card-bg, #1e293b);
}

/* Sparkline rows */
.week-overview {
    margin-bottom: 20px;
}
.sparkline-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sparkline-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sparkline-row-clickable {
    cursor: pointer;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.15s;
}
.sparkline-row-clickable:hover {
    background: var(--navy-50, #f0f4f8);
}
.sparkline-left {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sparkline-name {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.mini-bars-row {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    flex: 1;
    height: 28px;
    min-width: 0;
}
.mini-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-width: 0;
    transition: transform 0.15s;
    cursor: default;
}
.mini-bar:hover {
    transform: scaleY(1.15);
    transform-origin: bottom;
}
.sparkline-avg {
    font-size: var(--text-sm);
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}
.sparkline-trend {
    font-size: var(--text-base);
    font-weight: 600;
    min-width: 16px;
}

/* Insight Card */
.insight-card {
    border-left: 3px solid #F59E0B;
    margin-bottom: 20px;
}
.insight-card-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.insight-card-content span {
    font-size: var(--text-base);
    line-height: 1.4;
}
.insight-card-link {
    font-size: var(--text-sm);
    color: var(--teal-500, #14b8a6);
    text-decoration: none;
}
.insight-card-link:hover {
    text-decoration: underline;
}

/* Dark theme overrides */
[data-theme="dark"] .module-chip {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .module-chip:hover {
    background: var(--navy-100, #2d3748);
}
[data-theme="dark"] .mood-emoji:hover {
    background: rgba(255,255,255,0.1);
}
[data-theme="dark"] .mood-emoji:active,
[data-theme="dark"] .mood-emoji-active {
    background: rgba(20,184,166,0.15);
}
[data-theme="dark"] .timeline-entries {
    border-left-color: var(--border, #334155);
}

/* Tablet: chips 3+2 */
@media (max-width: 900px) {
    .module-chips {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Mobile: chips 2-col */
@media (max-width: 600px) {
    .module-chips {
        grid-template-columns: repeat(2, 1fr);
    }
    .module-chip-add {
        width: 16px;
        height: 16px;
    }
    .mood-quicktap-row {
        gap: 8px;
    }
    .mood-emoji {
        padding: 6px;
    }
    .mood-emoji-icon {
        font-size: var(--text-3xl);
    }
}

/* ==================== SLEEP VISUALIZATION ==================== */

/* Mini-Zeitleiste */
.sleep-mini-timeline { position: relative; border-radius: 6px; overflow: visible; background: rgba(0,0,0,0.05); margin: 6px 0 2px; }
.sleep-timeline-bar { background: #1A3B5C; height: 100%; border-radius: 6px; position: absolute; top: 0; }
.sleep-timeline-latency { background: rgba(26,59,92,0.35); position: absolute; height: 100%; top: 0; border-radius: 6px 0 0 6px; }
.sleep-timeline-wake { background: #F59E0B; position: absolute; height: 100%; top: 0; border-radius: 3px; min-width: 2px; }
.sleep-timeline-getup { border-left: 2px solid #10B981; position: absolute; height: 100%; top: 0; }
.sleep-timeline-labels { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.sleep-timeline-wake-label { position: absolute; bottom: -16px; font-size: var(--text-xs); color: var(--text-secondary); white-space: nowrap; transform: translateX(-50%); }

/* Sleep KPI Grid */
.sleep-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.sleep-kpi-card { padding: 12px; border-radius: 10px; background: var(--surface-elevated, rgba(0,0,0,0.03)); text-align: center; }
.sleep-kpi-value { font-size: var(--text-xl); font-weight: 700; }
.sleep-kpi-label { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.sleep-kpi-trend { font-size: var(--text-xs); margin-top: 2px; }

/* Schlaf-Regularität */
.sleep-regularity-bar { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #EF4444, #F59E0B, #10B981); position: relative; }
.sleep-regularity-marker { position: absolute; top: -4px; width: 4px; height: 20px; background: var(--text-primary, #333); border-radius: 2px; transform: translateX(-50%); }

/* Sleep Analysis Tabs */
.sleep-analysis-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.sleep-analysis-tab { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border, #ddd); background: none; cursor: pointer; font-size: var(--text-sm); font-family: inherit; color: inherit; }
.sleep-analysis-tab.active { background: var(--navy-100, #1A3B5C); color: #fff; border-color: var(--navy-100, #1A3B5C); }

/* Mood Insight Tabs */
.mood-insight-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.mood-insight-tabs::-webkit-scrollbar { display: none; }
.mood-insight-tab { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border, #ddd); background: none; cursor: pointer; font-size: var(--text-sm); font-family: inherit; color: inherit; white-space: nowrap; flex-shrink: 0; }
.mood-insight-tab.active { background: var(--navy-100, #1A3B5C); color: #fff; border-color: var(--navy-100, #1A3B5C); }

/* Wake-Detail Chips in Timeline */
.sleep-wake-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.sleep-wake-chip { font-size: var(--text-xs); padding: 2px 8px; border-radius: 10px; background: rgba(245,158,11,0.15); color: #92400e; }

/* Wake-Overlay Tooltip (Timing-Chart) */
.wake-overlay-tooltip {
    display: none;
    position: absolute;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: var(--text-xs);
    line-height: 1.4;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

/* Open Sleep Banner */
.open-sleep-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 8px;
}
.open-sleep-banner .btn-sm {
    font-size: var(--text-sm);
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.open-sleep-banner .btn-icon-sm {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: var(--text-base);
    padding: 0 4px;
    margin-left: auto;
}

/* Crisis Alert Banner */
.crisis-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    margin: 12px 0;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    font-size: var(--text-sm);
}
.crisis-alert-banner strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.crisis-alert-banner p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}
.crisis-alert-dismiss {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    white-space: nowrap;
    font-size: var(--text-sm);
    align-self: center;
}

/* Entry Detail Panel (inline expand) */
.entry-detail-panel {
    padding: 10px 14px;
    margin: 4px 0 4px 28px;
    background: var(--glass-bg, rgba(255,255,255,0.6));
    border-radius: 10px;
    font-size: var(--text-sm);
}
.detail-metrics {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.detail-chip {
    font-size: var(--text-sm);
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--navy-50, #f0f4f8);
}
.detail-notes {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 6px 0;
    line-height: 1.4;
}

/* Kompakter Zeitpunkt-Picker */
.time-picker-compact {
    margin-bottom: 12px;
}
.time-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--glass-bg);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}
.time-picker-label {
    font-size: var(--text-sm);
    color: var(--text-primary);
}
.time-picker-toggle {
    background: none;
    border: none;
    color: var(--teal-600);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}
.time-picker-detail {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--glass-bg);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}
.time-picker-date {
    flex: 1;
}
.time-picker-hour,
.time-picker-min {
    width: 60px;
}
.time-picker-sep {
    font-weight: 600;
    font-size: var(--text-lg);
}

/* Wizard Tags Separator */
.wizard-tags-separator {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
}
.empty-state-icon {
    font-size: var(--text-4xl);
    margin-bottom: 12px;
    opacity: 0.6;
}
.empty-state-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.empty-state-hint {
    font-size: var(--text-sm);
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}
.streak-hint {
    font-size: var(--text-sm);
    color: var(--text-secondary) !important;
    opacity: 0.7;
}

/* ===== Bottom Tab Bar ===== */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.tab-item i,
.tab-item svg {
    width: 22px;
    height: 22px;
}

.tab-item span {
    font-size: var(--text-xs);
    font-weight: 500;
    display: none;
}

.tab-item.active {
    background: var(--teal-100);
    color: var(--teal-600);
    padding: 6px 20px;
}

.tab-item.active span {
    display: block;
    font-weight: 600;
}

[data-theme="dark"] .bottom-tab-bar {
    background: var(--surface);
    border-top-color: var(--border);
}

[data-theme="dark"] .tab-item.active {
    background: rgba(13, 148, 136, 0.2);
    color: var(--teal-300);
}

/* Menü-Gruppen-Label */
.dropdown-group-label {
    display: block;
    padding: 8px 16px 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile: Haupt-Links im Hamburger-Menü ausblenden (Tab Bar übernimmt) */
@media (max-width: 768px) {
    .dropdown-hide-mobile {
        display: none !important;
    }
}

/* Desktop: Tab Bar ausblenden */
@media (min-width: 769px) {
    .bottom-tab-bar {
        display: none;
    }
}