/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MultiTarefas — Dashboard de Revisão Semanal
   dashboard.css
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

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

/* ── DARK MODE (default) ─────────────────────────────────────────── */
:root {
  --bg:           #0b0e1a;
  --surface:      #111627;
  --surface2:     #161d35;
  --surface3:     #1c2540;
  --border:       #1e2740;
  --text:         #e8ecf4;
  --muted:        #6b7799;

  --exec:         #00d4a1;
  --exec-bg:      rgba(0, 212, 161, 0.08);
  --exec-border:  rgba(0, 212, 161, 0.25);

  --pend:         #f59e0b;
  --pend-bg:      rgba(245, 158, 11, 0.08);
  --pend-border:  rgba(245, 158, 11, 0.25);

  --done:         #6366f1;
  --done-bg:      rgba(99, 102, 241, 0.08);
  --done-border:  rgba(99, 102, 241, 0.25);

  --accent:       #6366f1;
  --accent-glow:  rgba(99, 102, 241, 0.3);

  --danger:       #f87171;
  --danger-bg:    rgba(248, 113, 113, 0.08);

  --noise-opacity: 0.03;
  --toggle-icon:  '☀️';
}

/* ── LIGHT MODE ──────────────────────────────────────────────────── */
body.light {
  --bg:           #f7f8fc;
  --surface:      #ffffff;
  --surface2:     #f0f1f8;
  --surface3:     #e8eaf2;
  --border:       #e2e4ea;
  --text:         #1a2038;
  --muted:        #8892a4;

  --exec:         #059669;
  --exec-bg:      rgba(5, 150, 105, 0.08);
  --exec-border:  rgba(5, 150, 105, 0.25);

  --pend:         #d97706;
  --pend-bg:      rgba(217, 119, 6, 0.08);
  --pend-border:  rgba(217, 119, 6, 0.25);

  --done:         #4f46e5;
  --done-bg:      rgba(79, 70, 229, 0.08);
  --done-border:  rgba(79, 70, 229, 0.25);

  --accent:       #4f46e5;
  --accent-glow:  rgba(79, 70, 229, 0.2);

  --danger:       #dc2626;
  --danger-bg:    rgba(220, 38, 38, 0.07);

  --noise-opacity: 0.015;
  --toggle-icon:  '🌙';
}

/* ── BASE ───────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  padding: 2rem 1.5rem 5rem;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: var(--noise-opacity);
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── HEADER ─────────────────────────────────────────────────────── */
header {
  margin-bottom: 1.75rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 1rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  box-shadow: 0 0 24px var(--accent-glow);
  flex-shrink: 0;
}

h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

h1 span {
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.date-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .4rem 1rem;
  font-size: .8rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .82rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: none;
  white-space: nowrap;
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 14px var(--accent-glow);
}
.btn-primary:hover { opacity: .88; }

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, .25);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(248, 113, 113, .18); }

.btn-green {
  background: var(--exec-bg);
  border: 1px solid var(--exec-border);
  color: var(--exec);
}
.btn-green:hover { background: rgba(0, 212, 161, .15); }

.btn-sm { padding: .35rem .75rem; font-size: .75rem; }

/* ── SUMMARY CARDS ──────────────────────────────────────────────── */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  cursor: default;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.4); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 14px 14px 0 0;
}
.stat-card.total::before  { background: linear-gradient(90deg, var(--accent), #818cf8); }
.stat-card.s-exec::before { background: var(--exec); }
.stat-card.s-pend::before { background: var(--pend); }
.stat-card.s-done::before { background: var(--done); }
.stat-card.s-team::before { background: #ec4899; }

.stat-num {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: .2rem;
}
.stat-card.total  .stat-num { color: var(--accent); }
.stat-card.s-exec .stat-num { color: var(--exec); }
.stat-card.s-pend .stat-num { color: var(--pend); }
.stat-card.s-done .stat-num { color: var(--done); }
.stat-card.s-team .stat-num { color: #ec4899; }

.stat-label {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── TOOLBAR ────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.filter-bar { display: flex; gap: .4rem; flex-wrap: wrap; }

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: .38rem 1rem;
  font-size: .8rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}
.filter-btn.exec-btn.active {
  background: var(--exec);
  border-color: var(--exec);
  box-shadow: 0 0 12px rgba(0, 212, 161, .3);
  color: #0b0e1a;
}
.filter-btn.pend-btn.active {
  background: var(--pend);
  border-color: var(--pend);
  box-shadow: 0 0 12px rgba(245, 158, 11, .3);
  color: #0b0e1a;
}
.filter-btn.done-btn.active {
  background: var(--done);
  border-color: var(--done);
  color: #fff;
}

.tool-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── LEGEND ─────────────────────────────────────────────────────── */
.legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--muted);
}
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }

/* ── TEAM GRID ──────────────────────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.25rem;
}

/* ── PERSON CARD ────────────────────────────────────────────────── */
.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow .25s, transform .25s;
  animation: fadeUp .4s ease both;
}
.person-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  transform: translateY(-3px);
}
.person-card.hidden { display: none; }

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

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

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  flex-shrink: 0;
}

