/* ============================================================
   MON ESPACE DE TRAVAIL — Cal.com Design System
   Pure monochrome, white-first, professional confidence
   ============================================================ */

/* ============================================================
   FONT IMPORTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

@font-face {
  font-family: 'Cal Sans';
  src: url('https://cal.com/cal-sans/cal-sans-semi-bold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Core palette — pure monochrome */
  --bg:               #ffffff;
  --bg-subtle:        #f9fafb;
  --bg-muted:         #f3f4f6;
  --surface:          #ffffff;
  --surface-raised:   #ffffff;
  --border:           #e5e7eb;
  --border-strong:    #d1d5db;

  /* Text */
  --text:             #111827;
  --text-secondary:   #6b7280;
  --text-tertiary:    #9ca3af;

  /* Brand — pure black CTA */
  --brand:            #111827;
  --brand-hover:      #374151;
  --link:             #0099ff;
  --link-hover:       #0077cc;

  /* Status */
  --red:              #ef4444;
  --red-bg:           #fef2f2;
  --red-border:       #fecaca;
  --red-hover:        #dc2626;
  --yellow-bg:        #fffbeb;
  --yellow-border:    #fde68a;
  --yellow-text:      #92400e;
  --green-bg:         #f0fdf4;
  --green-border:     #bbf7d0;
  --green-text:       #166534;
  --blue-bg:          #eff6ff;
  --blue-border:      #bfdbfe;
  --blue-text:        #1d4ed8;

  /* Kanban status colors (muted, Cal-style) */
  --due-overdue-bg:   #fef2f2;
  --due-overdue-text: #dc2626;
  --due-soon-bg:      #fffbeb;
  --due-soon-text:    #d97706;
  --due-ok-bg:        #f0fdf4;
  --due-ok-text:      #16a34a;
  --dot-partial-bg:   #fffbeb;
  --dot-partial-text: #d97706;
  --dot-partial-border: #fde68a;
  --dot-complete-bg:  #f0fdf4;
  --dot-complete-text: #16a34a;
  --dot-complete-border: #bbf7d0;

  /* Project tag */
  --project-bg:       #eff6ff;
  --project-border:   #bfdbfe;
  --project-text:     #1d4ed8;

  /* Shadows — Cal.com multi-layer */
  --shadow-sm:        rgba(19,19,22,0.07) 0px 1px 3px -1px, rgba(34,42,53,0.06) 0px 0px 0px 1px;
  --shadow:           rgba(19,19,22,0.07) 0px 1px 5px -4px, rgba(34,42,53,0.08) 0px 0px 0px 1px, rgba(34,42,53,0.05) 0px 4px 8px;
  --shadow-md:        rgba(19,19,22,0.10) 0px 2px 8px -2px, rgba(34,42,53,0.08) 0px 0px 0px 1px, rgba(34,42,53,0.06) 0px 8px 16px -4px;
  --shadow-lg:        rgba(19,19,22,0.12) 0px 4px 16px -4px, rgba(34,42,53,0.08) 0px 0px 0px 1px, rgba(34,42,53,0.08) 0px 16px 32px -8px;
  --shadow-ring:      rgba(34,42,53,0.08) 0px 0px 0px 1px, rgba(34,42,53,0.04) 0px 1px 3px;
  --shadow-primary:   0 1px 2px rgba(0,0,0,0.08) inset, rgba(34,42,53,0.08) 0px 0px 0px 1px;

  /* Spacing & shape */
  --radius-xs:        4px;
  --radius-sm:        6px;
  --radius:           8px;
  --radius-md:        10px;
  --radius-lg:        12px;
  --radius-full:      9999px;

  /* Typography */
  --font:             'Inter', system-ui, -apple-system, sans-serif;
  --font-display:     'Cal Sans', 'Inter', system-ui, -apple-system, sans-serif;

  color-scheme: light;
}

/* ============================================================
   DARK THEME — Cal.com-inspired dark monochrome
   ============================================================ */
[data-theme="dark"] {
  --bg:               #111111;
  --bg-subtle:        #191919;
  --bg-muted:         #1c1c1c;
  --surface:          #1a1a1a;
  --surface-raised:   #222222;
  --border:           #2e2e2e;
  --border-strong:    #3a3a3a;

  --text:             #f0f0f0;
  --text-secondary:   #a0a0a0;
  --text-tertiary:    #6b6b6b;

  --brand:            #f0f0f0;
  --brand-hover:      #d4d4d4;
  --link:             #4db8ff;
  --link-hover:       #80ccff;

  --red:              #f87171;
  --red-bg:           #2a1515;
  --red-border:       #4a2020;
  --red-hover:        #ef4444;
  --yellow-bg:        #2a2515;
  --yellow-border:    #4a3f20;
  --yellow-text:      #fbbf24;
  --green-bg:         #152a1a;
  --green-border:     #204a2a;
  --green-text:       #4ade80;
  --blue-bg:          #15202a;
  --blue-border:      #20304a;
  --blue-text:        #60a5fa;

  --due-overdue-bg:   #2a1515;
  --due-overdue-text: #f87171;
  --due-soon-bg:      #2a2515;
  --due-soon-text:    #fbbf24;
  --due-ok-bg:        #152a1a;
  --due-ok-text:      #4ade80;
  --dot-partial-bg:   #2a2515;
  --dot-partial-text: #fbbf24;
  --dot-partial-border: #4a3f20;
  --dot-complete-bg:  #152a1a;
  --dot-complete-text: #4ade80;
  --dot-complete-border: #204a2a;

  --project-bg:       #15202a;
  --project-border:   #20304a;
  --project-text:     #60a5fa;

  --shadow-sm:        rgba(0,0,0,0.3) 0px 1px 3px -1px, rgba(255,255,255,0.04) 0px 0px 0px 1px;
  --shadow:           rgba(0,0,0,0.4) 0px 1px 5px -4px, rgba(255,255,255,0.06) 0px 0px 0px 1px, rgba(0,0,0,0.3) 0px 4px 8px;
  --shadow-md:        rgba(0,0,0,0.5) 0px 2px 8px -2px, rgba(255,255,255,0.06) 0px 0px 0px 1px, rgba(0,0,0,0.35) 0px 8px 16px -4px;
  --shadow-lg:        rgba(0,0,0,0.6) 0px 4px 16px -4px, rgba(255,255,255,0.06) 0px 0px 0px 1px, rgba(0,0,0,0.4) 0px 16px 32px -8px;
  --shadow-ring:      rgba(255,255,255,0.06) 0px 0px 0px 1px, rgba(0,0,0,0.2) 0px 1px 3px;
  --shadow-primary:   0 1px 2px rgba(255,255,255,0.06) inset, rgba(255,255,255,0.06) 0px 0px 0px 1px;

  color-scheme: dark;
}

