/**
 * Task Manager PWA Styles
 * ADHD-friendly design - minimal, clear, focused
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,800&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ============================================================================
   Layout
   ============================================================================ */

.tasks-v2 {
  --primary: #0f8f7a;
  --primary-dark: #0a6358;
  --secondary: #1d7ea8;
  --danger: #b42318;
  --warning: #b45309;
  --bg: #eef3f8;
  --card-bg: rgba(255, 255, 255, 0.84);
  --text: #1b2433;
  --text-light: #556173;
  --border: rgba(15, 38, 58, 0.14);
  --task-bg-top: #f5ede0;
  --task-bg-bottom: #f2f6fb;
  --task-ink: #1b2433;
  --task-muted: #556173;
  --task-accent: #0f8f7a;
  --task-accent-2: #f1b655;
  --task-card: rgba(255, 255, 255, 0.84);
  --task-border: rgba(15, 38, 58, 0.14);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(880px 520px at 8% -8%, rgba(241, 182, 85, 0.28), transparent 62%),
    radial-gradient(760px 480px at 96% 4%, rgba(15, 143, 122, 0.26), transparent 58%),
    linear-gradient(180deg, var(--task-bg-top), var(--task-bg-bottom));
  color: var(--task-ink);
}

.tasks-v2,
.tasks-v2 * {
  box-sizing: border-box;
}

html,
body.tasks-v2 {
  margin: 0;
  min-height: 100%;
}