.person-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
}
.person-meta { font-size: .72rem; color: var(--muted); margin-top: 1px; }

.person-badges {
  margin-left: auto;
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
  align-items: center;
}

.badge { border-radius: 999px; padding: .18rem .55rem; font-size: .68rem; font-weight: 600; }
.badge-e { background: var(--exec-bg); color: var(--exec); border: 1px solid var(--exec-border); }
.badge-p { background: var(--pend-bg); color: var(--pend); border: 1px solid var(--pend-border); }
.badge-d { background: var(--done-bg); color: var(--done); border: 1px solid var(--done-border); }

.edit-person-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 6px;
  font-size: .85rem;
  transition: all .2s;
  flex-shrink: 0;
}
.edit-person-btn:hover { background: var(--surface3); color: var(--text); }

/* ── LOAD BAR ───────────────────────────────────────────────────── */
.load-bar-wrap {
  padding: .65rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.load-bar-label {
  font-size: .7rem;
  color: var(--muted);
  margin-bottom: .3rem;
  display: flex;
  justify-content: space-between;
}
.load-bar { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.load-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--exec), var(--pend));
}

/* ── SECTION LABEL ──────────────────────────────────────────────── */
.section-label {
  padding: .6rem 1.25rem .25rem;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-label.exec { color: var(--exec); }
.section-label.pend { color: var(--pend); }
.section-label.done { color: var(--done); }

.add-proj-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: .75rem;
  opacity: .6;
  padding: .1rem .3rem;
  border-radius: 4px;
  transition: opacity .2s;
}
.add-proj-btn:hover { opacity: 1; }

/* ── PROJECT ITEM ───────────────────────────────────────────────── */
.project-item {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .45rem 1.25rem;
  transition: background .15s;
  position: relative;
}
.project-item:hover { background: rgba(255,255,255,.03); }
.project-item:hover .proj-actions { opacity: 1; }
.project-item:last-child { padding-bottom: 1rem; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.dot-exec { background: var(--exec); box-shadow: 0 0 6px var(--exec); }
.dot-pend { background: var(--pend); box-shadow: 0 0 6px var(--pend); }
.dot-done { background: var(--done); box-shadow: 0 0 6px var(--done); }

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

.proj-name-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.proj-name  { font-size: .84rem; line-height: 1.4; color: var(--text); }
.date-inline { flex-shrink: 0; }
.proj-note  { font-size: .7rem; color: var(--muted); margin-top: 2px; }

.proj-actions {
  display: flex;
  gap: .25rem;
  opacity: 0;
  transition: opacity .2s;
  flex-shrink: 0;
  margin-top: 1px;
}
.proj-act-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: .15rem .3rem;
  border-radius: 4px;
  font-size: .75rem;
  color: var(--muted);
  transition: all .15s;
}
.proj-act-btn:hover     { background: var(--surface3); color: var(--text); }
.proj-act-btn.del:hover { color: var(--danger); }

/* ── META PILLS ─────────────────────────────────────────────────── */
.proj-meta-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border-radius: 6px;
  padding: .15rem .5rem;
  font-size: .66rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s;
  border: 1px dashed transparent;
}
.meta-pill:hover { opacity: .8; border-color: var(--border); }