/* Dark theme input color-scheme fix */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] select {
  color-scheme: dark;
}

/* ============================================================
   BASE
   ============================================================ */
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LAYOUT
   ============================================================ */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-logo {
  height: 48px;
  width: auto;
  display: block;
  transition: filter 0.2s;
}
[data-theme="dark"] .header-logo {
  /* Le logo est navy : en dark mode, l'inverser en blanc pour lisibilité */
  filter: brightness(0) invert(1);
}
.header-logo-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: opacity 0.15s, transform 0.15s;
}
.header-logo-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.header-logo-btn:active { transform: translateY(0); }
.header-logo-btn:focus-visible { outline: 2px solid var(--accent, #3b82f6); outline-offset: 3px; }

h1 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.625rem 1rem;
  z-index: 20;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ============================================================
   NAVIGATION TABS
   ============================================================ */
nav {
  display: flex;
  gap: 0;
}

.tab-btn {
  padding: 0.375rem 0.875rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}

/* ============================================================
   DATE NAVIGATION
   ============================================================ */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  box-shadow: var(--shadow);
}

.date-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.date-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.date-picker {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  font-family: var(--font);
  cursor: pointer;
  background: var(--bg-muted);
  color: var(--text);
  color-scheme: light;
  transition: background 0.15s;
  box-shadow: var(--shadow-ring);
}
.date-picker:hover { background: var(--bg-subtle); }

/* ============================================================
   ENTRY FORM
   ============================================================ */
.entry-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.entry-form::before {
  display: none;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.125rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.field-group {
  margin-bottom: 0.875rem;
}

.field-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}

.required { color: var(--red); }
.optional { color: var(--text-tertiary); font-weight: 400; }

.field-group input[type="text"],
.field-group textarea {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-ring);
}

.field-group input[type="text"]::placeholder,
.field-group textarea::placeholder {
  color: var(--text-tertiary);
}

.field-group input[type="text"]:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

.field-group textarea {
  resize: vertical;
  min-height: 72px;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.field-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--text);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background: var(--brand);
  color: var(--bg);
  border: 1px solid transparent;
  padding: 0.5625rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.12) inset, rgba(34,42,53,0.12) 0px 0px 0px 1px, 0 4px 8px rgba(0,0,0,0.08);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-ring);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-nav {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: var(--shadow-ring);
}
.btn-nav:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-edit {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.625rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  box-shadow: var(--shadow-ring);
}
.btn-edit:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-delete {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.625rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.btn-delete:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

.btn-export {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3125rem 0.75rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  box-shadow: var(--shadow-ring);
}
.btn-export:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}

.settings-row-stacked {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.625rem;
  font-size: 0.875rem;
}
.settings-row-stacked label { color: var(--text); font-weight: 500; font-size: 0.8125rem; }

.settings-input-wide {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-ring);
  margin-top: 0.25rem;
}
.settings-input-wide:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.settings-input-wide::placeholder { color: var(--text-tertiary); }

.settings-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* ============================================================
   ENTRY CARDS
   ============================================================ */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.entry-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border: 1px solid transparent;
}
.entry-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--border);
}

