/* ============================================================
   GraviTask — Modern Light Layout & Workspace CSS
   Clean · Minimal · Executive
   ============================================================ */

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

:root {
  /* Backgrounds */
  --bg-base:        #F8FAFC;
  --bg-surface:     #FFFFFF;
  --bg-subtle:      #F1F5F9;

  /* Borders */
  --border:         #E2E8F0;
  --border-medium:  #CBD5E1;
  --border-accent:  #C7D2FE;

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #334155;
  --text-muted:     #64748B;
  --text-faint:     #94A3B8;

  /* Brand Accents */
  --accent:         #4F46E5;
  --accent-hover:   #4338CA;
  --accent-light:   #EEF2FF;
  --accent-medium:  #C7D2FE;
  --accent-purple:  #7C3AED;
  --accent-cyan:    #0891B2;

  /* Semantics */
  --success:        #059669;
  --success-light:  #F0FDF4;
  --success-border: #A7F3D0;
  --warning:        #D97706;
  --warning-light:  #FFFBEB;
  --warning-border: #FDE68A;
  --danger:         #DC2626;
  --danger-light:   #FEF2F2;
  --danger-border:  #FECACA;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 32px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-xl:  0 20px 48px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);

  /* Dimensions */
  --sidebar-w:  256px;
  --topbar-h:   64px;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --font: 'Prompt', 'Segoe UI', system-ui, sans-serif;
  --transition: 0.15s ease;
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 15px;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}
body {
  font-family: var(--font);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: flex;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  box-sizing: border-box;
}

/* ── Layout Shell ────────────────────────────────────────── */
#app-layout {
  display: flex;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  box-sizing: border-box;
  min-width: 0;
}

/* ── Sidebar ────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  padding: 1.25rem 1rem 1rem;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0.5rem 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.1;
}

/* Sidebar Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}
.sidebar-nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.sidebar-nav-btn.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-medium);
}
.sidebar-nav-btn svg { flex-shrink: 0; }

.sidebar-cta-wrap {
  margin: 1.25rem 0 1rem;
}
.btn-sidebar-add {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  border: none;
  color: white;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(79,70,229,0.3);
  transition: all var(--transition);
}
.btn-sidebar-add:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-ext-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
}
.sidebar-ext-link:hover {
  color: var(--accent);
  border-color: var(--accent-medium);
  background: var(--accent-light);
}
.ext-link-left { display: flex; align-items: center; gap: 8px; }

/* ── Main Wrapper ────────────────────────────────────────── */
#main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-w));
  max-width: calc(100% - var(--sidebar-w));
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ── Top Status Bar ──────────────────────────────────────── */
#top-bar {
  height: var(--topbar-h);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
}

