/* ============================================
   P'WEE'S - Soft Neumorphic Theme
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6B7FD7;
    --secondary: #A8B5E0;
    --accent: #F5B041;
    --bg: #E8EBF3;
    --bg-dark: #D1D9E6;
    --fg: #4A5568;
    --fg-light: #718096;
    --white: #FFFFFF;
    --shadow-out: 6px 6px 12px #C5CAD4, -6px -6px 12px #FFFFFF;
    --shadow-out-sm: 3px 3px 6px #C5CAD4, -3px -3px 6px #FFFFFF;
    --shadow-in: inset 4px 4px 8px #C5CAD4, inset -4px -4px 8px #FFFFFF;
    --shadow-in-sm: inset 2px 2px 4px #C5CAD4, inset -2px -2px 4px #FFFFFF;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

/* Night Mode */
body.night-mode {
    --bg: #1a1a2e;
    --bg-dark: #16162a;
    --fg: #e2e8f0;
    --fg-light: #a0aec0;
    --shadow-out: 6px 6px 12px #121220, -6px -6px 12px #22223c;
    --shadow-out-sm: 3px 3px 6px #121220, -3px -3px 6px #22223c;
    --shadow-in: inset 4px 4px 8px #121220, inset -4px -4px 8px #22223c;
    --shadow-in-sm: inset 2px 2px 4px #121220, inset -2px -2px 4px #22223c;
}

body.night-mode .message-error { background: #3d1f1f; color: #f87171; }
body.night-mode .message-success { background: #1f3d2a; color: #4ade80; }
body.night-mode .today-badge { background: var(--bg-dark); color: var(--accent); }
body.night-mode .time-picker select,
body.night-mode .timezone-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0aec0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

/* Accent Colors - Primary follows Accent */
body.theme-purple { --accent: #8B5CF6; --primary: #8B5CF6; }
body.theme-aqua { --accent: #06B6D4; --primary: #06B6D4; }
body.theme-green { --accent: #10B981; --primary: #10B981; }
body.theme-yellow { --accent: #F5B041; --primary: #F5B041; }
body.theme-blue { --accent: #3B82F6; --primary: #3B82F6; }
body.theme-red { --accent: #EF4444; --primary: #EF4444; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Layout */
.screen { display: none !important; min-height: 100vh; padding: 16px; padding-bottom: 100px; position: relative; z-index: 1; }
.screen.active { display: flex !important; flex-direction: column; }
#login-screen { z-index: 10; }
#login-screen.active { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg); }

.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 16px; 
    margin: 0 -16px 8px -16px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    transition: box-shadow 0.2s, padding 0.2s;
}
.header.header-with-date {
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.header.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,0.15); padding: 8px 16px; }
.header h1 { font-size: 22px; font-weight: 700; color: var(--fg); display: flex; align-items: center; gap: 10px; }
.header h1 i { color: var(--accent); }
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-logo { height: 48px; width: auto; transition: height 0.2s; }
.header.scrolled .header-logo { height: 36px; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.current-user { font-size: 18px; font-weight: 500; color: var(--fg); }

/* Date Navigation - inside header for sticky */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    width: 100%;
}

.date-nav-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    text-align: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: background 0.2s;
}
.date-nav-display
.date-nav-display:active { background: var(--bg-dark); }

/* Date Arrow Buttons - flush, no shadow */
.btn-date-arrow {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 18px;
    color: var(--fg-light);
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}
.btn-date-arrow
.btn-date-arrow:active { color: var(--primary); }

/* Jump to Today Button */
.btn-jump-today {
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 0 8px;
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-jump-today
.btn-jump-today:active { transform: scale(0.95); }

.btn-xs { padding: 6px 10px; font-size: 12px; }

/* Navigation */
.nav { position: fixed; bottom: 0; left: 0; right: 0; display: none; background: var(--bg); z-index: 100; padding: 12px 16px 20px; gap: 12px; }
.nav.visible { display: flex; }
.nav-item { flex: 1; padding: 16px 8px; text-align: center; background: var(--bg); border: none; border-radius: var(--radius); font-size: 24px; color: var(--fg-light); cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow-out-sm); }
.nav-item.active { box-shadow: var(--shadow-in); color: var(--accent); }

/* Forms */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; color: var(--fg-light); }
input, select, textarea { width: 100%; padding: 14px 16px; font-size: 16px; border: none; border-radius: var(--radius); background: var(--bg); font-family: inherit; color: var(--fg); box-shadow: var(--shadow-in); transition: all 0.2s ease; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--shadow-in), 0 0 0 2px var(--primary); }
input::placeholder { color: var(--fg-light); }
input[type="date"] { -webkit-appearance: none; appearance: none; }

/* Timezone Select */
.timezone-select {
    width: auto;
    min-width: 150px;
    padding: 10px 30px 10px 12px;
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; border: none; border-radius: var(--radius); background: var(--bg); color: var(--fg); cursor: pointer; font-family: inherit; transition: all 0.2s ease; box-shadow: var(--shadow-out); }
.btn:active { box-shadow: var(--shadow-in); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-icon { width: 44px; height: 44px; padding: 0; font-size: 20px; border-radius: var(--radius); }
.btn-action { width: 44px; height: 44px; padding: 0; font-size: 18px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; }
.btn-logout { font-size: 12px; padding: 10px 14px; border-radius: var(--radius-sm); }

/* Login */
#login-screen { display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { width: 200px; height: auto; }
.login-subtitle { text-align: center; color: var(--fg-light); margin-bottom: 40px; font-size: 14px; }
.login-form { max-width: 320px; margin: 0 auto; width: 100%; }
.password-input-wrapper { position: relative; display: flex; align-items: center; }
.password-input-wrapper input { padding-right: 48px; }
.password-toggle { position: absolute; right: 12px; background: none; border: none; color: var(--fg-light); cursor: pointer; padding: 8px; font-size: 16px; }
.password-toggle

/* Cards */
.card { background: var(--bg); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-out); }
.card-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.card-title i { font-size: 16px; color: var(--primary); }

.stats-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

/* Metric Cards - New Layout */
.metric-card { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-out); border-radius: var(--radius-lg); }

/* Metric card type backgrounds */
.metric-feeding { background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(6, 182, 212, 0.02) 100%); }
.metric-sleep { background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.02) 100%); }
.metric-diapers { background: linear-gradient(135deg, rgba(245, 176, 65, 0.08) 0%, rgba(245, 176, 65, 0.02) 100%); }
.metric-pumping { background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%); }

