/* ── Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg:           oklch(96.5% 0.008 65);
  --surface:      oklch(99.5% 0.004 65);
  --surface-2:    oklch(93%   0.012 65);
  --border:       oklch(87%   0.016 65);
  --text:         oklch(13%   0.018 65);
  --text-muted:   oklch(52%   0.022 65);
  --accent:       oklch(71%   0.19  52);
  --accent-hi:    oklch(64%   0.20  52);
  --accent-dim:   oklch(92%   0.07  52);
  --success:      oklch(68%   0.17  155);
  --danger:       oklch(60%   0.22  22);

  --ff-display: 'Barlow Condensed', sans-serif;
  --ff-body:    'Figtree', sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --sh: 0 1px 2px oklch(0% 0 0 / .06), 0 2px 6px oklch(0% 0 0 / .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         oklch(12%  0.014 65);
    --surface:    oklch(17%  0.014 65);
    --surface-2:  oklch(22%  0.016 65);
    --border:     oklch(30%  0.018 65);
    --text:       oklch(95%  0.008 65);
    --text-muted: oklch(60%  0.018 65);
    --accent:     oklch(76%  0.17  52);
    --accent-hi:  oklch(82%  0.15  52);
    --accent-dim: oklch(24%  0.06  52);
    --success:    oklch(72%  0.15  155);
    --danger:     oklch(68%  0.19  22);
  }
}
[data-theme="dark"] {
  --bg:         oklch(12%  0.014 65);
  --surface:    oklch(17%  0.014 65);
  --surface-2:  oklch(22%  0.016 65);
  --border:     oklch(30%  0.018 65);
  --text:       oklch(95%  0.008 65);
  --text-muted: oklch(60%  0.018 65);
  --accent:     oklch(76%  0.17  52);
  --accent-hi:  oklch(82%  0.15  52);
  --accent-dim: oklch(24%  0.06  52);
  --success:    oklch(72%  0.15  155);
  --danger:     oklch(68%  0.19  22);
}
[data-theme="light"] {
  --bg:         oklch(96.5% 0.008 65);
  --surface:    oklch(99.5% 0.004 65);
  --surface-2:  oklch(93%   0.012 65);
  --border:     oklch(87%   0.016 65);
  --text:       oklch(13%   0.018 65);
  --text-muted: oklch(52%   0.022 65);
  --accent:     oklch(71%   0.19  52);
  --accent-hi:  oklch(64%   0.20  52);
  --accent-dim: oklch(92%   0.07  52);
  --success:    oklch(68%   0.17  155);
  --danger:     oklch(60%   0.22  22);
}

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

html, body {
  height: 100%;
  font-family: var(--ff-body);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon {
  width: 20px; height: 20px;
  display: block;
  flex-shrink: 0;
}

/* ── App shell ────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
}

/* ── Header ───────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}

.header-logo {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .04em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 7px;
  border-radius: var(--r-sm);
  line-height: 1;
  flex-shrink: 0;
}

.header-logo-img {
  width: 30px; height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

header h1 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: .01em;
  color: var(--text);
  flex: 1;
}

.header-actions {
  display: flex;
  gap: 4px;
}

.header-actions button {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.header-actions button:active { background: var(--surface-2); }
.header-actions button.active { color: var(--accent); border-color: var(--accent-dim); }

/* ── Main scroll area ─────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 80px;
  overscroll-behavior: contain;
}

/* ── Bottom nav ───────────────────────────────────────────────────────── */
nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--ff-body);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tab-btn .icon { width: 22px; height: 22px; }
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

/* ── Tab content ──────────────────────────────────────────────────────── */
.tab-content {
  display: none;
  animation: fadeUp .2s ease;
}
.tab-content.active { display: block; }

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

/* ── FAB ──────────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom));
  right: max(16px, calc(50% - 224px));
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: oklch(99% 0.004 65);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px oklch(71% 0.19 52 / .35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  z-index: 5;
}
.fab .icon { width: 24px; height: 24px; }
.fab:active { background: var(--accent-hi); transform: scale(.93); }

/* ── Date heading ─────────────────────────────────────────────────────── */
.date-heading {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── Section label ────────────────────────────────────────────────────── */
.section-label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* HUMOR / DIÁRIO                                                          */
/* ─────────────────────────────────────────────────────────────────────── */

.mood-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--sh);
}

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