.topbar-greeting { display: flex; flex-direction: column; }
.greeting-subtitle { font-size: 0.7rem; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.greeting-title { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }

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

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
  user-select: none;
}
.streak-pill { color: #EA580C; background: #FFF7ED; border-color: #FFEDD5; }
.flame-icon { display: flex; color: #EA580C; }

.xp-pill { color: #B45309; background: #FFFBEB; border-color: #FDE68A; }
.star-icon { display: flex; color: #D97706; }
.stat-unit { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

.hearts-pill {
  cursor: pointer;
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
  transition: all var(--transition);
}
.hearts-pill:hover {
  background: #FEE2E2;
  transform: translateY(-1px);
}
.hearts-empty-pulse {
  animation: pulse-danger 1.5s infinite;
}
@keyframes pulse-danger {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.hearts-row { display: flex; gap: 3px; align-items: center; }
.heart-icon.filled { color: #DC2626; display: flex; }
.heart-icon.empty { color: #CBD5E1; display: flex; }

.lang-switch-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 8px;
}
.lang-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.lang-btn.active { color: var(--accent); font-weight: 800; }
.lang-divider { color: var(--border-medium); font-size: 0.75rem; }

/* ── Main Views Container ────────────────────────────────── */
#app-main {
  flex: 1;
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow-x: hidden;
}
.view { display: none; width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0; overflow-x: hidden; }
.view.active { display: block; }

/* ── Weekly Streak Widget ─────────────────────────────────── */
.weekly-widget-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}
.weekly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.weekly-title-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.weekly-flame { color: #EA580C; display: flex; }
.weekly-streak-count { font-size: 0.75rem; color: #EA580C; }

.weekly-days-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.weekly-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.weekly-day-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}
.weekly-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  transition: all var(--transition);
}
.weekly-dot.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.weekly-dot.today-dot {
  border-color: var(--accent);
  border-width: 2px;
}
.weekly-checkin-btn {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--accent-medium);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition);
}
.weekly-checkin-btn:hover:not(:disabled) {
  background: var(--accent);
  color: white;
}
.weekly-checkin-btn:disabled {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: default;
}

/* ── League & Leaderboard ────────────────────────────────── */
.league-page-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.league-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
}
.league-badge-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.league-icon-large {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.league-icon-large svg { width: 32px; height: 32px; }
.league-sub { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; letter-spacing: 0.05em; }
.league-heading { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.league-desc { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }

.league-prog-wrap { margin-bottom: 1.25rem; }
.league-prog-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 5px; }
.league-prog-track { height: 8px; background: var(--bg-subtle); border-radius: 4px; overflow: hidden; }
.league-prog-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

.league-tiers-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.league-tier-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  white-space: nowrap;
  font-size: 0.75rem;
}
.league-tier-chip.active-tier {
  background: var(--bg-surface);
  border-width: 2px;
  font-weight: 700;
}
.tier-dot { width: 8px; height: 8px; border-radius: 50%; }
.tier-min-xp { color: var(--text-muted); font-size: 0.7rem; }

.leaderboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
}
.lb-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.lb-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.lb-subtitle { font-size: 0.75rem; color: var(--text-muted); }

.lb-list { display: flex; flex-direction: column; gap: 6px; }
.leaderboard-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  background: var(--bg-surface);
  border: 1px solid transparent;
}
.leaderboard-row:hover { background: var(--bg-subtle); }
.leaderboard-row.user-row {
  background: var(--accent-light);
  border-color: var(--accent-medium);
}
.lb-rank { width: 36px; display: flex; align-items: center; font-weight: 700; font-size: 0.9rem; color: var(--text-muted); }
.rank-badge { display: flex; }
.rank-1 { color: #D97706; }
.rank-2 { color: #64748B; }
.rank-3 { color: #CD7F32; }

.lb-user { display: flex; align-items: center; gap: 10px; flex: 1; }
.lb-user-details { display: flex; flex-direction: column; line-height: 1.2; }
.lb-user-name { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.lb-user-role { font-size: 0.72rem; color: var(--text-muted); }

.lb-xp { display: flex; align-items: center; gap: 5px; font-size: 0.9rem; color: var(--text-primary); }
.lb-xp-icon { color: #D97706; display: flex; }
.lb-xp-unit { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

/* ── Profile & Avatar Customizer ─────────────────────────── */
#view-profile {
  padding-bottom: 7rem !important;
}
.profile-page-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 7rem;
}
@media (min-width: 1024px) {
  .profile-page-grid {
    display: grid !important;
    grid-template-columns: 1.35fr 1fr !important;
    gap: 1.5rem !important;
  }
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}
.profile-stat-box {
  min-width: 0;
  box-sizing: border-box;
}
.profile-stat-label {
  white-space: nowrap !important;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748B;
  display: block;
}
.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-xs);
}
.profile-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}
.avatar-preview-box {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.profile-card-header .profile-section-title {
  margin-bottom: 0;
}
.btn-profile-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-profile-edit:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.profile-avatar-center-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
}
.avatar-preview-box {
  display: flex;
  justify-content: center;
}
.avatar-swatches-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.avatar-swatches-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.avatar-swatches-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.avatar-swatch-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 0 1px var(--border);
}
.avatar-swatch-circle:hover {
  transform: scale(1.15);
}
.avatar-swatch-circle.selected {
  outline: 2px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: scale(1.15);
}
.profile-input-field {
  width: 100%;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-light);
  box-sizing: border-box;
}
.profile-input-field:focus {
  border-color: var(--accent-hover);
}
.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1.25rem;
}
.btn-profile-cancel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-profile-cancel:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.btn-profile-save {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
  transition: all var(--transition);
}
.btn-profile-save:hover {
  background: var(--accent-hover);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.profile-stats-summary {
  display: flex;
  justify-content: space-around;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.p-stat-box { display: flex; flex-direction: column; align-items: center; }
.p-stat-val { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.p-stat-lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

/* ── Duration Selector Chips ─────────────────────────────── */
.duration-selector-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.duration-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.duration-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.duration-chip.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Heart Recovery Modal Styles ─────────────────────────── */
#heart-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: min(500px, 94vw);
  padding: 0;
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
}
#heart-modal::backdrop {
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(4px);
}
.heart-modal-inner { padding: 1.5rem; }
.current-hearts-banner {
  text-align: center;
  padding: 1rem;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}
.hearts-big { font-size: 2.2rem; font-weight: 900; color: #DC2626; letter-spacing: -0.04em; }
.hearts-hint { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; margin-top: 2px; }

.heart-recovery-options { display: flex; flex-direction: column; gap: 10px; }
.recovery-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: all var(--transition);
}
.recovery-card:hover:not(.disabled) {
  border-color: var(--accent-medium);
  box-shadow: var(--shadow-xs);
}
.recovery-card.disabled { opacity: 0.5; pointer-events: none; }
.recovery-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quiz-box { background: var(--accent-light); color: var(--accent); }
.pomo-box { background: #FFFBEB; color: #D97706; }
.xp-box { background: #ECFEFF; color: #0891B2; }

.recovery-info { flex: 1; }
.recovery-info h4 { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.recovery-info p { font-size: 0.75rem; color: var(--text-muted); }

.btn-action-sm {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary-soft {
  background: var(--accent-light);
  border: 1px solid var(--accent-medium);
  color: var(--accent);
}
.btn-primary-soft:hover {
  background: var(--accent);
  color: white;
}

/* Quiz & Pomodoro Screens */
.quiz-container, .pomo-container { padding: 0.5rem 0; }
.quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.85rem; }
.quiz-step-tag { font-size: 0.75rem; font-weight: 700; color: var(--accent); background: var(--accent-light); padding: 2px 8px; border-radius: 12px; }
.quiz-q-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; line-height: 1.4; }
.quiz-options-list { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}
.quiz-opt-btn:hover { background: var(--bg-surface); border-color: var(--accent-medium); }
.quiz-opt-btn.correct { background: var(--success-light); border-color: var(--success-border); color: #166534; font-weight: 700; }
.quiz-opt-btn.wrong { background: var(--danger-light); border-color: var(--danger-border); color: #991B1B; }
.quiz-opt-marker { font-weight: 800; color: var(--text-muted); font-size: 0.8rem; }

.pomo-container { text-align: center; padding: 1.5rem 0; }
.pomo-title { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.pomo-timer-display { font-size: 3.5rem; font-weight: 900; color: var(--accent); letter-spacing: -0.04em; margin: 1rem 0; }
.pomo-subtext { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.pomo-actions { display: flex; flex-direction: column; align-items: center; }

/* ── Dashboard & Kanban (From previous base, refined) ─────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.875rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-icon-wrap { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.metric-value { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--text-primary); }
.metric-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.metric-bar { height: 3px; background: var(--bg-subtle); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.metric-bar-fill { height: 100%; border-radius: 2px; }

.metric-total    .metric-icon-wrap { background: var(--accent-light); color: var(--accent); }
.metric-total    .metric-bar-fill  { background: var(--accent); }
.metric-todo     .metric-icon-wrap { background: #F1F5F9; color: #64748B; }
.metric-todo     .metric-bar-fill  { background: #94A3B8; }
.metric-inprogress .metric-icon-wrap { background: var(--accent-light); color: var(--accent); }
.metric-inprogress .metric-bar-fill  { background: var(--accent); }
.metric-review   .metric-icon-wrap { background: var(--warning-light); color: var(--warning); }
.metric-review   .metric-bar-fill  { background: var(--warning); }
.metric-done     .metric-icon-wrap { background: var(--success-light); color: var(--success); }
.metric-done     .metric-bar-fill  { background: var(--success); }

/* ── Compact Overdue Alert Card ───────────────────────────── */
.overdue-compact-card {
  margin-bottom: 0.875rem;
  padding: 0.75rem 1rem;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.08);
}
@media (min-width: 640px) {
  .overdue-compact-card {
    flex-direction: row;
    align-items: center;
  }
}

.overdue-compact-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.overdue-alert-icon {
  color: #DC2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.overdue-alert-icon svg {
  width: 18px;
  height: 18px;
}

.overdue-alert-text {
  font-size: 0.85rem;
  color: #1E293B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overdue-alert-text strong {
  color: #B45309;
  font-weight: 700;
}

.overdue-titles-list {
  color: #475569;
  font-style: normal;
}

.btn-overdue-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: #FFFFFF;
  border: 1px solid #FCA5A5;
  border-radius: 6px;
  color: #DC2626;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-overdue-shortcut:hover {
  background: #FEF2F2;
  border-color: #DC2626;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
  transform: translateY(-1px);
}

/* ── Split-Row Layout: Donut Chart + Today's Priorities ──── */
.dashboard-split-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0.875rem;
  margin-top: 0.875rem;
}

.chart-card, .priorities-card, .dashboard-progress-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-xs);
}

.card-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.chart-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 auto;
}

.donut-chart-container {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#donut-chart {
  width: 176px !important;
  height: 176px !important;
  max-width: 176px;
  max-height: 176px;
}

.chart-center-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.center-pct {
  font-size: 2.1rem;
  font-weight: 800;
  color: #1E293B;
  line-height: 1;
  letter-spacing: -0.03em;
  display: block;
}

.center-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748B;
  margin-top: 4px;
  display: block;
  letter-spacing: 0.02em;
}

