/* Atelier do Empresário — Gabinete Inteligente (demo)
   Identidade visual do site do cliente (atelierdoempresario.pt):
   navy #1b405d (header), azul #045389 (--ac-color do Webnode), dourado do logo #e9c97c, Poppins (≈Metropolis). */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/poppins-700.woff2") format("woff2"); }

:root {
  --page: #eef2f6;
  --surface: #ffffff;
  --ink: #1e2b38;
  --ink-2: #4e586e;
  --ink-3: #8a93a5;
  --hairline: #e3e7ee;
  --ring: rgba(27, 64, 93, 0.10);

  --navy: #1b405d;
  --navy-deep: #14324a;
  --gold: #e9c97c;

  --accent: #045389;
  --accent-ink: #033a61;
  --accent-soft: rgba(4, 83, 137, 0.08);

  --good: #0ca30c;       --good-text: #006300;      --good-soft: rgba(12, 163, 12, 0.10);
  --warning: #fab219;    --warning-text: #7a5200;   --warning-soft: rgba(250, 178, 25, 0.16);
  --serious: #ec835a;    --serious-text: #8a3a1d;   --serious-soft: rgba(236, 131, 90, 0.14);
  --critical: #d03b3b;   --critical-text: #8f1f1f;  --critical-soft: rgba(208, 59, 59, 0.10);
  --neutral-soft: rgba(11, 11, 11, 0.06);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 50, 74, 0.05), 0 8px 24px rgba(20, 50, 74, 0.06);
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
a { color: var(--accent-ink); }