.entry-main {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.entry-task {
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.entry-time {
  color: var(--text-secondary);
  font-size: 0.75rem;
  background: var(--bg-muted);
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.entry-notes {
  font-size: 0.8125rem;
  margin: 0.25rem 0;
  padding: 0.3125rem 0.625rem;
  border-left: 2px solid var(--border-strong);
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.entry-notes.private {
  color: var(--text-tertiary);
  border-left-color: var(--border);
}
.entry-notes.shared {
  border-left-color: var(--text);
}

.entry-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  color: var(--text-tertiary);
  padding: 3rem 0;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============================================================
   WEEKLY REPORT
   ============================================================ */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  box-shadow: var(--shadow);
}

.week-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.report-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.report-day {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow);
  position: relative;
}

.report-day h3 {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.625rem;
}

.report-entry {
  padding: 0.3125rem 0;
  border-bottom: 1px solid var(--bg-muted);
}
.report-entry:last-child { border-bottom: none; }

.report-task {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
}

.report-time {
  color: var(--text-secondary);
  font-size: 0.75rem;
  background: var(--bg-muted);
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.report-notes {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.1875rem;
  padding-left: 0.625rem;
  border-left: 2px solid var(--border-strong);
}

.report-footer {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
  padding: 0.5rem 0 1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.action-bar {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* ============================================================
   READONLY BANNER
   ============================================================ */
.readonly-banner {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  color: var(--yellow-text);
}

/* ============================================================
   FOOTER / EXPORT BAR
   ============================================================ */
.export-bar {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.storage-warning {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.export-actions {
  display: flex;
  gap: 0.375rem;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.75rem);
  background: var(--brand);
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-theme="dark"] .toast {
  background: #1f2937;
  color: #f9fafb;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ============================================================
   TEMPLATES BAR
   ============================================================ */
.templates-bar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.templates-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  white-space: nowrap;
  padding-top: 0.3125rem;
}

.templates-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  flex: 1;
}

.template-item {
  display: inline-flex;
  align-items: center;
}

.template-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  padding: 0.25rem 0.5625rem 0.25rem 0.75rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.template-pill:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.template-time {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.template-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  background: var(--border);
  padding: 0.0625rem 0.3125rem;
  border-radius: var(--radius-xs);
}

.template-delete {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  padding: 0.25rem 0.5625rem;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.template-delete:hover { color: var(--red); background: var(--red-bg); }

.btn-save-template {
  background: none;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 0.4375rem 0.875rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-save-template:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

/* ============================================================
   TODAY BUTTON
   ============================================================ */
.btn-today {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5625rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: var(--shadow-ring);
}
.btn-today:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ============================================================
   TAG BADGE
   ============================================================ */
.tag-badge {
  display: inline-block;
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--blue-bg);
  color: var(--blue-text);
  border: 1px solid var(--blue-border);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ============================================================
   TAG & FILTER SELECTS
   ============================================================ */
.tag-select {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-ring);
}
.tag-select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

.filter-select {
  padding: 0.3125rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 100px;
  font-size: 0.8125rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.filter-select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

/* ============================================================
   TIMER
   ============================================================ */
.timer-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.timer-row input { flex: 1; }

.btn-timer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  box-shadow: var(--shadow-ring);
}
.btn-timer:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-timer.running {
  border-color: var(--red-border);
  color: var(--red);
  background: var(--red-bg);
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.2); }
  50% { box-shadow: 0 0 0 3px rgba(239,68,68,0.08); }
}

.timer-display {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 4rem;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   DAILY TOTAL
   ============================================================ */
.daily-total {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem 0;
  font-weight: 600;
}

/* ============================================================
   REPORT FILTER
   ============================================================ */
.report-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.625rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.report-filter label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ============================================================
   TODAY HIGHLIGHT IN REPORT
   ============================================================ */
.report-day.today {
  box-shadow: var(--shadow), 0 0 0 2px var(--text);
}
.today-badge {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--text);
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ============================================================
   REPORT ENTRY MAIN (tag + time inline)
   ============================================================ */
.report-entry-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================================
   UNDO BAR
   ============================================================ */
.undo-bar {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border-radius: var(--radius-full);
  padding: 0.5rem 0.625rem 0.5rem 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  border: 1px solid var(--border);
}
.undo-bar[hidden] { display: none; }
.undo-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.btn-undo {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.3125rem 0.875rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-undo:hover { background: var(--brand-hover); }

/* ============================================================
   SETTINGS BUTTON
   ============================================================ */
/* Header actions group */
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Header search bar */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-search-icon {
  position: absolute;
  left: 0.625rem;
  color: var(--text-tertiary);
  pointer-events: none;
  flex-shrink: 0;
}
.header-search-input {
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--bg-subtle);
  border: none;
  border-radius: var(--radius);
  padding: 0.4375rem 2rem 0.4375rem 2rem;
  width: 200px;
  box-shadow: var(--shadow-ring);
  outline: none;
  transition: all 0.15s;
}
.header-search-input::placeholder { color: var(--text-tertiary); }
.header-search-input:focus {
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
.header-search-kbd {
  position: absolute;
  right: 0.5rem;
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-muted);
  border-radius: var(--radius-xs);
  padding: 0.0625rem 0.375rem;
  line-height: 1.4;
  pointer-events: none;
}

/* Theme icon */
.theme-icon {
  display: block;
  width: 18px;
  height: 18px;
}
#btn-theme {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-settings {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 0.5625rem;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
  box-shadow: var(--shadow-ring);
}
.btn-settings:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.25rem 0.875rem;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.btn-modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  padding: 0.125rem;
  transition: color 0.15s;
  border-radius: var(--radius-sm);
}
.btn-modal-close:hover { color: var(--text); }

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
}
.modal-footer-right {
  display: flex;
  gap: 0.5rem;
}

.settings-section h3 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.625rem;
  font-size: 0.875rem;
}
.settings-row label { flex: 1; color: var(--text); font-size: 0.8125rem; font-weight: 500; }
.settings-row input[type="number"] {
  width: 80px;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  text-align: center;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.settings-row input[type="number"]:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

.settings-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
  min-height: 28px;
}
.settings-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1875rem 0.5rem 0.1875rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}
.settings-tag.project-tag { border-color: var(--project-border); background: var(--project-bg); color: var(--project-text); }
.settings-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0 0.0625rem;
  transition: color 0.15s;
}
.settings-tag-remove:hover { color: var(--red); }
.settings-add-row {
  display: flex;
  gap: 0.5rem;
}
.settings-add-row input[type="text"] {
  flex: 1;
  padding: 0.4375rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.settings-add-row input[type="text"]:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

/* ============================================================
   FORM ROW (side-by-side fields)
   ============================================================ */
.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.form-row .field-group {
  flex: 1;
  min-width: 140px;
}
.time-input {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  color-scheme: light;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.time-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  font-weight: 600;
}
.progress-track {
  height: 4px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.good { background: var(--blue-text); }
.progress-fill.complete { background: var(--green-text); }

/* ============================================================
   DRAG & DROP ENTRIES
   ============================================================ */
.drag-handle {
  color: var(--border-strong);
  cursor: grab;
  font-size: 0.875rem;
  padding: 0.2rem 0;
  line-height: 1.6;
  flex-shrink: 0;
  transition: color 0.15s;
  user-select: none;
}
.entry-card:hover .drag-handle { color: var(--text-tertiary); }
.drag-handle:active { cursor: grabbing; }
.entry-body { flex: 1; min-width: 0; }
.entry-card.dragging { opacity: 0.3; }
.entry-card.drag-over {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--text);
}

/* ============================================================
   DUPLICATE BUTTON
   ============================================================ */
.btn-duplicate {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.625rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  box-shadow: var(--shadow-ring);
}
.btn-duplicate:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ============================================================
   PROJECT BADGE
   ============================================================ */
.project-badge {
  background: var(--project-bg) !important;
  border-color: var(--project-border) !important;
  color: var(--project-text) !important;
}

/* ============================================================
   WEEK CENTER & DAY DOTS
   ============================================================ */
.week-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}
.week-day-dots {
  display: flex;
  gap: 0.25rem;
}
.day-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  font-size: 0.625rem;
  font-weight: 700;
  cursor: default;
  border: 1px solid transparent;
  transition: transform 0.15s;
  letter-spacing: 0;
}
.day-dot:hover { transform: scale(1.1); }
.dot-future  { background: var(--bg-muted); color: var(--text-tertiary); border-color: var(--border); }
.dot-empty   { background: var(--red-bg); color: var(--red); border-color: var(--red-border); opacity: 0.7; }
.dot-partial { background: var(--dot-partial-bg); color: var(--dot-partial-text); border-color: var(--dot-partial-border); }
.dot-complete{ background: var(--dot-complete-bg); color: var(--dot-complete-text); border-color: var(--dot-complete-border); }
.dot-today   { outline: 2px solid var(--text); outline-offset: 1px; }

/* ============================================================
   STATS (category breakdown)
   ============================================================ */