.metric-icon { width: 72px; height: 72px; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: transparent; flex-shrink: 0; }
.metric-icon img { width: 100%; height: 100%; object-fit: cover; }
.metric-content { flex: 1; }
.metric-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); margin-bottom: 4px; }

.metric-hero { display: flex; align-items: center; gap: 6px; margin-bottom: 0; flex-wrap: wrap; }
.metric-hero i { font-size: 16px; }
.metric-hero-value { font-size: 22px; font-weight: 700; }
.metric-hero-label { font-size: 14px; color: var(--fg-light); }
.metric-hero-detail { font-size: 13px; color: var(--fg-light); font-weight: 500; }
.metric-hero-detail:not(:empty)::before { content: "· "; }

/* Metric colors */
.metric-diapers .metric-hero i, .metric-diapers .metric-hero-value { color: #F5B041; }
.metric-feeding .metric-hero i, .metric-feeding .metric-hero-value { color: #06B6D4; }
.metric-sleep .metric-hero i, .metric-sleep .metric-hero-value { color: #8B5CF6; }
.metric-pumping .metric-hero i, .metric-pumping .metric-hero-value { color: #10B981; }

.metric-secondary { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.metric-total { font-size: 15px; font-weight: 700; color: var(--fg); }
.metric-target { font-weight: 400; color: var(--fg-light); }
.metric-details { font-size: 13px; color: var(--fg-light); }
.metric-details span { font-weight: 600; color: var(--fg); }

/* Metric Icon Wrapper with Action Button */
.metric-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    cursor: pointer;
}

.metric-icon-wrapper:active .metric-icon-circle {
    transform: scale(0.95);
}

.metric-icon-wrapper:active .metric-action-btn {
    transform: scale(0.9);
}

.metric-icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 0.3s ease, transform 0.15s ease;
}

.metric-icon-circle img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* Light accent backgrounds for each type */
.feeding-circle { background: rgba(6, 182, 212, 0.15); }
.sleep-circle { background: rgba(139, 92, 246, 0.15); }
.diapers-circle { background: rgba(245, 176, 65, 0.15); }
.pumping-circle { background: rgba(16, 185, 129, 0.15); }

/* Active sleep tracking state - full opacity */
.sleep-circle.active { background: rgba(139, 92, 246, 0.35); }
.pumping-circle.active { background: rgba(16, 185, 129, 0.35); }

/* Action Buttons (now divs, click handled by wrapper) */
.metric-action-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 12px;
    color: var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    pointer-events: none; /* Click passes through to wrapper */
}
#sleep-card .metric-action-btn {
    background: rgba(139, 92, 246, 0.7);
}
#pumping-card .metric-action-btn {
     background: rgba(16, 185, 129, 0.7);
}

.feeding-action { background: rgba(6, 182, 212, 0.7); }
.feeding-action

.sleep-action { background: rgba(139, 92, 246, 0.7); }
.sleep-action
.sleep-action.active { background: rgba(139, 92, 246, 1); }

.diapers-action { background: rgba(245, 176, 65, 0.7); }
.diapers-action

.pumping-action { background: rgba(16, 185, 129, 0.7); pointer-events: auto; }
.pumping-action.active { background: rgba(16, 185, 129, 1); }

/* Secondary action button (for stop when pumping) */
.metric-action-btn-secondary {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #059669;
    font-size: 10px;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 2;
}

/* ============================================
   LINE CHART
   ============================================ */