.badge-type-project {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-type-task {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}


.chart-pct {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.04em;
}

.chart-pct span {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.chart-pct-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Today's Priorities Card */
.priorities-card {
  display: flex;
  flex-direction: column;
}

.priorities-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.priorities-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.priorities-title-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.priorities-badge-count {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.priorities-filter-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle, #F1F5F9);
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border, #E2E8F0);
  gap: 2px;
}

.priority-toggle-btn {
  border: none;
  background: transparent;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #64748B);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.priority-toggle-btn:hover {
  color: var(--text-primary, #1E293B);
}

.priority-toggle-btn.active {
  background: #FFFFFF;
  color: var(--accent, #4F46E5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.priorities-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.priority-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.18s ease;
  cursor: pointer;
}

.priority-item:hover {
  background: #FFFFFF;
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xs);
}

.priority-item-completing {
  opacity: 0.4;
  transform: scale(0.98);
  pointer-events: none;
  transition: all 0.25s ease;
}

.priority-item-project {
  border-left: 3.5px solid #6366F1 !important;
  background: #FDFEFE;
}

.priority-item-project:hover {
  background: #FFFFFF;
  border-left-color: #4F46E5 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08);
}


/* Custom Interactive Checkbox */
.priority-checkbox-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.priority-task-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.priority-custom-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #CBD5E1;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: transparent;
}

.priority-checkbox-wrap:hover .priority-custom-box {
  border-color: var(--accent);
}

.priority-task-checkbox:checked + .priority-custom-box {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.priority-custom-box svg {
  width: 12px;
  height: 12px;
}

.priority-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.priority-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.priority-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-item-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.priority-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.priority-tag-high {
  background: #FEE2E2;
  color: #DC2626;
}

.priority-tag-medium {
  background: #FEF3C7;
  color: #D97706;
}

.priority-tag-low {
  background: #F1F5F9;
  color: #64748B;
}

.priority-tag-overdue {
  background: #FFE4E6;
  color: #E11D48;
  font-weight: 700;
}

.priority-tag-today {
  background: #DBEAFE;
  color: #1D4ED8;
}

.priority-tag-date {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.priority-tag-sub {
  background: #F3E8FF;
  color: #7E22CE;
}

.priority-tag-project {
  background: #EEF2FF;
  color: #4F46E5;
  font-weight: 700;
  border: 1px solid #C7D2FE;
}


.priorities-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
}

.priorities-empty-icon {
  color: #10B981;
  display: inline-flex;
}

.priorities-empty-icon svg {
  width: 18px;
  height: 18px;
}

/* ── Individual Member Progress Section ────────────────────── */
.dashboard-progress-card {
  margin-top: 0.875rem;
}

.progress-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.progress-card-header .card-title {
  margin-bottom: 0;
}

.progress-active-summary {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 10px;
  border-radius: 12px;
}

.progress-row {
  margin-bottom: 1rem;
  transition: opacity 0.2s ease;
}

.progress-row.is-idle {
  opacity: 0.75;
}

.progress-row.is-idle:hover {
  opacity: 1;
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.progress-name {
  font-weight: 600;
  font-size: 0.88rem;
  flex: 1;
  color: var(--text-primary);
}

.progress-frac {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.progress-track {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
  transition: width 0.3s ease;
}

.btn-toggle-idle {
  background: none;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  width: 100%;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.15s ease;
}

.btn-toggle-idle:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--accent);
}

.idle-members-list {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}

.progress-all-done-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #059669;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 1rem;
  background: #ECFDF5;
  border-radius: var(--radius-md);
}

.empty-state {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* ── Kanban Board ─────────────────────────────────────────── */
.kanban-board {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  gap: 0.875rem;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-bottom: 1rem;
}
.kanban-board::-webkit-scrollbar {
  height: 6px;
}
.kanban-board::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 9999px;
}
.kanban-board::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}
.kanban-board::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}
.kanban-col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 280px;
  min-width: 280px;
  max-width: 320px;
  box-sizing: border-box;
}
.col-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.7rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}
.col-header h3 { font-size: 0.8rem; font-weight: 700; flex: 1; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.col-dot { width: 7px; height: 7px; border-radius: 50%; }
.todo-dot       { background: #94A3B8; }
.inprogress-dot { background: var(--accent); }
.review-dot     { background: var(--warning); }
.done-dot       { background: var(--success); }
.col-count { background: var(--bg-subtle); color: var(--text-muted); font-size: 0.75rem; font-weight: 700; padding: 1px 7px; border-radius: 20px; }

.col-cards {
  min-height: 120px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.col-cards.drop-target { background: var(--accent-light); border-color: var(--accent-medium); }
.col-empty { text-align: center; color: var(--text-faint); font-size: 0.8rem; padding: 1.5rem 0.5rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); }

/* Task Cards */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: grab;
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.task-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-accent); transform: translateY(-1px); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.5; transform: scale(0.97); }

.task-card-overdue {
  border-color: var(--danger-border) !important;
  background: linear-gradient(to bottom, var(--danger-light), var(--bg-surface)) !important;
}
.overdue-stripe {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--danger);
  color: white;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 7px 2px 12px;
  clip-path: polygon(10px 0%, 100% 0%, 100% 100%, 0% 100%);
}

.card-header { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; flex-wrap: wrap; }
.card-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin-bottom: 5px; }
.card-desc { font-size: 0.775rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.card-assignee { display: flex; align-items: center; gap: 6px; }
.assignee-name { font-size: 0.775rem; color: var(--text-secondary); font-weight: 500; }
.task-deadline { display: inline-flex; align-items: center; gap: 3px; font-size: 0.73rem; color: var(--text-muted); background: var(--bg-subtle); border-radius: 4px; padding: 2px 6px; }
.deadline-overdue { color: var(--danger); background: var(--danger-light); font-weight: 600; }

.subject-badge { font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--accent-light); border: 1px solid var(--accent-medium); color: var(--accent); }
.priority-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.priority-badge::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; }
.badge-high   { background: var(--danger-light); border: 1px solid var(--danger-border); color: #B91C1C; }
.badge-high::before   { background: var(--danger); }
.badge-medium { background: var(--warning-light); border: 1px solid var(--warning-border); color: #92400E; }
.badge-medium::before { background: var(--warning); }
.badge-low    { background: var(--success-light); border: 1px solid var(--success-border); color: #166534; }
.badge-low::before    { background: var(--success); }

/* Unified Kanban Project Card */
.task-card-project {
  border-left: 4px solid #A855F7 !important;
  background: linear-gradient(to right, rgba(243, 232, 255, 0.25), var(--bg-surface) 18%) !important;
}
.task-card-project:hover {
  border-left-color: #9333EA !important;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.16) !important;
}
.badge-kanban-project {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #F3E8FF;
  border: 1px solid #DDD6FE;
  color: #7E22CE;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kanban-project-progress-wrap {
  width: 100%;
  margin: 6px 0 8px 0;
}
.kanban-project-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kanban-project-progress-bar {
  height: 5px;
  border-radius: 9999px;
  background: #E2E8F0;
  overflow: hidden;
  position: relative;
}
.kanban-project-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #A855F7, #7E22CE);
  transition: width 0.3s ease;
}

/* Dynamic Member Repeater (Project Modals) */
.member-repeater-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.member-repeater-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.member-repeater-row .member-name {
  flex: 1.2;
}
.member-repeater-row .member-role {
  flex: 1.4;
}
.member-repeater-row .btn-remove-member-row {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.member-repeater-row .btn-remove-member-row:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626;
}
.btn-add-member-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 4px;
}
.btn-add-member-row:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #1E293B;
}

