/* ==========================================================================
   Social Manager — Light Material Design System
   Clean, white, minimal — inspired by Material Design 3
   ========================================================================== */

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

/* ---------- Design Tokens ---------- */
:root {
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;

  /* Surfaces */
  --bg-page: #f5f5f7;
  --bg-white: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-dim: #f0f0f2;
  --bg-surface-hover: #f8f8fa;
  --bg-input: #f5f5f7;
  --bg-overlay: rgba(0, 0, 0, 0.3);

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;

  /* Borders */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-focus: #6366f1;

  /* Accent */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-bg: #eef2ff;
  --accent-text: #4338ca;

  /* Platform Colors */
  --color-linkedin: #0A66C2;
  --color-youtube: #FF0000;
  --color-facebook: #1877F2;
  --color-instagram: #E4405F;
  --color-email: #34A853;
  --color-email-seniors: #34A853;
  --color-email-advisors: #2E7D32;

  /* Status Colors */
  --status-idea: #6366f1;
  --status-planned: #f59e0b;
  --status-in-progress: #f97316;
  --status-published: #10b981;
  --status-missed: #ef4444;

  /* Shadows — Material elevation */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.06), 0 4px 10px rgba(0,0,0,0.04);

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 60px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;

  /* Brand: entitlemate */
  --brand-em-primary: #6366f1;
  --brand-em-bg: #eef2ff;

  /* Brand: Later Life Advice */
  --brand-lla-primary: #0ea5e9;
  --brand-lla-bg: #ecfeff;
}

[data-brand="later-life-advice"] {
  --accent: #0ea5e9;
  --accent-light: #38bdf8;
  --accent-dark: #0284c7;
  --accent-bg: #ecfeff;
  --accent-text: #0369a1;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ---------- Layout ---------- */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  grid-row: 1 / -1;
  background: var(--bg-white);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-logo .logo-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Brand Switcher */
.brand-switcher {
  margin: 12px 14px;
  background: var(--bg-surface-dim);
  border-radius: var(--radius-lg);
  padding: 3px;
  display: flex;
  gap: 2px;
}

.brand-btn {
  flex: 1;
  padding: 7px 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  line-height: 1.2;
}

.brand-btn:hover {
  color: var(--text-primary);
  background: var(--bg-white);
}

.brand-btn.active {
  background: var(--bg-white);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 4px 10px;
}

.nav-section-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: 14px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-primary);
}

.nav-item:hover {
  background: var(--bg-surface-dim);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent-text);
  font-weight: 600;
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
}

/* ---------- Header ---------- */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Main Content ---------- */
.main-content {
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-page);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-sm);
}

.card-glass {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--bg-surface-dim);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-surface-dim);
}

.btn-sm { padding: 4px 10px; font-size: 0.72rem; }
.btn-lg { padding: 10px 20px; font-size: 0.85rem; border-radius: var(--radius-lg); }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

/* ---------- Platform Badges ---------- */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.platform-badge.linkedin { background: #e8f0fe; color: #0A66C2; }
.platform-badge.youtube { background: #fde8e8; color: #cc0000; }
.platform-badge.facebook { background: #e8f0fe; color: #1877F2; }
.platform-badge.instagram { background: #fce4ec; color: #c13584; }
.platform-badge.email { background: #e8f5e9; color: #2e7d32; }
.platform-badge.email_seniors { background: #e8f5e9; color: #2e7d32; }
.platform-badge.email_advisors { background: #e0f2f1; color: #004d40; }

/* ---------- Status Badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.idea { background: #eef2ff; color: #4338ca; }
.status-badge.idea::before { background: var(--status-idea); }
.status-badge.planned { background: #fef3c7; color: #92400e; }
.status-badge.planned::before { background: var(--status-planned); }
.status-badge.in-progress { background: #ffedd5; color: #9a3412; }
.status-badge.in-progress::before { background: var(--status-in-progress); }
.status-badge.published { background: #d1fae5; color: #065f46; }
.status-badge.published::before { background: var(--status-published); }
.status-badge.missed { background: #fee2e2; color: #991b1b; }
.status-badge.missed::before { background: var(--status-missed); }
.status-badge.slot { background: #f3f4f6; color: #9ca3af; border: 1px dashed #d1d5db; }
.status-badge.slot::before { background: #d1d5db; }

/* Slot (unfilled placeholder) item */
.slot-item {
  border: 1.5px dashed var(--border-medium);
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 5px,
    rgba(0,0,0,0.01) 5px,
    rgba(0,0,0,0.01) 10px
  );
  opacity: 0.7;
  transition: all var(--transition-fast);
}

.slot-item:hover {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-bg);
}

.slot-item .slot-label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 500;
  font-style: italic;
}

/* ---------- Form Controls ---------- */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.82rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: var(--bg-white);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  transition: transform var(--transition-base);
}

.modal-overlay.open .modal { transform: translateY(0); }

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

.modal-title { font-size: 1rem; font-weight: 700; }

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  width: 100%;
  height: 5px;
  background: var(--bg-surface-dim);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ---------- Stat Cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}

.stat-card:hover { box-shadow: var(--shadow-sm); }

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- Chip / Tag ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--bg-surface-dim);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover, .chip.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* ---------- Table ---------- */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table th, .specs-table td {
  text-align: left;
  padding: 9px 12px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border-light);
}

