/* ============================================================
   Floq Application Styles
   Based on specs/ui/styles.css and specs/00-brand-guide.md
   ============================================================ */

/* Self-hosted fonts */
@font-face { font-family: 'Inter'; src: url('/fonts/inter_5.2.8/webfonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter_5.2.8/webfonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter_5.2.8/webfonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter_5.2.8/webfonts/inter-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/roboto-mono_5.2.8/webfonts/roboto-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/roboto-mono_5.2.8/webfonts/roboto-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

/* --- CSS Custom Properties (Brand Tokens) --- */
:root, [data-theme="light"] {
    --color-accent: #3B82F6;
    --color-accent-hover: #2563EB;
    --color-accent-muted: rgba(59, 130, 246, 0.25);
    --color-accent-text: #2563EB;
    --color-flow-start: #312E81;
    --color-flow-mid: #6D28D9;
    --color-flow-end: #8B5CF6;
    --color-bg: #F9FAFB;
    --color-surface: #FFFFFF;
    --color-surface-elevated: #F3F4F6;
    --color-border: #E5E7EB;
    --color-text-primary: #111827;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --color-bg: #111827;
    --color-surface: #1F2937;
    --color-surface-elevated: #374151;
    --color-border: #374151;
    --color-text-primary: #F9FAFB;
    --color-text-secondary: #9CA3AF;
    --color-text-muted: #6B7280;
    --color-accent-text: #3B82F6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text-primary); line-height: 1.5; min-height: 100vh; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
h1:focus { outline: none; }
a { color: var(--color-accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- App Shell --- */
.app-shell { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar { width: 240px; background: var(--color-surface); border-right: 1px solid var(--color-border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-brand { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-lg); border-bottom: 1px solid var(--color-border); }
.sidebar-brand img { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.sidebar-brand span { font-size: 1.25rem; font-weight: 700; color: var(--color-text-primary); }
.sidebar-nav { flex: 1; padding: var(--space-md) var(--space-sm); display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); color: var(--color-text-secondary); font-size: 0.875rem; font-weight: 500; text-decoration: none; transition: all 0.15s ease; }
.nav-item:hover { background: var(--color-surface-elevated); color: var(--color-text-primary); text-decoration: none; }
.nav-item.active { background: var(--color-accent-muted); color: var(--color-accent-text); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-spacer { flex: 1; }
.sidebar-footer { padding: var(--space-md) var(--space-sm); border-top: 1px solid var(--color-border); }

/* --- Main Content --- */
.main-content { flex: 1; margin-left: 240px; min-height: 100vh; }
.page-header { padding: var(--space-lg) var(--space-xl); border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; background: var(--color-surface); }
.page-header h1 { font-size: 1.375rem; margin: 0; }
.page-body { padding: var(--space-xl); }

/* --- User Menu --- */
.user-menu-trigger { display: flex; align-items: center; gap: var(--space-sm); width: 100%; padding: var(--space-sm) var(--space-md); border: none; background: transparent; color: var(--color-text); cursor: pointer; transition: background 0.15s; }
.user-menu-trigger:hover { background: var(--color-surface-hover, rgba(128,128,128,0.1)); }
.user-menu-chevron { transition: transform 0.2s; }
.user-menu-chevron.open { transform: rotate(180deg); }
.user-menu-accordion { padding: 0 var(--space-sm) var(--space-sm); }
.user-menu-item { display: flex; align-items: center; gap: var(--space-sm); width: 100%; padding: var(--space-xs) var(--space-md); border: none; border-radius: var(--radius-sm); background: transparent; color: var(--color-text); font-size: 0.8125rem; cursor: pointer; text-decoration: none; transition: background 0.15s; }
.user-menu-item:hover { background: var(--color-surface-hover, rgba(128,128,128,0.1)); }
.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }

/* --- Cards --- */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-lg); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.card-title { font-size: 0.875rem; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; border: none; cursor: pointer; transition: all 0.15s ease; text-decoration: none; line-height: 1.4; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); text-decoration: none; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: var(--color-surface-elevated); color: var(--color-text-primary); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-border); }
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-surface-elevated); color: var(--color-text-primary); }
.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.8125rem; }
.btn-icon { padding: 0.5rem; line-height: 1; }

/* --- Form Controls --- */
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--color-text-secondary); margin-bottom: var(--space-xs); }
.form-input, .form-select, .form-textarea { width: 100%; padding: 0.5rem 0.75rem; font-family: var(--font-sans); font-size: 0.875rem; background: var(--color-bg); color: var(--color-text-primary); border: 1px solid var(--color-border); border-radius: var(--radius-sm); outline: none; transition: border-color 0.15s ease; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-muted); }
.form-input::placeholder { color: var(--color-text-muted); }