.meta-pill.date-pill          { background: rgba(99,102,241,.12); color: #a5b4fc; border-color: rgba(99,102,241,.2); }
.meta-pill.date-pill.overdue  { background: rgba(248,113,113,.12); color: var(--danger); border-color: rgba(248,113,113,.25); }
.meta-pill.date-pill.soon     { background: rgba(245,158,11,.12); color: var(--pend); border-color: rgba(245,158,11,.2); }
.meta-pill.resp-pill          { background: rgba(0,212,161,.08); color: var(--exec); border-color: rgba(0,212,161,.15); }
.meta-pill.empty              { background: rgba(107,119,153,.08); color: var(--muted); border-style: dashed; }

/* ── EMPTY SECTION ──────────────────────────────────────────────── */
.empty-section {
  padding: .4rem 1.25rem .8rem;
  font-size: .75rem;
  color: var(--muted);
  font-style: italic;
}

/* ── FOOTER ─────────────────────────────────────────────────────── */
footer {
  margin-top: 3rem;
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

/* ── TOAST ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem 1.25rem;
  font-size: .82rem;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  transition: transform .3s ease, opacity .3s;
  opacity: 0;
  z-index: 200;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── MODALS ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: none;
  place-items: center;
  padding: 1rem;
}
.modal-overlay.open { display: grid; }

.modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.75rem;
  width: min(500px, 100%);
  animation: modalIn .2s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}

.modal label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
  margin-top: 1rem;
}
.modal label:first-of-type { margin-top: 0; }

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .88rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s;
  resize: vertical;
}
.modal input:focus,
.modal select:focus,
.modal textarea:focus { border-color: var(--accent); }
.modal select option  { background: var(--surface2); }

.modal-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── RADIO GROUP ────────────────────────────────────────────────── */
.radio-group { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }

.radio-opt {
  padding: .4rem .9rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .2s;
  user-select: none;
}
.radio-opt:hover { border-color: var(--accent); color: var(--text); }
.radio-opt.sel-exec { background: var(--exec-bg); color: var(--exec); border-color: var(--exec-border); }
.radio-opt.sel-pend { background: var(--pend-bg); color: var(--pend); border-color: var(--pend-border); }
.radio-opt.sel-done { background: var(--done-bg); color: var(--done); border-color: var(--done-border); }

/* ── DROP ZONE (import) ─────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  margin-top: .5rem;
}
.drop-zone:hover,
.drop-zone.drag { border-color: var(--accent); background: rgba(99,102,241,.05); }
.drop-zone p    { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.drop-zone .icon { font-size: 2rem; }

/* ── VIEW TOGGLE ─────────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.view-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: .38rem .9rem;
  font-size: .8rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.view-btn:hover { color: var(--text); }
.view-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 10px var(--accent-glow);
}

/* ── LIST TOOLBAR ────────────────────────────────────────────────── */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}

.list-search-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .85rem;
  flex: 1;
  max-width: 360px;
  transition: border-color .2s;
}
.list-search-wrap:focus-within { border-color: var(--accent); }
.list-search-icon { font-size: .85rem; flex-shrink: 0; }
.list-search {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .85rem;
  font-family: 'Inter', sans-serif;
  width: 100%;
}
.list-search::placeholder { color: var(--muted); }

.list-sort-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.list-sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .38rem .75rem;
  font-size: .8rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}
.list-sort-select:focus { border-color: var(--accent); }
.list-sort-select option { background: var(--surface2); }

/* ── LIST TABLE ──────────────────────────────────────────────────── */
.list-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table thead tr {
  border-bottom: 1px solid var(--border);
}

.list-table th {
  padding: .7rem 1rem;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}

.list-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  animation: fadeUp .3s ease both;
}
.list-table tbody tr:last-child { border-bottom: none; }
.list-table tbody tr:hover { background: rgba(255,255,255,.03); }

.list-table td {
  padding: .7rem 1rem;
  font-size: .84rem;
  vertical-align: middle;
}

/* status badge in table */
.list-status {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}
.list-status.exec { background: var(--exec-bg); color: var(--exec); border: 1px solid var(--exec-border); }
.list-status.pend { background: var(--pend-bg); color: var(--pend); border: 1px solid var(--pend-border); }
.list-status.done { background: var(--done-bg); color: var(--done); border: 1px solid var(--done-border); opacity: .7; }

/* person chip in table */
.list-person {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
}
.list-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .6rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  color: #fff;
  flex-shrink: 0;
}

/* date in table */
.list-date {
  font-size: .78rem;
  white-space: nowrap;
}
.list-date.overdue { color: var(--danger); }
.list-date.soon    { color: var(--pend); }
.list-date.ok      { color: #a5b4fc; }
.list-date.empty   { color: var(--muted); font-style: italic; }

/* note in table */
.list-note {
  font-size: .75rem;
  color: var(--muted);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* actions in table */
.list-actions { display: flex; gap: .25rem; justify-content: flex-end; }

/* task name done */
.list-name-done {
  opacity: .45;
  text-decoration: line-through;
}

/* empty state */
.list-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: .85rem;
  font-style: italic;
}

/* ── TEAM TABS ───────────────────────────────────────────────────── */
.team-tabs-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.team-tabs {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}

.team-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.1rem;
  border-radius: 10px 10px 0 0;
  font-size: .83rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--muted);
  background: transparent;
  transition: all .2s;
  position: relative;
  bottom: -1px;
  user-select: none;
}
.team-tab:hover { color: var(--text); background: var(--surface); }

.team-tab.active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  color: var(--text);
}
.team-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.team-tab-icon { font-size: 1rem; }
.team-tab-name { font-family: 'Inter', sans-serif; font-weight: 600; }

.team-tab-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: .72rem;
  opacity: 0;
  padding: .1rem .2rem;
  border-radius: 4px;
  transition: opacity .15s, background .15s;
  color: var(--muted);
}
.team-tab:hover .team-tab-edit { opacity: 1; }
.team-tab-edit:hover { background: var(--surface3); }

