/* Second Brain — Apple-inspired productivity UI */

.prod-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease, cubic-bezier(0.25, 0.1, 0.25, 1));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.prod-tab:hover {
  color: var(--text);
  border-color: var(--border);
  transform: translateY(-1px);
}

.prod-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.28);
}

.prod-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.prod-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 32px 16px;
  text-align: center;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.prod-view-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.prod-view-toggle .btn {
  border: none;
  background: transparent;
  box-shadow: none;
}

.prod-view-toggle .btn.active {
  background: #fff;
  color: var(--accent);
  box-shadow: var(--shadow-card);
  font-weight: 600;
}

.prod-task-board .pipeline-card { cursor: grab; }
.prod-task-board .pipeline-card.dragging {
  opacity: 0.6;
  transform: rotate(1deg) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.prod-task-board .pipeline-cards.drag-over {
  background: rgba(0, 113, 227, 0.04);
  border-radius: var(--radius-sm);
  outline: 2px dashed rgba(0, 113, 227, 0.2);
  outline-offset: -2px;
}

.prod-card-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.prod-goal-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease, ease), box-shadow 0.25s;
}

.prod-goal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.prod-goal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.prod-goal-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

.prod-goal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.prod-notes {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}

.prod-task-list { display: flex; flex-direction: column; gap: 10px; }

.prod-task-item {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s var(--ease, ease), box-shadow 0.2s;
}

.prod-task-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.prod-task-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prod-task-meta { font-size: 13px; color: var(--muted); margin: 8px 0; display: flex; gap: 14px; flex-wrap: wrap; }
.prod-task-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.habit-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 15px;
  box-shadow: var(--shadow-card);
  transition: all 0.25s var(--ease, ease);
}

.habit-check-row:hover {
  border-color: var(--accent);
  box-shadow: var(--ring), var(--shadow-card);
}

.habit-check-row:has(input:checked) {
  background: rgba(0, 113, 227, 0.04);
  border-color: rgba(0, 113, 227, 0.2);
}

.habit-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.habit-streak {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: 999px;
}

.prod-habit-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s, box-shadow 0.25s;
}

.prod-habit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.prod-habit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.prod-habit-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}

.habit-week-strip { display: flex; gap: 8px; }

.habit-day {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease, ease);
}

.habit-day.done {
  color: #fff;
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.habit-day:hover:not(.done) {
  border-color: var(--accent);
  background: #fff;
}

.prod-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.prod-today-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.prod-log-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.prod-log-form .field-group { margin: 0; }

.prod-report-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.prod-report-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.chart-wrap {
  height: 240px;
  position: relative;
}

/* Modal — Apple sheet style */
.prod-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease, ease);
}

.prod-modal-backdrop.open { opacity: 1; pointer-events: auto; }

.prod-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: min(540px, 94vw);
  max-height: 88vh;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  z-index: 201;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.prod-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

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

.prod-modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.prod-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.prod-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.split-row input {
  min-width: 0;
}

.prod-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.prod-overview-stat {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  transition: transform 0.2s, background 0.2s;
  border: 1px solid transparent;
}

.prod-overview-stat:hover {
  background: #fff;
  border-color: var(--border-light);
  transform: scale(1.03);
}

.prod-overview-stat .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.prod-overview-stat .value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.03em;
}

.content-area.prod-mode .topbar-filters { display: none !important; }

/* ─── Reports layout ─────────────────────────────── */
.report-section {
  margin-bottom: 32px;
}

.report-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.report-period-label {
  font-size: 14px;
  color: var(--muted);
  margin: -8px 0 20px;
}

.report-stats {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.stat-card .value.accent { color: var(--accent); }

.report-panel-full { margin-bottom: 16px; }

.report-panel-wide { grid-column: 1 / -1; }

.panel-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.report-date-input {
  width: auto !important;
  min-width: 150px;
}

.chart-wrap-lg { height: 280px; }

.report-goal-card {
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.report-goal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.report-horizon {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.report-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.report-goal-pcts { display: flex; gap: 10px; flex-shrink: 0; }

.report-pct {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.report-pct.tasks { background: rgba(52, 199, 89, 0.12); color: #248a3d; }
.report-pct.hours { background: rgba(0, 113, 227, 0.1); color: var(--accent); }

.report-dual-bars { display: flex; flex-direction: column; gap: 8px; }

.report-bar-row {
  display: grid;
  grid-template-columns: 52px 1fr 72px;
  align-items: center;
  gap: 10px;
}

.report-bar-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.report-bar-val { font-size: 12px; font-family: var(--mono); color: var(--muted); text-align: right; }

.gpr-fill.tasks { background: #34c759 !important; }
.gpr-fill.hours { background: var(--accent) !important; }

.habit-heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.habit-heatmap-table th,
.habit-heatmap-table td {
  padding: 6px 4px;
  text-align: center;
}

.habit-heatmap-table .hm-label {
  text-align: left;
  white-space: nowrap;
  font-weight: 500;
  padding-right: 12px;
}

.hm-th { font-size: 10px; color: var(--muted); font-weight: 600; }

.hm-cell {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border-light);
  transition: transform 0.15s;
}

.hm-cell.done {
  border-color: transparent;
  transform: scale(1.05);
}

.report-pct-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.report-log-table .mono { font-family: var(--mono); font-size: 12px; }
.report-log-table .muted-cell { color: var(--muted); font-size: 12px; max-width: 200px; }

.report-top-task {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.report-top-task:last-child { border-bottom: none; }

.report-top-task-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.report-top-task-head .mono {
  margin-left: auto;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--accent);
}

.report-top-task-goal {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.report-export-pre {
  white-space: pre-wrap;
  font-size: 12px;
  max-height: 400px;
  overflow: auto;
  font-family: var(--mono);
}

.prod-report-charts .report-panel-wide {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .prod-report-charts .report-panel-wide {
    grid-column: span 1;
  }

  .report-bar-row {
    grid-template-columns: 48px 1fr 60px;
  }

  .habit-heatmap-table { font-size: 10px; }
  .hm-cell { width: 22px; height: 22px; }

  .report-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .report-stats { grid-template-columns: 1fr; }
  .report-goal-pcts { width: 100%; }
}

.gpr-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.gpr-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent) !important;
  transition: width 0.6s var(--ease, ease);
}

@media (max-width: 900px) {
  .prod-today-layout,
  .prod-report-charts,
  .prod-report-bottom {
    grid-template-columns: 1fr !important;
  }

  .prod-overview-grid { grid-template-columns: repeat(2, 1fr); }

  .prod-goal-head { flex-direction: column; }

  .prod-goal-actions { width: 100%; }

  .habit-week-strip { flex-wrap: wrap; }

  .habit-day { flex: 1 1 calc(14% - 8px); min-width: 36px; }

  .prod-modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

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

  .prod-log-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .prod-tabs { gap: 6px; }

  .prod-tab { padding: 6px 12px; font-size: 12px; }

  .prod-toolbar { flex-direction: column; align-items: stretch; }

  .prod-toolbar .btn-primary { width: 100%; }
}