body.tasks-v2 {
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.header {
  background:
    linear-gradient(132deg, rgba(9, 63, 98, 0.96), rgba(11, 102, 95, 0.93)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 11px);
  color: #f9fbff;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 30px rgba(2, 26, 45, 0.28);
  backdrop-filter: blur(8px);
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.header-title-wrap {
  display: grid;
  gap: 0.15rem;
}

.header h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: 0.01em;
  font-size: 1.35rem;
  font-weight: 700;
}

.header-subtitle {
  margin: 0;
  font-size: 0.74rem;
  color: rgba(245, 251, 255, 0.9);
  letter-spacing: 0.01em;
}

.install-btn {
  margin-top: 0.1rem;
  color: #f7fbff;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  font-weight: 600;
}

/* Keep Tasks UI readable even when experience.css is loaded globally. */
.tasks-v2 .header {
  background:
    linear-gradient(132deg, rgba(9, 63, 98, 0.96), rgba(11, 102, 95, 0.93)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 11px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 16px 30px rgba(2, 26, 45, 0.28) !important;
  color: #f9fbff !important;
}

.tasks-v2 .card {
  background: var(--task-card, rgba(255, 255, 255, 0.84)) !important;
  border: 1px solid var(--task-border, rgba(15, 38, 58, 0.14)) !important;
  box-shadow: 0 14px 28px rgba(19, 34, 52, 0.1) !important;
}

.tasks-v2 .view-btn {
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

.tasks-v2 .view-btn.active {
  background: #f7fbff !important;
  color: #15476f !important;
  border-color: rgba(255, 255, 255, 0.64) !important;
}

.tasks-v2 .hidden {
  display: none !important;
}

.tasks-v2 .stats-bar {
  background: rgba(255, 255, 255, 0.92) !important;
  border-top: 1px solid rgba(15, 38, 58, 0.16) !important;
  box-shadow: 0 -8px 20px rgba(19, 34, 52, 0.14) !important;
}

.tasks-v2 .stat-value {
  color: var(--task-accent, #0f8f7a) !important;
}

.tasks-v2 .stat-label,
.tasks-v2 .empty-state,
.tasks-v2 .loading {
  color: var(--task-muted, #556173) !important;
}

.main {
  flex: 1;
  padding: 1rem;
  padding-bottom: 7.75rem; /* Space for stats bar + review bulk bar */
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ============================================================================
   View Selector
   ============================================================================ */

.view-selector {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.2rem;
}

.view-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn.active {
  background: #f7fbff;
  color: #15476f;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.64);
}

.page.active {
  animation: page-in 220ms ease;
}

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

/* ============================================================================
   Focus View - Single task, maximum clarity
   ============================================================================ */

.focus-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  margin-bottom: 1rem;
}

.focus-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.focus-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.focus-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.focus-time {
  color: var(--text-light, #6b7280);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.focus-mantra {
  color: var(--text-light, #6b7280);
  font-style: italic;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.focus-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.focus-secondary {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.empty-focus {
  padding: 2rem;
}

.empty-focus .emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-focus h2 {
  margin: 0 0 0.5rem 0;
}

.empty-focus p {
  color: var(--text-light, #6b7280);
  margin-bottom: 1.5rem;
}

.focus-support-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.support-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.86rem;
}

.support-panel.compact {
  margin-top: 0.55rem;
  font-size: 0.78rem;
}

.support-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.03);
}

.support-line strong {
  font-size: 0.8rem;
}

.inline-actions {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.inline-actions .btn.chip {
  font-size: 0.68rem;
  padding: 0.16rem 0.42rem;
}

.location-line {
  align-items: flex-start;
}

.location-submeta {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--task-muted, #556173);
}

.location-line-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.status-ok {
  color: #065f46;
}

.status-warn {
  color: #92400e;
}

.status-off {
  color: #6b7280;
}

.toggle-row {
  margin-top: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.toggle-row input {
  width: 1.1rem;
  height: 1.1rem;
}

.place-btn-row {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.support-alert {
  margin-top: 0.55rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark, #1e40af);
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.support-alert.hidden {
  display: none;
}

.capacity-list {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.capacity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.capacity-item span {
  line-height: 1.25;
}

.now-session-active {
  border: 1px solid rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.08);
  border-radius: 0.75rem;
  padding: 0.6rem;
}

.now-session-overdue {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
}

.now-timer {
  font-size: 1rem;
  font-weight: 800;
}

.now-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* ============================================================================
   Today View
   ============================================================================ */

.today-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vendor-card {
  background:
    linear-gradient(145deg, rgba(8, 78, 94, 0.93), rgba(9, 102, 85, 0.9)),
    radial-gradient(120% 110% at 96% 2%, rgba(241, 182, 85, 0.25), transparent 60%);
  color: #f2fbff;
}

.vendor-card h2 {
  color: #f7fcff;
}

.vendor-capture-row {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr auto;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.vendor-capture-row input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(7, 28, 43, 0.25);
  color: #f7fbff;
  border-radius: 0.75rem;
  padding: 0.48rem 0.55rem;
  font-size: 0.84rem;
}

.vendor-capture-row input::placeholder {
  color: rgba(236, 248, 255, 0.7);
}

.vendor-capture-row .btn.chip {
  border-color: rgba(255, 255, 255, 0.42);
  color: #eaf8ff;
  background: rgba(255, 255, 255, 0.14);
}

.vendor-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.vendor-line {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 0.78rem;
  background: rgba(7, 26, 42, 0.32);
  padding: 0.52rem 0.6rem;
  display: grid;
  gap: 0.35rem;
}

.vendor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  font-size: 0.82rem;
}

.vendor-top strong {
  letter-spacing: 0.01em;
}

.vendor-top span {
  color: rgba(238, 249, 255, 0.9);
}

.vendor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.vendor-actions .btn.chip {
  border-color: rgba(255, 255, 255, 0.34);
  color: #edfbff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
}

.vendor-items {
  margin-top: 0.45rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.22);
  padding-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.vendor-item-row {
  font-size: 0.75rem;
  line-height: 1.25;
  color: rgba(240, 249, 255, 0.93);
}

@media (max-width: 640px) {
  .vendor-capture-row {
    grid-template-columns: 1fr;
  }
}

.planner-card .support-line {
  background: rgba(12, 74, 110, 0.05);
  border-color: rgba(12, 74, 110, 0.14);
}

.planner-strip {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.planner-chip {
  --mins: 30;
  flex: calc(var(--mins) * 1) 0 0;
  min-width: 110px;
  border-radius: 0.8rem;
  border: 1px solid rgba(12, 74, 110, 0.14);
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.72);
}

.planner-chip.task {
  background: rgba(15, 143, 122, 0.12);
  border-color: rgba(15, 143, 122, 0.28);
}

.planner-chip.calendar {
  background: rgba(241, 182, 85, 0.18);
  border-color: rgba(241, 182, 85, 0.34);
}

.planner-chip.free {
  background: rgba(15, 38, 58, 0.06);
}

.planner-chip-time {
  font-size: 0.72rem;
  color: var(--task-muted, #556173);
}

.planner-chip-title {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: #17314d;
}

.planner-subline {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--task-muted, #556173);
}

/* ============================================================================
   Timeline View
   ============================================================================ */

.timeline-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-hero {
  background:
    linear-gradient(148deg, rgba(6, 54, 87, 0.98), rgba(7, 92, 84, 0.98)),
    radial-gradient(120% 140% at 85% 10%, rgba(255, 255, 255, 0.22), transparent 56%);
  color: #f3fbff;
  border-color: rgba(255, 255, 255, 0.24);
}

.timeline-hero h2 {
  color: #f7fcff;
}

.timeline-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.timeline-sub {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: rgba(247, 252, 255, 0.96);
}

.timeline-kpis {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.timeline-kpi {
  border-radius: 0.7rem;
  padding: 0.5rem 0.55rem;
  background: rgba(7, 26, 42, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.timeline-kpi-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff9e9;
}

.timeline-kpi-label {
  display: block;
  font-size: 0.72rem;
  color: rgba(239, 251, 255, 0.96);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.timeline-item {
  border: 1px solid rgba(15, 38, 58, 0.14);
  border-left: 5px solid rgba(15, 143, 122, 0.5);
  border-radius: 0.85rem;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.72);
}

.timeline-item.commitment {
  border-left-color: rgba(241, 182, 85, 0.85);
}

.timeline-item.event {
  border-left-color: rgba(39, 137, 197, 0.82);
}

.timeline-item.floating {
  border-left-style: dashed;
}

.timeline-when {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--task-muted, #556173);
}

.timeline-main {
  margin-top: 0.35rem;
}

.timeline-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.timeline-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(12, 74, 110, 0.16);
  background: rgba(12, 74, 110, 0.06);
  padding: 0.16rem 0.44rem;
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-pill.priority {
  background: rgba(11, 102, 95, 0.1);
  border-color: rgba(11, 102, 95, 0.25);
}

.timeline-pill.hard {
  background: rgba(192, 38, 38, 0.1);
  border-color: rgba(192, 38, 38, 0.28);
  color: #7f1d1d;
}

.timeline-pill.leave {
  text-transform: none;
  letter-spacing: normal;
}

.timeline-title {
  margin: 0.45rem 0 0.35rem;
  font-size: 0.97rem;
  line-height: 1.3;
  color: #16314c;
}

.timeline-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.74rem;
  color: var(--task-muted, #556173);
}

.timeline-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.timeline-alert {
  font-size: 0.72rem;
  font-weight: 800;
}

.timeline-leave-late {
  color: #991b1b;
}

.timeline-leave-now {
  color: #9a3412;
}

.timeline-leave-in {
  color: #92400e;
}

.timeline-leave-upcoming {
  color: #0f766e;
}

/* ============================================================================
   Review View
   ============================================================================ */

.review-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-header-card h2 {
  margin: 0;
}

.review-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.review-sub {
  margin-top: 0.3rem;
  color: var(--text-light, #6b7280);
  font-size: 0.85rem;
  line-height: 1.35;
}

.review-controls {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  background: var(--bg, #f5f5f5);
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 0.9rem;
}

.review-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  outline: none;
}

.review-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.review-scope-filters {
  margin-top: -0.15rem;
}

.filter-chip {
  flex-shrink: 0;
  border: 1px solid var(--border, #e5e7eb);
  background: white;
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.filter-chip:active {
  transform: scale(0.99);
}

.filter-chip.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary, #2563eb);
}

.review-bulk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.review-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text, #1f2937);
}

.task-item.review-item {
  align-items: flex-start;
}

.review-check {
  display: inline-flex;
  padding-top: 0.1rem;
}

.review-check input {
  width: 1.1rem;
  height: 1.1rem;
}

.review-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.review-text {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text, #1f2937);
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-light, #6b7280);
}

.review-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.review-pill.overdue {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #7f1d1d;
}

.review-pill.due {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
  color: #7c2d12;
}

.review-pill.waiting {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.35);
  color: #4c1d95;
}

.review-pill.repeat {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary-dark, #1e40af);
}

/* ============================================================================
   Shared View
   ============================================================================ */

.shared-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shared-header-card h2 {
  margin: 0;
}

.shared-request-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.shared-request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: var(--task-muted, #556173);
}

.shared-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.shared-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.04);
  font-size: 0.72rem;
  font-weight: 700;
}

.shared-status-pill.pending {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
  color: #7c2d12;
}

.shared-status-pill.accepted,
.shared-status-pill.completed {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #065f46;
}

.shared-status-pill.declined,
.shared-status-pill.returned {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #7f1d1d;
}

.bulk-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 4.75rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.75rem;
  z-index: 150;
}

.bulk-bar.hidden {
  display: none;
}

.bulk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.bulk-count {
  font-weight: 800;
  color: var(--text, #1f2937);
}

.bulk-actions {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bulk-btn {
  flex-shrink: 0;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg, #f5f5f5);
  color: var(--text, #1f2937);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.bulk-btn:active {
  transform: scale(0.99);
}

.bulk-btn.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #7f1d1d;
  border-color: rgba(239, 68, 68, 0.35);
}

/* ============================================================================
   Energy View
   ============================================================================ */

.energy-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.energy-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  background: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.energy-btn.active {
  border-color: var(--primary, #2563eb);
  background: var(--primary, #2563eb);
  color: white;
}

.energy-btn[data-energy="low"] { border-color: #10b981; }
.energy-btn[data-energy="low"].active { background: #10b981; }

.energy-btn[data-energy="high"] { border-color: #ef4444; }
.energy-btn[data-energy="high"].active { background: #ef4444; }

.energy-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================================================
   Triage View
   ============================================================================ */

.triage-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.triage-progress {
  text-align: center;
  color: var(--text-light, #6b7280);
  font-size: 0.875rem;
}

.triage-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.triage-emoji {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.triage-title {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
}

.triage-time {
  color: var(--text-light, #6b7280);
  font-size: 0.875rem;
}

.triage-notes {
  color: var(--text-light, #6b7280);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.triage-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.action-btn {
  padding: 0.75rem 0.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn.today { background: var(--primary, #2563eb); color: white; }
.action-btn.week { background: var(--secondary, #10b981); color: white; }
.action-btn.someday { background: #8b5cf6; color: white; }
.action-btn.delete { background: var(--danger, #ef4444); color: white; }
.action-btn.breakdown { background: var(--warning, #f59e0b); color: white; grid-column: span 3; }

.empty-triage {
  text-align: center;
}

.empty-triage .emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ============================================================================
   Task List & Items
   ============================================================================ */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-header {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light, #6b7280);
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg, #f5f5f5);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.task-item:hover {
  background: var(--border, #e5e7eb);
}

.task-item.quick-win {
  background: rgba(16, 185, 129, 0.1);
}

.task-item.recovery {
  opacity: 0.7;
}

.task-number {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, #2563eb);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

.task-emoji {
  font-size: 1.25rem;
}

.task-text {
  flex: 1;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.task-desc {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text, #1f2937);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-light, #6b7280);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.meta-pill.overdue {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #7f1d1d;
}

.meta-pill.due {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
  color: #7c2d12;
}

.meta-pill.soon {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.28);
  color: var(--primary-dark, #1e40af);
}

.meta-pill.repeat {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary-dark, #1e40af);
}

.meta-pill.priority-critical {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #7f1d1d;
}

.meta-pill.priority-high {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
  color: #7c2d12;
}

.meta-pill.priority-low {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.35);
  color: #334155;
}

.meta-pill.scope-shared {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #065f46;
}

.task-time {
  color: var(--text-light, #6b7280);
  font-size: 0.75rem;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.15s;
}

.task-btn:hover {
  opacity: 1;
}

.task-btn:active {
  transform: scale(0.98);
}

.task-done-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.task-done-btn:hover {
  opacity: 1;
}

/* ============================================================================
   Cards
   ============================================================================ */

.card {
  background: var(--task-card, rgba(255, 255, 255, 0.84));
  border-radius: 0.95rem;
  padding: 1rem;
  border: 1px solid var(--task-border, rgba(15, 38, 58, 0.14));
  box-shadow: 0 14px 28px rgba(19, 34, 52, 0.1);
  backdrop-filter: blur(8px);
}

.card h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: 0.01em;
  color: #14304c;
}

/* ============================================================================
   Stats Bar
   ============================================================================ */

.stats-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 0.75rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
}

.stat-label {
  font-size: 0.625rem;
  color: var(--text-light, #6b7280);
  text-transform: uppercase;
}

/* ============================================================================
   FAB (Floating Action Button)
   ============================================================================ */

.fab {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--primary, #2563eb);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  z-index: 99;
  transition: transform 0.2s;
}

.fab:hover {
  transform: scale(1.1);
}

/* ============================================================================
   Modals
   ============================================================================ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin: 0 0 1rem 0;
}

.modal-content textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 1rem;
}

.modal-content textarea:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
}

.capture-scope-row {
  margin-bottom: 0.9rem;
}

.capture-scope-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.capture-scope-row select {
  width: 100%;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.task-detail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.task-detail-header {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.task-detail-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.task-detail-title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
}

.task-detail-meta {
  margin-top: 0.2rem;
  color: var(--text-light, #6b7280);
  font-size: 0.8rem;
}

.detail-field label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--text, #1f2937);
}

.detail-field input[type="date"],
.detail-field input[type="datetime-local"],
.detail-field input[type="number"],
.detail-field input[type="text"],
.detail-field select,
.detail-field textarea {
  width: 100%;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
}

.detail-field textarea {
  min-height: 90px;
  resize: vertical;
}

.detail-field input:focus,
.detail-field select:focus,
.detail-field textarea:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
}

.detail-move-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-row.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.detail-row.two-col.checks {
  gap: 0.55rem;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.03);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.check-pill input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.detail-hint-box {
  border: 1px dashed rgba(15, 23, 42, 0.2);
  border-radius: 0.75rem;
  padding: 0.6rem 0.7rem;
  font-size: 0.78rem;
  color: var(--text-light, #6b7280);
}

.detail-hint-box code {
  font-size: 0.72rem;
  word-break: break-all;
}

.detail-comments {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-item {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.65rem;
  padding: 0.5rem 0.6rem;
  background: rgba(15, 23, 42, 0.03);
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--task-muted, #556173);
}

.comment-body {
  margin-top: 0.25rem;
  font-size: 0.84rem;
  color: var(--task-ink, #1b2433);
  line-height: 1.35;
  white-space: pre-wrap;
}

.detail-comment-compose {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.detail-comment-compose textarea {
  min-height: 72px;
}

.repeat-options {
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.repeat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.repeat-row:first-child {
  margin-top: 0;
}

.repeat-row.weekdays {
  align-items: flex-start;
}

.weekday-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.weekday-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.03);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text, #1f2937);
  user-select: none;
}

.weekday-chip input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.mini-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-light, #6b7280);
}

.repeat-interval {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.repeat-interval input[type="number"] {
  width: 5.5rem;
}

.repeat-unit {
  font-size: 0.85rem;
  color: var(--text-light, #6b7280);
}

.repeat-help {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-light, #6b7280);
  line-height: 1.35;
}

.detail-help {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--task-muted, #556173);
}

.assign-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.due-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn.chip {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--bg, #f5f5f5);
  color: var(--text, #1f2937);
}

.btn.icon {
  padding: 0.35rem 0.55rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.04);
  color: var(--text, #1f2937);
}

.btn.icon:active {
  transform: scale(0.98);
}

.btn.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #7f1d1d;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Breakdown list */
.breakdown-list {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.breakdown-list li {
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.breakdown-list li.start-here {
  background: rgba(37, 99, 235, 0.1);
  margin-left: -0.5rem;
  padding-left: 0.5rem;
  border-radius: 0.25rem;
}

.step-time {
  color: var(--text-light, #6b7280);
  font-size: 0.75rem;
}

.breakdown-total {
  font-weight: 600;
  color: var(--primary, #2563eb);
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  background: var(--primary, #2563eb);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark, #1e40af);
}

.btn.secondary {
  background: var(--bg, #f5f5f5);
  color: var(--text, #1f2937);
}

.btn.text {
  background: none;
  color: var(--text-light, #6b7280);
  padding: 0.5rem;
}

.btn.text:hover {
  color: var(--text, #1f2937);
}

.btn.large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */

.toast {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text, #1f2937);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================================================
   Loading & Empty States
   ============================================================================ */

.loading {
  opacity: 0.5;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border, #e5e7eb);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  color: var(--text-light, #6b7280);
  padding: 1rem;
  font-size: 0.875rem;
}

.error {
  color: var(--danger, #ef4444);
  text-align: center;
  padding: 1rem;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (min-width: 768px) {
  .main {
    max-width: 920px;
    margin: 0 auto;
  }

  .focus-support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .today-container > section:first-child {
    grid-column: 1 / -1;
  }

  .timeline-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-row.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .triage-actions {
    grid-template-columns: repeat(5, 1fr);
  }

  .action-btn.breakdown {
    grid-column: auto;
  }
}