.mood-insights-link {
  font-size: .72rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.mood-picker {
  display: flex;
  justify-content: space-around;
  gap: 6px;
  margin-bottom: 4px;
}

.mood-btn {
  flex: 1;
  aspect-ratio: 1;
  font-size: 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.mood-btn:active { transform: scale(.9); }
.mood-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.1);
}

.mood-insights {
  margin-top: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}

.mood-insight-line {
  font-size: .8rem;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.mood-insight-line:last-child { border-bottom: none; }

/* ─────────────────────────────────────────────────────────────────────── */
/* GAMIFICAÇÃO                                                             */
/* ─────────────────────────────────────────────────────────────────────── */

.xp-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--sh);
}

.xp-streak {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 52px;
}

.xp-flame {
  font-size: 1.6rem;
  line-height: 1;
  animation: flamePulse 2s ease-in-out infinite;
}

@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

.xp-streak-num {
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.xp-streak-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.xp-right { flex: 1; min-width: 0; }

.xp-level-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.xp-bar-wrap {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.xp-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.xp-label {
  font-size: .7rem;
  color: var(--text-muted);
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.badge-chip {
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent-hi);
  white-space: nowrap;
  cursor: default;
}
[data-theme="dark"] .badge-chip { color: var(--accent); }

.xp-flash {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--accent);
  color: oklch(15% 0.018 65);
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 6px 16px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: none;
}
.xp-flash.xp-flash-go {
  animation: xpFly .85s cubic-bezier(.2,.8,.4,1) forwards;
}
@keyframes xpFly {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0); }
  20%  { opacity: 1; transform: translateX(-50%) translateY(-8px); }
  80%  { opacity: 1; transform: translateX(-50%) translateY(-24px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-32px); }
}

/* ─────────────────────────────────────────────────────────────────────── */
/* HOJE TAB                                                                */
/* ─────────────────────────────────────────────────────────────────────── */

.activity-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: none; }
.activity-row.is-done { opacity: .5; }

.activity-num {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
  line-height: 1;
}
.activity-row.is-done .activity-num { color: var(--text-muted); }

.activity-body { flex: 1; min-width: 0; }

.activity-name {
  font-weight: 600;
  font-size: .975rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.activity-meta {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.activity-logged {
  font-size: .75rem;
  color: var(--success);
  font-weight: 500;
  margin-top: 3px;
}

.btn-check {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  -webkit-tap-highlight-color: transparent;
}
.btn-check .icon { width: 16px; height: 16px; opacity: 0; transition: opacity .2s; }
.btn-check:active { transform: scale(.88); }
.btn-check.is-done {
  background: var(--success);
  border-color: var(--success);
  color: oklch(99% 0 0);
}
.btn-check.is-done .icon { opacity: 1; }

/* ─────────────────────────────────────────────────────────────────────── */
/* PROGRESSO TAB                                                           */
/* ─────────────────────────────────────────────────────────────────────── */

.weight-entry {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--sh);
}

.weight-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

#weight-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}
#weight-input:focus { border-color: var(--accent); }

.weight-unit-label {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.weight-hero {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 0 16px;
  justify-content: center;
}

.weight-hero-num {
  font-family: var(--ff-display);
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  letter-spacing: -.02em;
}

.weight-hero-unit {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 8px;
}

.progress-block {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--sh);
}

.progress-track {
  position: relative;
  height: 10px;
  background: var(--surface-2);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  border-radius: 5px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.progress-marker {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 3px;
  background: var(--accent-hi);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left .6s cubic-bezier(.4,0,.2,1);
}

.progress-anchors {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 500;
}

.progress-stats {
  display: flex;
  gap: 0;
}

.pstat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 0;
}

.pstat + .pstat {
  border-left: 1px solid var(--border);
}

.pstat-val {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.pstat-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  color: var(--text-muted);
}

.chart-block {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh);
}

#weight-chart { width: 100%; display: block; margin-top: 10px; }
.empty-inline { font-size: .875rem; color: var(--text-muted); padding: 24px 0 8px; text-align: center; }

/* ─────────────────────────────────────────────────────────────────────── */
/* NUTRIÇÃO TAB                                                            */
/* ─────────────────────────────────────────────────────────────────────── */