.report-stats {
  margin-bottom: 1rem;
}
.stats-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.625rem;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}
.stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  width: 100px;
  min-width: 0;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-bar-track {
  flex: 1;
  height: 5px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-value {
  font-size: 0.75rem;
  color: var(--text-secondary);
  width: 80px;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ============================================================
   KANBAN BOARD
   ============================================================ */
main.kanban-active { max-width: 1400px; }

.kanban-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}

.kanban-column {
  flex: 1;
  min-width: 240px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.kanban-col-count {
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  padding: 0.125rem 0.5rem;
  min-width: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.kanban-cards {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-height: 80px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: background 0.15s;
}
.kanban-cards::-webkit-scrollbar { width: 3px; }
.kanban-cards::-webkit-scrollbar-track { background: transparent; }
.kanban-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.kanban-cards.drop-target {
  background: rgba(17,24,39,0.03);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.3; }

.kanban-card.priority-high { border-left: 3px solid var(--red); }
.kanban-card.priority-low  { border-left: 3px solid var(--border-strong); }

.kanban-card-title {
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
  color: var(--text);
}
.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.375rem;
}

/* ============================================================
   RICH TEXT EDITOR
   ============================================================ */
.rte-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-ring);
}
.rte-wrap:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.rte-toolbar {
  display: flex;
  gap: 2px;
  padding: 0.3125rem 0.4375rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.rte-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.1875rem 0.4375rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  line-height: 1.2;
  min-width: 26px;
  text-align: center;
  transition: all 0.15s;
}
.rte-btn:hover { background: var(--bg-muted); color: var(--text); }
.rte-btn.active { background: var(--bg-muted); color: var(--text); border-color: var(--border); }
.rte-sep { width: 1px; background: var(--border); margin: 0 0.1875rem; align-self: stretch; }
.rte-content {
  min-height: 60px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
  outline: none;
}
.rte-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
  pointer-events: none;
}
.rte-content ul, .rte-content ol { padding-left: 1.4rem; margin: 0.3rem 0; }
.rte-content li { margin-bottom: 0.15rem; }
.rte-content p { margin: 0 0 0.25rem; }

/* ============================================================
   CARD DETAIL MODAL
   ============================================================ */
.card-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3vh 1rem;
  overflow-y: auto;
}
.card-modal-overlay[hidden] { display: none; }
.card-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 780px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.card-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-tertiary);
  cursor: pointer;
  z-index: 5;
  line-height: 1;
  transition: color 0.15s;
  padding: 0.125rem;
  border-radius: var(--radius-sm);
}
.card-modal-close:hover { color: var(--text); }
.card-modal-cover {
  height: 5px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: background 0.2s;
}
.card-modal-layout {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
}
.card-modal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.card-modal-sidebar { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.card-modal-number {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.card-modal-title-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.375rem 0.5rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  resize: none;
  overflow: hidden;
  line-height: 1.35;
  transition: all 0.15s;
  letter-spacing: -0.01em;
}
.card-modal-title-input:focus {
  outline: none;
  border-color: var(--border);
  background: var(--bg-subtle);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.06);
}
.card-modal-labels-strip { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.card-section-header {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
  user-select: none;
}
.card-section-header[data-toggle] { cursor: pointer; }
.card-section-header[data-toggle]:hover { color: var(--text-secondary); }
.cs-chevron {
  display: inline-block;
  font-size: 0.6875rem;
  width: 1em;
  transition: transform 0.2s;
}
.sidebar-group { }
.sidebar-group-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}
.sidebar-select, .sidebar-input {
  width: 100%;
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8125rem;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.sidebar-select:focus, .sidebar-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.sidebar-btn {
  width: 100%;
  padding: 0.4375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  box-shadow: var(--shadow-ring);
}
.sidebar-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-danger { border-color: var(--red-border) !important; color: var(--red) !important; background: var(--red-bg) !important; }
.btn-danger:hover { background: var(--red) !important; color: #fff !important; border-color: var(--red) !important; }
.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.75rem; }

@media (max-width: 640px) {
  .card-modal-layout { flex-direction: column; }
  .card-modal-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .sidebar-group { min-width: 120px; flex: 1; }
}

/* ============================================================
   LABELS
   ============================================================ */
.label-strip {
  height: 5px;
  border-radius: 2px;
  display: inline-block;
  min-width: 32px;
}
.labels-picker { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.label-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s, transform 0.15s;
  border: 2px solid transparent;
  letter-spacing: 0.02em;
}
.label-chip:hover { opacity: 0.75; transform: translateY(-1px); }
.label-chip.active { opacity: 1; border-color: rgba(0,0,0,0.2); }
.label-chip .check-mark { font-size: 0.625rem; }
.labels-settings-list { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 0.5rem; }
.label-setting-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.label-color-input {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  border: 1px solid var(--border);
  padding: 1px;
  cursor: pointer;
  background: none;
}
.label-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.label-color-input::-webkit-color-swatch { border: none; border-radius: 3px; }
.label-color-input::-moz-color-swatch { border: none; border-radius: 3px; }
.label-del-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-tertiary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}
.label-del-btn:hover {
  color: var(--red);
  border-color: var(--red-border);
  background: var(--red-bg);
}
.label-name-input {
  flex: 1;
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8125rem;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.label-name-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

/* ============================================================
   DUE DATE BADGE
   ============================================================ */
.due-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.1875rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.due-badge.overdue { background: var(--due-overdue-bg); color: var(--due-overdue-text); }
.due-badge.soon { background: var(--due-soon-bg); color: var(--due-soon-text); }
.due-badge.ok { background: var(--due-ok-bg); color: var(--due-ok-text); }

/* ============================================================
   CHECKLISTS
   ============================================================ */
.checklist-section {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.checklist-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.btn-delete-checklist {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.15s;
}
.btn-delete-checklist:hover { color: var(--red); }
.checklist-progress-bar { margin-bottom: 0.5rem; }
.checklist-progress-text {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-bottom: 0.1875rem;
  font-variant-numeric: tabular-nums;
}
.checklist-items { display: flex; flex-direction: column; gap: 0.25rem; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.1875rem 0;
  font-size: 0.8125rem;
}
.checklist-item input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); flex-shrink: 0;
}
.checklist-item-text { flex: 1; min-width: 0; color: var(--text); }
.checklist-item.done .checklist-item-text { text-decoration: line-through; color: var(--text-tertiary); }
.btn-delete-item {
  background: none; border: none; color: var(--border-strong); font-size: 0.875rem; cursor: pointer; padding: 0 0.1875rem; line-height: 1;
  transition: color 0.15s;
}
.btn-delete-item:hover { color: var(--red); }
.checklist-add-row {
  display: flex; gap: 0.375rem; margin-top: 0.375rem;
}
.checklist-add-input {
  flex: 1; padding: 0.3125rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 0.8125rem;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.checklist-add-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.checklist-mini {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.6875rem; color: var(--text-tertiary); font-weight: 600;
}
.checklist-mini.all-done { color: var(--green-text); }

/* ============================================================
   COVER COLORS
   ============================================================ */
.cover-picker { display: flex; flex-wrap: wrap; gap: 0.3125rem; }
.cover-swatch {
  width: 24px; height: 24px; border-radius: var(--radius-xs); cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.15s, transform 0.15s;
}
.cover-swatch:hover { transform: scale(1.1); }
.cover-swatch.active { border-color: var(--text); }
.cover-swatch.no-cover {
  width: auto; height: auto; padding: 0.125rem 0.4375rem; font-size: 0.6875rem;
  color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-xs);
  display: flex; align-items: center;
}