/* --- Badges & Tags --- */
.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 500; border-radius: var(--radius-full); line-height: 1.4; }
.badge-accent { background: var(--color-accent-muted); color: var(--color-accent-text); }
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--color-success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--color-error); }
.badge-muted { background: var(--color-surface-elevated); color: var(--color-text-secondary); }
.tag { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 500; border-radius: var(--radius-full); background: var(--color-surface-elevated); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* --- Auth Pages --- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--color-bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-2xl); box-shadow: var(--shadow-lg); text-align: center; }
.auth-logo { width: 64px; height: 64px; border-radius: var(--radius-md); margin: 0 auto var(--space-md); display: block; }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: var(--space-xs); }
.auth-subtitle { color: var(--color-text-secondary); font-size: 0.875rem; margin-bottom: var(--space-xl); }
.auth-error { padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-md); border-radius: var(--radius-sm); background: rgba(239, 68, 68, 0.15); color: var(--color-error); font-size: 0.875rem; }
.divider { border: none; border-top: 1px solid var(--color-border); margin: var(--space-lg) 0; }

/* --- Avatar --- */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--color-accent-muted); color: var(--color-accent-text); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.8125rem; flex-shrink: 0; }

/* --- Theme Toggle --- */
.theme-toggle { background: none; border: none; cursor: pointer; color: var(--color-text-secondary); padding: var(--space-sm); border-radius: var(--radius-sm); display: flex; align-items: center; }
.theme-toggle:hover { background: var(--color-surface-elevated); color: var(--color-text-primary); }

/* --- Utility Classes --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-text); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* --- Tabs --- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--color-border); }
.tab { padding: var(--space-sm) var(--space-lg); font-size: 0.875rem; font-weight: 500; color: var(--color-text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; transition: all 0.15s; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--font-sans); }
.tab:hover { color: var(--color-text-primary); }
.tab.active { color: var(--color-accent-text); border-bottom-color: var(--color-accent); }

/* --- Settings --- */
.settings-group { margin-bottom: var(--space-xl); }
.settings-group-title { font-size: 0.8125rem; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-md); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md) 0; border-bottom: 1px solid var(--color-border); }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-weight: 500; }
.settings-description { font-size: 0.8125rem; color: var(--color-text-secondary); margin-top: 2px; }

/* --- Tag chips (multi-select picker) --- */
.tag-picker { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.tag-chip { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; font-size: 0.8125rem; font-weight: 500; border-radius: var(--radius-full); border: 1px solid var(--color-border); background: var(--color-surface-elevated); color: var(--color-text-secondary); cursor: pointer; transition: all 0.15s; font-family: var(--font-sans); }
.tag-chip:hover { border-color: var(--color-accent); color: var(--color-text-primary); }
.tag-chip-selected { background: var(--color-accent-muted); border-color: var(--color-accent); color: var(--color-accent-text); }

/* --- Timer Display --- */
.timer-display { font-family: var(--font-mono); font-size: 3rem; font-weight: 400; color: var(--color-accent); letter-spacing: 0.02em; line-height: 1; }
.timer-display-sm { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 400; color: var(--color-accent); }
.timer-display-secondary { color: var(--color-text-secondary); }

/* --- Pulsing Indicator --- */
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); animation: pulse 2s ease-in-out infinite; flex-shrink: 0; }
.pulse-dot-secondary { background: var(--color-text-secondary); }
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(59,130,246,0); }
}

/* --- Timer Card --- */
.timer-card { padding: var(--space-lg); background: var(--color-bg); border-radius: var(--radius-md); }
.timer-card + .timer-card { margin-top: var(--space-md); }

/* --- Auto-stop Banner --- */
.auto-stop-banner { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius-md); margin-bottom: var(--space-lg); }

/* --- Nudge Banner --- */
.nudge-banner { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08)); border: 1px solid var(--color-accent-muted); border-radius: var(--radius-md); font-size: 0.875rem; }
.nudge-icon { color: var(--color-accent); flex-shrink: 0; }