.add-team-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: .38rem .85rem;
  font-size: .78rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 1px;
}
.add-team-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── EMPTY TEAM STATE ────────────────────────────────────────────── */
.empty-team {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
}

/* ── PDF BUTTON ──────────────────────────────────────────────────── */
.btn-pdf {
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .25);
  color: #f87171;
}
.btn-pdf:hover { background: rgba(239, 68, 68, .16); }

/* ── LIGHT MODE OVERRIDES ────────────────────────────────────────── */

/* load-bar gradient adapts automatically via CSS vars */
body.light .load-bar-fill {
  background: linear-gradient(90deg, var(--exec), var(--pend));
}

/* modal inputs */
body.light .modal input,
body.light .modal select,
body.light .modal textarea {
  background: var(--surface2);
  color: var(--text);
}

/* filter btn active states */
body.light .filter-btn.exec-btn.active {
  color: #ffffff;
  background: var(--exec);
  border-color: var(--exec);
  box-shadow: 0 0 10px rgba(5,150,105,.25);
}
body.light .filter-btn.pend-btn.active {
  color: #ffffff;
  background: var(--pend);
  border-color: var(--pend);
  box-shadow: 0 0 10px rgba(217,119,6,.25);
}

/* stat cards */
body.light .stat-card {
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
body.light .stat-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

/* person cards */
body.light .person-card {
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
body.light .person-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
}

/* dot glows — lighter in light mode */
body.light .dot-exec { box-shadow: 0 0 4px rgba(5,150,105,.5); }
body.light .dot-pend { box-shadow: 0 0 4px rgba(217,119,6,.5); }
body.light .dot-done { box-shadow: 0 0 4px rgba(79,70,229,.5); }

/* legend dots */
body.light .legend-dot { opacity: .9; }

/* project item hover */
body.light .project-item:hover { background: rgba(0,0,0,.025); }

/* list table */
body.light .list-table-wrap {
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
body.light .list-table thead tr {
  background: var(--surface2);
}
body.light .list-table tbody tr:hover {
  background: rgba(79,70,229,.03);
}

/* toast */
body.light .toast {
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

/* view toggle active */
body.light .view-btn.active {
  box-shadow: inset 0 0 8px rgba(79,70,229,.15);
}

/* team tab active underline */
body.light .team-tab.active::after {
  background: var(--accent);
}

/* PDF button in light */
body.light .btn-pdf {
  background: rgba(220,38,38,.06);
  border-color: rgba(220,38,38,.2);
  color: #dc2626;
}
body.light .btn-pdf:hover { background: rgba(220,38,38,.12); }

/* ── THEME TOGGLE BUTTON ─────────────────────────────────────────── */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .82rem;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  white-space: nowrap;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}
.theme-toggle .toggle-track {
  width: 32px;
  height: 18px;
  border-radius: 99px;
  background: var(--border);
  position: relative;
  transition: background .25s;
  flex-shrink: 0;
}
.theme-toggle .toggle-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform .25s, background .25s;
}
body.light .theme-toggle .toggle-track { background: var(--accent); }
body.light .theme-toggle .toggle-thumb {
  transform: translateX(14px);
  background: #fff;
}

/* transition for smooth theme switch */
body {
  transition: background .3s, color .3s;
}
.person-card, .stat-card, .modal, .list-table-wrap,
.filter-btn, .btn, .team-tab, .view-toggle, .toast {
  transition: background .3s, border-color .3s, color .3s, box-shadow .3s;
}

/* ── LOGO UPLOAD ─────────────────────────────────────────────────── */
.logo-upload-wrap {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
  cursor: pointer;
}
.logo-upload-wrap:hover .logo-upload-hint { opacity: 1; }
.logo-upload-wrap:hover .logo-icon,
.logo-upload-wrap:hover #logoImg { opacity: .75; }
.logo-upload-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.45);
  border-radius: 10px;
  font-size: .9rem; color: #fff; font-weight: 700;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}

/* ── ORG IDENTITY IN HEADER ──────────────────────────────────────── */
#orgNameDisplay {
  font-size: .78rem;
  color: var(--text);
  font-weight: 600;
}
#orgDeptDisplay {
  font-size: .7rem;
  color: var(--muted);
}
#orgIdentityDisplay button:hover #orgPlaceholder {
  color: var(--accent);
}

/* ── AVATAR INITIALS FIX ─────────────────────────────────────────── */
.avatar {
  font-size: .7rem !important;
  letter-spacing: -.01em;
  overflow: hidden;
  word-break: break-all;
  line-height: 1;
  text-align: center;
  padding: 2px;
}

/* ── SAVE INDICATOR ──────────────────────────────────────────────── */
.save-indicator {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all .4s ease;
  white-space: nowrap;
  min-width: 90px;
  justify-content: center;
}

