/* ==========================================================================
   CRM IP Consultoria — Design System
   Identidade extraída de ipconsultoria.pt: navy #122232, azul de ação #1e4a7c,
   dourado discreto #a08c62, fundo #f4f6fa, tipografia Plus Jakarta Sans.
   Regra: fundos neutros; a cor da marca só em ações, estados ativos e destaques.
   ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Marca */
  --primary: #1e4a7c;
  --primary-dark: #16365f;
  --primary-light: #e8eef6;
  --primary-50: #f3f6fa;
  --navy: #122232;
  --navy-mid: #1a3148;
  --gold: #a08c62;
  --gold-dark: #756440;
  --gold-soft: #f5f0e4;

  /* Neutros */
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e8ef;
  --border-strong: #cdd5e0;
  --ink: #0c1222;
  --text: #2b3a4d;
  --muted: #5a6778;
  --subtle: #8b97a7;

  /* Estados (secundários — nunca competem com a marca) */
  --success: #1f7a4d;   --success-bg: #e6f4ec;
  --warning: #9a5b0a;   --warning-bg: #fcf0dc;
  --danger:  #b3372b;   --danger-bg:  #fbe9e6;
  --info:    #2a6fb0;   --info-bg:    #e6f0fa;

  /* Forma */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(18, 34, 58, .06);
  --shadow-md: 0 4px 16px rgba(18, 34, 58, .08);
  --shadow-lg: 0 16px 40px rgba(18, 34, 58, .16);
  --ring: 0 0 0 3px rgba(30, 74, 124, .20);

  /* Layout */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 56px;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* Aliases das páginas anteriores (mantidos para não partir nada) */
  --azul: var(--primary); --azul-claro: var(--primary-light);
  --texto: var(--text); --texto-suave: var(--muted); --borda: var(--border);
  --fundo: var(--bg); --branco: var(--surface);
  --verde: var(--success); --amarelo: var(--warning); --vermelho: var(--danger);
  --radius-legacy: var(--radius);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3, h4 { color: var(--navy); margin: 0; letter-spacing: -.01em; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Tipografia ---------- */
.t-page-title { font-size: 22px; font-weight: 700; }
.t-page-sub { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.t-section { font-size: 15px; font-weight: 700; }
.t-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); }
.t-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- Botões ---------- */
.btn, .card-form button, .toolbar button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--navy);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover, .toolbar button:hover { background: var(--surface-2); border-color: var(--subtle); }
.btn-primary, .card-form button {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.btn-primary:hover, .card-form button:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--primary-50); border-color: transparent; color: var(--navy); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #952d23; border-color: #952d23; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { width: 34px; padding: 0; }
.btn[disabled], button[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg, .icone { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Campos ---------- */
.input, .select, .textarea, .toolbar input, .toolbar select,
.card-form input:not([type=checkbox]):not([type=radio]), .card-form select, .card-form textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); width: 100%;
}
.textarea, .card-form textarea { height: auto; padding: 8px 10px; }
.toolbar input, .toolbar select { width: auto; }
.input:hover, .select:hover { border-color: var(--subtle); }
.input:focus, .select:focus, .textarea:focus, .toolbar input:focus, .toolbar select:focus,
.card-form input:focus, .card-form select:focus, .card-form textarea:focus, .login-card input:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.input::placeholder, .card-form input::placeholder { color: var(--subtle); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field-error .input { border-color: var(--danger); }
.field-hint { font-size: 12px; color: var(--subtle); }
.field-hint.err { color: var(--danger); }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
}
.login-card {
  background: var(--surface); width: 100%; max-width: 380px; padding: 32px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 16px; border-top: 3px solid var(--gold);
}
.login-card .login-logo { height: 40px; width: auto; align-self: flex-start; margin-bottom: 4px; }
.login-card h1 { font-size: 18px; font-weight: 700; }
.login-card .login-sub { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.login-card input { height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 14px; }
.login-card button {
  height: 40px; background: var(--primary); color: #fff; border: 0; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; margin-top: 4px;
}
.login-card button:hover { background: var(--primary-dark); }
.erro { color: var(--danger); font-size: 13px; margin: 0; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; z-index: 40;
  transition: width .2s var(--ease);
}
.sidebar-topo { height: var(--topbar-h); display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-topo .logo-full { height: 30px; width: auto; }
.sidebar-topo .logo-mini { display: none; width: 34px; height: 34px; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; align-items: center; justify-content: center; border-bottom: 2px solid var(--gold); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-grupo { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); padding: 14px 10px 6px; }
.nav-grupo:first-child { padding-top: 4px; }
.sidebar-nav a {
  position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: var(--radius); font-size: 13.5px; font-weight: 500; color: var(--muted);
}
.sidebar-nav a .icone { width: 18px; height: 18px; color: var(--subtle); }
.sidebar-nav a:hover { background: var(--primary-50); color: var(--navy); }
.sidebar-nav a:hover .icone { color: var(--navy); }
.sidebar-nav a.ativo { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-nav a.ativo .icone { color: var(--primary); }
.sidebar-nav a.ativo::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.sidebar-rodape { border-top: 1px solid var(--border); padding: 12px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sidebar-rodape .u-info { min-width: 0; flex: 1; }
.sidebar-rodape .u-nome { font-size: 13px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-rodape .u-cargo { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.btn-logout { background: transparent; border: 0; color: var(--muted); width: 32px; height: 32px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; }
.btn-logout:hover { background: var(--danger-bg); color: var(--danger); }

.app-shell.recolhida .sidebar { width: var(--sidebar-w-collapsed); }
.app-shell.recolhida .sidebar-topo { padding: 0; justify-content: center; }
.app-shell.recolhida .logo-full, .app-shell.recolhida .nav-grupo span, .app-shell.recolhida .nav-label,
.app-shell.recolhida .u-info { display: none; }
.app-shell.recolhida .logo-mini { display: inline-flex; }
.app-shell.recolhida .nav-grupo { height: 1px; padding: 0; margin: 10px 8px; background: var(--border); }
.app-shell.recolhida .sidebar-nav a { justify-content: center; padding: 0; }
.app-shell.recolhida .sidebar-nav a.ativo::before { left: -10px; }
.app-shell.recolhida .sidebar-rodape { flex-direction: column; padding: 10px 0; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.topbar .spacer { flex: 1; }
.pesquisa-global { position: relative; width: 100%; max-width: 440px; }
.pesquisa-global .icone { position: absolute; left: 10px; top: 9px; color: var(--subtle); }
.pesquisa-global input { padding-left: 34px; background: var(--bg); border-color: transparent; }
.pesquisa-global input:focus { background: var(--surface); }
.pesquisa-global kbd { position: absolute; right: 8px; top: 7px; font: 600 11px var(--font); color: var(--subtle); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 6px; background: var(--surface); }
.pesquisa-resultados { position: absolute; top: 40px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-height: 380px; overflow-y: auto; padding: 6px; z-index: 60; }
.pesquisa-resultados a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); font-size: 13px; color: var(--ink); }
.pesquisa-resultados a:hover, .pesquisa-resultados a.sel { background: var(--primary-50); }
.pesquisa-resultados .tipo { margin-left: auto; font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: .05em; }
.pesquisa-resultados .vazio { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }
.topbar .badge-dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.topbar .rel { position: relative; }

.conteudo { flex: 1; padding: 24px; max-width: 1480px; width: 100%; margin: 0 auto; }
.pagina > h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.pagina > h3 { font-size: 15px; font-weight: 700; margin: 24px 0 12px; }

/* Menu suspenso */
.dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.dropdown a, .dropdown button.item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; background: transparent; border-radius: var(--radius); font-size: 13px; color: var(--ink); text-align: left; }
.dropdown a:hover, .dropdown button.item:hover { background: var(--primary-50); }
.dropdown .sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown .titulo { padding: 6px 10px 4px; }
.dropdown .item .icone { color: var(--muted); }

/* ---------- Cartões, KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-top .icone { color: var(--subtle); }
.kpi-num { font-size: 28px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-num.txt-sm { font-size: 22px; }
.kpi-foot { font-size: 12px; color: var(--subtle); display: flex; align-items: center; gap: 6px; min-height: 18px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12px; }
.trend.up { color: var(--success); } .trend.down { color: var(--danger); } .trend.flat { color: var(--subtle); }
.trend .icone { width: 13px; height: 13px; stroke-width: 2.25; }
.kpi.link { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.kpi.link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

/* Legado */
.stat-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; min-width: 150px; }
.stat strong { display: block; font-size: 24px; font-weight: 800; color: var(--navy); }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- Tabelas ---------- */
table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .02em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:hover > td { background: var(--primary-50); }
td .toolbar { margin: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.table-wrap table { border-radius: var(--radius-lg); }

/* ---------- Badges, avatares ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eceff4; color: var(--muted); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success, .badge-verde { background: var(--success-bg); color: var(--success); }
.badge-warning, .badge-amarelo { background: var(--warning-bg); color: var(--warning); }
.badge-danger, .badge-vermelho { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral, .badge-cinza { background: #eceff4; color: var(--muted); }
.badge-gold { background: var(--gold-soft); color: var(--gold-dark); }
.badge .dot, .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--subtle); }
.prio.alta { background: var(--danger); } .prio.media { background: #d99a2b; } .prio.baixa { background: var(--success); }

/* ---------- Tabs, segmentado ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--navy); }
.tabs button.ativo { color: var(--primary); border-bottom-color: var(--primary); }
.segmented { display: inline-flex; background: #eceff4; border-radius: var(--radius); padding: 2px; }
.segmented button { height: 28px; padding: 0 12px; border: 0; background: transparent; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.segmented button.ativo { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-sm); }

/* ---------- Toolbar, cartão-formulário (legado + novo) ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.card-form { background: var(--surface); padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); max-width: 520px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.card-form h3 { font-size: 15px; }
.card-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.card-form label:has(input[type=checkbox]) { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.card-form button { align-self: flex-start; }
.card-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.card-form legend { font-size: 12px; font-weight: 700; color: var(--navy); padding: 0 6px; }
.msg-vazio { color: var(--muted); padding: 12px 0; font-size: 13.5px; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-coluna { background: #eef1f6; border-radius: var(--radius-lg); width: 264px; flex-shrink: 0; display: flex; flex-direction: column; }
.kanban-coluna h3 { padding: 12px 14px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.kanban-lista { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 72px; flex: 1; border-radius: var(--radius); transition: background .15s; }
.kanban-lista.drag-over { background: var(--primary-light); outline: 2px dashed var(--primary); outline-offset: -4px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s; }
.kanban-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.kanban-card:active { cursor: grabbing; }
.kanban-card strong { display: block; color: var(--navy); font-weight: 600; margin-bottom: 2px; }
.kanban-card small { color: var(--muted); font-size: 12px; }
.kanban-card .kc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.kanban-card .kc-valor { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.kanban.compacto .kanban-coluna { width: 220px; }

/* ---------- Progresso, alertas, timeline ---------- */
.progresso { background: #e6eaf0; border-radius: 999px; height: 6px; overflow: hidden; width: 160px; }
.progresso > div { background: var(--primary); height: 100%; border-radius: 999px; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 13px; border: 1px solid; align-items: flex-start; }
.alert .icone { margin-top: 1px; }
.alert-info { background: var(--info-bg); border-color: #c7dcf1; color: #1d4f80; }
.alert-success { background: var(--success-bg); border-color: #bfe0cd; color: #185c3a; }
.alert-warning { background: var(--warning-bg); border-color: #f0d9ab; color: #7a480a; }
.alert-danger { background: var(--danger-bg); border-color: #f0c4be; color: #8e2c22; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 1px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline li.gold::before { border-color: var(--gold); }
.timeline .tl-title { font-weight: 600; color: var(--navy); font-size: 13.5px; }
.timeline .tl-meta { font-size: 12px; color: var(--subtle); margin-top: 1px; }
.timeline .tl-desc { font-size: 13px; color: var(--text); margin-top: 4px; }

/* ---------- Lista de atividades ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.lista li:last-child { border-bottom: 0; }
.lista .l-main { min-width: 0; flex: 1; }
.lista .l-title { font-size: 13.5px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .l-sub { font-size: 12px; color: var(--muted); }
.lista .l-when { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 56px; font-variant-numeric: tabular-nums; }
.lista .l-when.atraso { color: var(--danger); }

/* ---------- Modal, drawer, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 18, 34, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease-out; }
.overlay.drawer-pos { justify-content: flex-end; padding: 0; align-items: stretch; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .18s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.drawer { background: var(--surface); width: 100%; max-width: 440px; height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .22s var(--ease); }
.drawer .modal-body { flex: 1; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 14px; background: var(--navy); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13px; animation: pop .18s var(--ease); border-left: 3px solid var(--gold); }
.toast.success { border-left-color: #3fb27f; } .toast.error { border-left-color: #e5665a; }
.tooltip { position: relative; }
.tooltip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 70; }
.tooltip:hover::after { opacity: 1; }

/* ---------- Empty, skeleton ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; gap: 8px; }
.empty .empty-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.empty .empty-ico .icone { width: 24px; height: 24px; }
.empty h3 { font-size: 16px; }
.empty p { margin: 0 0 8px; color: var(--muted); max-width: 380px; }
.skeleton { background: linear-gradient(90deg, #e9edf3 25%, #f3f5f9 37%, #e9edf3 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
.sk-line { height: 12px; margin: 8px 0; } .sk-num { height: 28px; width: 60%; } .sk-block { height: 90px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slide { from { transform: translateX(32px); opacity: 0; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Responsivo ---------- */
.so-mobile { display: none; }
@media (max-width: 1280px) { .grid-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .so-mobile { display: inline-flex; }
  .so-desktop { display: none !important; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s var(--ease); width: 264px !important; box-shadow: var(--shadow-lg); }
  .app-shell.menu-aberto .sidebar { transform: none; }
  .app-shell.menu-aberto::after { content: ""; position: fixed; inset: 0; background: rgba(12,18,34,.4); z-index: 35; }
  .app-shell.recolhida .logo-full, .app-shell.recolhida .nav-label, .app-shell.recolhida .u-info { display: initial; }
  .app-shell.recolhida .logo-mini { display: none; }
  .conteudo { padding: 16px; }
  .topbar { padding: 0 12px; }
}
@media (max-width: 640px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-num { font-size: 24px; }
  .btn-criar .lbl, .pesquisa-global kbd { display: none; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .card-form { max-width: none; }
  .modal { max-width: none; }
}

/* ---------- Calendário ---------- */
.cal-grelha { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.cal-cab { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-dia { min-height: 108px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-dia:nth-child(7n) { border-right: 0; }
.cal-dia:hover { background: var(--primary-50); }
.cal-dia.fora { background: var(--surface-2); }
.cal-dia.fora .cal-num { color: var(--subtle); }
.cal-grelha.semana .cal-dia { min-height: 320px; }
.cal-num { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-dia.hoje .cal-num { background: var(--primary); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; border-radius: 4px; padding: 2px 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-family: inherit; }
.cal-tarefa { background: var(--primary-light); color: var(--primary); }
.cal-atraso { background: var(--danger-bg); color: var(--danger); }
.cal-feito { background: var(--success-bg); color: var(--success); text-decoration: line-through; }
.cal-contacto { background: var(--gold-soft); color: var(--gold-dark); }
.cal-mais { background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 600; text-align: left; padding: 0 6px; cursor: pointer; font-family: inherit; }
@media (max-width: 640px) { .cal-dia { min-height: 64px; padding: 3px; } .cal-chip { font-size: 10px; padding: 1px 3px; } .cal-grelha.semana .cal-dia { min-height: 200px; } }

/* ---------- Gráficos leves ---------- */
.bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-rotulo { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-pista { height: 10px; background: #eceff4; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }
.bar-valor { font-weight: 600; color: var(--navy); min-width: 40px; text-align: right; }
.col-chart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 8px; }
.col-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.col-barra { width: 100%; max-width: 44px; background: var(--primary); border-radius: 4px 4px 0 0; }
.col-num { font-size: 12px; font-weight: 700; color: var(--navy); }
.col-rotulo { font-size: 12px; color: var(--muted); text-transform: capitalize; }
@media (max-width: 1280px) { .grid-kpi[style*="repeat(5"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 640px) { .grid-kpi[style*="repeat(5"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .bar-row { grid-template-columns: 90px minmax(0, 1fr) auto; } }