/* --- Color Dot (category indicator) --- */
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* --- Segmented Control (inline mode toggle, not tabs) --- */
.segmented-control { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.segmented-btn { padding: 0.3rem 0.75rem; font-size: 0.75rem; font-weight: 500; background: transparent; border: none; color: var(--color-text-secondary); cursor: pointer; font-family: var(--font-sans); line-height: 1.4; transition: background 0.12s, color 0.12s; white-space: nowrap; }
.segmented-btn + .segmented-btn { border-left: 1px solid var(--color-border); }
.segmented-btn:hover { background: var(--color-surface-elevated); color: var(--color-text-primary); }
.segmented-btn.active { background: var(--color-accent-muted); color: var(--color-accent-text); }

/* --- Overlap Warning --- */
.overlap-warning { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius-sm); font-size: 0.8125rem; color: var(--color-warning); margin-bottom: var(--space-sm); }

/* --- Timer Page Layout --- */
.timer-page-grid { display: grid; grid-template-columns: 1fr 380px; gap: var(--space-xl); }
@media (max-width: 900px) { .timer-page-grid { grid-template-columns: 1fr; } }

/* --- Mobile Bottom Nav --- */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--color-surface); border-top: 1px solid var(--color-border); z-index: 100; padding: var(--space-xs) 0; }
.mobile-nav-inner { display: flex; justify-content: space-around; }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-xs) var(--space-sm); color: var(--color-text-muted); text-decoration: none; font-size: 0.625rem; font-weight: 500; }
.mobile-nav-item.active { color: var(--color-accent-text); }
.mobile-nav-item svg { width: 22px; height: 22px; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding-bottom: 72px; }
    .mobile-nav { display: block; }
    .page-body { padding: var(--space-md); }
}

/* --- Note Toggle (inline disclosure in forms) --- */
.note-toggle { display: inline-flex; align-items: center; gap: var(--space-xs); background: none; border: none; color: var(--color-text-secondary); font-size: 0.8125rem; font-weight: 500; font-family: var(--font-sans); cursor: pointer; padding: var(--space-xs) 0; line-height: 1; }
.note-toggle:hover { color: var(--color-text-primary); }

/* --- Note Cards --- */
.note-card { padding: var(--space-md); background: var(--color-bg); border-radius: var(--radius-sm); border: 1px solid var(--color-border); }
.note-card + .note-card { margin-top: var(--space-sm); }
.note-timestamp { font-size: 0.75rem; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.note-content { font-size: 0.875rem; line-height: 1.6; }
.note-content p { margin-bottom: var(--space-sm); }
.note-content p:last-child { margin-bottom: 0; }
.note-content ul, .note-content ol { padding-left: 1.5rem; margin-bottom: var(--space-sm); }
.note-content code { font-family: var(--font-mono); font-size: 0.8125rem; background: var(--color-surface-elevated); padding: 0.125rem 0.25rem; border-radius: 3px; }
.note-content pre { background: var(--color-surface-elevated); padding: var(--space-sm); border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: var(--space-sm); }
.note-content pre code { background: none; padding: 0; }
.note-content strong { font-weight: 600; }
.note-content blockquote { border-left: 3px solid var(--color-border); padding-left: var(--space-sm); color: var(--color-text-secondary); margin-bottom: var(--space-sm); }

/* --- Progress Bars (used in Timer page summary) --- */
.progress-bar { height: 4px; background: var(--color-surface-elevated); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.3s ease; background: linear-gradient(90deg, var(--color-flow-start), var(--color-flow-end)); }
.progress-fill-accent { height: 100%; background: var(--color-accent); border-radius: var(--radius-full); transition: width 0.3s ease; }
.progress-fill-success { height: 100%; background: var(--color-success); border-radius: var(--radius-full); transition: width 0.3s ease; }
.progress-fill-warning { height: 100%; background: var(--color-warning); border-radius: var(--radius-full); transition: width 0.3s ease; }
.progress-fill-error { height: 100%; background: var(--color-error); border-radius: var(--radius-full); transition: width 0.3s ease; }
.goal-card { display: flex; flex-direction: column; gap: var(--space-xs); }
.goal-stat { font-family: var(--font-mono); font-size: 0.875rem; color: var(--color-text-secondary); }

/* --- Blazor Loading & Error UI --- */
#blazor-error-ui { color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,0.2); display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }
.loading-progress { position: absolute; display: block; width: 8rem; height: 8rem; inset: 20vh 0 auto 0; margin: 0 auto; }
.loading-progress circle { fill: none; stroke: var(--color-border, #e0e0e0); stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--color-accent, #3B82F6); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; transition: stroke-dasharray 0.05s ease-in-out; }
.loading-progress-text { position: absolute; text-align: center; font-weight: bold; inset: calc(20vh + 3.25rem) 0 auto 0.2rem; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

/* --- Entry List (History page) --- */
.filters-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.entry-row { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-border); transition: background 0.1s; cursor: pointer; }
.entry-row:last-child { border-bottom: none; }
.entry-row:hover { background: var(--color-surface-elevated); }
.entry-row-link { text-decoration: none; color: inherit; display: flex; align-items: center; gap: var(--space-md); flex: 1; min-width: 0; }
.entry-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--color-border); }
.entry-info { flex: 1; min-width: 0; }
.entry-description { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-meta { font-size: 0.8125rem; color: var(--color-text-secondary); display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-top: 2px; }
.entry-duration { font-family: var(--font-mono); font-size: 0.9375rem; flex-shrink: 0; color: var(--color-text-primary); }
.entry-tags { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; flex-shrink: 0; }
.day-group-header { padding: var(--space-md) var(--space-lg); background: var(--color-surface-elevated); border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }
.day-group-header + .entry-row, .day-group-header { border-top: 1px solid var(--color-border); }
.day-group-header:first-child { border-top: none; }


/* --- Timesheet Grid --- */
.timesheet-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.timesheet-grid th, .timesheet-grid td { text-align: center; padding: var(--space-xs) var(--space-xs); font-size: 0.8125rem; }
.timesheet-grid th:first-child, .timesheet-grid td:first-child { text-align: left; width: 140px; min-width: 100px; }
.timesheet-grid th:last-child, .timesheet-grid td:last-child { width: 60px; }
.timesheet-grid th { font-size: 0.75rem; white-space: nowrap; }
.timesheet-cell { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-xs); font-family: var(--font-mono); font-size: 0.8125rem; text-align: center; width: 100%; max-width: 72px; color: var(--color-text-primary); box-sizing: border-box; }
.timesheet-cell:focus { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent-muted); outline: none; }
.timesheet-cell-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.timesheet-cell-total { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--color-text-primary); }
.timesheet-cell-total.is-zero { color: var(--color-text-muted); font-weight: 400; }
.timesheet-total { font-weight: 600; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--color-accent-text); }