/* ============================================================
   BOARD DASHBOARD
   ============================================================ */
.board-dashboard {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dash-stat {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1875rem 0.5625rem;
  border-radius: var(--radius-full);
}
.dash-inprogress { background: var(--blue-bg); color: var(--blue-text); }
.dash-overdue { background: var(--due-overdue-bg); color: var(--due-overdue-text); }
.dash-done { background: var(--green-bg); color: var(--green-text); }

/* ============================================================
   BOARD SELECTOR
   ============================================================ */
.board-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.board-select {
  flex: 1;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.board-select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.btn-board-action {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3125rem 0.5625rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  box-shadow: var(--shadow-ring);
}
.btn-board-action:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-board-delete:hover {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

/* ============================================================
   KANBAN TOOLBAR / FILTERS
   ============================================================ */
.kanban-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kanban-search {
  padding: 0.3125rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8125rem;
  width: 160px;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.kanban-search:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.kanban-search::placeholder { color: var(--text-tertiary); }
.kanban-filter-labels { display: flex; gap: 0.1875rem; flex-wrap: wrap; }
.kanban-filter-chip {
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-xs);
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.2s, transform 0.15s;
}
.kanban-filter-chip:hover { opacity: 0.7; transform: translateY(-1px); }
.kanban-filter-chip.active { opacity: 1; outline: 2px solid var(--text); outline-offset: 1px; }
.btn-filter-toggle {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-ring);
}
.btn-filter-toggle:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-filter-toggle.active { background: var(--red); border-color: var(--red); color: #fff; }
.kanban-view-btns { display: flex; gap: 0.25rem; margin-left: auto; }
.btn-view {
  padding: 0.25rem 0.5625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-ring);
}
.btn-view:hover { background: var(--bg-subtle); color: var(--text); border-color: var(--border-strong); }
.btn-view.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-clear-filters {
  padding: 0.1875rem 0.4375rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: none; color: var(--text-tertiary); font-family: var(--font); font-size: 0.6875rem; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.btn-clear-filters:hover { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }

/* ============================================================
   KANBAN COLUMN UPDATES
   ============================================================ */
.col-collapse-btn {
  background: none; border: none; color: var(--text-tertiary); cursor: pointer;
  font-size: 0.6875rem; padding: 0.0625rem 0.25rem; transition: color 0.15s;
}
.col-collapse-btn:hover { color: var(--text); }
.kanban-col-title[contenteditable="true"] {
  background: var(--bg-muted); border-radius: var(--radius-xs); padding: 0.0625rem 0.25rem;
  outline: none; border: 1px solid var(--border-strong);
}
.kanban-column.collapsed .kanban-cards,
.kanban-column.collapsed .quick-add-toggle,
.kanban-column.collapsed .quick-add-form { display: none; }
.kanban-column.collapsed { min-width: 50px; flex: 0; }
.kanban-column.collapsed .kanban-col-header {
  writing-mode: vertical-rl; text-orientation: mixed;
  padding: 0.75rem 0.375rem; gap: 0.5rem;
  letter-spacing: 0.04em; font-size: 0.6875rem;
  border-bottom: none;
  border-right: 2px solid var(--border-strong);
}
.kanban-column.collapsed .kanban-col-title {
  max-height: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kanban-col-count.wip-exceeded { background: var(--red); color: #fff; }
.kanban-col-count.wip-close { background: var(--due-soon-bg); color: var(--due-soon-text); }

/* ============================================================
   QUICK ADD
   ============================================================ */
.quick-add-toggle {
  width: 100%;
  padding: 0.375rem 0.625rem;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
}
.quick-add-toggle:hover { color: var(--text); background: var(--bg-subtle); }
.quick-add-form {
  padding: 0.5rem 0.625rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.quick-add-input {
  width: 100%; padding: 0.375rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 0.8125rem;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.quick-add-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.quick-add-row {
  display: flex; gap: 0.25rem; flex-wrap: wrap;
}
.quick-add-select {
  flex: 1; min-width: 70px; padding: 0.25rem 0.375rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 0.75rem;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.quick-add-select:focus {
  outline: none;
  border-color: var(--text);
}
.quick-add-date {
  width: 110px; padding: 0.25rem 0.375rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 0.75rem;
  color-scheme: light;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.quick-add-date:focus {
  outline: none;
  border-color: var(--text);
}
.quick-add-btns { display: flex; gap: 0.25rem; }

/* ============================================================
   ADD COLUMN BUTTON
   ============================================================ */
.btn-add-col {
  min-width: 160px;
  padding: 0.75rem 1rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: none;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  align-self: flex-start;
  flex-shrink: 0;
}
.btn-add-col:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
  background: var(--bg-subtle);
}

/* ============================================================
   KANBAN TABLE VIEW
   ============================================================ */
.kanban-table-wrap { overflow-x: auto; }
.kanban-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.kanban-table th {
  text-align: left;
  padding: 0.5rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.kanban-table th:hover { color: var(--text-secondary); }
.kanban-table th.sorted::after { margin-left: 0.25rem; font-size: 0.5625rem; }
.kanban-table th.sorted-asc::after { content: '▲'; }
.kanban-table th.sorted-desc::after { content: '▼'; }
.kanban-table td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.kanban-table tr { cursor: pointer; transition: background 0.1s; }
.kanban-table tr:hover { background: var(--bg-subtle); }
.table-number { color: var(--text-tertiary); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-title { font-weight: 600; }
.table-due.overdue { color: var(--due-overdue-text); }
.table-due.soon { color: var(--due-soon-text); }
.priority-high { color: var(--due-overdue-text); }
.priority-low { color: var(--text-tertiary); }

/* ============================================================
   KANBAN CARD COVER & LABELS ON CARD
   ============================================================ */
.kanban-card-cover {
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -0.625rem -0.75rem 0.4375rem;
}
.kanban-card-labels { display: flex; flex-wrap: wrap; gap: 0.125rem; margin-bottom: 0.25rem; }
.kanban-card-label {
  height: 5px; border-radius: var(--radius-xs); min-width: 32px;
}
.kanban-card.filtered-out { opacity: 0.1; pointer-events: none; }

/* ============================================================
   ACTIVITY LOG
   ============================================================ */
.card-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}
.activity-entry {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.activity-icon { flex-shrink: 0; width: 20px; text-align: center; font-size: 0.6875rem; padding-top: 0.0625rem; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { display: block; }
.activity-comment-html {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.625rem;
  margin-top: 0.1875rem;
  font-size: 0.8125rem;
  color: var(--text);
}
.activity-comment-html ul, .activity-comment-html ol { padding-left: 1.2rem; }
.activity-time {
  font-size: 0.625rem;
  color: var(--text-tertiary);
  display: block;
  margin-top: 0.0625rem;
}

/* ============================================================
   SETTINGS: COLUMNS & LABELS
   ============================================================ */
.columns-settings-list { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 0.625rem; }
.column-setting-row {
  display: flex; align-items: center; gap: 0.375rem;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.3125rem 0.5rem;
}
.column-name-input {
  flex: 1; padding: 0.25rem 0.4375rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 0.8125rem;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.column-name-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.column-wip-label { font-size: 0.6875rem; color: var(--text-tertiary); white-space: nowrap; font-weight: 500; }
.column-wip-input {
  width: 45px; padding: 0.1875rem 0.3125rem; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 0.75rem;
  transition: border-color 0.15s;
  box-shadow: var(--shadow-ring);
}
.column-wip-input:focus {
  outline: none;
  border-color: var(--text);
}
.col-move-btn, .col-del-btn {
  background: none; border: none; color: var(--text-tertiary); cursor: pointer;
  font-size: 0.8125rem; padding: 0.0625rem 0.25rem; transition: color 0.15s;
}
.col-move-btn:hover { color: var(--text); }
.col-del-btn:hover { color: var(--red); }

/* ============================================================
   OVERDUE BADGE & CARD TIME
   ============================================================ */
/* Notification bell button */
.btn-notifications {
  position: relative;
}
.btn-notifications svg {
  display: block;
}
.notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: var(--red);
  border-radius: var(--radius-full);
  pointer-events: none;
}
.btn-notifications:not([hidden]) {
  color: var(--due-overdue-text);
  border-color: var(--red-border);
  background: var(--due-overdue-bg);
}
.btn-notifications:not([hidden]):hover {
  background: var(--red-border);
}

/* Overdue dropdown */
.overdue-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 300px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: dropdownIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.overdue-dropdown-title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--due-overdue-text);
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
}
.overdue-dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  transition: background 0.1s;
}
.overdue-dropdown-item:hover {
  background: var(--bg-subtle);
}
.overdue-dropdown-item:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.overdue-dropdown-item-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.overdue-dropdown-item-meta {
  font-size: 0.6875rem;
  color: var(--due-overdue-text);
}
.card-time-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.card-time-badge.has-logged {
  background: var(--blue-bg);
  color: var(--blue-text);
}
.cm-logged-time {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--blue-text);
  margin-top: 0.25rem;
}

/* ============================================================
   ACTIVITIES LAYOUT (sidebar + content)
   ============================================================ */
.activities-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 140px);
}
.activities-sidebar {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border-right: none;
}
.sidebar-icon {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
  font-family: var(--font);
  text-align: left;
}
.sidebar-icon:hover { background: var(--bg-subtle); color: var(--text); }
.sidebar-icon.active {
  background: var(--bg-muted);
  color: var(--text);
  font-weight: 600;
}
.sidebar-label {
  font-size: 0.75rem;
  font-weight: 500;
}
.activities-content {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.25rem;
}

@media (max-width: 600px) {
  .activities-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-right: 1px solid var(--border);
    border-bottom: none;
    padding: 0.3125rem;
    gap: 0.25rem;
  }
  .activities-layout { flex-direction: column; }
  .activities-content {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 0.75rem;
  }
  .sidebar-icon {
    justify-content: center;
    padding: 0.375rem 0.5rem;
    border-bottom: 2px solid transparent;
  }
  .sidebar-icon.active { background: transparent; border-bottom-color: var(--text); }
  .sidebar-label { display: none; }
}

/* ============================================================
   CALENDAR VIEW
   ============================================================ */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
}
.cal-month-label {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  min-width: 160px;
  text-align: center;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day-header {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 0.375rem 0;
}
.cal-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem;
  min-height: 90px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-ring);
}
.cal-cell:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.cal-empty { background: transparent; border-color: transparent; cursor: default; box-shadow: none; }
.cal-empty:hover { border-color: transparent; box-shadow: none; }
.cal-today {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}
.cal-date {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.1875rem;
  font-variant-numeric: tabular-nums;
}
.cal-today .cal-date {
  color: var(--bg);
  background: var(--text);
  border-radius: var(--radius-full);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.cal-hours {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--blue-text);
  margin-bottom: 0.1875rem;
  font-variant-numeric: tabular-nums;
}
.cal-entries, .cal-cards { display: flex; flex-direction: column; gap: 1px; }
.cal-entry-dot {
  font-size: 0.5625rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.0625rem 0.25rem;
  background: var(--bg-muted);
  border-radius: var(--radius-xs);
}
.cal-card-dot {
  font-size: 0.5625rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.0625rem 0.25rem;
  border-radius: var(--radius-xs);
  border-left: 2px solid var(--text);
  background: var(--bg-subtle);
}
.cal-card-dot.overdue { color: var(--due-overdue-text); border-left-color: var(--due-overdue-text); background: var(--due-overdue-bg); }
.cal-card-dot.soon { color: var(--due-soon-text); border-left-color: var(--due-soon-text); background: var(--due-soon-bg); }
.cal-more {
  font-size: 0.5625rem;
  color: var(--text-tertiary);
  padding: 0.0625rem 0.25rem;
}

@media (max-width: 480px) {
  .cal-cell { min-height: 60px; padding: 0.25rem; }
  .cal-entry-dot, .cal-card-dot { display: none; }
  .cal-hours { font-size: 0.5625rem; }
}

/* ============================================================
   GLOBAL SEARCH
   ============================================================ */
.search-overlay {
  z-index: 400;
  align-items: flex-start;
  padding-top: 12vh;
}
.search-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-input {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  font-weight: 500;
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}
.search-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 0.5rem 0.5rem 0.25rem;
}
.search-result {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
}
.search-result:hover { background: var(--bg-subtle); }
.search-result-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.search-result-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.search-hint {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  padding: 0.4375rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   FOCUS VISIBLE (accessibility)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.field-group input[type="text"]:focus-visible,
.field-group textarea:focus-visible,
.tag-select:focus-visible,
.filter-select:focus-visible,
.time-input:focus-visible,
.date-picker:focus-visible,
.board-select:focus-visible,
.sidebar-select:focus-visible,
.sidebar-input:focus-visible,
.kanban-search:focus-visible,
.rte-content:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 0;
  border-color: var(--text);
}
.tab-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
  border-radius: var(--radius-xs);
}