/* ── Modals & Shared Form Elements ───────────────────────── */
/* บังคับ Overlay คลุมเต็มหน้าจอ และจัดกล่อง Modal ให้อยู่กึ่งกลางเสมอ */
.modal-overlay,
.modal-backdrop,
div[id$="Modal"] {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(4px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  padding: 16px !important;
  margin: 0 !important;
}

/* กล่องเนื้อหาด้านใน Modal ทุกตัว */
.modal-content,
.modal-dialog,
.modal-card,
div[id$="Modal"] > div {
  position: relative !important;
  margin: auto !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  border-radius: 1rem !important;
}

/* รองรับ HTML5 native <dialog> ที่เปิดด้วย .showModal() ให้จัดกึ่งกลาง Viewport เสมอ */
dialog.modal-dialog,
dialog.system-modal,
dialog#task-modal,
dialog#metricDrillDownModal,
dialog[open] {
  position: fixed !important;
  inset: 0 !important;
  margin: auto !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  max-height: 90vh !important;
  width: fit-content !important;
  max-width: min(640px, 94vw) !important;
  overflow-y: auto !important;
  border: 1px solid var(--border) !important;
  border-radius: 1rem !important;
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  padding: 0 !important;
  z-index: 9999 !important;
}

dialog::backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 9998 !important;
}

#task-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  width: min(540px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  color: var(--text-primary);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
#task-modal::backdrop { background: rgba(15,23,42,0.45); backdrop-filter: blur(4px); }
.modal-inner { padding: 1.75rem; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.modal-close { background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-muted); width: 30px; height: 30px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }
label { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.required { color: var(--danger); }

input[type="text"], input[type="date"], textarea, select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 9px 11px;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
textarea { resize: vertical; min-height: 80px; }

.modal-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.footer-right { display: flex; gap: 7px; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  border: none;
  color: white;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); font-family: var(--font); font-size: 0.85rem; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-md); cursor: pointer; }
.btn-danger { display: inline-flex; align-items: center; gap: 6px; background: var(--danger-light); border: 1px solid var(--danger-border); color: var(--danger); font-family: var(--font); font-size: 0.85rem; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-md); cursor: pointer; }

/* ── Orbit (Profile) ─────────────────────────────────────── */
.orbit-phases { display: flex; gap: 3px; margin-bottom: 0.7rem; flex-wrap: wrap; }
.phase { font-size: 0.62rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.phase.spark { background: #ECFEFF; color: #0E7490; border: 1px solid #A5F3FC; }
.phase.resist { background: var(--warning-light); color: #92400E; border: 1px solid var(--warning-border); }
.phase.identity { background: var(--success-light); color: #166534; border: 1px solid var(--success-border); }

.orbit-svg-container { position: relative; display: flex; justify-content: center; align-items: center; }
#orbit-svg { width: 220px; height: 220px; overflow: visible; }
.orbit-center-info { position: absolute; text-align: center; pointer-events: none; }
.orbit-streak { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -0.04em; }
.orbit-streak-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 500; }
.orbit-completed { font-size: 0.7rem; color: var(--accent-cyan); font-weight: 600; margin-top: 2px; }

/* ── Toasts ──────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-size: 0.85rem; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px); transition: all 0.22s ease; color: var(--text-primary); }
.toast.toast-show { opacity: 1; transform: translateY(0); }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-success .toast-icon { background: var(--success-light); color: var(--success); }
.toast-error   .toast-icon { background: var(--danger-light); color: var(--danger); }
.toast-info    .toast-icon { background: var(--accent-light); color: var(--accent); }
.toast-warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .profile-page-grid { display: flex !important; flex-direction: column !important; width: 100% !important; gap: 1.5rem !important; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-split-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  #main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  .mobile-menu-btn { display: flex; }
  .top-header, #top-bar {
    padding: 0 1rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  #app-main {
    padding: 1rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }
  .metric-card {
    padding: 0.85rem !important;
  }
  .metric-value {
    font-size: 1.6rem !important;
  }
  .dashboard-split-row {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
  .dashboard-lower { grid-template-columns: 1fr; }
  .projects-section-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .projects-header-actions {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
  .projects-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
}

@media (max-width: 360px) {
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 1280px) {
  .kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow-x: visible;
    gap: 1rem;
  }
  .kanban-col {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-shrink: 1;
  }
}

/* ── Database Table View ────────────────────────────────── */
.table-view-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.table-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-view-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.table-view-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.table-stats-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}

.table-stats-pill strong {
  color: var(--accent);
}

/* Toolbar */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-xs);
}

.table-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
}

.table-search-wrap .search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.table-search-input {
  width: 100%;
  padding: 7px 32px 7px 2.75rem !important;
  font-size: 0.825rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

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

.clear-search-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
}
.clear-search-btn:hover {
  color: var(--text-primary);
}

.table-filters-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-select-wrap .filter-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.table-filter-select {
  padding: 6px 28px 6px 30px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.table-filter-select:focus,
.table-filter-select:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Database Table */
.tasks-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-xs);
}

.tasks-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.825rem;
}

.tasks-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tasks-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  color: var(--text-secondary);
}