.save-indicator.saving {
  color: var(--pend);
  border-color: var(--pend-border);
  background: var(--pend-bg);
}

.save-indicator.saved {
  color: var(--exec);
  border-color: var(--exec-border);
  background: var(--exec-bg);
}

.save-indicator.error {
  color: var(--danger);
  border-color: rgba(248,113,113,.25);
  background: var(--danger-bg);
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  transition: background .3s;
  flex-shrink: 0;
}

.save-indicator.saving .save-dot {
  background: var(--pend);
  animation: pulse 1s ease infinite;
}

.save-indicator.saved .save-dot {
  background: var(--exec);
}

.save-indicator.error .save-dot {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.7); }
}

/* ── IMPROVED TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1.4rem;
  font-size: .84rem;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .35s;
  opacity: 0;
  z-index: 200;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
  pointer-events: none;
}

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

.toast.toast-success { border-color: var(--exec-border); }
.toast.toast-error   { border-color: rgba(248,113,113,.3); color: var(--danger); }

/* ── MOBILE-ONLY ACTION BUTTONS (hidden desktop, shown mobile) ────── */
.mobile-action { display: none; }

/* ── SHARE BUTTON ─────────────────────────────────────────────── */
.btn-share {
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.25);
  color: var(--accent2);
}
.btn-share:hover { background: rgba(99,102,241,.16); }
.btn-share.loading { opacity: .6; pointer-events: none; }

/* ── SHARE MODAL ─────────────────────────────────────────────── */
.share-url-wrap {
  display: flex; gap: .5rem; margin-top: .5rem;
}
.share-url-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .6rem .9rem;
  font-size: .82rem;
  font-family: 'Inter', sans-serif;
  outline: none;
}
.share-copy-btn {
  background: var(--accent);
  border: none; color: #fff;
  border-radius: 8px; padding: .6rem 1rem;
  font-size: .82rem; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer; transition: opacity .2s;
  white-space: nowrap;
}
.share-copy-btn:hover { opacity: .88; }
.share-note {
  font-size: .75rem; color: var(--muted);
  margin-top: .65rem; line-height: 1.5;
}

/* ── WEEKLY SUMMARY MODAL ────────────────────────────────────────── */
.weekly-modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0;
  width: min(520px, 100%);
  animation: modalIn .25s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  overflow: hidden;
}

.weekly-hero {
  background: linear-gradient(135deg, #1a1f3a 0%, #111627 100%);
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
body.light .weekly-hero {
  background: linear-gradient(135deg, #eeedfe 0%, #f0f1f8 100%);
}
.weekly-hero::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.2), transparent 70%);
  top: -100px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}
.weekly-day-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 999px; padding: .3rem .9rem;
  font-size: .72rem; font-weight: 600; color: var(--accent2);
  letter-spacing: .05em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.weekly-title {
  font-size: 1.4rem; font-weight: 800;
  letter-spacing: -.03em; margin-bottom: .35rem;
}
.weekly-sub {
  font-size: .83rem; color: var(--muted);
  line-height: 1.5;
}

.weekly-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.weekly-stat {
  padding: 1.25rem .75rem;
  text-align: center;
  border-right: 1px solid var(--border);
  position: relative;
}
.weekly-stat:last-child { border-right: none; }
.weekly-stat-num {
  font-size: 2rem; font-weight: 800;
  line-height: 1; letter-spacing: -.04em;
  margin-bottom: .2rem;
}
.weekly-stat-lbl {
  font-size: .65rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
}
.ws-total { color: var(--accent2); }
.ws-done  { color: var(--exec); }
.ws-pend  { color: var(--pend); }
.ws-over  { color: var(--danger); }

.weekly-history {
  padding: 1.25rem 1.75rem;
}
.weekly-history-title {
  font-size: .7rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: .85rem;
}
.history-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 0;
  border-bottom: .5px solid var(--border);
  font-size: .82rem;
}
.history-row:last-child { border-bottom: none; }
.history-week {
  color: var(--muted); font-size: .75rem;
  min-width: 90px; flex-shrink: 0;
}
.history-bars {
  flex: 1; display: flex; gap: .3rem; align-items: center;
}
.history-bar {
  height: 6px; border-radius: 99px; min-width: 3px;
  transition: width .4s ease;
}
.hb-done { background: var(--exec); }
.hb-pend { background: var(--pend); }
.hb-over { background: var(--danger); }
.history-nums {
  font-size: .72rem; color: var(--muted);
  white-space: nowrap; flex-shrink: 0;
}
.history-empty {
  text-align: center; padding: 1rem;
  font-size: .8rem; color: var(--muted); font-style: italic;
}