/* ============================================================
   CUSTOM DIALOG (replaces native prompt/confirm)
   ============================================================ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.dialog-overlay.dialog-visible { opacity: 1; }
.dialog-overlay.dialog-visible .dialog-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.dialog-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s;
}

.dialog-header {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  padding: 1.125rem 1.25rem 0.625rem;
  color: var(--text);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
}

.dialog-message {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.dialog-input {
  display: block;
  width: calc(100% - 2.5rem);
  margin: 0 1.25rem 1rem;
  padding: 0.5625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-ring);
}
.dialog-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

.dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
}

.dialog-btn {
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: all 0.15s;
}

.dialog-cancel {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: var(--shadow-ring);
}
.dialog-cancel:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text);
}

.dialog-ok {
  background: var(--brand);
  border: 1px solid transparent;
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.dialog-ok:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.dialog-danger {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(239,68,68,0.2) inset !important;
}
.dialog-danger:hover {
  background: var(--red-hover) !important;
  transform: translateY(-1px);
}

/* ============================================================
   DOCUMENTATION MODAL
   ============================================================ */
.modal-doc {
  max-width: 720px;
  width: 95vw;
  max-height: 90vh;
}

.doc-body {
  padding: 1.5rem !important;
  scroll-behavior: smooth;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.doc-nav a {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all 0.15s;
}
.doc-nav a:hover {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.doc-section {
  margin-bottom: 1.75rem;
}
.doc-section h3 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.625rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.doc-section h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.875rem 0 0.375rem;
}
.doc-section p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}
.doc-section ul,
.doc-section ol {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
  padding-left: 1.4rem;
  margin-bottom: 0.5rem;
}
.doc-section li {
  margin-bottom: 0.25rem;
}
.doc-section li strong {
  color: var(--text);
  font-weight: 600;
}
.doc-section code {
  font-size: 0.8125rem;
  background: var(--bg-muted);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'SFMono-Regular', Consolas, monospace;
  border: 1px solid var(--border);
}
.doc-section kbd {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font);
  background: var(--bg-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.4375rem;
  color: var(--text);
  box-shadow: 0 1px 0 var(--border-strong);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.375rem;
}
.doc-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--border);
}
.doc-table td {
  padding: 0.4375rem 0.625rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.doc-table tr:hover td {
  background: var(--bg-subtle);
}

.doc-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem;
    height: auto;
    min-height: 56px;
  }
  h1 { font-size: 0.9375rem; flex: 1; }
  nav {
    order: 3;
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--border);
    padding-top: 0.375rem;
    padding-bottom: 0.25rem;
  }
  .header-actions { margin-left: auto; }
  .header-search-input { width: 120px; }
  .header-search-kbd { display: none; }
  .btn-settings { margin-left: 0; }
  main { padding: 1.5rem 1rem 5rem; }
}