.chart-container { background: var(--bg); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-out); margin-bottom: 16px; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.chart-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); display: flex; align-items: center; gap: 8px; }
.chart-title i { color: var(--primary); }

.chart-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); box-shadow: var(--shadow-in-sm); }
.chart-tab { padding: 8px 12px; font-size: 11px; font-weight: 600; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--fg-light); cursor: pointer; transition: all 0.2s ease; }
.chart-tab.active { background: var(--accent); color: var(--white); }
.chart-view-toggle { display: flex; gap: 4px; justify-content: center; margin-bottom: 12px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); box-shadow: var(--shadow-in-sm); }
.view-btn { flex: 1; padding: 8px 16px; font-size: 11px; font-weight: 600; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--fg-light); cursor: pointer; transition: all 0.2s ease; }
.view-btn.active { background: var(--accent); color: var(--white); }

.chart-legend-filter { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.legend-btn { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 11px; font-weight: 600; border: none; border-radius: var(--radius-sm); background: var(--bg); color: var(--fg-light); cursor: pointer; box-shadow: var(--shadow-out-sm); transition: all 0.2s ease; }
.legend-btn.active { box-shadow: var(--shadow-in-sm); color: var(--fg); }
.legend-btn:not(.active) { opacity: 0.5; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.feeding { background: #06B6D4; }
.legend-dot.diapers { background: #F5B041; }
.legend-dot.sleep { background: #8B5CF6; }

/* Line Chart Canvas */
.line-chart-wrapper {
    position: relative;
    height: 150px;
    margin-bottom: 8px;
}

.line-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-labels { display: flex; justify-content: space-between; overflow: hidden; }
.chart-label { font-size: 9px; color: var(--fg-light); font-weight: 500; text-align: center; flex: 1; min-width: 0; }

/* Chart Detail Bottom Sheet */
.chart-detail-body { padding: 0; }
.chart-detail-stat { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--bg-dark); }
.chart-detail-stat:last-child { border-bottom: none; }
.chart-detail-label { color: var(--fg-light); display: flex; align-items: center; gap: 10px; font-size: 14px; }
.chart-detail-value { font-weight: 700; color: var(--fg); font-size: 16px; }
.chart-detail-sub { padding-left: 20px; }

/* Day Groups */
.day-group { margin-bottom: 12px; }
.day-header { background: var(--accent); color: var(--white); padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; border-radius: var(--radius); cursor: pointer; transition: all 0.2s ease; }
.day-header:active { opacity: 0.9; }
.day-header-left { display: flex; align-items: center; gap: 12px; flex: 1; flex-wrap: wrap; }
.day-header-date { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.day-header-summary { font-size: 12px; display: flex; gap: 12px; opacity: 0.9; }
.day-header-summary span { display: flex; align-items: center; gap: 3px; }
.day-expand { font-size: 20px; transition: transform 0.3s ease; flex-shrink: 0; }
.day-group.collapsed .day-expand { transform: rotate(-90deg); }
.day-entries { padding-top: 12px; }
.day-group.collapsed .day-entries { display: none; }

/* Filter Info */
.filter-info { display: none; padding: 12px 16px; background: var(--accent); color: var(--white); border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.filter-info.active { display: flex; justify-content: space-between; align-items: center; }
.filter-info button { background: rgba(255,255,255,0.2); border: none; color: var(--white); padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 600; }

/* Filter Presets Grid */
.filter-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.filter-preset-btn {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-out-sm);
    text-align: center;
}

.filter-preset-btn:active {
    box-shadow: var(--shadow-in);
}

.filter-preset-btn.active {
    background: var(--accent);
    color: var(--white);
    box-shadow: var(--shadow-in-sm);
}

/* Date Range Row */
.date-range-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.date-range-block {
    flex: 1;
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-in-sm);
}

.date-range-block label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-light);
    margin-bottom: 8px;
}

.date-range-block input {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    box-shadow: var(--shadow-out-sm);
}

/* Entry */
.entry { background: var(--bg); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-out-sm); }
.entry-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; gap: 12px; }
.entry-header:active { background: var(--bg-dark); }
.entry-summary { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; overflow: hidden; }
.entry-time { font-size: 14px; font-weight: 700; color: var(--fg); white-space: nowrap; flex-shrink: 0; }
.entry-summary-details { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-light); overflow: hidden; white-space: nowrap; }
.entry-summary-details span { display: inline-flex; align-items: center; gap: 3px; }
.entry-summary-details i { font-size: 14px; }
.summary-sep { opacity: 0.4; }
.summary-volume { font-weight: 600; color: var(--accent); }
.summary-pumping { font-weight: 600; color: #10B981; }
.summary-solids { color: #F59E0B; }
.entry-expand { font-size: 20px; transition: transform 0.2s ease; flex-shrink: 0; color: var(--fg-light); }
.entry.expanded .entry-expand { transform: rotate(180deg); }
.entry-details { display: none; padding: 0 16px 16px; border-top: 1px solid var(--bg-dark); }
.entry.expanded .entry-details { display: block; }
.entry-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding-top: 14px; }
.entry-metric { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; background: var(--bg); padding: 8px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-in-sm); color: var(--fg); }
.entry-metric i { font-size: 16px; color: var(--primary); }
.entry-by { font-size: 11px; color: var(--fg-light); display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.entry-actions { display: flex; gap: 10px; }

/* Bottom Sheet */
.bottom-sheet { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); z-index: 200; align-items: flex-end; justify-content: center; }
.bottom-sheet.active { display: flex; }
.bottom-sheet-content { background: var(--bg); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 20px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; animation: slideUp 0.3s ease-out; box-shadow: 0 -10px 40px rgba(0,0,0,0.15); }
.bottom-sheet-compact { max-height: 60vh; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bottom-sheet-handle { width: 40px; height: 5px; background: var(--bg-dark); border-radius: 3px; margin: 0 auto 20px; }
.bottom-sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--bg-dark); }
.bottom-sheet-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--fg); }
.bottom-sheet-title i { color: var(--primary); }