/* ---- shell ---- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand-tile {
  width: 42px; height: 42px; border-radius: 9px; flex: 0 0 42px;
  background: #fff;
  display: grid; place-items: center;
}
.brand-tile img { width: 34px; height: 34px; object-fit: contain; display: block; }
.brand-name { font-weight: 700; font-size: 14px; line-height: 1.25; color: #fff; }
.brand-sub { font-size: 10.5px; color: rgba(255, 255, 255, 0.7); letter-spacing: 0.01em; }

#nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
  padding: 16px 12px 6px;
}
.nav-badge {
  margin-left: auto;
  background: var(--critical); color: #fff;
  font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px;
}
.nav-badge:empty { display: none; }
#nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.78); text-decoration: none; font-weight: 500; font-size: 13.5px;
}
#nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
#nav a.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 650; box-shadow: inset 3px 0 0 var(--gold); }
.nav-ico { width: 18px; text-align: center; font-size: 14px; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.sidebar .btn-ghost { border-color: rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.85); background: transparent; }
.sidebar .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.main { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1120px; }
.loading { color: var(--ink-3); padding: 40px; }

/* ---- typography ---- */
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; color: var(--navy); }
h2 { font-size: 15px; font-weight: 650; color: var(--navy); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-sub { color: var(--ink-3); font-size: 13.5px; margin-top: 3px; }
.section { margin-top: 28px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.eyebrow {
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3);
}
.group-title {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 12px;
}
.group-title .eyebrow { white-space: nowrap; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* ---- cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card + .card { margin-top: 14px; }
.card > h2 {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

/* ---- KPI tiles ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 14px; }
.kpi {
  padding: 18px 18px 14px;
  min-height: 116px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--gold);
}
.kpi .kpi-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.kpi .kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi .kpi-note { font-size: 12px; color: var(--ink-3); margin-top: auto; padding-top: 6px; }
.kpi-value .unit { font-size: 15px; font-weight: 600; color: var(--ink-2); }

/* ---- separadores de área fiscal e tipo de cliente ---- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 650;
  color: var(--accent-ink);
  background: rgba(4, 83, 137, 0.06);
  border: 1px solid rgba(4, 83, 137, 0.18);
  border-radius: 6px; padding: 2px 8px;
  white-space: nowrap;
}
.badge-tipo {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  border-radius: 6px; padding: 3px 9px; white-space: nowrap;
}
.badge-empresa { background: var(--navy); color: #fff; }
.badge-particular { background: transparent; color: var(--navy); border: 1px solid var(--navy); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  border: 1px solid var(--hairline); background: var(--surface);
  border-radius: 999px; padding: 6px 15px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.filter-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-chip .count { opacity: 0.65; font-weight: 500; margin-left: 3px; }

/* ---- status chips: sempre ícone + rótulo, nunca só cor ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.chip-good     { background: var(--good-soft);     color: var(--good-text); }
.chip-good .dot { background: var(--good); }
.chip-warning  { background: var(--warning-soft);  color: var(--warning-text); }
.chip-warning .dot { background: var(--warning); }
.chip-serious  { background: var(--serious-soft);  color: var(--serious-text); }
.chip-serious .dot { background: var(--serious); }
.chip-critical { background: var(--critical-soft); color: var(--critical-text); }
.chip-critical .dot { background: var(--critical); }
.chip-neutral  { background: var(--neutral-soft);  color: var(--ink-2); }
.chip-neutral .dot { background: var(--ink-3); }

/* ---- alerts ---- */
.alert {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}
.alert + .alert { margin-top: 10px; }
.alert-ico {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 16px;
}
.alert-critical .alert-ico { background: var(--critical-soft); color: var(--critical-text); }
.alert-serious  .alert-ico { background: var(--serious-soft); color: var(--serious-text); }
.alert-warning  .alert-ico { background: var(--warning-soft); color: var(--warning-text); }
.alert-good     .alert-ico { background: var(--good-soft); color: var(--good-text); }
.alert-main { flex: 1 1 260px; min-width: 0; overflow-wrap: break-word; }
.alert .alert-title { font-weight: 650; font-size: 13.5px; color: var(--ink); }
.alert .alert-body  { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.alert .alert-act { margin-left: auto; flex: 0 0 auto; }

/* ---- tables ---- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-3); font-weight: 650; padding: 10px; border-bottom: 1px solid var(--hairline);
}
.tbl td { padding: 14px 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.row-link { cursor: pointer; transition: background 0.12s ease; }
.tbl tr.row-link:hover { background: rgba(4, 83, 137, 0.04); }
.td-actions { text-align: right; white-space: nowrap; }

/* ---- buttons ---- */
.btn {
  border: 1px solid var(--ring); background: var(--surface);
  border-radius: var(--radius-sm); padding: 7px 14px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.alert-act .btn { min-width: 132px; }
.btn:hover { background: var(--neutral-soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--hairline); color: var(--ink-2); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---- meter (limiar de IVA) ---- */
.meter { margin-top: 8px; }
.meter-track {
  position: relative; height: 14px; border-radius: 4px;
  background: var(--neutral-soft); overflow: visible;
}
.meter-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent); border-radius: 4px 0 0 4px;
}
.meter-over {
  position: absolute; top: 0; bottom: 0;
  background: var(--critical);
  border-left: 2px solid var(--surface);
  border-radius: 0 4px 4px 0;
}
.meter-tick {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--ink);
}
.meter-tick-25 { background: var(--critical); opacity: 0.7; }
.meter-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* ---- cliente header ---- */
.client-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: 0 0 46px;
}
.client-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 24px; margin-top: 4px; }
.client-meta .meta-val { font-size: 13px; color: var(--ink); margin-top: 3px; line-height: 1.45; }

/* ---- ícones svg ---- */
svg.ic { flex: 0 0 auto; vertical-align: -2px; }
.nav-ico { display: inline-flex; align-items: center; }
.tag svg.ic { vertical-align: -1.5px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; }
.doc-ico { display: inline-flex; color: var(--accent-ink); }
.upload-zone svg.ic { vertical-align: -3px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.grid-2 > .card { margin: 0; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- timeline (cérebro) ---- */
.timeline { list-style: none; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.timeline li:last-child { border-bottom: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: 0 0 10px; }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-impact { font-size: 13px; color: var(--ink-2); }
.tl-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tl-tag {
  display: inline-block; font-size: 11px; font-weight: 650; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 4px; padding: 1px 7px; margin-right: 6px;
}

/* ---- notas ---- */
.note { border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--page); }
.note + .note { margin-top: 10px; }
.note-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.note-ai { color: var(--accent-ink); font-weight: 600; }
textarea.input, input.input {
  width: 100%; border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: 9px 12px; font: inherit; font-size: 13.5px; background: var(--surface); color: var(--ink);
}
textarea.input:focus, input.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form-row { display: flex; gap: 8px; margin-top: 10px; }
.form-row .input { flex: 1; }

/* ---- documentos ---- */
.doclist { list-style: none; }
.doclist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.doclist li:last-child { border-bottom: none; }
.doc-ico { font-size: 16px; }
.upload-zone {
  border: 1.5px dashed var(--hairline); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; color: var(--ink-3); font-size: 13px;
  margin-top: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* ---- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11, 11, 11, 0.42);
  display: grid; place-items: center; z-index: 60; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 22px;
}
.modal h3 { font-size: 16.5px; margin-bottom: 4px; }
.modal .modal-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* balão estilo WhatsApp */
.wa-preview { background: #e7f0e4; border-radius: var(--radius-sm); padding: 16px; }
.wa-bubble {
  background: #fff; border-radius: 10px; padding: 10px 12px; font-size: 13.5px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08); max-width: 92%; white-space: pre-wrap;
}
.wa-time { font-size: 10.5px; color: var(--ink-3); text-align: right; margin-top: 4px; }
.approve-note { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }

/* ---- portal do cliente (moldura de telemóvel) ---- */
.portal-wrap { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.phone {
  width: 375px; flex: 0 0 375px; border-radius: 36px; border: 10px solid #1c1c1c;
  background: var(--page); overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.22);
}
.phone-screen { height: 700px; overflow-y: auto; }
.phone-head {
  background: linear-gradient(160deg, var(--navy) 0%, var(--accent) 100%); color: #fff; padding: 42px 18px 16px;
}
.phone-head .ph-hello { font-size: 13px; opacity: 0.85; }
.phone-head .ph-name { font-size: 18px; font-weight: 700; }
.phone-head .ph-gab { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.phone-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.pcard { background: var(--surface); border: 1px solid var(--ring); border-radius: 12px; padding: 13px 14px; }
.pcard h4 { font-size: 13.5px; margin-bottom: 6px; }
.pcard .p-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.pcard .p-item:last-child { border-bottom: none; }
.portal-side { flex: 1; min-width: 280px; }

/* ---- segurança ---- */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sec-card h3 { font-size: 14.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.sec-card p { font-size: 13px; color: var(--ink-2); }

/* ---- toast ---- */
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; font-size: 13.5px; padding: 10px 18px;
  border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- lista de clientes ---- */
.client-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.client-card { cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; display: flex; flex-direction: column; }
.client-card .cc-foot { margin-top: auto; padding-top: 12px; }
.client-card:hover { box-shadow: 0 6px 24px rgba(11,11,11,0.10); transform: translateY(-1px); }
.client-card .cc-top { display: flex; gap: 10px; align-items: center; }
.client-card .cc-name { font-weight: 650; font-size: 14.5px; }
.client-card .cc-type { font-size: 12.5px; color: var(--ink-3); }
.client-card .cc-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.search-row { margin-bottom: 14px; }
.search-row .input { max-width: 340px; }

.footnote { font-size: 12px; color: var(--ink-3); margin-top: 14px; }

/* ---- movimento & efeitos ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { width: 0; } }
@keyframes growUp { from { transform: scaleY(0.02); } to { transform: scaleY(1); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes spinner { to { transform: rotate(360deg); } }

.fade-up { animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
.modal-backdrop { animation: fadeUp 0.18s ease both; }
.modal { animation: scaleIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both; }
.meter-fill { animation: grow 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.meter-over { animation: fadeUp 0.5s ease 0.75s both; }
.card { transition: box-shadow 0.18s ease, transform 0.18s ease; }
.btn { transition: background 0.15s ease, transform 0.1s ease; }
.btn:active { transform: scale(0.97); }
#nav a { transition: background 0.15s ease, color 0.15s ease; }
.chart-bar { transform-box: fill-box; transform-origin: bottom; animation: growUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.seg-fill { animation: grow 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }

.spin {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: currentColor;
  border-radius: 50%; animation: spinner 0.7s linear infinite; vertical-align: -2px;
}
.btn .spin { border-color: rgba(4, 83, 137, 0.25); border-top-color: var(--accent); }
.btn-primary .spin { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }

.skeleton { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.sk {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 50%, #eef1f5 75%);
  background-size: 800px 100%;
  animation: shimmer 1.1s linear infinite;
}
.loading-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 50, 74, 0.55); backdrop-filter: blur(2px);
  display: grid; place-items: center; color: #fff; font-weight: 600;
  animation: fadeUp 0.2s ease both;
}
.loading-overlay .spin { width: 22px; height: 22px; margin-right: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- dashboard ---- */
.chart-card > h2 { border-bottom: none; padding-bottom: 0; margin-bottom: 2px; }
.chart-sub { font-size: 12.5px; color: var(--ink-3); padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
#tip {
  position: fixed; z-index: 95; pointer-events: none;
  background: var(--navy-deep); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 6px 10px; border-radius: 7px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; display: none;
}
.seg-row { display: grid; grid-template-columns: 170px 1fr 44px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.seg-row .seg-label { color: var(--ink-2); font-weight: 500; }
.seg-track { height: 12px; border-radius: 4px; background: var(--neutral-soft); overflow: hidden; }
.seg-fill { height: 100%; border-radius: 4px 0 0 4px; background: var(--accent); }
.seg-val { text-align: right; font-weight: 650; }

/* ---- equipa ---- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.team-card { display: flex; gap: 12px; align-items: center; }
.team-card .avatar { background: var(--navy); color: #fff; }
.team-name { font-weight: 650; font-size: 14px; }
.team-role { font-size: 12.5px; color: var(--ink-2); }
.team-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.role-select {
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: 9px 10px; font: inherit; font-size: 13.5px; background: var(--surface); color: var(--ink);
}

/* ---- responsivo ---- */
@media (max-width: 760px) {
  .shell { display: block; }
  body { overflow-x: hidden; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; overflow-x: auto; }
  .brand { padding: 0; }
  .brand-sub, .sidebar-foot .user-chip { display: none; }
  #nav { flex-direction: row; margin: 0 auto; }
  #nav a { padding: 7px 10px; white-space: nowrap; }
  .sidebar-foot { margin: 0; flex-direction: row; }
  .main { padding: 18px 16px 50px; }
  .phone { width: 100%; flex: 1 1 auto; border-radius: 24px; }
  .phone-screen { height: 560px; }
}