.specs-table th {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  background: var(--bg-surface-dim);
  position: sticky;
  top: 0;
}

.specs-table td { color: var(--text-secondary); }
.specs-table tr:hover td { background: var(--bg-surface-hover); }

.specs-table .dims {
  font-family: 'Inter', monospace;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Checklist ---------- */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.checklist-item:hover { background: var(--bg-surface-hover); }

.checklist-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-medium);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition-fast);
}

.checklist-checkbox.checked {
  background: var(--status-published);
  border-color: var(--status-published);
}

.checklist-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
}

.checklist-content { flex: 1; min-width: 0; }

.checklist-title { font-size: 0.82rem; font-weight: 500; }

.checklist-item.done .checklist-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.checklist-meta {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Calendar ---------- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-header-cell {
  padding: 8px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  background: var(--bg-surface-dim);
}

.calendar-cell {
  min-height: 90px;
  padding: 6px;
  background: var(--bg-white);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.calendar-cell:hover { background: var(--bg-surface-hover); }
.calendar-cell.today { background: var(--accent-bg); }

.calendar-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.calendar-cell.today .calendar-date { color: var(--accent); font-weight: 700; }

.calendar-item {
  padding: 3px 5px;
  margin-bottom: 2px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 2px solid;
}

.calendar-item:hover { opacity: 0.8; }

.calendar-item.linkedin { background: #e8f0fe; color: #0A66C2; border-color: var(--color-linkedin); }
.calendar-item.youtube { background: #fde8e8; color: #cc0000; border-color: var(--color-youtube); }
.calendar-item.facebook { background: #e8f0fe; color: #1877F2; border-color: var(--color-facebook); }
.calendar-item.instagram { background: #fce4ec; color: #c13584; border-color: var(--color-instagram); }
.calendar-item.email { background: #e8f5e9; color: #2e7d32; border-color: var(--color-email); }

/* ---------- Drop Zone ---------- */
.dropzone-area {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  transition: all var(--transition-base);
  cursor: pointer;
  background: var(--bg-surface-hover);
}

.dropzone-area:hover, .dropzone-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.dropzone-area .dropzone-icon { font-size: 2rem; margin-bottom: 10px; color: var(--text-tertiary); }
.dropzone-area .dropzone-text { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.dropzone-area .dropzone-hint { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 4px; }

/* ---------- Search ---------- */
.search-wrapper { position: relative; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.8rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.82rem;
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
  background: var(--bg-white);
}

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; color: var(--text-tertiary); }
.empty-state-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.empty-state-text { font-size: 0.82rem; color: var(--text-secondary); max-width: 300px; margin: 0 auto 16px; }

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

.toast {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease-out;
  max-width: 320px;
}

.toast.success { border-left: 3px solid var(--status-published); }
.toast.error { border-left: 3px solid var(--status-missed); }
.toast.info { border-left: 3px solid var(--accent); }

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

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-surface-dim);
  border-radius: var(--radius-lg);
  padding: 3px;
  margin-bottom: 20px;
}

.tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover { color: var(--text-primary); }

.tab.active {
  background: var(--bg-white);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

/* ---------- Views ---------- */
.view {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.view.active { display: block; }

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

/* ---------- Password Gate ---------- */
.password-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-gate-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.password-gate-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.password-gate-card p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 20px;
}

.password-gate-card .form-input {
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.password-gate-card .btn { width: 100%; justify-content: center; }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 0.78rem; }
.text-xs { font-size: 0.68rem; }
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: -260px;
    width: 260px;
    transition: left var(--transition-base);
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { left: 0; }
  .main-content { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .calendar-cell { min-height: 50px; padding: 3px; }
}

/* ---------- Stagger animation ---------- */
.stagger-children > * {
  animation: fadeIn 0.2s ease-out both;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.09s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.15s; }

/* ---------- Spin animation ---------- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