/* Metric buttons */
.metric-selector { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 20px; }
.metric-btn { padding: 14px 4px; border: none; border-radius: var(--radius); background: var(--bg); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.2s ease; box-shadow: var(--shadow-out-sm); color: var(--fg-light); }
.metric-btn.selected { box-shadow: var(--shadow-in); color: var(--accent); }
.metric-btn-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.metric-btn-label { font-size: 9px; font-weight: 600; text-transform: uppercase; text-align: center; }

/* Size selector */
.size-selector { display: flex; gap: 10px; }
.size-btn { flex: 1; padding: 14px; border: none; border-radius: var(--radius); background: var(--bg); cursor: pointer; text-align: center; font-size: 12px; font-weight: 600; transition: all 0.2s ease; box-shadow: var(--shadow-out-sm); color: var(--fg-light); }
.size-btn.selected { box-shadow: var(--shadow-in); color: var(--accent); }

/* User list */
.user-item { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: var(--bg); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow-out-sm); }
.user-name { font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--fg); }
.user-name i { color: var(--primary); }
.user-actions { display: flex; gap: 8px; }

/* FAB */
.fab { position: fixed; bottom: 115px; right: 20px; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--white); border: none; font-size: 28px; cursor: pointer; box-shadow: var(--shadow-out), 0 4px 15px rgba(0,0,0,0.2); z-index: 50; display: flex; align-items: center; justify-content: center; transition: transform 0.2s ease; }
.fab:active { transform: scale(0.95); }
.fab i { font-size: 26px; }

/* Messages */
.message { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-in-sm); }
.message-error { background: #FEE2E2; color: #DC2626; }
.message-success { background: #D1FAE5; color: #059669; }

/* Section */
.section { margin-bottom: 0; }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding-bottom: 12px; margin-bottom: 16px; color: var(--fg-light); display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--primary); }

/* Field groups */
.field-group { display: none; padding: 16px; background: var(--bg); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow-in-sm); }
.field-group.active { display: block; }
.field-group-title { font-size: 13px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--fg); }
.field-group-title i { color: var(--primary); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--fg-light); }
.empty-state-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.4; color: var(--primary); }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* Badges */
.today-badge { background: var(--white); color: var(--accent); padding: 4px 10px; font-size: 10px; font-weight: 700; border-radius: var(--radius-sm); margin-left: 8px; }

/* Form actions */
.form-actions { display: flex; gap: 12px; margin-top: 28px; }
.form-actions .btn { flex: 1; }

/* Help text */
.help-text { color: var(--fg-light); font-size: 11px; margin-top: 6px; }
.help-text i { margin-right: 4px; }

/* Time picker */
.time-picker { display: flex; gap: 8px; align-items: center; }
.time-picker select { flex: 1; padding: 14px 10px; font-size: 16px; text-align: center; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.time-picker-sep { font-size: 20px; font-weight: 700; color: var(--fg-light); }

/* Settings */
.settings-card { margin-bottom: 16px; background: var(--bg); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-out);margin-bottom: 16px;}
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; }
.settings-row:not(:last-child) { border-bottom: 1px solid var(--bg-dark); }
.settings-label { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--fg); }
.settings-label i { font-size: 20px; color: var(--primary); }

/* Theme Toggle */
.theme-toggle { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); box-shadow: var(--shadow-in-sm); }
.theme-btn { width: 40px; height: 32px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--fg-light); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.2s ease; }
.theme-btn.active { background: var(--accent); color: var(--white); }