.tasks-table-row {
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.tasks-table-row:hover {
  background-color: #F8FAFC;
}

.tasks-table-row:last-child td {
  border-bottom: none;
}

/* Row Cells */
.cell-title .title-flex {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-title-text {
  color: var(--text-primary);
  font-size: 0.85rem;
}

.task-desc-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-assignee .assignee-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-deadline .deadline-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cell-deadline .deadline-wrap.is-overdue {
  color: var(--danger);
  font-weight: 600;
}

.overdue-tag {
  background: var(--danger-light);
  color: var(--danger);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--danger-border);
  margin-left: 3px;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-status-todo {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.badge-status-inprogress {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.badge-status-review {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.badge-status-done {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

/* Actions */
.actions-flex {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-table-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-table-action.text-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger-border);
  color: var(--danger);
}

/* Empty State */
.table-empty-row {
  text-align: center;
  padding: 3rem 1rem !important;
}

.empty-state-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.empty-state-wrap svg {
  opacity: 0.4;
}

/* ── Top Header & Language Switcher ─────────────────────── */
.top-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.header-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.header-brand-tag {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-sep {
  color: var(--border);
  font-size: 0.8rem;
}

.header-active-name {
  font-weight: 600;
  color: var(--accent);
}

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

.lang-switch-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 2px 4px;
  box-shadow: var(--shadow-xs);
}

.lang-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

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

.lang-btn.active {
  background: var(--accent-light, #EEF2FF);
  color: var(--accent, #4F46E5);
  font-weight: 800;
}

.lang-btn-sep {
  color: var(--border);
  font-size: 0.65rem;
  margin: 0 1px;
}

/* ── More Popover Menu ──────────────────────────────────── */
.sidebar-more-wrap {
  position: relative;
  width: 100%;
}

.sidebar-more-btn {
  width: 100%;
  text-align: left;
}

.more-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: popoverSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.more-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.more-popover-item:hover {
  background-color: var(--bg-subtle, #F8FAFC);
  color: var(--accent);
}

.popover-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.popover-item-left svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.more-popover-item:hover .popover-item-left svg {
  color: var(--accent);
}

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

/* ── Help & System Modal ────────────────────────────────── */
.system-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: min(500px, 94vw);
  max-height: 90vh;
  padding: 0;
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
}

.system-modal::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}

.help-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.help-spec-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.help-spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
}

.help-spec-label {
  color: var(--text-muted);
  font-weight: 500;
}

.help-spec-val {
  color: var(--text-primary);
  font-weight: 600;
}

.help-shortcuts-section {
  margin-top: 1.25rem;
}

.shortcuts-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.shortcuts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.shortcuts-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shortcut-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ═════════════════════════════════════════════════════════════
   DAILY ROUTINE MODULE (Google Tasks Style)
══════════════════════════════════════════════════════════════ */

/* Header Quick-Access Button */
.header-routine-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.header-routine-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.routine-quick-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.routine-badge-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
}

.routine-badge-icon svg {
  width: 15px;
  height: 15px;
}

.routine-badge-label {
  color: var(--text-secondary);
}

.routine-badge-count {
  background: var(--bg-subtle);
  color: var(--accent);
  font-size: 0.725rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Routine View Container */
.routine-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0.5rem 0 3rem;
}

/* Google Tasks Style Main Card */
.routine-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

/* Routine Header */
.routine-header {
  padding: 1.5rem 1.75rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

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

.routine-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.routine-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.routine-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.routine-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.routine-midnight-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.routine-midnight-pill svg {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
}

.routine-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--border-medium);
  font-weight: 600;
}

.routine-progress-pill.is-complete {
  background: #DCFCE7;
  color: #166534;
  border-color: #BBF7D0;
}

/* Top Progress Bar */
.routine-progress-bar-wrap {
  height: 4px;
  background: var(--border);
  width: 100%;
  overflow: hidden;
}

.routine-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #3B82F6 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* All Done Banner */
.routine-all-done-banner {
  margin: 1rem 1.75rem 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #15803D;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: slideDown 0.3s ease;
}

.routine-all-done-banner svg {
  width: 16px;
  height: 16px;
  color: #16A34A;
}

/* Routine List */
.routine-list {
  padding: 0.5rem 0;
}

.routine-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.routine-empty svg {
  width: 36px;
  height: 36px;
  color: var(--border-medium);
}

/* Routine Item Row */
.routine-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.75rem;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition), opacity var(--transition);
  position: relative;
  cursor: grab;
  user-select: none;
}

.routine-item:last-child {
  border-bottom: none;
}

.routine-item:hover {
  background: var(--bg-subtle);
}

.routine-item.is-editing {
  cursor: default;
  background: #F8FAFC;
}

.routine-item.item-dragging {
  opacity: 0.45;
  background: #EFF6FF;
  cursor: grabbing;
}

.routine-item.drop-target-above {
  border-top: 2.5px solid var(--accent, #2563EB) !important;
}

.routine-item.drop-target-below {
  border-bottom: 2.5px solid var(--accent, #2563EB) !important;
}

/* Drag Handle */
.routine-drag-handle {
  color: var(--text-muted);
  opacity: 0;
  cursor: grab;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.routine-item:hover .routine-drag-handle {
  opacity: 0.6;
}

.routine-drag-handle:hover {
  opacity: 1;
  color: var(--text-primary);
}

.routine-drag-handle svg {
  width: 14px;
  height: 14px;
}

/* Circular Checkmark Button (Google Tasks Style) */
.routine-check-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: transparent;
}

.routine-check-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.routine-check-btn.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.routine-check-btn .check-svg {
  transform: scale(0.6);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.routine-check-btn.checked .check-svg {
  transform: scale(1);
  opacity: 1;
}

/* Text Content */
.routine-text-wrap {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.routine-item-text {
  font-size: 0.925rem;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
  transition: color var(--transition), text-decoration var(--transition);
}

.routine-item-text.strike {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Inline Edit Form */
.routine-inline-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.routine-inline-edit-input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 0.925rem;
  color: var(--text-primary);
  background: #FFFFFF;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.routine-inline-edit-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.routine-save-edit-btn,
.routine-cancel-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.routine-save-edit-btn {
  background: #DCFCE7;
  color: #16A34A;
}

.routine-save-edit-btn:hover {
  background: #BBF7D0;
  color: #15803D;
}

.routine-cancel-edit-btn {
  background: #F1F5F9;
  color: var(--text-muted);
}

.routine-cancel-edit-btn:hover {
  background: #E2E8F0;
  color: var(--text-primary);
}

.routine-save-edit-btn svg,
.routine-cancel-edit-btn svg {
  width: 14px;
  height: 14px;
}

/* Routine Item Actions (Right Aligned, Clean Minimal) */
.routine-item-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Edit & Delete Action Buttons */
.routine-edit-btn,
.routine-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  opacity: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.routine-item:hover .routine-edit-btn,
.routine-item:hover .routine-del-btn,
.routine-edit-btn:focus-visible,
.routine-del-btn:focus-visible {
  opacity: 1;
}

.routine-edit-btn:hover {
  background: #EEF2FF;
  color: var(--accent);
}

.routine-del-btn:hover {
  background: #FEE2E2;
  color: #DC2626;
}

.routine-edit-btn svg,
.routine-del-btn svg {
  width: 14px;
  height: 14px;
}

/* Routine Footer / Add Action */
.routine-footer {
  padding: 0.85rem 1.75rem 1.25rem;
  border-top: 1px dashed var(--border);
  background: #FAFAFA;
}

.routine-add-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  width: 100%;
}

.routine-add-btn:hover {
  background: var(--accent-light);
}

.routine-add-btn svg {
  width: 16px;
  height: 16px;
}

/* Add Form Inline */
.routine-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.routine-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  color: var(--text-primary);
  background: #FFFFFF;
  outline: none;
  font-family: inherit;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.routine-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-routine-cancel {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: #FFFFFF;
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-routine-cancel:hover {
  background: var(--bg-subtle);
}

.btn-routine-submit {
  padding: 6px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-routine-submit:hover {
  background: var(--accent-hover);
}

/* ═════════════════════════════════════════════════════════════
   MONTHLY MISSIONS MODULE (TimeBlocks Calendar Style)
══════════════════════════════════════════════════════════════ */

.calendar-module-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1300px;
  margin: 0 auto;
}

/* Calendar Header Bar */
.calendar-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  flex-wrap: wrap;
  gap: 1rem;
}

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

.calendar-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.calendar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.calendar-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 3px 0 0;
}

.calendar-month-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.calendar-current-month-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

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

/* Month Nav Controls */
.calendar-nav-group {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.calendar-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

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

.calendar-today-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all var(--transition);
}

.calendar-today-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Add Mission Button */
.btn-calendar-add {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
  transition: all var(--transition);
}

.btn-calendar-add:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* Calendar Grid Card */
.calendar-grid-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

/* Days Header (Sun - Sat) */
.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-medium);
}

.calendar-day-col-header {
  padding: 10px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-col-header:last-child {
  border-right: none;
}

.calendar-day-col-header.is-weekend {
  color: #EA580C;
}

/* Cells Matrix Grid (7 Columns - Strict Equal Width) */
.calendar-cells-matrix {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  background: var(--border);
  gap: 1px;
}

/* Individual Calendar Cell */
.calendar-cell {
  background: var(--bg-surface);
  min-height: 120px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition);
  cursor: pointer;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.calendar-cell:hover {
  background: #F8FAFC;
}

.calendar-cell.is-overflow-month {
  background: #FAFAFA;
  opacity: 0.65;
}

.calendar-cell.is-overflow-month:hover {
  opacity: 0.9;
  background: #F1F5F9;
}

/* Today highlight */
.calendar-cell.is-today {
  background: #EFF6FF;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

/* Drag over highlight on target cell */
.calendar-cell.drag-over {
  background: #E0E7FF !important;
  box-shadow: inset 0 0 0 2px var(--accent) !important;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

.calendar-cell-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 2px;
}

.calendar-date-number {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendar-date-number.today-badge {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

/* Cell Chips Stack */
.calendar-cell-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* TimeBlocks Minimal Dot Style Chip */
.cal-task-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 3px 6px;
  border-radius: 4px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: opacity 0.15s ease, transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
  white-space: nowrap;
  box-sizing: border-box;
  user-select: none;
}

.cal-task-chip:active {
  cursor: grabbing;
}

/* Dragging state with 0.5 - 0.7 opacity */
.cal-task-chip.chip-dragging {
  opacity: 0.6;
  cursor: grabbing;
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.cal-task-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
  border-color: var(--border-medium);
  background: #FAFAFA;
}

.chip-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-title {
  font-weight: 600;
  color: #1E293B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.chip-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 600;
}

/* Overflow Button (+X more) */
.cal-overflow-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  margin-top: 2px;
}

.cal-overflow-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-medium);
}

/* Day Missions Overflow Popover */
.calendar-day-popover {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day-popover.hidden {
  display: none;
}

.cal-popover-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 440px;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cal-popover-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.cal-popover-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.cal-popover-close-btn:hover {
  color: var(--text-primary);
}

.cal-popover-list {
  padding: 1rem 1.25rem;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popover-mission-row {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.popover-mission-row:hover {
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.popover-mission-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.popover-mission-title {
  font-size: 0.85rem;
  color: var(--text-primary);
  flex: 1;
}

.popover-mission-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.popover-mission-tag {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Color Palette Picker in Task Modal (8 TimeBlocks colors) */
.color-palette-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.color-option {
  position: relative;
  cursor: pointer;
  display: inline-flex;
}

.color-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
}

.color-option input[type="radio"]:checked + .color-swatch {
  transform: scale(1.18);
  border-color: #FFFFFF;
  outline: 2px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.color-swatch:hover {
  transform: scale(1.1);
}

/* ═════════════════════════════════════════════════════════════
   FOCUS TIMER MODULE & TOP-HEADER PERSISTENT DOCKING
══════════════════════════════════════════════════════════════ */

/* Focus Page Container */
.focus-page-container {
  max-width: 640px;
  margin: 1rem auto 3rem;
}

.focus-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.focus-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.focus-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.focus-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

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

/* Big Hero Timer Display */
.focus-timer-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.focus-hero-time {
  font-family: 'Prompt', monospace, system-ui;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
}

.focus-hero-time.is-running {
  color: var(--accent);
}

.focus-hero-time.is-paused {
  color: var(--warning);
}

.focus-status-tag-row {
  margin-top: 1rem;
  min-height: 24px;
}

.focus-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.focus-status-badge.badge-active {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.focus-status-badge.badge-paused {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.focus-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Stepper Inputs for Hours & Minutes */
.focus-time-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.focus-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.focus-input-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.focus-number-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}

.focus-number-stepper input {
  flex: 1;
  text-align: center;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  border: none;
  background: transparent;
  padding: 8px 4px;
  outline: none;
  -moz-appearance: textfield;
}

.focus-number-stepper input::-webkit-outer-spin-button,
.focus-number-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-stepper {
  width: 40px;
  height: 42px;
  background: var(--bg-subtle);
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.btn-stepper:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* Presets Section */
.focus-presets-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.focus-presets-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.focus-presets-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-focus-preset {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn-focus-preset:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Focus Actions */
.focus-actions-wrap {
  margin-top: 0.5rem;
}

.btn-focus-start {
  width: 100%;
  background: var(--accent);
  border: none;
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  transition: all var(--transition);
}

.btn-focus-start:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

/* Active Controls on page */
.focus-active-controls {
  display: flex;
  gap: 10px;
  margin-top: 0.5rem;
}

.btn-focus-pause, .btn-focus-resume {
  flex: 1;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-focus-pause:hover, .btn-focus-resume:hover {
  background: var(--accent-hover);
}

.btn-focus-cancel {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-focus-cancel:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626;
}

/* ═════════════════════════════════════════════════════════════
   TOP HEADER PERSISTENT DOCKING WIDGET & POPOVER
══════════════════════════════════════════════════════════════ */

.header-focus-dock {
  position: relative;
}

.header-focus-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 9999px;
  padding: 4px 10px;
  font-family: 'Prompt', monospace, system-ui;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  user-select: none;
}

.header-focus-badge.is-running {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #4F46E5;
}

.header-focus-badge.is-paused {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #D97706;
}

.header-focus-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.header-focus-icon {
  display: flex;
  align-items: center;
  color: currentColor;
}

.header-focus-time {
  letter-spacing: -0.01em;
}

.header-focus-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.header-focus-badge.is-running .header-focus-dot {
  animation: pulse-ring 1.5s infinite;
}

/* Header Popover */
.header-focus-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
  padding: 12px 14px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-focus-popover.hidden {
  display: none;
}

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

.focus-popover-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.focus-popover-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.focus-popover-status-badge.running {
  background: #EFF6FF;
  color: #2563EB;
}

.focus-popover-status-badge.paused {
  background: #FFFBEB;
  color: #D97706;
}

.focus-popover-time {
  font-family: 'Prompt', monospace, system-ui;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  padding: 4px 0;
}

.focus-popover-actions {
  display: flex;
  gap: 6px;
}

.btn-popover-action {
  flex: 1;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-popover-pause, .btn-popover-resume {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-popover-pause:hover, .btn-popover-resume:hover {
  background: var(--accent-hover);
}

.btn-popover-cancel {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-popover-cancel:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626;
}

/* ══════════════════════════════════════════════════════════════════════════════
   COLLABORATIVE PROJECT CHECK-IN MODULE & TEAM HEATMAP MATRIX
   ══════════════════════════════════════════════════════════════════════════════ */
.dashboard-project-section {
  margin-top: 1.25rem;
}

.project-checkin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.project-checkin-card.empty {
  padding: 2rem;
  text-align: center;
}

.project-checkin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.project-header-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.project-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #EEF2FF;
  color: #4F46E5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #E0E7FF;
}

.project-icon-badge svg {
  width: 22px;
  height: 22px;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.project-badge-active {
  font-size: 0.72rem;
  font-weight: 600;
  color: #4F46E5;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  padding: 2px 8px;
  border-radius: 12px;
}

.project-timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  flex-wrap: wrap;
}

.timeline-date-range, .timeline-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

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

.project-header-right {
  display: flex;
  align-items: center;
}

.btn-checkin-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-checkin-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-checkin-action.pending {
  background: #059669;
  color: #FFFFFF;
  border-color: #047857;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.btn-checkin-action.pending:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.25);
}

.btn-checkin-action.pending:active {
  transform: translateY(0);
}

.btn-checkin-action.checked {
  background: #ECFDF5;
  color: #059669;
  border-color: #A7F3D0;
  cursor: default;
  box-shadow: none;
}

/* Heatmap Matrix Table */
.team-heatmap-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  -webkit-overflow-scrolling: touch;
}

.team-heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.th-member-col {
  min-width: 220px;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 3;
}

.td-member-info {
  min-width: 220px;
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 2;
}

.row-current-user .td-member-info {
  background: #F8FAFC;
}

.member-info-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.member-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-user-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.2;
}

.member-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.th-date-col {
  min-width: 44px;
  width: 44px;
  padding: 0.6rem 0.2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px dashed var(--border);
  background: var(--bg-surface);
}

.date-header-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.date-day-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.date-day-num {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.today-indicator-pill {
  font-size: 0.58rem;
  font-weight: 700;
  background: #2563EB;
  color: #FFFFFF;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.th-date-col.col-today {
  background: #EFF6FF;
  border-right: 1px solid #BFDBFE;
  border-left: 1px solid #BFDBFE;
}

.th-date-col.col-future .date-day-num {
  color: var(--text-muted);
}

.th-stat-col {
  min-width: 90px;
  padding: 0.75rem 0.75rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.td-status-cell {
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  border-right: 1px dashed var(--border);
  vertical-align: middle;
}

.td-status-cell.cell-today-col {
  background: rgba(37, 99, 235, 0.03);
  border-right: 1px solid #BFDBFE;
  border-left: 1px solid #BFDBFE;
}

.status-cell-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.status-cell-box svg {
  width: 14px;
  height: 14px;
}

.status-cell-box.status-completed {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.25);
}

.status-cell-box.status-active {
  background: #F59E0B;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.25);
}

.status-cell-box.status-empty {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

.status-cell-box.status-future {
  background: transparent;
  border: 1px dashed #CBD5E1;
  color: #94A3B8;
  font-size: 0.75rem;
  opacity: 0.6;
}

.cell-future-dash {
  font-size: 0.8rem;
  color: #94A3B8;
}

.status-cell-box.clickable-cell {
  cursor: pointer;
}

.status-cell-box.clickable-cell:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.td-member-stat {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.member-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-mini-bar {
  width: 48px;
  height: 5px;
  background: #E2E8F0;
  border-radius: 3px;
  overflow: hidden;
}

.stat-mini-fill {
  height: 100%;
  background: #10B981;
  border-radius: 3px;
}

/* Footer & Legend */
.project-checkin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legend-dot svg {
  width: 11px;
  height: 11px;
}

.legend-dot.status-completed {
  background: #10B981;
  color: #FFFFFF;
}

.legend-dot.status-active {
  background: #F59E0B;
  color: #FFFFFF;
}

.legend-dot.status-warning {
  background: #F59E0B;
  color: #FFFFFF;
}

.legend-dot.status-empty {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
}

.legend-dot.status-future {
  background: #FAFAFA;
  border: 1px dashed #CBD5E1;
  color: #94A3B8;
  font-size: 0.8rem;
  font-weight: 700;
}

.legend-dash {
  line-height: 1;
}

.legend-dot.status-today-marker {
  border: 2px solid #2563EB;
  background: #EFF6FF;
}

.footer-help-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-help-text svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* ═════════════════════════════════════════════════════════════
   MULTI-PROJECT SELECTOR & NEVER MISS TWICE STATUSES
══════════════════════════════════════════════════════════════ */
.project-checkin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.project-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-switcher-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-switcher-label svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.project-select-container {
  position: relative;
}

.project-switcher-select {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  max-width: 340px;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.project-switcher-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.btn-join-project {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-join-project:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-join-project svg {
  width: 13px;
  height: 13px;
}

.project-code-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  padding: 1px 6px;
  border-radius: 6px;
  font-family: monospace;
  letter-spacing: 0.05em;
}

.status-cell-box.status-warning {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #D97706;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.25);
}

.cell-icon-warning svg {
  width: 12px;
  height: 12px;
  color: #D97706;
}

.status-cell-box.is-today-active-cell {
  outline: 2px solid #2563EB;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* ═════════════════════════════════════════════════════════════
   TOP HEADER RIGHT PERSISTENT WIDGETS (STREAK & DOCKED FOCUS)
══════════════════════════════════════════════════════════════ */
.top-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Header Streak Widget */
.header-streak-dock {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.streak-dock-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.streak-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #EA580C;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
}

.streak-pill-btn:hover {
  background: #FFEDD5;
  border-color: #FDBA74;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.15);
}

.streak-flame-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #EA580C;
}

.streak-flame-icon svg {
  width: 15px;
  height: 15px;
}

.streak-count-num {
  font-size: 0.82rem;
  font-weight: 800;
}

.streak-unit-label {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}

/* Streak Popover (7-Day History) */
.streak-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  padding: 1.15rem;
  z-index: 1000;
  animation: popoverFadeIn 0.18s ease;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.streak-popover-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.85rem;
}

.streak-popover-flame-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EA580C;
  flex-shrink: 0;
}

.streak-popover-flame-wrap svg {
  width: 20px;
  height: 20px;
}

.streak-popover-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.streak-popover-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.streak-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 0.85rem 0;
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.streak-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.streak-day-name {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}

.streak-day-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.streak-day-circle.streak-day-completed {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.streak-check-icon svg {
  width: 13px;
  height: 13px;
}

.streak-day-circle.streak-day-today {
  background: #EFF6FF;
  border: 2px solid #2563EB;
  color: #2563EB;
}

.streak-pending-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563EB;
}

.streak-day-circle.streak-day-missed {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #94A3B8;
}

.streak-missed-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #CBD5E1;
}

.streak-day-circle.streak-day-future {
  background: #FAFAFA;
  border: 1px dashed #E2E8F0;
  color: #CBD5E1;
}

.streak-future-dash {
  font-size: 0.8rem;
  color: #CBD5E1;
}

.streak-day-number {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.is-today-col .streak-day-number {
  color: var(--accent);
  font-weight: 700;
}

.streak-popover-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.streak-footer-shield {
  display: inline-flex;
  color: var(--accent);
  flex-shrink: 0;
}

.streak-footer-shield svg {
  width: 14px;
  height: 14px;
}

/* Header Focus Dock with Inline Mini Controls */
.header-focus-dock-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  padding: 3px 6px 3px 10px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.header-focus-dock-wrap.is-running {
  border-color: var(--accent);
}

.header-focus-dock-wrap.is-paused {
  border-color: #F59E0B;
}

.header-focus-badge {
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
}

.header-focus-badge:hover .header-focus-time {
  color: var(--accent);
}

.header-focus-time {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  transition: color 0.15s ease;
}

.header-focus-mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 6px;
  border-left: 1px solid var(--border);
}

.btn-dock-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-secondary);
  padding: 0;
}

.btn-dock-mini:hover {
  transform: scale(1.1);
}

.btn-dock-pause:hover {
  background: #FEF3C7;
  color: #D97706;
  border-color: #F59E0B;
}

.btn-dock-resume:hover {
  background: #D1FAE5;
  color: #059669;
  border-color: #10B981;
}

.btn-dock-stop:hover {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #EF4444;
}


/* ============================================================
   AUTH GATE — Full-screen Login Overlay
   ============================================================ */

#auth-screen {
  display: none !important;
}

#auth-screen.hidden {
  display: none !important;
}

#app-layout.hidden {
  display: none !important;
}

/* ═════════════════════════════════════════════════════════════
   PROJECT WORKSPACE CARDS (OVERVIEW PAGE)
══════════════════════════════════════════════════════════════ */
.dashboard-projects-section {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.projects-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.section-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.projects-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-subtle-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: white;
  border: 1.5px solid #E2E8F0;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-subtle-action:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #1E293B;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #4F46E5;
  border: none;
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
}

.btn-primary-action:hover {
  background: #4338CA;
  transform: translateY(-1px);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ═════════════════════════════════════════════════════════════
   TASK DISPATCHER & MODAL ENHANCEMENTS
══════════════════════════════════════════════════════════════ */
.dispatcher-card-btn:hover {
  border-color: #6366F1 !important;
  background: #EEF2FF !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.1);
}

.clickable-timeline-cell:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 5;
}

#timeline-table-scroll-container::-webkit-scrollbar {
  height: 8px;
}
#timeline-table-scroll-container::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}
#timeline-table-scroll-container::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
#timeline-table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ═════════════════════════════════════════════════════════════
   PROJECT DETAIL & SEAT CLAIMING STYLES (Viewport & Timeline Containment)
══════════════════════════════════════════════════════════════ */
#project-detail-view,
#view-project-detail,
.project-detail-container,
.project-detail-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.project-detail-container {
  max-width: 1200px !important;
  margin: 0 auto;
  width: 100% !important;
  padding: 0 1.5rem 2.5rem 1.5rem;
}

.timeline-matrix-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.timeline-scroll-wrapper,
#timeline-table-scroll-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  display: block !important;
  box-sizing: border-box !important;
  -webkit-overflow-scrolling: touch;
}

.timeline-table,
#timeline-table-scroll-container table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: max-content !important;
  min-width: 100% !important;
}

.timeline-table th.member-column,
.timeline-table td.member-column {
  position: sticky !important;
  left: 0 !important;
  z-index: 10 !important;
  background-color: #ffffff !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  box-sizing: border-box !important;
  border-right: 1.5px solid #E2E8F0 !important;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.03);
}

.timeline-table th.member-column {
  background-color: #F8FAFC !important;
  z-index: 20 !important;
}

.timeline-table th.total-column,
.timeline-table td.total-column {
  position: sticky !important;
  right: 0 !important;
  width: 75px !important;
  min-width: 75px !important;
  max-width: 75px !important;
  box-sizing: border-box !important;
  background: #F8FAFC;
  z-index: 15;
}

.timeline-table th.total-column {
  z-index: 25 !important;
}

.timeline-table th.date-column,
.timeline-table td.date-column {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  box-sizing: border-box !important;
  text-align: center;
}

.seat-claim-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.seat-claim-card:hover {
  background: #EEF2FF;
  border-color: #818CF8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.seat-claim-card.selected {
  background: #EEF2FF;
  border-color: #4F46E5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #DCFCE7;
  color: #15803D;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #BBF7D0;
}

.role-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #FDE68A;
}

.password-masked-text {
  font-family: monospace;
  letter-spacing: 0.15em;
  font-size: 1.1rem;
  color: #475569;
}

.btn-checkin-active {
  background: #DCFCE7 !important;
  color: #15803D !important;
  border: 1.5px solid #86EFAC !important;
  font-weight: 700 !important;
}

.btn-checkin-active:hover {
  background: #BBF7D0 !important;
  border-color: #4ADE80 !important;
}

/* ── Deliverable Status Badges & Lifecycle FSM ── */
.badge-deliverable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-deliverable-inprogress {
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
}

.badge-deliverable-submitted {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-deliverable-revision {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.badge-deliverable-approved {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.is-hidden-workspace {
  background-color: #F8FAFC !important;
  border-color: #CBD5E1 !important;
}

/* ── Metric Cards Interactive Hover & Pointer ────────── */
.metric-card.cursor-pointer {
  cursor: pointer;
  user-select: none;
}
.metric-card.cursor-pointer:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}
.metric-card.cursor-pointer:active {
  transform: translateY(0);
}

/* ── Metric Drill-Down Modal ──────────────────────────── */
#metricDrillDownModal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: min(640px, 94vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 0;
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
}
#metricDrillDownModal::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.metric-drilldown-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.metric-drilldown-row:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}
.metric-drilldown-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ── Floating In-App Feedback Button & Modal ───────────────── */
.floating-feedback-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.25), 0 4px 6px -2px rgba(15, 23, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.floating-feedback-btn:hover {
  transform: translateY(-2px) scale(1.06);
  background: var(--accent);
  box-shadow: 0 14px 28px -4px rgba(79, 70, 229, 0.35);
}
.floating-feedback-btn:active {
  transform: scale(0.95);
}

#feedback-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.star-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}