.metrics-list {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 0 16px;
  margin-bottom: 12px;
  box-shadow: var(--sh);
}

.metric-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.metric-row:last-child { border-bottom: none; }

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.metric-name {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}

.metric-goal {
  display: block;
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.metric-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.metric-input {
  width: 72px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: right;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}
.metric-input:focus { border-color: var(--accent); }

.metric-unit {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 22px;
}

.metric-bar {
  height: 5px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .4s cubic-bezier(.4,0,.2,1), background .3s;
}
.metric-bar-fill.done { background: var(--success); }

.notes-textarea {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--ff-body);
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  resize: none;
  height: 80px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color .15s;
}
.notes-textarea:focus { border-color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────── */
/* ATIVIDADES TAB                                                          */
/* ─────────────────────────────────────────────────────────────────────── */

.act-item {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--sh);
  display: flex;
  align-items: center;
  gap: 12px;
}

.act-item-body { flex: 1; min-width: 0; }

.act-name {
  font-weight: 600;
  font-size: .975rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.day-tag {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent-hi);
}
[data-theme="dark"] .day-tag { color: var(--accent); }

.act-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background .2s;
  cursor: pointer;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px oklch(0% 0 0 / .2);
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::before { transform: translateX(18px); }

/* Icon buttons */
.btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon .icon { width: 16px; height: 16px; }
.btn-icon:active { background: var(--surface-2); }
.btn-icon.danger:active { color: var(--danger); }

/* ─────────────────────────────────────────────────────────────────────── */
/* SHARED BUTTONS                                                          */
/* ─────────────────────────────────────────────────────────────────────── */

.btn-accent {
  padding: 10px 18px;
  background: var(--accent);
  color: oklch(15% 0.018 65);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--ff-body);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-accent:active { background: var(--accent-hi); transform: scale(.97); }

.btn-full {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: oklch(15% 0.018 65);
  border: none;
  border-radius: var(--r-lg);
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 8px;
}
.btn-full:active { background: var(--accent-hi); }

.btn-ghost {
  flex: 1;
  padding: 14px;
  border: 1.5px solid var(--border);
  background: none;
  border-radius: var(--r-md);
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s;
}
.btn-ghost:active { background: var(--surface-2); }

/* ─────────────────────────────────────────────────────────────────────── */
/* MODAL                                                                   */
/* ─────────────────────────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(5% 0 0 / .55);
  z-index: 20;
  align-items: flex-end;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  max-height: 90dvh;
  overflow-y: auto;
}

.modal h2 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.label-hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .72rem; }

.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--ff-body);
  font-size: 1rem;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: none; height: 72px; }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-modal-save { flex: 2; padding: 14px; font-size: 1rem; border-radius: var(--r-md); }

/* Day picker */
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-btn {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-family: var(--ff-body);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.day-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: oklch(15% 0.018 65);
}

/* ─────────────────────────────────────────────────────────────────────── */
/* METAS                                                                   */
/* ─────────────────────────────────────────────────────────────────────── */

.goals-block {
  margin-bottom: 14px;
}

#goals-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  box-shadow: var(--sh);
  transition: border-color .3s;
}
.goal-card.goal-done {
  border: 1.5px solid var(--success);
}

.goal-ring {
  width: 54px; height: 54px;
  flex-shrink: 0;
}

.goal-body { flex: 1; min-width: 0; }

.goal-title {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 3px;
}

