/* ==========================================================================
   Design System CSS — Horial Calendar Aggregator PWA
   Typography: Outfit (Google Fonts)
   Theme: Civic Editorial — French municipal, warm and professional
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */

:root {
  --nav-bg: #14384f;
  --nav-bg-lighter: #1a456b;
  --nav-text: #7ea8c9;

  --accent: #8faa00;
  --accent-light: #b1c800;
  --accent-dark: #4e5e00;
  --accent-muted: #f0f3d2;

  --danger: #c0222e;
  --danger-muted: #fce8ea;
  --success: #0a7d56;
  --success-muted: #e6f9f0;
  --warning: #c27800;
  --warning-muted: #fef6e6;

  --bg: #f4f6f8;
  --card: #ffffff;

  --border: #dde3ea;
  --border-light: #edf0f4;

  --text: #1a2b3c;
  --text-secondary: #334155;
  --text-muted: #5e7187;
  --text-faint: #8fa0b3;

  --highlight: #faf8f5;
  --weekend-bg: #f7f5f2;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --transition-fast: 0.12s ease;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --nav-bg: #0c1f2e;
  --nav-bg-lighter: #14384f;
  --nav-text: #4e7a9b;

  --accent: #c8e030;
  --accent-light: #d8ee55;
  --accent-dark: #8faa00;
  --accent-muted: #2a3500;

  --danger: #ef4444;
  --danger-muted: #3b1111;
  --success: #34d399;
  --success-muted: #0a2e1d;
  --warning: #fbbf24;
  --warning-muted: #2e1f05;

  --bg: #0b1520;
  --card: #152232;

  --border: #243347;
  --border-light: #1a2a3c;

  --text: #dce4ec;
  --text-secondary: #b0c0d0;
  --text-muted: #5e7a92;
  --text-faint: #374c62;

  --highlight: #1a2636;
  --weekend-bg: #11202e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-muted);
  color: var(--accent-dark);
}

/* --------------------------------------------------------------------------
   3. Nav
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--nav-bg) 0%, var(--nav-bg-lighter) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: 56px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.nav-title {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--nav-text);
  padding: 0.45rem 0.8rem;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.nav-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.nav-btn.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   4. Container
   -------------------------------------------------------------------------- */

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

/* --------------------------------------------------------------------------
   5. Cards
   -------------------------------------------------------------------------- */

.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-padded {
  padding: 1rem;
}

/* --------------------------------------------------------------------------
   6. Calendar Header & Navigation
   -------------------------------------------------------------------------- */

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.calendar-header .btn {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--card);
  transition: all var(--transition-fast);
}

.calendar-header .btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.calendar-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  min-width: 200px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   7. Calendar Grid — Week View
   -------------------------------------------------------------------------- */

.week-grid {
  display: grid;
  grid-template-columns: 50px repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.week-day-header {
  text-align: center;
  padding: 0.5rem 0.25rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background-color: var(--card);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.week-day-header .day-num {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.week-day-header.today {
  background-color: var(--accent-muted);
}

.week-day-header.today .day-num {
  color: var(--accent-dark);
}

.week-day-header.weekend {
  background-color: var(--weekend-bg);
}

.hour-label {
  height: 3rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.15rem 0.4rem 0 0;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-light);
  background-color: var(--card);
}

.hour-cell {
  height: 3rem;
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition-fast);
}

.hour-cell:hover {
  background-color: var(--highlight);
}

.hour-cell.weekend {
  background-color: var(--weekend-bg);
}

.hour-cell.weekend:hover {
  background-color: var(--highlight);
}

/* --------------------------------------------------------------------------
   8. Calendar Grid — Day View
   -------------------------------------------------------------------------- */

.day-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.day-allday {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--card);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.day-hour-row {
  display: flex;
  border-bottom: 1px solid var(--border-light);
}

.day-hour-label {
  width: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.15rem 0.5rem 0 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-faint);
  background-color: var(--card);
  height: 3.5rem;
}

