/* =====================================================================
   hubby-shared.css — Design System Hubby v3 "Precisão calma"
   Mantém os nomes de classes/variáveis da v2 (as telas usam direto),
   com nova paleta, tipografia, componentes e responsividade.
   ===================================================================== */
/* Fontes servidas pelo próprio Hubby (funcionam sem internet) — fontes variáveis, cobrem todos os pesos */
@font-face { font-family:'Inter'; font-style:normal; font-weight:100 900; font-display:swap; src:url('fonts/inter-latin.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:100 800; font-display:swap; src:url('fonts/jetbrains-mono-latin.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* ── Escala neutra (grafite frio) ── */
  --n-0:#ffffff; --n-25:#fbfbfc; --n-50:#f6f7f9; --n-100:#eef0f3; --n-150:#e4e7ec; --n-200:#d5d9e0;
  --n-300:#b9bfc9; --n-400:#8a919e; --n-500:#646b78; --n-600:#4a505c; --n-700:#343944; --n-800:#22262e; --n-900:#14171c;
  /* ── Marca ── */
  --brand-50:#eef4ff; --brand-100:#dce8ff; --brand-200:#b9d1ff; --brand-500:#2f6bff; --brand-600:#1f56e6; --brand-700:#1a45b8;
  /* ── Semânticas (texto 700 = contraste AA) ── */
  --ok-50:#ecf8f1;  --ok-500:#1f9d57;  --ok-700:#13703c;
  --warn-50:#fff6e5; --warn-500:#e08a00; --warn-700:#995c00;
  --err-50:#fdeeee; --err-500:#dc3b3b; --err-700:#a32626;

  /* ── Papéis (nomes da v2 preservados) ── */
  --bg: var(--n-50);
  --bg-2: var(--n-100);
  --surface: var(--n-0);
  --surface-2: var(--n-25);
  --glass: rgba(255,255,255,.92);
  --border: var(--n-150);
  --border-2: var(--n-100);
  --border-strong: var(--n-200);
  --text-primary: var(--n-900);
  --text-secondary: var(--n-600);
  --text-tertiary: var(--n-400);
  --accent: var(--brand-600);
  --accent-hover: var(--brand-700);
  --accent-light: var(--brand-50);
  --accent-mid: rgba(31,86,230,.18);
  --green: #178a4c;       --green-light: var(--ok-50);
  --orange: #c26a00;      --orange-light: var(--warn-50);
  --red: #d33636;         --red-light: var(--err-50);
  --purple: #6d4fd6;      --purple-light: #f1edff;
  --teal: #0e8aa8;        --teal-light: #e3f5f9;
  --pink: #c4366b;        --pink-light: #fcedf3;
  --indigo: #4a4fd1;
  /* Acento por módulo */
  --c-imp: #0e8aa8; --c-exp: #c4366b; --c-hab: #6d4fd6; --c-fin: #178a4c; --c-com: #d9730d; --c-cad: #1f56e6; --c-adm: #4a505c;

  --sidebar-w: 248px;
  --header-h: 60px;
  --shadow-sm: 0 1px 2px rgba(20,23,28,.06), 0 1px 1px rgba(20,23,28,.03);
  --shadow-md: 0 8px 24px -6px rgba(20,23,28,.14), 0 2px 6px rgba(20,23,28,.05);
  --shadow-lg: 0 24px 64px -12px rgba(20,23,28,.30);
  --focus-ring: 0 0 0 3px rgba(47,107,255,.28);
  --radius: 12px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --font: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; -webkit-font-smoothing:antialiased; }
html { -webkit-text-size-adjust:100%; }
body { font-family:var(--font); background:var(--bg); color:var(--text-primary); min-height:100vh; display:flex; font-size:14px; line-height:1.45; letter-spacing:-0.006em; font-feature-settings:'cv11','ss01'; }
button, input, select, textarea { font-family:inherit; }
::selection { background:var(--brand-100); }
:focus-visible { outline:none; box-shadow:var(--focus-ring); border-radius:6px; }
a { color:var(--accent); }
@media (prefers-reduced-motion:reduce){ *,*::before,*::after { animation-duration:.001ms!important; transition-duration:.001ms!important; } }

/* Padrão v3: rótulos em frase normal. Neutraliza o "tudo em maiúsculas" das telas antigas
   (só estilo; o texto digitado/salvo não muda). Use .hb-keep-case para manter maiúsculas. */
body *:not(input):not(textarea):not(select):not(.hb-keep-case) { text-transform:none !important; }

/* ── ÍCONES (sprite injetado por hubby-ui.js) ── */
.hi { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; vertical-align:-3px; }
.hi-sm { width:15px; height:15px; vertical-align:-2px; }
.hi-lg { width:22px; height:22px; }

/* ── SIDEBAR ── */
.sidebar { width:var(--sidebar-w); position:fixed; top:0; left:0; bottom:0; background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; z-index:200; transition:transform .25s var(--ease); }
.sidebar-logo { padding:18px 18px 14px; display:flex; align-items:center; gap:10px; }
.logo-icon { width:32px; height:32px; background:var(--accent); border-radius:9px; display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow:0 1px 2px rgba(31,86,230,.3); }
.logo-icon svg { width:17px; height:17px; stroke:white; fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.logo-name { font-size:16px; font-weight:700; color:var(--text-primary); letter-spacing:-0.02em; }
.logo-name b { color:var(--accent); font-weight:700; }
.logo-tagline { font-size:11px; color:var(--text-tertiary); font-weight:500; }
.sidebar-nav { flex:1; overflow-y:auto; padding:4px 10px 12px; }
.sidebar-nav::-webkit-scrollbar { width:6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background:var(--n-150); border-radius:99px; }
.nav-section { font-size:11.5px; color:var(--text-tertiary); font-weight:500; padding:16px 10px 6px; }
.nav-item { display:flex; align-items:center; gap:10px; min-height:34px; padding:7px 10px; font-size:13.5px; line-height:1.25; color:var(--text-secondary); cursor:pointer; border-radius:var(--radius-xs); text-decoration:none; transition:background .12s, color .12s; position:relative; font-weight:500; margin-bottom:1px; }
.nav-item:hover { background:var(--n-100); color:var(--text-primary); }
.nav-item.active { background:var(--accent-light); color:var(--brand-700); font-weight:600; }
.nav-item.active::before { content:''; position:absolute; left:-10px; top:8px; bottom:8px; width:3px; border-radius:0 3px 3px 0; background:var(--accent); }
.nav-icon { width:20px; display:flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0; color:var(--text-tertiary); }
.nav-item:hover .nav-icon { color:var(--text-secondary); }
.nav-item.active .nav-icon { color:var(--accent); background:none; }
.nav-label { flex:1; font-weight:inherit; }
.nav-badge { font-size:10.5px; font-weight:600; padding:1px 7px; border-radius:99px; background:var(--red); color:white; min-width:18px; text-align:center; }
.nav-locked { opacity:0.45; cursor:not-allowed; pointer-events:none; }
.sidebar-footer { padding:12px; border-top:1px solid var(--border); }
.user-chip { display:flex; align-items:center; gap:10px; padding:7px; border-radius:var(--radius-xs); cursor:pointer; transition:background 0.12s; margin-bottom:8px; min-width:0; }
.user-chip:hover { background:var(--n-100); }
.user-chip > div:last-child { min-width:0; }
.user-av { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; color:var(--brand-700); flex-shrink:0; background:var(--brand-50); background-size:cover; background-position:center; }
.user-name { font-size:13px; font-weight:600; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-role { font-size:11.5px; color:var(--text-tertiary); }
.btn-logout { width:100%; height:32px; font-size:12.5px; font-weight:500; background:transparent; border:1px solid var(--border); border-radius:var(--radius-xs); color:var(--text-secondary); cursor:pointer; transition:all 0.12s; display:flex; align-items:center; justify-content:center; gap:6px; }
.btn-logout:hover { background:var(--err-50); border-color:#f3c4c4; color:var(--err-700); }

/* ── MAIN / HEADER ── */
.main { margin-left:var(--sidebar-w); flex:1; min-width:0; min-height:100vh; display:flex; flex-direction:column; }
.header { min-height:var(--header-h); background:var(--glass); backdrop-filter:saturate(180%) blur(12px); -webkit-backdrop-filter:saturate(180%) blur(12px); border-bottom:1px solid var(--border); display:flex; align-items:center; flex-wrap:wrap; padding:10px 28px; gap:10px 14px; position:sticky; top:0; z-index:50; }
.header-title { font-size:19px; font-weight:600; color:var(--text-primary); flex:1; letter-spacing:-0.015em; display:flex; align-items:center; gap:9px; min-width:0; }
.header-title .hi { color:var(--text-tertiary); width:20px; height:20px; }
.header-sub { font-size:12.5px; color:var(--text-tertiary); margin-top:1px; font-weight:400; }
.content { flex:1; padding:24px 28px 40px; min-width:0; }
.hb-menu { display:none; width:36px; height:36px; border-radius:var(--radius-xs); border:1px solid var(--border); background:var(--surface); align-items:center; justify-content:center; cursor:pointer; color:var(--text-secondary); flex-shrink:0; }
.hb-menu:hover { background:var(--n-100); }
.hb-scrim { display:none; position:fixed; inset:0; background:rgba(20,23,28,.38); z-index:190; opacity:0; transition:opacity .2s; }

/* ── BOTÕES ── */
.btn-add, .mbtn-s { height:34px; padding:0 14px; background:var(--accent); color:white; border:1px solid var(--accent); border-radius:var(--radius-xs); font-size:13px; font-weight:500; cursor:pointer; transition:background .15s, box-shadow .15s, transform .05s; white-space:nowrap; display:inline-flex; align-items:center; justify-content:center; gap:7px; box-shadow:0 1px 2px rgba(31,86,230,.25); }
.btn-add:hover, .mbtn-s:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
.btn-add:active, .mbtn-s:active, .mbtn-c:active, .action-btn:active { transform:translateY(1px); }
.mbtn-s:disabled, .btn-add:disabled { opacity:.55; cursor:not-allowed; }
.mbtn-c { height:34px; padding:0 14px; border:1px solid var(--border-strong); border-radius:var(--radius-xs); background:var(--surface); color:var(--text-primary); font-size:13px; font-weight:500; cursor:pointer; transition:background .15s, border-color .15s; box-shadow:var(--shadow-sm); display:inline-flex; align-items:center; gap:6px; }
.mbtn-c:hover { background:var(--n-50); border-color:var(--n-300); }
.mbtn-danger { height:34px; padding:0 14px; background:var(--err-500); color:white; border:1px solid var(--err-500); border-radius:var(--radius-xs); font-size:13px; font-weight:500; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.mbtn-danger:hover { background:var(--err-700); }
.action-btn { height:28px; padding:0 10px; font-size:12px; font-weight:500; border-radius:7px; border:1px solid var(--border-strong); background:var(--surface); color:var(--text-secondary); cursor:pointer; transition:all 0.12s; margin-right:4px; display:inline-flex; align-items:center; gap:5px; white-space:nowrap; }
.action-btn:hover { background:var(--accent-light); color:var(--brand-700); border-color:var(--brand-200); }
.action-btn.del:hover { background:var(--err-50); color:var(--err-700); border-color:#f3c4c4; }

/* ── BUSCA / FILTROS ── */
.search-bar { display:flex; gap:10px; margin-bottom:18px; flex-wrap:wrap; align-items:center; }
.search-input { flex:1; min-width:200px; height:36px; padding:0 12px 0 36px; border:1px solid var(--border-strong); border-radius:var(--radius-xs); font-size:13.5px; background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a919e' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; color:var(--text-primary); outline:none; transition:border-color .15s, box-shadow .15s; }
.search-input:hover, .filter-sel:hover { border-color:var(--n-300); }
.search-input:focus, .filter-sel:focus { border-color:var(--brand-500); box-shadow:var(--focus-ring); }
.search-input::placeholder { color:var(--text-tertiary); }
.filter-sel { height:36px; padding:0 30px 0 12px; border:1px solid var(--border-strong); border-radius:var(--radius-xs); font-size:13px; background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23646b78' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; -webkit-appearance:none; appearance:none; color:var(--text-primary); cursor:pointer; outline:none; transition:border-color .15s, box-shadow .15s; }

/* ── TABELA ── */
.table-wrap { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:auto; box-shadow:var(--shadow-sm); }
table { width:100%; border-collapse:collapse; }
thead tr { background:var(--surface-2); border-bottom:1px solid var(--border); }
th { padding:10px 14px; font-size:12px; font-weight:500; color:var(--text-tertiary); text-align:left; white-space:nowrap; position:sticky; top:0; background:var(--surface-2); z-index:1; }
td { padding:11px 14px; font-size:13.5px; border-bottom:1px solid var(--border-2); vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tbody tr { transition:background .1s; }
tbody tr:hover td { background:var(--n-25); }
.num-badge { display:inline-flex; align-items:center; height:22px; padding:0 7px; border-radius:6px; font-size:11.5px; font-weight:500; font-family:var(--mono); background:var(--n-100); color:var(--text-secondary); white-space:nowrap; }

/* ── BADGES / STATUS ── */
.badge { display:inline-flex; align-items:center; gap:6px; height:22px; padding:0 9px; border-radius:99px; font-size:12px; font-weight:500; white-space:nowrap; }
.badge-green { background:var(--ok-50); color:var(--ok-700); }
.badge-blue { background:var(--brand-50); color:var(--brand-700); }
.badge-orange { background:var(--warn-50); color:var(--warn-700); }
.badge-gray { background:var(--n-100); color:var(--n-600); }
.badge-red { background:var(--err-50); color:var(--err-700); }
.badge-purple { background:var(--purple-light); color:#523aa8; }
.sbadge { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:500; height:22px; padding:0 9px; border-radius:99px; }
.sbadge::before { content:''; width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.sbadge.approved { background:var(--ok-50); color:var(--ok-700); } .sbadge.approved::before { background:var(--ok-500); }
.sbadge.pending { background:var(--warn-50); color:var(--warn-700); } .sbadge.pending::before { background:var(--warn-500); }
.sbadge.blocked { background:var(--err-50); color:var(--err-700); } .sbadge.blocked::before { background:var(--err-500); }

/* ── ESTADO VAZIO / CARREGANDO ── */
.empty-state { text-align:center; padding:44px 24px; }
.empty-icon { width:48px; height:48px; border-radius:14px; background:var(--n-100); color:var(--text-secondary); display:flex; align-items:center; justify-content:center; margin:0 auto 12px; font-size:22px; }
.empty-icon .hi { width:22px; height:22px; }
.empty-text { font-size:14px; font-weight:600; color:var(--text-primary); }
.empty-sub { font-size:13px; color:var(--text-secondary); margin-top:4px; }
.loading { display:flex; align-items:center; justify-content:center; padding:48px; }
.spinner { width:26px; height:26px; border:2.5px solid var(--n-150); border-top-color:var(--accent); border-radius:50%; animation:spin 0.7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.skeleton { background:linear-gradient(90deg,var(--n-100) 0%,var(--n-50) 50%,var(--n-100) 100%); background-size:200% 100%; animation:hb-sh 1.2s linear infinite; border-radius:6px; }
@keyframes hb-sh { to { background-position:-200% 0; } }

/* ── MODAL ── */
.modal-ov { display:none; position:fixed; inset:0; background:rgba(20,23,28,.42); z-index:1000; align-items:center; justify-content:center; padding:20px; }
.modal-ov.open { display:flex; animation:hb-fade .16s ease-out; }
.modal-ov.open .modal-box { animation:hb-pop .22s var(--ease); }
@keyframes hb-fade { from { opacity:0; } }
@keyframes hb-pop { from { opacity:0; transform:translateY(10px) scale(.985); } }
.modal-box { background:var(--surface); border-radius:14px; box-shadow:var(--shadow-lg); width:100%; max-width:560px; max-height:calc(100vh - 40px); overflow-y:auto; }
.modal-box.wide { max-width:760px; }
.modal-box.xwide { max-width:980px; }
.modal-title { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 22px 14px; border-bottom:1px solid var(--border); font-size:16px; font-weight:600; letter-spacing:-.01em; color:var(--text-primary); position:sticky; top:0; background:var(--surface); z-index:2; }
.modal-close { width:30px; height:30px; border-radius:8px; border:none; background:transparent; cursor:pointer; font-size:14px; display:flex; align-items:center; justify-content:center; color:var(--text-tertiary); transition:all 0.12s; flex-shrink:0; }
.modal-close:hover { background:var(--n-100); color:var(--text-primary); }
.modal-btns { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; padding:14px 22px; border-top:1px solid var(--border); position:sticky; bottom:0; background:var(--surface); }

/* ── FORMULÁRIO ── */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px 16px; padding:20px 22px; }
.form-grid.single { grid-template-columns:1fr; }
.fgroup { display:flex; flex-direction:column; gap:6px; min-width:0; }
.fgroup label { font-size:12.5px; font-weight:500; color:var(--text-secondary); }
.fgroup input, .fgroup select, .fgroup textarea { min-height:36px; padding:8px 12px; border:1px solid var(--border-strong); border-radius:var(--radius-xs); font-size:13.5px; color:var(--text-primary); background:var(--surface); outline:none; transition:border-color 0.15s, box-shadow .15s; width:100%; }
.fgroup input:hover, .fgroup select:hover, .fgroup textarea:hover { border-color:var(--n-300); }
.fgroup input:focus, .fgroup select:focus, .fgroup textarea:focus { border-color:var(--brand-500); box-shadow:var(--focus-ring); }
.fgroup input:disabled, .fgroup select:disabled { background:var(--n-50); color:var(--text-tertiary); }
.fgroup textarea { resize:vertical; min-height:84px; line-height:1.5; }
.sec-label { grid-column:1/-1; font-size:13px; font-weight:600; color:var(--text-primary); padding-top:14px; border-top:1px solid var(--border-2); margin-top:4px; }

/* ── KANBAN ── */
.kanban-board { display:flex; gap:12px; overflow-x:auto; padding-bottom:16px; align-items:flex-start; scroll-snap-type:x proximity; }
.kanban-board::-webkit-scrollbar { height:8px; }
.kanban-board::-webkit-scrollbar-thumb { background:var(--n-200); border-radius:99px; }
.kanban-col { flex:0 0 288px; background:var(--n-100); border-radius:var(--radius); overflow:hidden; scroll-snap-align:start; }
.kanban-col-header { padding:12px 14px 8px; display:flex; align-items:center; justify-content:space-between; gap:8px; border-bottom:none!important; }
.kanban-col-title { font-size:13px; font-weight:600; display:flex; align-items:center; gap:8px; color:var(--text-primary)!important; }
.kanban-col-title .hi { color:var(--text-tertiary); }
.kanban-col-count { font-size:12px; font-weight:500; padding:1px 8px; border-radius:99px; background:var(--surface); color:var(--text-secondary); }
.kanban-col-body { padding:4px 8px 10px; display:flex; flex-direction:column; gap:8px; min-height:120px; }
.kanban-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:12px; cursor:pointer; transition:box-shadow .15s var(--ease), transform .15s var(--ease), border-color .15s; position:relative; box-shadow:var(--shadow-sm); }
.kanban-card:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); border-color:var(--n-200); }
.kanban-card-title { font-size:13.5px; font-weight:600; color:var(--text-primary); margin-bottom:4px; line-height:1.35; }
.kanban-card-sub { font-size:12.5px; color:var(--text-secondary); margin-bottom:8px; }
.kanban-card-meta { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px; }
.kanban-card-num { font-size:11px; font-weight:500; font-family:var(--mono); color:var(--text-tertiary); }
.kanban-card-tags { display:flex; gap:4px; flex-wrap:wrap; }
.kanban-tag { font-size:11.5px; padding:1px 8px; border-radius:99px; font-weight:500; }

/* ── DASHBOARD ── */
.section-title { font-size:13px; font-weight:600; color:var(--text-secondary); margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.module-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(232px,1fr)); gap:12px; margin-bottom:32px; }
.module-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; text-decoration:none; color:var(--text-primary); transition:border-color .15s, box-shadow .15s var(--ease), transform .15s var(--ease); display:grid; grid-template-columns:40px 1fr; grid-template-rows:auto auto; column-gap:12px; row-gap:2px; align-items:center; position:relative; cursor:pointer; box-shadow:var(--shadow-sm); }
.module-card:hover { border-color:var(--brand-200); box-shadow:var(--shadow-md); transform:translateY(-1px); }
.module-card.locked { opacity:0.45; pointer-events:none; }
.module-card-icon { grid-row:1 / span 2; width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; background:var(--brand-50); color:var(--accent); }
.module-card-icon .hi { width:20px; height:20px; }
.module-card-title { font-size:14px; font-weight:600; color:var(--text-primary); letter-spacing:-0.01em; align-self:end; }
.module-card-desc { font-size:12.5px; color:var(--text-secondary); line-height:1.4; align-self:start; }
.module-card-arrow { position:absolute; right:14px; top:16px; font-size:14px; color:var(--text-tertiary); transition:all .15s; opacity:0; }
.module-card:hover .module-card-arrow { opacity:1; right:12px; color:var(--accent); }
.mc-clientes .module-card-icon { background:var(--brand-50); color:var(--c-cad); }
.mc-fornecedores .module-card-icon { background:var(--warn-50); color:var(--c-com); }
.mc-comercial .module-card-icon { background:#fff1e5; color:var(--c-com); }
.mc-financeiro .module-card-icon { background:var(--ok-50); color:var(--c-fin); }
.mc-importacao .module-card-icon { background:var(--teal-light); color:var(--c-imp); }
.mc-exportacao .module-card-icon { background:var(--pink-light); color:var(--c-exp); }
.mc-radar .module-card-icon, .mc-hab .module-card-icon { background:var(--purple-light); color:var(--c-hab); }
.mc-kpi .module-card-icon { background:var(--brand-50); color:var(--accent); }
.stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; margin-bottom:28px; }
.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--shadow-sm); display:flex; align-items:center; gap:12px; transition:border-color .15s; }
.stat-card:hover { border-color:var(--n-200); }
.stat-icon { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; color:var(--text-secondary); }
.stat-icon .hi { width:19px; height:19px; }
.stat-val { font-weight:600; font-size:22px; letter-spacing:-0.02em; color:var(--text-primary); line-height:1.1; font-variant-numeric:tabular-nums; }
.stat-label { font-size:12.5px; color:var(--text-secondary); margin-top:2px; font-weight:400; }

/* ── ABAS (segmentado) ── */
.tabs-bar { display:inline-flex; gap:2px; margin-bottom:18px; background:var(--n-100); padding:3px; border-radius:var(--radius-sm); max-width:100%; overflow-x:auto; }
.tab-btn { height:30px; padding:0 14px; font-size:13px; font-weight:500; border:none; border-radius:7px; cursor:pointer; background:transparent; color:var(--text-secondary); transition:all 0.12s; white-space:nowrap; display:inline-flex; align-items:center; gap:6px; }
.tab-btn:hover { color:var(--text-primary); }
.tab-btn.active { background:var(--surface); color:var(--text-primary); box-shadow:var(--shadow-sm); }

/* ── URGÊNCIA ── */
.urgencia-alta { border-left:3px solid var(--err-500) !important; }
.urgencia-media { border-left:3px solid var(--warn-500) !important; }
.urgencia-baixa { border-left:3px solid var(--ok-500) !important; }

/* ── AVISOS (toast) e DIÁLOGO (hubby-ui.js) ── */
.hb-toasts { position:fixed; right:20px; bottom:20px; display:flex; flex-direction:column; gap:8px; z-index:3000; pointer-events:none; }
.hb-toast { background:var(--n-900); color:#fff; border-radius:10px; padding:10px 14px; font-size:13px; font-weight:500; display:flex; align-items:center; gap:10px; box-shadow:var(--shadow-lg); max-width:380px; pointer-events:auto; animation:hb-pop .2s var(--ease); }
.hb-toast.ok .hi { color:#5fd99a; } .hb-toast.erro { background:var(--err-700); } .hb-toast.aviso .hi { color:#ffc35c; }
.modal-ov.hb-dialog { z-index:5000; }
.hb-dialog .modal-box { max-width:440px; }
.hb-dialog-body { padding:20px 22px 6px; display:flex; gap:14px; }
.hb-dialog-ico { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; background:var(--brand-50); color:var(--accent); }
.hb-dialog-ico.danger { background:var(--err-50); color:var(--err-700); }
.hb-dialog h3 { font-size:15.5px; font-weight:600; margin-bottom:4px; }
.hb-dialog p { font-size:13.5px; color:var(--text-secondary); line-height:1.5; white-space:pre-line; }
.hb-dialog .modal-btns { border-top:none; padding-top:16px; }

/* ── RESPONSIVO ── */
@media (max-width:1100px) {
  .content { padding:20px; }
  .header { padding:10px 20px; }
}
@media (max-width:1024px) {
  .sidebar { transform:translateX(-100%); box-shadow:var(--shadow-lg); }
  body.hb-nav-open .sidebar { transform:none; }
  body.hb-nav-open .hb-scrim { display:block; opacity:1; }
  .main { margin-left:0; }
  .hb-menu { display:inline-flex; }
}
@media (max-width:640px) {
  .content { padding:16px; }
  .header { padding:10px 16px; }
  .header-title { font-size:17px; }
  /* Ações do cabeçalho: linha própria, botões compactos lado a lado */
  .header > div:has(> .header-title) { flex:1 1 calc(100% - 50px); min-width:0; }
  .header button:not(.hb-menu):not(.modal-close), .header .btn-add, .header .mbtn-c { height:32px; min-height:32px; padding:0 10px; font-size:12.5px; white-space:nowrap; }
  .header > div:not(:has(.header-title)) { display:flex; flex-wrap:wrap; gap:6px; }
  .form-grid { grid-template-columns:1fr; padding:16px; }
  .modal-ov { padding:0; align-items:flex-end; }
  .modal-box, .modal-box.wide, .modal-box.xwide { max-width:100%; max-height:92vh; border-radius:16px 16px 0 0; }
  .modal-title, .modal-btns { padding-left:16px; padding-right:16px; }
  .kanban-col { flex-basis:84vw; }
  .module-grid { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .search-input { min-width:0; flex-basis:100%; }
  .hb-toasts { left:16px; right:16px; bottom:16px; }
  .hb-toast { max-width:none; }
  td, th { padding-left:10px; padding-right:10px; }

  /* Tabelas viram cartões (rótulos vindos do cabeçalho via hubby-ui.js) */
  .table-wrap { overflow:visible !important; background:transparent !important; border:none !important; box-shadow:none !important; }
  .table-wrap table.hb-cardable { min-width:0 !important; display:block; }
  .table-wrap table.hb-cardable thead { display:none; }
  .table-wrap table.hb-cardable tbody { display:flex; flex-direction:column; gap:10px; }
  .table-wrap table.hb-cardable tr { display:block; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:6px 14px; box-shadow:var(--shadow-sm); }
  .table-wrap table.hb-cardable td { display:grid; grid-template-columns:32% minmax(0,1fr); column-gap:12px; align-items:center; padding:7px 0 !important; border:none !important; min-width:0 !important; font-size:13.5px; white-space:normal !important; }
  .table-wrap table.hb-cardable td + td { border-top:1px solid var(--border-2) !important; }
  .table-wrap table.hb-cardable td::before { content:attr(data-label); grid-column:1; grid-row:1 / span 9; font-size:12px; color:var(--text-tertiary); align-self:start; padding-top:2px; }
  .table-wrap table.hb-cardable td > * { grid-column:2; min-width:0; justify-self:start; }
  .table-wrap table.hb-cardable td[data-label=""]::before { content:''; }
  /* Coluna de ações: botões lado a lado */
  .table-wrap table.hb-cardable td:last-child:has(button) { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
  .table-wrap table.hb-cardable td:last-child:has(button)::before { flex:0 0 calc(32% - 6px); }
  .table-wrap table.hb-cardable tr:hover td { background:transparent; }
  .table-wrap table.hb-cardable tr.hb-row-full { display:block; }
  .table-wrap table.hb-cardable tr.hb-row-full td { display:block; }
  .table-wrap table.hb-cardable tr.hb-row-full td::before { content:none; }
  .table-wrap .pag-bar { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); margin-top:10px; }
}
/* Chat interno e banner de notificação (montados pelo hubby-shared.js) */
#hubby-chat { background:var(--surface)!important; border-radius:14px!important; }
#hubby-chat input#chat-input { border-color:var(--border-strong)!important; height:36px; }
#hubby-chat input#chat-input:focus { border-color:var(--brand-500)!important; box-shadow:var(--focus-ring); }
@media (max-width:720px) {
  #hubby-chat { inset:0!important; width:auto!important; height:auto!important; border-radius:0!important; }
  #chat-sidebar { width:128px!important; min-width:128px!important; }
  #hubby-notif-toast { left:16px!important; right:16px!important; width:auto!important; }
}
@media print {
  .sidebar, .hb-menu, .hb-scrim, .hb-toasts { display:none!important; }
  .main { margin-left:0!important; }
  .header { position:static; backdrop-filter:none; }
}