.goal-desc {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Confetti */
.confetti-piece {
  position: fixed;
  top: -10px;
  pointer-events: none;
  z-index: 100;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────────────── */
/* RELATÓRIO SEMANAL                                                       */
/* ─────────────────────────────────────────────────────────────────────── */

.report-block {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--sh);
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.report-header .section-label { margin-bottom: 0; }

.report-rate {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.report-meta {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.report-projection {
  font-size: .8rem;
  color: var(--text);
  background: var(--accent-dim);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.report-act-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.report-act-row:last-child { border-bottom: none; }

.report-act-name {
  font-size: .8rem;
  font-weight: 500;
  flex-shrink: 0;
  min-width: 0;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-act-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.report-act-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.report-act-bar-fill.done { background: var(--success); }

.report-act-pct {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* HEATMAP                                                                 */
/* ─────────────────────────────────────────────────────────────────────── */

.heatmap-block {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--sh);
}

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

.heatmap-header .section-label { margin-bottom: 0; }

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

.heatmap-legend-label {
  font-size: .65rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.heatmap-scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.heatmap-days-col {
  display: grid;
  grid-template-rows: 14px repeat(7, 11px);
  gap: 2px;
  flex-shrink: 0;
}

.heatmap-days-col span {
  font-size: .58rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 11px;
  white-space: nowrap;
}

.heatmap-grid {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.hm-week {
  display: grid;
  grid-template-rows: 14px repeat(7, 11px);
  gap: 2px;
}

.hm-month-label {
  font-size: .6rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  line-height: 14px;
}

.hm-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity .1s;
  flex-shrink: 0;
}
.hm-cell:active { opacity: .7; }

.hm-cell.lv0 { background: var(--surface-2); }
.hm-cell.lv1 { background: oklch(68% 0.17 155 / .35); }
.hm-cell.lv2 { background: oklch(68% 0.17 155 / .65); }
.hm-cell.lv3 { background: oklch(68% 0.17 155); }
.hm-cell.lv-none { background: var(--surface-2); opacity: .3; }

[data-theme="dark"] .hm-cell.lv1 { background: oklch(72% 0.15 155 / .3); }
[data-theme="dark"] .hm-cell.lv2 { background: oklch(72% 0.15 155 / .6); }
[data-theme="dark"] .hm-cell.lv3 { background: oklch(72% 0.15 155); }

.heatmap-tooltip {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: .78rem;
  color: var(--text);
  border-left: 3px solid var(--success);
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* EMOJI PICKER                                                            */
/* ─────────────────────────────────────────────────────────────────────── */

.act-icon {
  margin-right: 5px;
  font-size: 1em;
  line-height: 1;
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
}

.emoji-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  transition: background .1s, border-color .1s;
  -webkit-tap-highlight-color: transparent;
}
.emoji-btn:active { background: var(--surface); }
.emoji-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ─────────────────────────────────────────────────────────────────────── */
/* HISTÓRICO TAB                                                           */
/* ─────────────────────────────────────────────────────────────────────── */

.hist-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

#hist-search {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--ff-body);
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
#hist-search:focus { border-color: var(--accent); }

.hist-export-btns { display: flex; gap: 6px; flex-shrink: 0; }

.btn-sm {
  padding: 8px 12px;
  font-size: .75rem;
  border-radius: var(--r-sm);
}

.hist-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.hist-month-title {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .03em;
  color: var(--text);
}

.hist-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 16px;
}

.hist-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 0;
}
.hist-cell:active { opacity: .7; }
.hist-cell-hdr {
  background: none;
  cursor: default;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.hist-cell-empty { background: none; cursor: default; }

.hist-cell-num {
  font-family: var(--ff-display);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}

.hist-cell.hc-low     { background: oklch(68% 0.17 155 / .2); }
.hist-cell.hc-partial { background: oklch(68% 0.17 155 / .5); }
.hist-cell.hc-full    { background: oklch(68% 0.17 155); }
.hist-cell.hc-full .hist-cell-num { color: oklch(15% 0 0); }

.hist-day-detail {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh);
}

.hist-day-title {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hist-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.hist-timeline-item:last-child { border-bottom: none; }

.hist-tl-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1.4; }

.hist-tl-body { flex: 1; min-width: 0; }

.hist-tl-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}

.hist-tl-time {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* EMPTY STATES                                                            */
/* ─────────────────────────────────────────────────────────────────────── */

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px;
  font-size: .9rem;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* LOGIN OVERLAY                                                           */
/* ─────────────────────────────────────────────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px 28px;
  box-shadow: 0 8px 32px oklch(0% 0 0 / .08);
}

.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .04em;
  margin: 0 0 4px;
  color: var(--text);
}

.login-sub {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-error {
  font-size: .82rem;
  color: oklch(55% .18 25);
  margin-top: 6px;
  text-align: center;
}

.login-success {
  font-size: .82rem;
  color: var(--success);
  margin-top: 8px;
  text-align: center;
  line-height: 1.45;
}

.login-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font-size: 1rem;
}

#login-form {
  width: 100%;
}

#password-login-form {
  width: 100%;
  margin-top: 12px;
}

.login-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  margin-top: 12px;
  padding: 8px;
  cursor: pointer;
}