.weekly-actions {
  padding: 1.25rem 1.75rem;
  display: flex; gap: .75rem; justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE RESPONSIVE — max-width: 768px
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {

  /* ── WRAP ── */
  body { padding: 0 0 5rem; }
  .wrap { padding: 0; }

  /* ── HEADER — compact single row ── */
  header {
    padding: .55rem .9rem .45rem;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
  }

  /* header-left: logo + title stacked column */
  .header-left {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100%;
  }

  .header-top {
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    flex-wrap: nowrap;
  }

  .logo-area {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 1;
    min-width: 0;
  }

  /* Smaller logo on mobile */
  .logo-upload-wrap {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
  .logo-upload-wrap svg,
  .logo-upload-wrap img { width: 32px !important; height: 32px !important; }
  #logoPlaceholder svg   { width: 32px !important; height: 32px !important; }

  .logo-area h1 {
    font-size: 1rem;
    white-space: nowrap;
    letter-spacing: -.03em;
  }

  /* hide secondary identity info on mobile */
  #orgNameDisplay,
  #orgDeptDisplay,
  #orgPlaceholder { display: none !important; }

  /* team tabs sit BELOW logo+title in the same left column */
  .team-tabs-wrap {
    display: flex;
    align-items: center;
    gap: .35rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: .4rem .9rem .35rem;
    margin: .35rem -.9rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
  }
  .team-tabs-wrap::-webkit-scrollbar { display: none; }
  .team-tabs { display: flex; gap: .3rem; flex-shrink: 0; }

  .team-tab {
    padding: .28rem .65rem;
    font-size: .72rem;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
  }
  .team-tab-edit { display: none; }

  .add-team-btn {
    padding: .28rem .65rem;
    font-size: .7rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* header-right: compact controls pushed right */
  .header-right {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
    flex-wrap: nowrap;
    margin-left: auto;
    align-self: flex-start;
    padding-top: .05rem;
  }

  /* Hide date badge on mobile */
  .date-badge { display: none !important; }

  /* Save indicator — dot only */
  .save-indicator {
    min-width: unset;
    padding: .25rem .45rem;
    font-size: 0;
  }
  .save-indicator .save-dot { width: 7px; height: 7px; margin: 0; }
  #saveLabel { display: none; }

  /* Theme toggle — icon only */
  .theme-toggle {
    padding: .28rem .55rem;
    font-size: .7rem;
    gap: .2rem;
    border-radius: 8px;
  }
  .toggle-track { width: 26px; height: 15px; }
  .toggle-thumb { width: 11px; height: 11px; }
  #themeLabel { display: none; }

  /* Sair button — small */
  header .header-right > button:last-child {
    padding: .28rem .55rem !important;
    font-size: .68rem !important;
    border-radius: 7px !important;
    white-space: nowrap;
  }

  /* ── SUMMARY CARDS — 2x2 grid ── */
  .summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .4rem;
    padding: .65rem .9rem;
    margin: 0;
  }
  .stat-card {
    padding: .65rem .75rem;
    border-radius: 10px;
  }
  .stat-num { font-size: 1.55rem; }
  .stat-label { font-size: .58rem; }

  /* ── TOOLBAR — compact top section ── */
  .toolbar {
    padding: .5rem .9rem .4rem;
    flex-direction: column;
    gap: .45rem;
    margin-bottom: .5rem;
  }

  /* Filter bar — compact pills, horizontal scroll */
  .filter-bar {
    display: flex;
    overflow-x: auto;
    gap: .3rem;
    scrollbar-width: none;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn {
    padding: .22rem .65rem;
    font-size: .7rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 999px;
    line-height: 1.4;
  }

  /* Tool actions row — compact, scrollable */
  .tool-actions {
    display: flex;
    overflow-x: auto;
    gap: .3rem;
    scrollbar-width: none;
    padding-bottom: 2px;
    align-items: center;
    flex-wrap: nowrap;
  }
  .tool-actions::-webkit-scrollbar { display: none; }

  /* View toggle — smaller */
  .view-toggle { flex-shrink: 0; border-radius: 7px; }
  .view-btn {
    padding: .28rem .65rem;
    font-size: .7rem;
  }

  /* Action buttons — very compact */
  .btn-sm {
    padding: .26rem .6rem;
    font-size: .68rem;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 7px;
  }

  /* Mobile-only buttons shown, more-actions hidden */
  .mobile-action { display: inline-flex !important; }
  .more-actions-wrap { display: none !important; }

  /* ── LEGEND — tighter ── */
  .legend {
    padding: .2rem .9rem .5rem;
    gap: .75rem;
    font-size: .68rem;
    margin-bottom: .5rem;
  }

  /* ── BOARD GRID ── */
  .team-grid {
    grid-template-columns: 1fr;
    padding: 0 .65rem 5rem;
    gap: .75rem;
  }

  /* ── PERSON CARD ── */
  .person-card { border-radius: 12px; }
  .person-header { padding: .8rem .9rem; gap: .7rem; }
  .person-name { font-size: .86rem; }
  .person-meta { font-size: .67rem; }
  .avatar { width: 34px; height: 34px; }

  .load-bar-wrap { padding: .4rem .9rem; }
  .section-label { padding: .4rem .9rem .2rem; font-size: .63rem; }

  /* Project items */
  .project-item { padding: .4rem .9rem; gap: .45rem; }
  .proj-name { font-size: .8rem; }
  .date-pill { font-size: .63rem; }
  .meta-pill { font-size: .63rem; }
  .proj-note { font-size: .7rem; }
  .proj-act-btn { font-size: .78rem; padding: .15rem .28rem; }

  /* ── LIST VIEW ── */
  .list-toolbar {
    flex-direction: column;
    gap: .45rem;
    padding: .65rem .9rem;
  }
  .list-table-wrap { margin: 0 .5rem; border-radius: 10px; }
  .list-table th:nth-child(4),
  .list-table td:nth-child(4),
  .list-table th:nth-child(5),
  .list-table td:nth-child(5),
  .list-table th:nth-child(6),
  .list-table td:nth-child(6) { display: none; }
  .list-table { font-size: .76rem; }
  .list-table td, .list-table th { padding: .55rem .75rem; }

  /* ── MODALS — bottom sheet style ── */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-overlay.open .modal {
    border-radius: 20px 20px 0 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    padding: 1.4rem 1.1rem;
  }

  /* ── TOAST ── */
  .toast {
    bottom: 1.25rem;
    font-size: .78rem;
    padding: .6rem 1rem;
    max-width: calc(100vw - 2rem);
    white-space: normal;
    text-align: center;
    border-radius: 10px;
  }

  /* ── FOOTER ── */
  #footer {
    font-size: .68rem;
    padding: 1rem .9rem;
    text-align: center;
  }

  /* ── WEEKLY MODAL ── */
  .weekly-modal { border-radius: 20px 20px 0 0; }
  .weekly-hero { padding: 1.4rem 1.1rem 1.1rem; }
  .weekly-title { font-size: 1.1rem; }
  .weekly-stats { grid-template-columns: repeat(2, 1fr); }
  .weekly-stat:nth-child(3) { border-right: none; }
  .weekly-stat { padding: .85rem .65rem; }
  .weekly-stat-num { font-size: 1.5rem; }
  .weekly-history, .weekly-actions { padding: .9rem 1.1rem; }

  /* ── EMPTY STATE ── */
  .empty-team { padding: 2rem 1.25rem; }

  /* ── HOJE VIEW ── */
  #hojeView { padding: 0 .65rem; }
}

/* ── VERY SMALL SCREENS (< 400px) ── */
@media (max-width: 400px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .stat-card.s-team { display: none; }
  .logo-area h1 { font-size: .9rem; }
  .filter-btn {
    padding: .2rem .55rem;
    font-size: .65rem;
  }
  .btn-sm {
    padding: .22rem .5rem;
    font-size: .64rem;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   VISTA HOJE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

#hojeView {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.hoje-section {
  margin-bottom: 2rem;
}

.hoje-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: .6rem;
  box-shadow: 0 0 12px var(--accent-glow);
}

.hoje-section-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: .2rem;
}

.hoje-section-sub {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .85rem;
}

/* ── 01 Priority card ── */
.hoje-priority-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.hoje-priority-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 14px 0 0 14px;
}
.hoje-priority-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.hoje-priority-card.has-priority {
  background: rgba(99,102,241,.05);
  border-color: rgba(99,102,241,.25);
}
.hoje-priority-text {
  flex: 1;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.4;
}
.hoje-priority-placeholder {
  color: var(--muted);
  font-weight: 400;
  font-size: .88rem;
}
.hoje-priority-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  opacity: .5;
  transition: opacity .2s;
  padding: .2rem;
  flex-shrink: 0;
}
.hoje-priority-card:hover .hoje-priority-edit { opacity: 1; }

