/* ============================================================
   Gestor de Tarefas — Preview Visual
   Identidade visual + design system reutilizável
   Base de frontend (Reuse-First) — construída a partir do
   template fast-stack (TypeScript + Hono + HTMX + ECharts).
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --bg-grad-a: #eef1fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #f1f4f9;
  --border: #e4e9f2;
  --border-strong: #d4dbe8;
  --text: #181d2c;
  --muted: #596274;
  --faint: #8b94a8;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #eef0ff;
  --primary-softer: #f5f6ff;
  --on-primary: #ffffff;
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.18);

  --wa: #16a34a;
  --wa-soft: #e7f6ec;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 24px -14px rgba(16, 24, 40, 0.16);
  --shadow-lg: 0 18px 40px -16px rgba(16, 24, 40, 0.28);

  --font: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, Arial, sans-serif;
  --mono: "Cascadia Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- status / prioridade ---------- */
:root {
  --st-pendente: #d97706;
  --st-pendente-bg: #fef4e2;
  --st-pendente-fg: #92510a;
  --st-em_andamento: #2563eb;
  --st-em_andamento-bg: #e9f1fe;
  --st-em_andamento-fg: #1d4ed8;
  --st-concluida: #16a34a;
  --st-concluida-bg: #e7f6ec;
  --st-concluida-fg: #15803d;
  --st-cancelada: #64748b;
  --st-cancelada-bg: #eef1f5;
  --st-cancelada-fg: #475569;

  --pr-alta: #dc2626;
  --pr-alta-bg: #fdecec;
  --pr-alta-fg: #b91c1c;
  --pr-media: #d97706;
  --pr-media-bg: #fef4e2;
  --pr-media-fg: #92510a;
  --pr-baixa: #64748b;
  --pr-baixa-bg: #eef1f5;
  --pr-baixa-fg: #475569;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 80% -10%, var(--bg-grad-a), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }

.wrap, .page { max-width: 1140px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.page { padding-top: 22px; padding-bottom: 96px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.small { font-size: 13px; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px !important; }
.mt-2 { margin-top: 12px !important; } .mt-3 { margin-top: 20px !important; }
.mb-1 { margin-bottom: 6px !important; } .mb-2 { margin-bottom: 12px !important; }
.mb-3 { margin-bottom: 20px !important; }
.nowrap { white-space: nowrap; }

/* ---------- banner de exemplo (preview) ---------- */
.pv-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff7e6;
  border: 1px solid #f6e2b3;
  color: #8a5a06;
  font-size: 12px;
  font-weight: 600;
}
.pv-flag svg { flex: 0 0 auto; }
.pv-strip {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 14px; margin-bottom: 16px;
  background: #fffdf5; border: 1px solid #f3e3b6; border-radius: var(--radius-sm);
  color: #7c5a12; font-size: 13px;
}
.pv-strip strong { color: #5d4308; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-in {
  max-width: 1140px; margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); margin-right: 14px; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 4px 10px -4px rgba(79, 70, 229, 0.7);
}
.brand .b-name { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.brand .b-sub { display: block; font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: 0.02em; }

.nav-main { display: flex; align-items: center; gap: 2px; }
.nav-main a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 9px; color: var(--muted);
  font-weight: 600; font-size: 14px;
}
.nav-main a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-main a.active { background: var(--primary-soft); color: var(--primary); }
.nav-main a svg { opacity: 0.85; }

.nav-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-user .u-email { font-size: 12px; color: var(--faint); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700; background: linear-gradient(135deg, #f59e0b, #ef4444);
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.userbox { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 999px; }
.userbox:hover { background: var(--surface-3); cursor: pointer; }
.userbox .uname { font-weight: 700; font-size: 13.5px; line-height: 1.1; }
.userbox .u-email { display: block; font-size: 11px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  background: var(--surface); color: var(--text);
}
.btn:hover { text-decoration: none; filter: brightness(0.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn svg { flex: 0 0 auto; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 14px -8px rgba(79, 70, 229, 0.8); }
.btn-primary:hover { background: var(--primary-strong); filter: none; }
.btn-ghost { border-color: var(--border); background: var(--surface); color: var(--muted); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 32px; height: 32px; padding: 0; border-radius: 8px; display: inline-grid; place-items: center;
  color: var(--muted); border: 1px solid transparent; background: transparent; cursor: pointer;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon.danger:hover { background: var(--pr-alta-bg); color: var(--pr-alta-fg); }
.btn-icon svg { width: 17px; height: 17px; }

/* FAB — Nova tarefa */
.fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 55;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 20px; border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  color: #fff; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 14px 30px -10px rgba(79, 70, 229, 0.7), 0 2px 6px rgba(16,24,40,0.2);
  border: 0; cursor: pointer;
}
.fab:hover { text-decoration: none; filter: brightness(1.06); }
.fab .fab-icon {
  width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.22);
  display: grid; place-items: center; font-size: 16px; line-height: 1;
}

/* ---------- cards / painéis ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-h {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
}
.panel-h h2, .panel-h h3 { font-size: 15.5px; font-weight: 700; }
.panel-h .sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.panel-h .spacer { margin-left: auto; }
.panel-b { padding: 16px 20px 20px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi .k { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.kpi .v { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.kpi .foot { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi .k-icon { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.kpi.accent-indigo { border-top: 3px solid var(--primary); }
.kpi.accent-green { border-top: 3px solid var(--wa); }
.kpi.accent-amber { border-top: 3px solid #f59e0b; }
.kpi.accent-red { border-top: 3px solid #ef4444; }
.kpi .v.indigo { color: var(--primary); } .kpi .v.green { color: var(--wa); }
.kpi .v.amber { color: #b45309; } .kpi .v.red { color: #dc2626; }
.k-icon.indigo { background: var(--primary-soft); color: var(--primary); }
.k-icon.green { background: var(--wa-soft); color: var(--wa); }
.k-icon.amber { background: var(--st-pendente-bg); color: var(--st-pendente); }
.k-icon.red { background: var(--pr-alta-bg); color: var(--pr-alta-fg); }
.prog { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.prog > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #22c55e); }

/* ---------- context bar (filtros do painel) ---------- */
.ctx { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.ctx .cgroup { display: flex; flex-direction: column; gap: 6px; }
.ctx .cgroup > .clabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .cnt { opacity: 0.75; font-weight: 500; margin-left: 3px; }
.chip.active .cnt { opacity: 0.85; }

/* ---------- badges ---------- */
.bd { display: inline-flex; align-items: center; gap: 6px; padding: 2.5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bd .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bd--pendente { background: var(--st-pendente-bg); color: var(--st-pendente-fg); }
.bd--em_andamento { background: var(--st-em_andamento-bg); color: var(--st-em_andamento-fg); }
.bd--concluida { background: var(--st-concluida-bg); color: var(--st-concluida-fg); }
.bd--cancelada { background: var(--st-cancelada-bg); color: var(--st-cancelada-fg); }
.bd--alta { background: var(--pr-alta-bg); color: var(--pr-alta-fg); }
.bd--media { background: var(--pr-media-bg); color: var(--pr-media-fg); }
.bd--baixa { background: var(--pr-baixa-bg); color: var(--pr-baixa-fg); }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--faint); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .t-title { font-weight: 650; }
.tbl .t-title a { color: var(--text); }
.tbl .t-title a:hover { color: var(--primary); text-decoration: none; }
.tbl .t-cat { font-size: 12.5px; color: var(--muted); }
.tbl .t-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tbl .t-date.overdue { color: #dc2626; font-weight: 700; }
.tbl .t-date.safe { color: var(--faint); }
.tbl .row-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.tbl td.right, .tbl th.right { text-align: right; }
.tbl .total-row td { font-weight: 800; background: var(--surface-2); }
.tbl .sub-row td { background: var(--surface-2); }

.list-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.list-toolbar .grow { flex: 1; min-width: 220px; }
.result-meta { font-size: 13px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 4px; }
.pager .pg-count { font-size: 13px; color: var(--muted); margin-right: 6px; }
.pager button { min-width: 90px; }

/* ---------- formulários ---------- */
.field { margin-bottom: 16px; }
.field > .flabel { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 650; color: var(--text); margin-bottom: 6px; }
.field .flabel .opt { font-weight: 500; color: var(--faint); font-size: 12px; }
.field .req { color: #ef4444; }
.input, textarea.input, select.input {
  width: 100%; padding: 10px 13px; font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { resize: vertical; min-height: 100px; }
.input::placeholder { color: #a9b1c2; }
.input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.hint { display: block; font-size: 12px; color: var(--faint); margin-top: 5px; }
.err-text { display: flex; gap: 5px; align-items: flex-start; font-size: 12.5px; color: #dc2626; margin-top: 5px; }
.input.invalid { border-color: #ef4444; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 4px; top: 4px; bottom: 4px; width: 34px; border: 0; border-radius: 8px;
  background: transparent; color: var(--faint); cursor: pointer; display: grid; place-items: center;
}
.pw-toggle:hover { color: var(--muted); }
.input-prefix { position: relative; }
.input-prefix .input { padding-left: 96px; }
.prefix-label {
  position: absolute; left: 4px; top: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 5px;
  padding: 0 10px; border-radius: 8px; background: var(--surface-3); color: var(--muted);
  font-size: 13px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.check-row input { margin-top: 3px; }

.fieldset-card { padding: 4px 0 2px; }
.fs-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin: 22px 0 12px; }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.radio-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio-pill span {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 6px;
  font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); text-align: center;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.radio-pill .pill-sub { font-size: 11px; font-weight: 500; color: var(--faint); }
.radio-pill input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: var(--ring); }
.radio-pill input:checked + span .pill-sub { color: var(--primary); opacity: 0.8; }
.radio-pill:hover span { border-color: var(--primary); }

/* ---------- estados ---------- */
.empty {
  padding: 46px 20px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 12px; color: var(--muted);
}
.empty .e-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.empty h3 { font-size: 17px; color: var(--text); }
.empty p { max-width: 380px; font-size: 14px; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); border: 1px solid #dfe2ff; color: #3730a3; font-size: 13px;
}
.notice.warn { background: var(--st-pendente-bg); border-color: #f4ddab; color: #7c5a12; }
.notice.ok { background: var(--wa-soft); border-color: #cbe9d5; color: #15803d; }
.notice.err { background: var(--pr-alta-bg); border-color: #f6caca; color: #b91c1c; }
.notice.info-note { background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--muted); }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--surface-3) 25%, #e9edf5 45%, var(--surface-3) 65%); background-size: 200% 100%; animation: sk 1.3s infinite linear; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 11px;
  background: #181d2c; color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: all 0.22s ease;
  pointer-events: auto; max-width: min(480px, 90vw);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
.toast svg { flex: 0 0 auto; }

/* ---------- modal (confirmação destrutiva) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 20, 34, 0.5); display: grid; place-items: center; padding: 20px; z-index: 110; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; }
.modal .m-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--pr-alta-bg); color: var(--pr-alta-fg); display: grid; place-items: center; margin-bottom: 14px; }
.modal h3 { font-size: 17px; margin-bottom: 6px; }
.modal p { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.modal .m-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-backdrop.hidden { display: none; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart .chart-canvas { width: 100%; }
.chart-note {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  color: var(--muted); font-size: 13px; background: var(--surface-2); border-radius: var(--radius-sm);
}
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.axis-note { font-size: 11px; color: var(--faint); margin-top: 4px; }

/* ---------- auth ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 26px 16px; }
.auth-card { width: 100%; max-width: 432px; }
.auth-card .card-pad { padding: 30px 30px 26px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 22px; }
.auth-brand .logo { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 10px 22px -10px rgba(79,70,229,.8); }
.auth-brand h1 { font-size: 21px; }
.auth-brand p { font-size: 13.5px; color: var(--muted); }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 16px 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); padding: 14px 0 0; border-top: 1px solid var(--border); margin-top: 20px; }
.demo-creds { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.demo-creds code { font-family: var(--mono); color: var(--text); background: #fff; border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }

/* ---------- detail ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 920px) { .detail-grid { grid-template-columns: 1fr; } }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: 0; }
.kv .kv-k { color: var(--faint); font-size: 13px; }
.kv .kv-v { font-weight: 600; font-size: 13.5px; text-align: right; }
.wa-msg {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: #f0faf4; border: 1px solid #d5eedd; align-items: flex-start;
}
.wa-msg .wa-bubble { flex: 0 0 auto; }
.wa-bubble { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--wa); color: #fff; }
.wa-msg p { font-size: 13px; color: #14532d; }
.wa-msg .msg-preview { display: block; background: #fff; border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 12.5px; color: #1f2937; border: 1px solid #e4eee6; }

/* ---------- reports ---------- */
.rep-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-tabs button { border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 8px 14px; font-weight: 650; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.rep-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.rep-block { display: none; }
.rep-block.active { display: block; }
.num-r { font-variant-numeric: tabular-nums; }

/* ---------- section page-head ---------- */
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.page-head .spacer { flex: 1; }
.crumb { font-size: 13px; color: var(--faint); margin-bottom: 4px; }
.crumb a { color: var(--muted); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-grid .full { grid-column: 1 / -1; }
@media (max-width: 880px) { .chart-grid { grid-template-columns: 1fr; } .chart-grid .full { grid-column: auto; } }

/* ---------- footer ---------- */
.foot-note { text-align: center; padding: 18px 20px 34px; font-size: 12px; color: var(--faint); }

@media (max-width: 760px) {
  .topbar-in { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; }
  .nav-main { order: 3; width: 100%; overflow-x: auto; }
  .userbox .u-email { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* ---------- app real (gestor de tarefas) ---------- */
.panel-b { position: relative; }
.chart-box { width: 100%; min-height: 232px; }
.chart-box svg { display: block; }
.chart-note { z-index: 2; }
.logout-form { display: inline-flex; }
.topbar .logout-form { margin-left: 0; }
.row-actions { align-items: center; }

/* foco acessível em todos os interativos */
a:focus-visible, button:focus-visible, .chip:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
button { touch-action: manipulation; }

/* transição estados (carregando) */
.is-loading { opacity: 0.55; pointer-events: none; }