@media (max-width: 480px) {
  h1 { display: none; }
  .header-logo { height: 40px; }
  .header-search-input { width: 0; padding-left: 2rem; padding-right: 0.5rem; }
  .header-search-input:focus { width: 120px; padding-right: 0.5rem; }
  .header-search-kbd { display: none; }
  main { padding: 1rem 0.75rem 5rem; }
  .form-row { flex-direction: column; gap: 0; }
  .date-label { font-size: 0.875rem; }
  .stat-row { flex-direction: column; align-items: flex-start; gap: 0.1875rem; }
  .stat-label { width: auto; white-space: normal; }
  .stat-value { width: auto; text-align: left; }
  .entry-form { padding: 1rem; }
}

@media (max-width: 640px) {
  .kanban-board { gap: 0.5rem; }
  .kanban-column { min-width: 220px; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  header nav,
  .date-nav,
  .entry-form,
  .entries-list,
  .action-bar,
  .export-bar,
  footer,
  .btn-edit,
  .btn-delete,
  .btn-nav,
  .toast,
  .readonly-banner {
    display: none !important;
  }

  header {
    position: static;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
    background: #fff;
  }

  body {
    font-size: 11pt;
    color: #111827;
    background: #fff;
  }

  main {
    padding: 0;
    max-width: 100%;
  }

  h1 { font-size: 16pt; color: #111827; }

  .report-day {
    page-break-inside: avoid;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    margin-bottom: 0.5em;
    padding: 0.5em 0;
  }

  .report-day h3 {
    font-size: 11pt;
    border-bottom: 1px solid #111827;
    color: #111827;
  }

  .report-task { color: #111827; }

  .report-entry {
    border-bottom: none;
  }

  .report-footer {
    border-top: 1px solid #111827;
    padding-top: 0.3em;
    font-size: 10pt;
    color: #111827;
  }

  .week-nav {
    border: none;
    padding: 0;
    margin-bottom: 0.5em;
    background: none;
    box-shadow: none;
  }

  .week-label {
    font-size: 13pt;
    color: #111827;
  }
}

/* ============================================================
   AUTH UI (login/signup + user menu)
   ============================================================ */
.btn-auth {
  position: relative;
}
.btn-auth.btn-auth-loggedin {
  background: var(--accent, #3b82f6);
  color: #fff;
  border-color: var(--accent, #3b82f6);
}
.btn-auth.btn-auth-loggedin svg { stroke: #fff; }

.modal-auth { max-width: 440px; }

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--grey, #6b7280);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab:hover { color: var(--text, #111827); }
.auth-tab.auth-tab-active {
  color: var(--accent, #3b82f6);
  border-bottom-color: var(--accent, #3b82f6);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-row label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text, #111827);
}
.auth-row input {
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-row input:focus {
  outline: none;
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-error {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #dc2626;
  font-size: 0.9rem;
}
.auth-success {
  padding: 10px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  color: #16a34a;
  font-size: 0.9rem;
}

.auth-submit {
  margin-top: 4px;
  padding: 11px 16px;
  font-weight: 600;
}

.auth-link {
  background: none;
  border: none;
  color: var(--accent, #3b82f6);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
  align-self: center;
}
.auth-link:hover { color: var(--accent-dark, #2563eb); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--grey, #6b7280);
  font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #e5e7eb);
}

.auth-skip { width: 100%; margin-top: 8px; }

.btn-auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-auth-google[hidden] { display: none; }
.auth-divider[hidden] { display: none; }
.btn-auth-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
[data-theme="dark"] .btn-auth-google {
  background: #1f2937;
  color: #f9fafb;
  border-color: rgba(255,255,255,0.12);
}
[data-theme="dark"] .btn-auth-google:hover {
  background: #374151;
}

/* ============================================================
   LANDING PAGE (premier écran avant login/app)
   ============================================================ */
.landing-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #fafafa);
  /* 150 : au-dessus du footer (20) mais sous les modals (200+) */
  z-index: 150;
  padding: 2rem;
  animation: landing-fade-in 0.3s ease;
}
.landing-page[hidden] { display: none; }

/* Password recovery modal intro */
.recovery-intro {
  margin: 0 0 20px 0;
  padding: 12px 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  color: var(--text, #111827);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Hyperliens dans les notes/commentaires/descriptions */
.entry-notes a,
.report-notes a,
.activity-comment-html a,
.rte-content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.entry-notes a:hover,
.report-notes a:hover,
.activity-comment-html a:hover,
.rte-content a:hover {
  color: #1d4ed8;
}
[data-theme="dark"] .entry-notes a,
[data-theme="dark"] .report-notes a,
[data-theme="dark"] .activity-comment-html a,
[data-theme="dark"] .rte-content a {
  color: #60a5fa;
}
[data-theme="dark"] .entry-notes a:hover,
[data-theme="dark"] .report-notes a:hover,
[data-theme="dark"] .activity-comment-html a:hover,
[data-theme="dark"] .rte-content a:hover {
  color: #93c5fd;
}
[data-theme="dark"] .recovery-intro {
  background: rgba(59, 130, 246, 0.15);
  color: var(--text, #f9fafb);
}
@keyframes landing-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.landing-container {
  max-width: 440px;
  width: 100%;
  text-align: center;
}
.landing-logo {
  width: 320px;
  max-width: 100%;
  margin-bottom: 12px;
}
[data-theme="dark"] .landing-logo { filter: brightness(0) invert(1); }
.landing-tagline {
  color: var(--text-secondary, #6b7280);
  font-size: 0.95rem;
  margin: 0 0 40px 0;
}
.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.landing-btn {
  padding: 13px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.landing-btn:active { transform: scale(0.98); }
.landing-btn-primary {
  background: var(--brand);
  color: var(--bg, #fff);
  border: 1px solid var(--brand);
}
[data-theme="dark"] .landing-btn-primary {
  background: var(--brand);
  color: #111827;
  border-color: var(--brand);
}
.landing-btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.landing-btn-secondary {
  background: transparent;
  color: var(--text, #111827);
  border: 1px solid var(--border, #e5e7eb);
}
.landing-btn-secondary:hover {
  background: var(--hover, #f3f4f6);
}
.landing-btn-link {
  background: none;
  border: none;
  color: var(--text-secondary, #6b7280);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px;
  margin-top: 4px;
  text-decoration: underline;
}
.landing-btn-link:hover {
  color: var(--text, #111827);
}
.landing-hint {
  font-size: 0.8rem;
  color: var(--text-tertiary, #9ca3af);
  line-height: 1.5;
  margin: 0;
}
@media (max-width: 480px) {
  .landing-logo { width: 240px; }
  .landing-tagline { margin-bottom: 32px; }
}

/* Cacher les boutons d'export/import en mode connecté (Supabase gère tout) */
body.is-logged-in #btn-export,
body.is-logged-in #btn-export-csv,
body.is-logged-in #btn-import {
  display: none;
}

/* Footer centré quand connecté (plus de boutons à droite) */
body.is-logged-in .export-bar {
  justify-content: center;
  text-align: center;
}
body.is-logged-in .storage-warning::before {
  content: "✓ ";
  color: #22c55e;
}


/* --- User menu dropdown --- */
.user-menu {
  position: fixed;
  z-index: 1000;
  min-width: 260px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  padding: 6px;
  overflow: hidden;
}
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
}
.user-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.user-menu-info { flex: 1; min-width: 0; }
.user-menu-name {
  font-weight: 600;
  color: var(--text, #111827);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-email {
  color: var(--grey, #6b7280);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-divider {
  height: 1px;
  background: var(--border, #e5e7eb);
  margin: 4px 0;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: none;
  color: var(--text, #111827);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
}
.user-menu-item:hover { background: var(--hover, #f3f4f6); }
.user-menu-danger { color: #dc2626; }
.user-menu-danger:hover { background: rgba(239, 68, 68, 0.1); }
.user-menu-item svg { flex-shrink: 0; }

/* Dark theme adjustments */
[data-theme="dark"] .auth-row input { background: var(--surface-elevated, #1f2937); }
[data-theme="dark"] .auth-error { background: rgba(239, 68, 68, 0.15); }
[data-theme="dark"] .auth-success { background: rgba(34, 197, 94, 0.15); }
[data-theme="dark"] .user-menu { box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