/* Color picker */
.color-picker { display: flex; gap: 10px; justify-content: center; padding: 16px 0; flex-wrap: wrap; }
.color-option { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow-out-sm); }
.color-option
.color-option.selected { border-color: var(--fg); box-shadow: var(--shadow-in); }
.color-option.purple { background: #8B5CF6; }
.color-option.aqua { background: #06B6D4; }
.color-option.green { background: #10B981; }
.color-option.yellow { background: #F5B041; }
.color-option.blue { background: #3B82F6; }
.color-option.red { background: #EF4444; }

/* Admin section */
.admin-section { margin-top: 24px; padding-top: 24px; border-top: 2px solid var(--bg-dark); margin-bottom: 16px; }
.admin-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.admin-section-title i { color: var(--primary); }
.admin-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-buttons .btn { flex: 1; min-width: 140px; }
.file-input-wrapper { position: relative; overflow: hidden; display: inline-block; flex: 1; min-width: 140px; border-radius: var(--radius); }
.file-input-wrapper input[type=file] { position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-input-wrapper .btn { width: 100%; pointer-events: none; border-radius: var(--radius); box-shadow: var(--shadow-in);}

/* Loading */
.loading { display: none; text-align: center; padding: 40px; color: var(--fg-light); }
.loading.active { display: block; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--bg-dark); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Summary Target Display */
.summary-value-row { display: flex; align-items: baseline; gap: 6px; }

/* Progress Rings Card */
.progress-card { padding: 16px; }
.progress-card .card-title { margin-bottom: 16px; }
.progress-main { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.progress-rings { width: 180px; height: 180px; transform: rotate(-90deg); flex-shrink: 0; }
.ring-bg { fill: none; stroke: var(--bg-dark); stroke-width: 10; }
.ring-progress { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.ring-feeding { stroke: #06B6D4; }
.ring-sleep { stroke: #8B5CF6; }
.ring-diapers { stroke: #F5B041; }

.progress-metrics { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.progress-metric { display: flex; flex-direction: column; }
.progress-metric-label { font-size: 11px; color: var(--fg-light); text-transform: uppercase; letter-spacing: 0.3px; }
.progress-metric-value { font-size: 26px; font-weight: 700; }
.progress-metric-value.feeding { color: #06B6D4; }
.progress-metric-value.sleep { color: #8B5CF6; }
.progress-metric-value.diapers { color: #F5B041; }

.progress-history { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.progress-history::-webkit-scrollbar { display: none; }
.progress-history-day { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; padding: 4px; border-radius: 8px; transition: background 0.2s; flex-shrink: 0; }
.progress-history-day
.history-day-label { font-size: 10px; font-weight: 600; color: var(--fg-light); text-transform: uppercase; }
.history-rings { width: 40px; height: 40px; transform: rotate(-90deg); }
.history-rings .ring-bg { stroke-width: 3; }
.history-rings .ring-progress { stroke-width: 3; }
.history-scroll-hint { text-align: center; font-size: 10px; color: var(--fg-light); margin-top: 4px; opacity: 0.6; }

/* Settings Note */
.settings-note { font-size: 12px; color: var(--fg-light); margin-bottom: 16px; font-style: italic; }

/* Baby Age Display */
.baby-age { font-size: 13px; color: var(--primary); font-weight: 600; margin-top: 8px; }

/* Recommended Targets */
.recommended-targets { margin-top: 16px; padding: 12px; background: var(--bg-dark); border-radius: var(--radius-sm); }
.recommended-title { font-size: 11px; font-weight: 600; color: var(--fg-light); text-transform: uppercase; margin-bottom: 8px; }
.recommended-values { font-size: 13px; color: var(--fg); line-height: 1.6; }

/* Version Info */
.version-info { text-align: center; padding: 20px; color: var(--fg-light); font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.source-ref { font-size: 10px; }
.source-ref a { color: var(--primary); text-decoration: none; }

/* Chart Detail Modal */
.chart-detail-body { max-height: 300px; overflow-y: auto; }
.chart-detail-entry { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--bg-dark); }
.chart-detail-entry:last-child { border-bottom: none; }
.chart-detail-time { font-weight: 600; color: var(--fg); }
.chart-detail-desc { flex: 1; margin-left: 12px; color: var(--fg-light); font-size: 14px; }
.chart-detail-edit { padding: 8px; color: var(--primary); cursor: pointer; }

/* Logout Button Full Width */
.btn-logout-full { margin-bottom: 16px; background: var(--bg-dark); color: var(--fg); border: 1px solid var(--bg-dark); }
.btn-logout-full

/* Settings Hamburger Button */
.btn-settings-hamburger { background: transparent; border: none; box-shadow: none; font-size: 20px; padding: 8px 12px; color: var(--fg); }
.btn-settings-hamburger

/* Plan Page */
.plan-header { margin-bottom: 16px; }
.plan-title { font-size: 20px; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.plan-context { font-size: 13px; color: var(--fg-light); font-style: italic; }

.plan-card { margin-bottom: 16px; }

/* Coming Soon Page */
.coming-soon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    min-height: 400px;
}

.coming-soon-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.coming-soon-icon i {
    font-size: 40px;
    color: var(--primary);
}

.coming-soon-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
}

.coming-soon-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.coming-soon-desc {
    font-size: 14px;
    color: var(--fg-light);
    max-width: 280px;
    line-height: 1.5;
}

/* Pumping Session Summary */
.pumping-session-summary {
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.pumping-session-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pumping-session-label {
    font-size: 12px;
    color: var(--fg-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pumping-session-value {
    font-size: 32px;
    font-weight: 700;
    color: #10B981;
}

.plan-events { display: flex; flex-direction: column; gap: 12px; }
.plan-event { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-dark); border-radius: var(--radius); border-left: 3px dashed var(--fg-light); }
.plan-event-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.plan-event-icon.feeding { background: rgba(6, 182, 212, 0.15); color: #06B6D4; }
.plan-event-icon.sleep { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }
.plan-event-icon.diapers { background: rgba(245, 176, 65, 0.15); color: #F5B041; }
.plan-event-icon.pumping { background: rgba(236, 72, 153, 0.15); color: #EC4899; }

/* Plan Accordions */
.plan-accordions { display: flex; flex-direction: column; gap: 8px; }
.plan-accordion { background: var(--bg-dark); border-radius: var(--radius); overflow: hidden; }
.plan-accordion-header { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; }
.plan-accordion-summary { flex: 1; }
.plan-accordion-arrow { color: var(--fg-light); transition: transform 0.2s; }
.plan-accordion.expanded .plan-accordion-arrow { transform: rotate(180deg); }
.plan-accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.plan-accordion.expanded .plan-accordion-content { max-height: 500px; }
.plan-accordion-list { padding: 0 12px 12px 12px; display: flex; flex-direction: column; gap: 8px; }

/* Schedule Items with Log Button */
.plan-schedule-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg); border-radius: 6px; font-size: 13px; }
.plan-schedule-item .schedule-time { font-weight: 600; color: var(--fg); min-width: 65px; }
.plan-schedule-item .schedule-expected { font-size: 12px; color: var(--fg-light); flex: 1; }
.plan-schedule-item .schedule-expected.size-small { color: #22C55E; }
.plan-schedule-item .schedule-expected.size-medium { color: #EAB308; }
.plan-schedule-item .schedule-expected.size-large { color: #EF4444; }
.plan-schedule-item.current { border-left: 3px solid var(--primary); background: rgba(var(--primary-rgb), 0.05); }

/* Single Log Button */
.schedule-log-btn { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    padding: 6px 12px; 
    border-radius: 16px; 
    border: none; 
    background: var(--primary); 
    color: white; 
    font-size: 12px; 
    font-weight: 500; 
    cursor: pointer; 
    transition: all 0.2s; 
    white-space: nowrap;
}
.schedule-log-btn
.schedule-log-btn:active { transform: scale(0.98); }
.schedule-log-btn i { font-size: 10px; }

/* Schedule item main row */
.schedule-main { display: flex; align-items: center; gap: 8px; }

/* Schedule formula toggle */
.schedule-formula-toggle {
    font-size: 10px;
    color: var(--fg-light);
    cursor: pointer;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.schedule-formula-toggle
.schedule-formula-toggle i { font-size: 9px; }

/* Schedule formula detail - hidden by default */
.schedule-formula-detail {
    display: none;
    background: var(--bg);
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 6px;
    font-size: 10px;
}
.plan-schedule-item.show-formula .schedule-formula-detail { display: block; }

.formula-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    color: var(--fg-light);
}
.formula-row span:last-child { font-weight: 500; color: var(--fg); }
.formula-calc {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--bg-dark);
    font-family: monospace;
    font-size: 9px;
    color: var(--primary);
}

/* Goals Progress on Plan Page */
.goals-progress-list { display: flex; flex-direction: column; gap: 10px; }
.goal-progress-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--bg-dark); border-radius: var(--radius); }
.goal-progress-item .goal-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.goal-progress-item .goal-icon.achieved { background: rgba(34, 197, 94, 0.15); color: #22C55E; }
.goal-progress-item .goal-icon.close { background: rgba(234, 179, 8, 0.15); color: #EAB308; }
.goal-progress-item .goal-icon.far { background: var(--bg); color: var(--fg-light); }
.goal-progress-item .goal-info { flex: 1; }
.goal-progress-item .goal-name { font-size: 13px; font-weight: 500; color: var(--fg); }
.goal-progress-item .goal-status { font-size: 12px; color: var(--fg-light); }
.goals-progress-note { font-size: 12px; color: var(--fg-light); display: flex; align-items: center; gap: 6px; padding-top: 8px; }

/* Settings Goals Divider */
.goals-targets-divider { height: 1px; background: var(--bg-dark); margin: 16px 0; }
.goals-targets-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); margin-bottom: 12px; }

/* Toast Notification */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--fg); color: var(--bg); padding: 12px 24px; border-radius: 24px; font-size: 14px; font-weight: 500; opacity: 0; transition: all 0.3s; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Stacked Trends View Container */
.gantt-container { background: var(--bg-dark); border-radius: var(--radius); margin: 0 0 16px 0; overflow: hidden; display: flex; flex-direction: column; }
.gantt-timeline { padding: 12px; display: flex; flex-direction: column; overflow: hidden; }

/* Prediction Info (Progressive Disclosure) */
.prediction-info { padding: 10px 12px; background: var(--bg); border-radius: 6px; margin-bottom: 10px; font-size: 12px; }
.prediction-info-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.prediction-info-summary { color: var(--fg-light); }
.prediction-info-comparison { font-weight: 600; }
.prediction-info-comparison.typical { color: #22C55E; }
.prediction-info-comparison.above { color: #EAB308; }
.prediction-info-comparison.below { color: #3B82F6; }
.prediction-info-toggle { color: var(--fg-light); font-size: 10px; }
.prediction-info-details { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--bg-dark); }
.prediction-info.expanded .prediction-info-details { display: block; }
.prediction-formula { font-family: monospace; font-size: 10px; color: var(--fg-light); background: var(--bg-dark); padding: 8px; border-radius: 4px; margin-top: 6px; overflow-x: auto; }
.prediction-breakdown { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.prediction-breakdown-item { display: flex; justify-content: space-between; font-size: 11px; }
.prediction-breakdown-label { color: var(--fg-light); }
.prediction-breakdown-value { font-weight: 500; color: var(--fg); }

.plan-event-title { font-size: 13px; color: var(--fg-light); margin-bottom: 2px; }
.plan-event-time { font-size: 16px; font-weight: 600; color: var(--fg); }
.plan-event-desc { font-size: 11px; color: var(--fg-light); margin-top: 2px; font-style: italic; }

.plan-rhythm { display: flex; flex-direction: column; gap: 16px; }
.rhythm-section { display: flex; flex-direction: column; gap: 6px; }
.rhythm-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); margin-bottom: 2px; }
.rhythm-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg); }
.rhythm-item i { width: 20px; color: var(--primary); }

.plan-adjust { display: flex; flex-direction: column; gap: 12px; }
.plan-adjust .form-group { margin-bottom: 0; }
.plan-adjust select { width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--bg-dark); background: var(--bg-dark); color: var(--fg); font-size: 14px; }

.plan-note { display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px; background: var(--bg-dark); border-radius: var(--radius); font-size: 12px; color: var(--fg-light); margin-top: 8px; }
.plan-note i { color: var(--primary); margin-top: 2px; }

/* Logbook Grid View */
.logbook-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
}
.grid-day { 
    background: #F6F8FC; 
    border-radius: var(--radius); 
    padding: 6px 12px 12px; 
    cursor: pointer; 
    border: 1px solid var(--bg-dark);
    transition: transform 0.15s, border-color 0.15s;
}
.grid-day
.grid-day:active { transform: scale(0.98); }
.grid-day-today { 
    border: 2px solid var(--accent);
}
.grid-day-today .grid-day-num {
    color: var(--accent);
}
.grid-day-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: baseline; 
    margin-bottom: 6px; 
}
.grid-day-name { 
    font-size: 14px; 
    font-weight: 400; 
    color: var(--fg); 
}
.grid-day-num { 
    font-size: 24px; 
    font-weight: 700; 
    color: var(--fg); 
}
.grid-day-stats { display: flex; flex-direction: column; gap: 5px; }

.grid-stat-row { display: flex; flex-direction: column; gap: 1px; }
.grid-stat-row.feeding { color: #06B6D4; }
.grid-stat-row.sleep { color: #8B5CF6; }
.grid-stat-row.diapers { color: #F5B041; }

.grid-stat-main { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}
.grid-stat-main i { 
    font-size: 13px; 
}
.grid-stat-total { 
    font-size: 13px; 
    font-weight: 600; 
}
.grid-stat-breakdown { 
    font-size: 11px; 
    color: var(--fg-light); 
    font-weight: 400;
    line-height: 1.1em;
}
.grid-stat-breakdown .stat-item {
    white-space: nowrap;
    display: inline;
}
.grid-stat-breakdown strong {
    font-weight: 600;
}

/* Night mode grid adjustments */
body.night-mode .grid-day {
    background: var(--bg-dark);
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-dark); border-radius: 28px; transition: 0.3s; }
.toggle-slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px; background-color: var(--fg-light); border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); background-color: white; }

/* Form Row */
.form-row { display: flex; gap: 12px; }

/* Stacked Trends View */
.trends-header { padding: 8px 0; margin-bottom: 8px; }
.trends-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Color circle metric toggles */
.trends-metric-toggles { display: flex; gap: 8px; align-items: center; }
.metric-toggle { display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg-light);
    cursor: pointer;
    box-shadow: var(--shadow-in-sm);
    transition: all 0.2s ease;
    opacity: 0.5;
}
.metric-toggle.active { opacity: 1; }
.metric-toggle
.metric-dot { display: block; width: 14px; height: 14px; border-radius: 50%; }
.metric-dot.feeding { background: #06B6D4; }
.metric-dot.sleep { background: #8B5CF6; }
.metric-dot.diapers { background: #F5B041; }

/* Days dropdown */
.trends-days-select { padding: 6px 10px; font-size: 12px; border-radius: var(--radius); border: 1px solid var(--bg-dark); background: var(--bg); color: var(--fg); cursor: pointer; }

.trends-stack { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 220px); overflow-y: auto; padding-bottom: 16px; }

.trend-day { background: var(--bg); border-radius: var(--radius); padding: 10px 12px; border: 1px solid var(--bg-dark); }

.trend-day-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.trend-day-label { font-weight: 600; font-size: 13px; color: var(--fg); }
.trend-day-totals { display: flex; gap: 10px; font-size: 11px; }
.trend-total { display: flex; align-items: center; gap: 3px; color: var(--fg-light); font-weight: 500; }
.trend-total.feeding { color: #06B6D4; }
.trend-total.sleep { color: #8B5CF6; }
.trend-total.diapers { color: #F5B041; }

.trend-day-chart { position: relative; }
.trend-canvas { width: 100%; height: 60px; display: block; }
.trend-time-labels { display: flex; justify-content: space-between; padding: 0 5px; }
.trend-label { font-size: 9px; color: var(--fg-light); }

.loading-indicator { text-align: center; padding: 20px; color: var(--fg-light); }

/* Gantt button active state */
#logbook-gantt-btn.active { background: var(--primary); color: var(--bg); }

/* Sleep Merge Modal */
.merge-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;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}
.merge-modal.visible { opacity: 1; }

.merge-modal-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-out);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}
.merge-modal.visible .merge-modal-content {
    transform: translateY(0);
}

.merge-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: white;
}

.merge-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
}

.merge-modal-message {
    font-size: 14px;
    color: var(--fg-light);
    line-height: 1.5;
    margin-bottom: 16px;
}

.merge-modal-message strong {
    color: var(--fg);
    display: block;
    margin-top: 4px;
}

.merge-modal-suggestion {
    margin-bottom: 20px;
}

.merge-preview {
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: inline-block;
}

.merge-preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-light);
    margin-bottom: 4px;
}

.merge-preview-time {
    font-size: 16px;
    font-weight: 600;
    color: #8B5CF6;
}

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

.merge-modal-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

.merge-btn-extend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Sleep Warning Modal */
.sleep-warning-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;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}
.sleep-warning-modal.visible { opacity: 1; }

/* Split Sleep Modal */
.split-sleep-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;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}
.split-sleep-modal.visible { opacity: 1; }

.split-sleep-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-out);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}
.split-sleep-modal.visible .split-sleep-content {
    transform: translateY(0);
}

.split-sleep-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: white;
}

.split-sleep-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
}

.split-sleep-message {
    font-size: 14px;
    color: var(--fg-light);
    line-height: 1.5;
    margin-bottom: 20px;
}

.split-sleep-timeline {
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.timeline-icon.sleep {
    background: rgba(139, 92, 246, 0.2);
    color: #8B5CF6;
}

.timeline-icon.entry {
    background: rgba(6, 182, 212, 0.2);
    color: #06B6D4;
}

.timeline-text {
    font-size: 13px;
    color: var(--fg);
}

.timeline-text strong {
    color: var(--fg);
    font-weight: 600;
}

.timeline-connector {
    width: 2px;
    height: 16px;
    background: var(--fg-light);
    opacity: 0.3;
    margin: 4px 0 4px 15px;
}

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

.split-sleep-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

.split-btn-confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sleep-warning-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-out);
}

.sleep-warning-icon {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.sleep-warning-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
}

.sleep-warning-message {
    font-size: 14px;
    color: var(--fg-light);
    line-height: 1.5;
    margin-bottom: 20px;
}

.sleep-warning-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.sleep-warning-actions .btn {
    flex: 1;
    max-width: 130px;
}

/* Sleep card with warning */
.metric-card.warning-shown {
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: var(--shadow-out); }
    50% { box-shadow: var(--shadow-out), 0 0 0 3px rgba(245, 158, 11, 0.3); }
}

/* Split Sleep Option Groups */
.split-sleep-option-group {
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
    text-align: left;
}

.split-option-label {
    font-size: 12px;
    color: var(--fg-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.split-option-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.split-option-value i {
    color: var(--accent);
}

.split-resume-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.split-resume-btn {
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--bg-lighter);
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.split-resume-btn:hover {
    border-color: var(--accent);
}

.split-resume-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
}

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

.split-custom-input input {
    width: 70px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--bg-lighter);
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
}

.split-custom-input span {
    color: var(--fg-light);
    font-size: 13px;
}

.split-sleep-preview {
    margin-bottom: 16px;
}

/* End Sleep Time Modal */
.end-sleep-time-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;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.end-sleep-time-modal.visible {
    opacity: 1;
}

.end-sleep-time-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-out);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.end-sleep-time-modal.visible .end-sleep-time-content {
    transform: translateY(0);
}

.end-sleep-time-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: white;
}

.end-sleep-time-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 16px;
}

.end-sleep-time-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--bg-lighter);
    background: var(--bg);
    color: var(--fg);
    font-size: 16px;
    margin-bottom: 20px;
}

.end-sleep-time-actions {
    display: flex;
    gap: 12px;
}

.end-sleep-time-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}