.day-hour-cell {
  flex: 1;
  min-height: 3.5rem;
  position: relative;
  border-left: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.day-hour-cell:hover {
  background-color: var(--highlight);
}

.day-grid .event-block {
  font-size: 0.82rem;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
}

.event-block__time {
  font-size: 0.7rem;
  opacity: 0.65;
  font-weight: 400;
}

.event-block__location {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.1rem;
}

/* --------------------------------------------------------------------------
   9. Calendar Grid — Month View
   -------------------------------------------------------------------------- */

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.month-day {
  min-height: 5.5rem;
  min-width: 0;
  overflow: hidden;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  background-color: var(--card);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.month-day:hover {
  background-color: var(--highlight);
}

/* Remove left border for first column of each week (including headers row) */
.month-grid > :nth-child(7n + 1) {
  border-left: none;
}

/* Weekend columns: 6th and 7th of each group of 7 */
.month-day:nth-child(7n + 6),
.month-day:nth-child(7n) {
  background-color: var(--weekend-bg);
}

/* Weekend day headers */
.month-grid > .week-day-header:nth-child(6),
.month-grid > .week-day-header:nth-child(7) {
  background-color: var(--weekend-bg);
  color: var(--text-faint);
}

.month-day.today {
  background-color: var(--accent-muted);
}

.month-day.other-month {
  opacity: 0.35;
}

.month-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.month-day.today .month-day-num {
  color: var(--accent-dark);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   9. Events
   -------------------------------------------------------------------------- */

/* Event chip (month view — timed events) */
.event-chip {
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.3;
  padding: 0.1rem 0.35rem;
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-color: var(--highlight);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.event-chip:hover {
  background-color: var(--border-light);
}

/* Event block (week view — positioned absolutely) */
.event-block {
  position: absolute;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.3;
  background-color: var(--highlight);
  color: var(--text-secondary);
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
  transition: box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.event-block:hover {
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* All-day bar (both views) */
.all-day-bar {
  width: 100%;
  padding: 0.12rem 0.35rem;
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  background-color: var(--highlight);
  color: var(--text-secondary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.all-day-bar:hover {
  background-color: var(--border-light);
}

/* --------------------------------------------------------------------------
   10. Modal
   -------------------------------------------------------------------------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background-color: var(--card);
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: slideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

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

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

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   11. Forms
   -------------------------------------------------------------------------- */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(143, 170, 0, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 5rem;
}

/* All-day toggle row */
.form-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.form-toggle-row label {
  margin: 0;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   12. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), opacity var(--transition-fast), box-shadow var(--transition-fast);
}

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

.btn-primary {
  background-color: var(--nav-bg);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--nav-bg-lighter);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background-color: var(--danger-muted);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  opacity: 0.85;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle input:checked + .toggle-slider {
  background: var(--nav-bg);
}

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

/* --------------------------------------------------------------------------
   13. Source Badges & Filter Bar
   -------------------------------------------------------------------------- */

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.source-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  min-height: 44px;
  min-width: 44px;
  font-size: 0.8rem;
  font-family: var(--font);
  font-weight: 500;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background-color: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--text-faint);
  box-shadow: var(--shadow-sm);
}

.filter-chip.active {
  background-color: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* --------------------------------------------------------------------------
   14. Sources Page
   -------------------------------------------------------------------------- */

.source-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  transition: background-color var(--transition-fast);
}

.source-card:hover {
  background-color: var(--highlight);
}

.source-card + .source-card {
  border-top: 1px solid var(--border-light);
}

.source-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

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

.source-info .source-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.source-info .source-url,
.source-info .source-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-status {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.sync-status {
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   15. FAB
   -------------------------------------------------------------------------- */

.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nav-bg) 0%, var(--nav-bg-lighter) 100%);
  color: #ffffff;
  border: none;
  font-size: 1.5rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 56, 79, 0.3);
  z-index: 50;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.fab:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   16. PWA Banner
   -------------------------------------------------------------------------- */

.pwa-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 900;
  max-width: 90vw;
  font-size: 0.88rem;
  font-weight: 500;
  animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   17. Toast Notifications
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 500;
  font-family: var(--font);
  z-index: 800;
  transition: opacity 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
}

.toast--success {
  background: var(--success-muted);
  color: var(--success);
}

.toast--error {
  background: var(--danger-muted);
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   18. Custom Confirm Dialog
   -------------------------------------------------------------------------- */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.confirm-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 90%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.confirm-box__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.confirm-box__message {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.confirm-box__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   19. Loading States
   -------------------------------------------------------------------------- */

.loading-bar {
  position: relative;
  overflow: hidden;
  height: 3px;
  background: var(--border-light);
  border-radius: 2px;
  margin-bottom: 0.5rem;
}

.loading-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loadingSlide 1.2s ease-in-out infinite;
  border-radius: 2px;
}

@keyframes loadingSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.calendar-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-faint);
  font-size: 0.88rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   20. User Menu
   -------------------------------------------------------------------------- */

.user-menu {
  position: relative;
  display: inline-block;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 150;
  padding: 0.4rem 0;
  animation: scaleIn 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.user-dropdown__email {
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-light);
}

.user-dropdown__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--font);
  color: var(--text);
  transition: background-color var(--transition-fast);
}

.user-dropdown__item:hover {
  background-color: var(--highlight);
}

.user-dropdown__item--danger {
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   21. Login / Welcome Overlays
   -------------------------------------------------------------------------- */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 32, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.auth-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-box__title {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--nav-bg);
}

.auth-box__error {
  color: var(--danger);
  font-size: 0.84rem;
  display: none;
  margin: 0.5rem 0;
}

.auth-box__success {
  color: var(--success);
  font-size: 0.84rem;
  display: none;
  margin: 0.5rem 0;
}

/* Welcome guide */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 32, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.welcome-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.welcome-box__title {
  margin: 0 0 0.75rem;
  color: var(--nav-bg);
  font-size: 1.2rem;
  font-weight: 700;
}

.welcome-box__intro {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.welcome-step {
  margin-bottom: 0.75rem;
}

.welcome-step__title {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
}

.welcome-step__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.1rem;
}

/* --------------------------------------------------------------------------
   22. Utilities
   -------------------------------------------------------------------------- */

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-sm {
  gap: 0.5rem;
}

.mt-1 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

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

.text-sm {
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   23. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .container {
    padding: 0.5rem;
  }

  .calendar-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .calendar-title {
    font-size: 0.95rem;
    min-width: auto;
    width: 100%;
    text-align: center;
    order: -1;
  }

  .month-day {
    min-height: 3.5rem;
    padding: 0.25rem;
  }

  .month-day-num {
    font-size: 0.72rem;
  }

  .event-chip,
  .all-day-bar {
    font-size: 0.62rem;
    padding: 0.05rem 0.2rem;
  }

  .hour-cell,
  .hour-label {
    height: 2.5rem;
  }

  .day-hour-label {
    width: 40px;
  }

  .modal {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .nav {
    padding: 0 0.5rem;
    flex-wrap: wrap;
    height: auto;
    min-height: 50px;
    gap: 0.25rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .nav-actions {
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    min-height: 36px;
    min-width: 36px;
  }

  .filter-bar {
    gap: 0.3rem;
  }

  .filter-chip {
    padding: 0.35rem 0.65rem;
    min-height: 36px;
    font-size: 0.72rem;
  }
}

@media (min-width: 601px) {
  .modal-overlay {
    align-items: center;
  }

  .modal {
    max-width: 520px;
    border-radius: var(--radius-lg);
    margin: 2rem;
  }
}