/* --- Goal rule toggles --- */
.goal-rule { padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 2px; transition: border-color 0.15s; }
.goal-rule:hover { border-color: var(--color-accent-muted); }
.goal-rule-disabled { opacity: 0.5; }
.goal-rule-body { padding: var(--space-sm) var(--space-md) var(--space-md) calc(var(--space-md) + 22px); }

/* --- Reminder snoozed state --- */
.reminder-snoozed { opacity: 0.6; }

/* --- Snooze popover --- */
.snooze-popover { position: absolute; left: 0; top: 100%; margin-top: var(--space-xs); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-md); box-shadow: var(--shadow-lg); z-index: 50; min-width: 220px; }

/* --- Loading Spinner --- */
.loading-spinner { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-md) 0; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--color-border); border-top-color: var(--color-accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Toast Notifications --- */
.toast-container { position: fixed; bottom: var(--space-lg); right: var(--space-lg); z-index: 1000; display: flex; flex-direction: column; gap: var(--space-sm); max-width: 360px; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); font-size: 0.875rem; box-shadow: var(--shadow-lg); animation: slideIn 0.2s ease-out; }
.toast-success { background: var(--color-success); color: #fff; }
.toast-error { background: var(--color-error); color: #fff; }
.toast-info { background: var(--color-accent); color: #fff; }
.toast-warning { background: var(--color-warning); color: #fff; }
.toast-dismiss { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.25rem; line-height: 1; opacity: 0.7; }
.toast-dismiss:hover { opacity: 1; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Mobile refinements --- */
@media (max-width: 768px) {
    .toast-container { bottom: 80px; right: var(--space-md); left: var(--space-md); max-width: none; }
    .page-header { padding: var(--space-md); flex-wrap: wrap; gap: var(--space-sm); }
    .page-header h1 { font-size: 1.125rem; }
    .page-header .flex { flex-wrap: wrap; }
    .stat-card { padding: var(--space-sm) !important; }
    .stat-value { font-size: 1.25rem !important; }
    .reminder-card { flex-direction: column; }
    .reminder-actions { flex-direction: row !important; }
    .hero-total { font-size: 2rem !important; }

    /* Timer page: already handled by .timer-page-grid at 900px */

    /* Timesheet: horizontal scroll with sticky category column */
    .timesheet-grid th:first-child, .timesheet-grid td:first-child { position: sticky; left: 0; background: var(--color-surface); z-index: 1; }
}

/* Timer page large tap targets on mobile */
@media (max-width: 768px) {
    .btn-primary, .btn-secondary, .btn-danger { min-height: 44px; }
}