/* ── 02 Tarefas de Hoje ── */
.hoje-group-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin: .75rem 0 .4rem;
}
.hoje-group-label.overdue { color: var(--danger); }
.hoje-group-label.today   { color: var(--pend); }
.hoje-group-label.week    { color: var(--accent2); }
.hoje-group-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}

.hoje-task-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: .75rem 1rem;
  margin-bottom: .45rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: border-color .2s;
}
.hoje-task-row:hover { border-color: var(--border2); }
.hoje-task-row.overdue { border-left: 2px solid var(--danger); }
.hoje-task-row.today   { border-left: 2px solid var(--pend); }
.hoje-task-row.week    { border-left: 2px solid var(--accent2); }

.hoje-task-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .58rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.hoje-task-info { flex: 1; min-width: 0; }
.hoje-task-name {
  font-size: .86rem; font-weight: 600;
  color: var(--text); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hoje-task-meta {
  display: flex; align-items: center; gap: .4rem; margin-top: .2rem;
}
.hoje-task-person { font-size: .7rem; color: var(--muted); }
.hoje-task-date {
  font-size: .68rem; font-weight: 600;
  border-radius: 4px; padding: .1rem .45rem;
}
.htd-over { background: rgba(248,113,113,.1); color: var(--danger); }
.htd-today { background: rgba(245,158,11,.1); color: var(--pend); }
.htd-week  { background: rgba(99,102,241,.1); color: var(--accent2); }
.hoje-task-status {
  font-size: .66rem; font-weight: 600;
  border-radius: 999px; padding: .15rem .55rem;
  flex-shrink: 0;
}
.hts-exec { background: var(--exec-bg); color: var(--exec); border: 1px solid var(--exec-border); }
.hts-pend { background: var(--pend-bg); color: var(--pend); border: 1px solid var(--pend-border); }

.hoje-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: .84rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.hoje-empty-icon { font-size: 2rem; margin-bottom: .5rem; }

/* ── 05 Revisão rápida ── */
.hoje-revisao-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.hoje-revisao-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 1rem 1.1rem;
}
.hoje-revisao-icon {
  width: 28px; height: 28px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: var(--accent2);
  margin-bottom: .65rem;
}
.hoje-revisao-card:nth-child(2) .hoje-revisao-icon {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.2);
  color: var(--pend);
}
.hoje-revisao-label {
  font-size: .78rem; font-weight: 600;
  color: var(--text); margin-bottom: .6rem;
  line-height: 1.4;
}
.hoje-revisao-list { display: flex; flex-direction: column; gap: .3rem; }
.hoje-revisao-item {
  font-size: .74rem; color: var(--muted);
  display: flex; align-items: flex-start; gap: .4rem;
  line-height: 1.4; padding: .25rem 0;
  border-bottom: .5px solid var(--border);
}
.hoje-revisao-item:last-child { border-bottom: none; }
.hoje-revisao-item::before { content: '·'; color: var(--accent2); flex-shrink: 0; }
.hoje-revisao-empty { font-size: .74rem; color: var(--muted); font-style: italic; }

