/* Aparência "Dashboard V14": clara e suave, cartões bem arredondados, cápsulas no topo, barra de ícones,
   laranja como cor de destaque e preto nos botões e na aba ativa. Só vale com <html data-style="v14">.
   Carregado depois de glass.css; Q = html[data-style="v14"][data-theme] ganha das regras do tema claro/escuro do glass. */

/* ---------- variáveis ---------- */
html[data-style="v14"] {
  color-scheme: light;
  --bg: #e3e3e5; --surface: #efeff1; --surface-2: #e6e6e8; --ink: #17171a; --muted: #7d7d86; --strong: #17171a;
  --line: rgba(0, 0, 0, .07); --brand: #17171a; --brand-ink: #17171a; --accent: #e8582a;
  --ok: #1d9a54; --ok-bg: rgba(29, 154, 84, .13); --warn: #a8630a; --warn-bg: rgba(240, 160, 30, .18);
  --bad: #d3362b; --bad-bg: rgba(211, 54, 43, .11); --info-bg: rgba(232, 88, 42, .11);
  --radius: 24px; --shadow: 0 1px 0 rgba(255, 255, 255, .85) inset, 0 8px 26px rgba(0, 0, 0, .055);
  --glass-blur: none; --glass-strong: #f4f4f5; --hover: rgba(0, 0, 0, .055); --soft: rgba(0, 0, 0, .037);
  --series-1: #1c1c1f; --series-2: #ee6a3c; --viz-grid: rgba(0, 0, 0, .08); --viz-base: rgba(0, 0, 0, .25); --viz-muted: #8a8a93;
  --fin-rec: #1d9a54; --fin-des: #e0453a; --pos: #1b8a4c; --neg: #c93a30;
  --cap-bd: rgba(255, 255, 255, .75); --pill: #17171a; --pill-ink: #fff;
  --hero: linear-gradient(150deg, #f6724a 0%, #e4572a 55%, #d2461b 100%);
}
html[data-style="v14"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113; --surface: #1c1c1f; --surface-2: #26262a; --ink: #f2f2f4; --muted: #9b9ba5; --strong: #ffffff;
  --line: rgba(255, 255, 255, .085); --brand: #ffffff; --brand-ink: #ffffff; --accent: #ff7a45;
  --ok: #4ade80; --ok-bg: rgba(74, 222, 128, .15); --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .15);
  --bad: #ff8a80; --bad-bg: rgba(255, 99, 88, .16); --info-bg: rgba(255, 122, 69, .15);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 10px 28px rgba(0, 0, 0, .45);
  --glass-strong: #202023; --hover: rgba(255, 255, 255, .075); --soft: rgba(255, 255, 255, .048);
  --series-1: #f1f1f4; --series-2: #ff7a45; --viz-grid: rgba(255, 255, 255, .09); --viz-base: rgba(255, 255, 255, .28); --viz-muted: #9b9ba5;
  --fin-rec: #4ade80; --fin-des: #f87171; --pos: #86efac; --neg: #fca5a5;
  --cap-bd: rgba(255, 255, 255, .06); --pill: #f2f2f4; --pill-ink: #111113;
}

/* ---------- base ---------- */
html[data-style="v14"] body { background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
html[data-style="v14"] .liquid-bg { display: none; }
html[data-style="v14"] a { color: var(--accent); }
html[data-style="v14"] h1, html[data-style="v14"] h2, html[data-style="v14"] h3 { color: var(--strong); }
html[data-style="v14"] .main h1 { font-size: 38px; font-weight: 500; letter-spacing: -.028em; line-height: 1.1; }
html[data-style="v14"] .main h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
html[data-style="v14"] .page-head, html[data-style="v14"] .day-head { margin-bottom: 22px; }
html[data-style="v14"] .muted { color: var(--muted); }

/* ---------- estrutura: topo em cápsulas + barra de ícones ---------- */
html[data-style="v14"] .v14-shell {
  max-width: 1780px; margin: 0 auto; min-height: 100vh; padding: 18px 24px 56px;
  display: grid; grid-template-columns: 58px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 20px 22px; align-items: start;
}
html[data-style="v14"] .v14-shell .main { padding: 0; max-width: none; min-width: 0; grid-column: 2; }
html[data-style="v14"] .topbar { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
html[data-style="v14"] .cap {
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--cap-bd); box-shadow: var(--shadow);
}
html[data-style="v14"] .brand-cap { justify-self: start; gap: 10px; padding-right: 18px; }
html[data-style="v14"] .logo-dot {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(150deg, #f7794f, #d84a1e); box-shadow: 0 5px 12px rgba(232, 88, 42, .4), inset 0 1px 0 rgba(255, 255, 255, .35);
}
html[data-style="v14"] .brand-name { font-weight: 600; font-size: 15px; color: var(--strong); letter-spacing: -.01em; }
html[data-style="v14"] .topnav { justify-self: center; }
html[data-style="v14"] .topnav a {
  padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
html[data-style="v14"] .topnav a:hover { color: var(--ink); background: var(--hover); }
html[data-style="v14"] .topnav a.active { background: var(--pill); color: var(--pill-ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
html[data-style="v14"] .tools { justify-self: end; padding-left: 8px; }
html[data-style="v14"] .cap-btn, html[data-style="v14"] .rail-link {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0;
  background: transparent; color: var(--ink); cursor: pointer; transition: background-color .15s, color .15s;
}
html[data-style="v14"] .cap-btn:hover, html[data-style="v14"] .rail-link:hover { background: var(--hover); text-decoration: none; }
html[data-style="v14"] .cap-btn.on { background: var(--pill); color: var(--pill-ink); }
html[data-style="v14"] .user-chip { display: flex; align-items: center; gap: 10px; margin-left: 4px; padding: 4px 16px 4px 4px; border-radius: 999px; background: var(--soft); }
html[data-style="v14"] .user-chip b { display: block; font-size: 13px; line-height: 1.15; color: var(--strong); }
html[data-style="v14"] .user-chip small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }
html[data-style="v14"] .avatar.sm { width: 36px; height: 36px; font-size: 14px; box-shadow: none; background: linear-gradient(145deg, #4a4a50, #17171a); }

/* barra de ícones na vertical */
html[data-style="v14"] .rail { grid-column: 1; position: sticky; top: 18px; display: grid; gap: 14px; justify-items: center; align-self: start; }
html[data-style="v14"] .cap-v {
  display: grid; gap: 4px; justify-items: center; padding: 8px 6px; border-radius: 30px;
  background: var(--surface); border: 1px solid var(--cap-bd); box-shadow: var(--shadow);
}
html[data-style="v14"] .rail-link { color: var(--muted); }
html[data-style="v14"] .rail-link:hover { color: var(--ink); }
html[data-style="v14"] .rail-link.active { background: var(--pill); color: var(--pill-ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
html[data-style="v14"] .rail-sep { border: 0; border-top: 1px solid var(--line); width: 22px; margin: 4px 0; }

/* dicas ao passar o mouse sobre um ícone */
html[data-style="v14"] [data-tip]:hover::after {
  content: attr(data-tip); position: absolute; z-index: 60; white-space: nowrap; pointer-events: none;
  padding: 6px 11px; border-radius: 9px; font-size: 12px; font-weight: 500; background: #17171a; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
html[data-style="v14"] .tools [data-tip]:hover::after, html[data-style="v14"] .topbar [data-tip]:hover::after { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
html[data-style="v14"] .rail [data-tip]:hover::after { left: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
html[data-style="v14"][data-theme="dark"] [data-tip]:hover::after { background: #f2f2f4; color: #111113; }

/* ---------- cartões, botões e controles ---------- */
html[data-style="v14"] .card {
  background: var(--surface); border: 1px solid var(--cap-bd); border-radius: 24px; box-shadow: var(--shadow); padding: 20px;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
html[data-style="v14"] .card, html[data-style="v14"] .gw, html[data-style="v14"] .modal, html[data-style="v14"] .seg,
html[data-style="v14"] .viz-tip, html[data-style="v14"] .checklist, html[data-style="v14"] .sticky-head { -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-style="v14"] .stat:hover, html[data-style="v14"] .gw:hover { transform: none; }
html[data-style="v14"] .btn { border-radius: 999px; padding: 10px 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 500; box-shadow: none; }
html[data-style="v14"] .btn:hover { background: var(--hover); }
html[data-style="v14"] .btn.sm { padding: 6px 14px; }
html[data-style="v14"] .btn.primary { background: var(--pill); border-color: var(--pill); color: var(--pill-ink); box-shadow: none; }
html[data-style="v14"] .btn.primary:hover { background: var(--pill); opacity: .85; }
html[data-style="v14"] .btn.danger { color: var(--bad); border-color: rgba(211, 54, 43, .3); background: transparent; }
html[data-style="v14"] .btn.ghost { color: var(--ink); border-color: var(--line); }
html[data-style="v14"] .btn.fin-add { color: #fff; border-color: transparent; }
html[data-style="v14"] .seg { background: var(--soft); border: 0; border-radius: 999px; padding: 4px; gap: 2px; }
html[data-style="v14"] .seg button { border-radius: 999px; padding: 8px 18px; color: var(--muted); }
html[data-style="v14"] .seg button.on, html[data-style="v14"][data-theme] .seg button.on { background: var(--pill); color: var(--pill-ink); box-shadow: 0 3px 10px rgba(0, 0, 0, .16); }
html[data-style="v14"] input, html[data-style="v14"] select, html[data-style="v14"] textarea { border-radius: 14px; }
html[data-style="v14"] input:focus, html[data-style="v14"] select:focus, html[data-style="v14"] textarea:focus { outline: 2px solid rgba(232, 88, 42, .4); border-color: var(--accent); }
html[data-style="v14"] input[type="checkbox"], html[data-style="v14"] input[type="radio"], html[data-style="v14"] input[type="range"] { accent-color: var(--accent); }
html[data-style="v14"] .check input { accent-color: var(--accent); }
html[data-style="v14"] .badge { background: var(--info-bg); color: var(--accent); }
html[data-style="v14"] .badge.ok { background: var(--ok-bg); color: var(--ok); }
html[data-style="v14"] .badge.bad { background: var(--bad-bg); color: var(--bad); }
html[data-style="v14"] .badge.warn { background: var(--warn-bg); color: var(--warn); }
html[data-style="v14"] .badge.gray { background: var(--soft); color: var(--muted); }
html[data-style="v14"] th { color: var(--muted); background: var(--soft); border-bottom: 0; }
html[data-style="v14"] th:first-child { border-radius: 12px 0 0 12px; }
html[data-style="v14"] th:last-child { border-radius: 0 12px 12px 0; }
html[data-style="v14"] td { border-bottom-color: var(--line); }
html[data-style="v14"] .modal { background: var(--surface); border: 1px solid var(--cap-bd); border-radius: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
html[data-style="v14"] .overlay { background: rgba(20, 20, 24, .38); }
html[data-style="v14"] .modal-head, html[data-style="v14"] .modal-foot { border-color: var(--line); }
html[data-style="v14"] #toast { background: var(--pill); color: var(--pill-ink); border: 0; }
html[data-style="v14"] .nav-title-text, html[data-style="v14"] .brand { -webkit-text-fill-color: initial; }

/* ---------- Dashboard: cartão laranja em destaque e gráficos preto + laranja ---------- */
html[data-style="v14"] .stat { padding: 18px 20px; }
html[data-style="v14"] .stat .n { color: var(--strong); font-weight: 600; letter-spacing: -.02em; }
html[data-style="v14"] .stat-ico { background: var(--soft); border: 0; color: var(--ink); border-radius: 50%; width: 34px; height: 34px; margin-bottom: 14px; }
html[data-style="v14"] .stats.day-kpis .stat:first-child {
  background: var(--hero); border-color: rgba(255, 255, 255, .25); color: #fff;
  box-shadow: 0 14px 30px rgba(232, 88, 42, .32), inset 0 1px 0 rgba(255, 255, 255, .35);
}
html[data-style="v14"] .stats.day-kpis .stat:first-child .n, html[data-style="v14"] .stats.day-kpis .stat:first-child .l, html[data-style="v14"] .stats.day-kpis .stat:first-child .small { color: #fff; }
html[data-style="v14"] .stats.day-kpis .stat:first-child .l { opacity: .85; }
html[data-style="v14"] .stats.day-kpis .stat:first-child .stat-ico { background: rgba(255, 255, 255, .22); color: #fff; }
html[data-style="v14"] .stat.alert, html[data-style="v14"][data-theme] .stat.alert { background: var(--bad-bg); border-color: rgba(211, 54, 43, .35); }
html[data-style="v14"] .stat.alert .n, html[data-style="v14"][data-theme] .stat.alert .n { color: var(--bad); }
html[data-style="v14"] .stat.alert .stat-ico, html[data-style="v14"][data-theme] .stat.alert .stat-ico { background: rgba(211, 54, 43, .16); color: var(--bad); }

/* Financeiro: cartões neutros com número colorido; o de receitas é o destaque verde */
html[data-style="v14"][data-theme] .stat[class*="tone-"] { background: var(--surface); border-color: rgba(var(--tone), .35); }
html[data-style="v14"][data-theme] .stat[class*="tone-"] .stat-ico { background: rgba(var(--tone), .16); color: var(--tone-ink); border: 0; }
html[data-style="v14"][data-theme] .fin-stats .stat:first-child[class*="tone-"] {
  background: linear-gradient(150deg, #36c46b 0%, #1f9d55 60%, #178446 100%); border-color: rgba(255, 255, 255, .25);
  box-shadow: 0 14px 30px rgba(29, 154, 84, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
}
html[data-style="v14"][data-theme] .fin-stats .stat:first-child[class*="tone-"] .n,
html[data-style="v14"][data-theme] .fin-stats .stat:first-child[class*="tone-"] .l { color: #fff; }
html[data-style="v14"][data-theme] .fin-stats .stat:first-child[class*="tone-"] .stat-ico { background: rgba(255, 255, 255, .22); color: #fff; }
html[data-style="v14"][data-theme] .mini[class*="tone-"] { background: var(--soft); border: 0; }

/* cartões flutuantes da direita: o azul vira o laranja em destaque */
html[data-style="v14"][data-theme] .gw { background: var(--surface); color: var(--strong); border: 1px solid var(--cap-bd); border-radius: 24px; }
html[data-style="v14"][data-theme] .gw-blue { background: var(--hero); color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: 0 14px 30px rgba(232, 88, 42, .32), inset 0 1px 0 rgba(255, 255, 255, .35); }
html[data-style="v14"][data-theme] .gw[class*="tone-"] { background: var(--surface); border-color: rgba(var(--tone), .4); }
html[data-style="v14"][data-theme] .gw[class*="tone-"] .gw-big { color: var(--tone-ink); }
html[data-style="v14"] .gw-chip { background: var(--soft); }
html[data-style="v14"] .gw-blue .gw-chip { background: rgba(255, 255, 255, .25); }
html[data-style="v14"][data-theme] .gw-plus { background: var(--pill); border-color: transparent; color: var(--pill-ink); }
html[data-style="v14"][data-theme] .gw-blue .gw-plus { background: #fff; color: #d2461b; }

/* ---------- itens internos ---------- */
html[data-style="v14"] .dl-row, html[data-style="v14"] .feed-row, html[data-style="v14"] .attn-row, html[data-style="v14"] .mini, html[data-style="v14"] .ag-up { background: var(--soft); border-radius: 16px; }
html[data-style="v14"] .pcard { background: var(--surface); border-left-color: var(--line); }
html[data-style="v14"][data-theme] .pcard { background: var(--surface); }
html[data-style="v14"] .pcard .num, html[data-style="v14"] .pub-num, html[data-style="v14"] .mini-n, html[data-style="v14"] .success-line .n { color: var(--strong); }
html[data-style="v14"] .pcard.alert { background: var(--bad-bg); border-left-color: var(--bad); }
html[data-style="v14"] .pcard:hover { background: var(--hover); box-shadow: var(--shadow); }
html[data-style="v14"] .ag-cell { background: var(--surface); }
html[data-style="v14"] .ag-cell.out { background: var(--soft); }
html[data-style="v14"] .ag-head { background: var(--soft); }
html[data-style="v14"] .ag-cell.today .ag-num { background: var(--accent); }
html[data-style="v14"] .ag-chip { background: rgba(232, 88, 42, .14); }
html[data-style="v14"] .cat-track { background: transparent; }

/* ---------- Configurações (miniaturas dos tipos) ---------- */
html[data-style="v14"] .style-card.on { border-color: var(--accent); }
html[data-style="v14"] .preset.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232, 88, 42, .3); }

/* ---------- telas menores ---------- */
@media (max-width: 1100px) {
  html[data-style="v14"] .v14-shell { grid-template-columns: 1fr; padding: 12px 12px 48px; gap: 14px; }
  html[data-style="v14"] .v14-shell .main { grid-column: 1; }
  html[data-style="v14"] .topbar { grid-template-columns: 1fr; }
  html[data-style="v14"] .brand-cap, html[data-style="v14"] .tools, html[data-style="v14"] .topnav { justify-self: stretch; }
  html[data-style="v14"] .topnav { overflow-x: auto; }
  html[data-style="v14"] .user-chip div { display: none; }
  html[data-style="v14"] .rail { position: static; grid-auto-flow: column; justify-content: start; overflow-x: auto; padding-bottom: 4px; }
  html[data-style="v14"] .cap-v { grid-auto-flow: column; border-radius: 999px; padding: 6px 8px; }
  html[data-style="v14"] .rail-sep { width: 0; height: 22px; border-top: 0; border-left: 1px solid var(--line); margin: 0 4px; }
  html[data-style="v14"] .rail [data-tip]:hover::after { display: none; }
  html[data-style="v14"] .main h1 { font-size: 30px; }
}
