/* ============================================================
   v6-tasks.css — GPR Daily Ops Hub (Tasks view)
   V6 language: cream work surface, dark navy ink, ONE gold accent (#c18a25).
   Reserved-dark only for the AI-action control panel. No generic todo-app look.
   Pairs with js/tasks.js, renders inside #view-tasksnative.
   ============================================================ */

.tasks-hub {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg, #f6f3ec);
  color: var(--ink, #101722);
}

/* ── Header ─────────────────────────────────────────────────── */
.tasks-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border, #d7d0c3);
  background: var(--surface, #fffdf8);
}
.tasks-head-left { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.tasks-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold, #c18a25);
}
.tasks-date-label {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--ink, #101722);
}

/* progress */
.tasks-progress { flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; max-width: 520px; }
.tasks-progress-bar {
  position: relative;
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: var(--surface-2, #ebe7de);
  overflow: hidden;
}
.tasks-progress-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold, #c18a25), #d9a648);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.tasks-progress-text { font-size: 12px; color: var(--muted, #647184); font-variant-numeric: tabular-nums; }

/* brain-dump button */
.tasks-brain-dump-btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  font-size: 13px; font-weight: 600;
  color: #fff;
  background: var(--gold, #c18a25);
  border: 1px solid var(--gold, #c18a25);
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,23,34,.08);
  transition: filter .15s ease, transform .1s ease;
}
.tasks-brain-dump-btn:hover { filter: brightness(1.06); }
.tasks-brain-dump-btn:active { transform: translateY(1px); }
.tasks-brain-dump-btn span { font-size: 16px; line-height: 1; }

/* demo-data honesty banner */
.tasks-demo-banner {
  margin: 12px 28px 0;
  padding: 8px 14px;
  font-size: 12px;
  color: #8a6d1f;
  background: #fdf6e3;
  border: 1px solid #ecdca6;
  border-radius: 8px;
}

/* ── List ───────────────────────────────────────────────────── */
.tasks-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tasks-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted, #647184);
  margin: 8px 2px 2px;
}
.tasks-section-label.tasks-section-done { color: var(--text-meta, #8a95a3); margin-top: 18px; }

/* ── Task card ──────────────────────────────────────────────── */
.task-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface, #fffdf8);
  border: 1px solid var(--border, #d7d0c3);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16,23,34,.04);
  transition: border-color .15s ease, box-shadow .15s ease, opacity .3s ease;
}
.task-card:hover {
  border-color: var(--gold, #c18a25);
  box-shadow: 0 2px 10px rgba(193,138,37,.12);
}
.task-card.task-done { opacity: .4; }
.task-card.task-completing { opacity: .4; transition: opacity .4s ease; }

/* checkbox */
.task-check-wrap { position: relative; flex: 0 0 auto; width: 22px; height: 22px; cursor: pointer; }
.task-check { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.task-check-custom {
  position: absolute; inset: 0;
  border: 2px solid var(--border, #d7d0c3);
  border-radius: 7px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.task-check-wrap:hover .task-check-custom { border-color: var(--gold, #c18a25); }
.task-check:checked + .task-check-custom {
  background: var(--gold, #c18a25);
  border-color: var(--gold, #c18a25);
}
.task-check:checked + .task-check-custom::after {
  content: ""; position: absolute;
  left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* category pill */
.task-cat-badge {
  flex: 0 0 auto;
  font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

/* title */
.task-title { flex: 1 1 auto; font-size: 15px; font-weight: 500; color: var(--ink, #101722); line-height: 1.35; }
.task-title-done { text-decoration: line-through; opacity: .55; }

/* auto/AI completed badge */
.task-auto-badge {
  flex: 0 0 auto;
  font-size: 11px; color: var(--muted, #647184);
  white-space: nowrap;
}

/* owner chip */
.task-owner-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  margin-left: 2px;
}

/* AI button */
.task-ai-btn {
  flex: 0 0 auto;
  font-size: 12px; font-weight: 600;
  color: #fff;
  background: var(--gold, #c18a25);
  border: 1px solid var(--gold, #c18a25);
  padding: 5px 13px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s ease, transform .1s ease;
}
.task-ai-btn:hover { filter: brightness(1.07); }
.task-ai-btn:active { transform: translateY(1px); }

/* empty state */
.tasks-empty {
  margin: auto;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  color: var(--muted, #647184);
  padding: 48px 0;
}
.tasks-empty p { font-size: 15px; margin: 0; }

/* shared gold button */
.btn-gold {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600;
  color: #fff;
  background: var(--gold, #c18a25);
  border: 1px solid var(--gold, #c18a25);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.btn-gold:hover { filter: brightness(1.06); }
.btn-gold:active { transform: translateY(1px); }

/* ── Brain-dump modal ───────────────────────────────────────── */
.brain-dump-overlay {
  position: fixed; inset: 0;
  z-index: 99970;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(16,23,34,.55);
  backdrop-filter: blur(2px);
}
.brain-dump-modal {
  width: 560px; max-width: calc(100vw - 40px);
  background: var(--surface, #fffdf8);
  border: 1px solid var(--border, #d7d0c3);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(16,23,34,.32);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.brain-dump-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: #141b22;
  color: #fff;
  font-size: 15px; font-weight: 600;
}
.brain-dump-close {
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.brain-dump-close:hover { color: #fff; }
.brain-dump-hint { margin: 0; padding: 16px 20px 6px; font-size: 13px; color: var(--muted, #647184); }
.brain-dump-modal textarea {
  margin: 6px 20px;
  height: 200px;
  resize: none;
  padding: 14px;
  font-size: 14px; line-height: 1.5;
  font-family: inherit;
  color: var(--ink, #101722);
  background: var(--bg, #f6f3ec);
  border: 1px solid var(--border, #d7d0c3);
  border-radius: 10px;
}
.brain-dump-modal textarea:focus { outline: none; border-color: var(--gold, #c18a25); box-shadow: 0 0 0 3px rgba(193,138,37,.14); }
.brain-dump-actions { display: flex; align-items: center; gap: 14px; padding: 10px 20px 20px; }
.brain-dump-status { font-size: 13px; color: var(--muted, #647184); }

/* ── AI action slide-in panel (reserved dark) ───────────────── */
.ai-action-panel {
  position: fixed; top: 0; right: 0;
  width: 380px; max-width: 92vw; height: 100vh;
  z-index: 99965;
  background: #141b22;
  color: #eef2f7;
  border-left: 1px solid rgba(255,255,255,.08);
  box-shadow: -12px 0 40px rgba(16,23,34,.4);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.ai-action-panel.ai-panel-open { transform: translateX(0); }
.ai-action-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 15px; font-weight: 600;
}
.ai-action-close { background: none; border: none; color: rgba(255,255,255,.7); font-size: 18px; cursor: pointer; line-height: 1; }
.ai-action-close:hover { color: #fff; }
#ai-action-body { padding: 20px; overflow-y: auto; }
.ai-action-task { font-style: italic; font-size: 15px; line-height: 1.45; color: #f3efe6; margin: 0 0 18px; }
.ai-action-cta { margin-bottom: 16px; }
.ai-action-loading { font-size: 13px; color: rgba(255,255,255,.7); }
.ai-action-pending { font-size: 13px; color: rgba(255,255,255,.6); }
.ai-action-success { font-size: 14px; font-weight: 600; color: #5bd08a; }
.ai-action-preview {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5;
  color: #e9e4d8;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 12px;
  max-height: 340px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
  margin: 0 0 14px;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tasks-header { flex-wrap: wrap; gap: 14px; padding: 16px; }
  .tasks-head-left { min-width: 0; flex: 1 1 100%; }
  .tasks-progress { max-width: none; flex: 1 1 100%; order: 3; }
  .tasks-brain-dump-btn { order: 2; }
  .tasks-list { padding: 14px 16px 24px; }
  .task-card { flex-wrap: wrap; gap: 10px; }
  .task-title { flex: 1 1 100%; order: 5; }
  .ai-action-panel { width: 100vw; max-width: 100vw; }
  .tasks-demo-banner { margin: 12px 16px 0; }
}