@media (max-width: 600px) {
  .hoje-revisao-grid { grid-template-columns: 1fr; }
  #hojeView { padding: 1rem 1rem 4rem; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FIX 1 — MORE ACTIONS DROPDOWN (desktop only)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.more-actions-wrap {
  position: relative;
}
.more-actions-btn {
  font-weight: 600;
  letter-spacing: -.01em;
}
.more-actions-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .4rem;
  min-width: 200px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  z-index: 100;
  animation: fadeUp .15s ease;
}
.more-actions-dropdown.open { display: block; }
.more-actions-dropdown button {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; text-align: left;
  background: transparent; border: none;
  color: var(--text); font-size: .84rem;
  font-family: 'Inter', sans-serif; font-weight: 500;
  padding: .6rem .85rem; border-radius: 8px;
  cursor: pointer; transition: background .15s;
}
.more-actions-dropdown button:hover { background: var(--surface2); }

/* On mobile — hide the dropdown, show individual buttons */
@media (max-width: 768px) {
  .more-actions-wrap { display: none; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FIX 2 — MOBILE TEAM TAB EDIT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.team-tab-edit.desktop-only { display: inline-flex; }
.team-tab-edit.mobile-only  { display: none; }

@media (max-width: 768px) {
  /* On mobile, always show the edit button in the tab */
  .team-tab-edit.desktop-only { display: none; }
  .team-tab-edit.mobile-only  {
    display: inline-flex;
    opacity: 1 !important;
    font-size: .8rem;
    padding: .2rem .35rem;
    background: rgba(99,102,241,.12);
    border: 1px solid rgba(99,102,241,.2);
    border-radius: 6px;
    color: var(--accent2);
  }
  /* Also restore mobile toolbar to show all key actions */
  .tool-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tool-actions::-webkit-scrollbar { display: none; }
  /* Show full action row on mobile (Importar, Exportar, PDF, Partilhar) */
  .btn-ghost.btn-sm,
  .btn-green.btn-sm,
  .btn-pdf.btn-sm,
  .btn-share.btn-sm {
    display: inline-flex;
    flex-shrink: 0;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FIX 3 — VISTA HOJE BACK BUTTON
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.hoje-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.hoje-back-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: .4rem .9rem;
  font-size: .82rem; font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all .2s;
}
.hoje-back-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.hoje-header-date {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
}

/* Mobile action buttons — hidden on desktop, visible on mobile */
.mobile-action { display: none; }
@media (max-width: 768px) {
  .mobile-action { display: inline-flex; flex-shrink: 0; }
}
