/* ============================================================
   Mabe Comercial — Painel · sistema visual hi-fi
   Paleta neutra quente + acento terracota. Grotesca neutra (Archivo).
   3 peles: .skin-paper · .skin-studio · .skin-tech
   Tema via [data-theme="light|dark"] no root de cada artboard.
   ============================================================ */

/* ---------- tokens: tema claro ---------- */
.mabe[data-theme="light"] {
  --bg:        #f4f1ea;
  --surface:   #fffdf9;
  --surface-2: #faf6ee;
  --raise:     #ffffff;
  --ink:       #26241f;
  --ink-2:     #6f6a60;
  --ink-3:     #9a9385;
  --hair:      #e7e0d2;
  --hair-2:    #d9d0bd;
  --accent:    #c0673f;
  --accent-2:  #a44e29;
  --accent-soft:#f2e1d5;
  --st-prospec:#b3a892;
  --st-negoc:  #c79a3e;
  --st-prop:   #cf8338;
  --st-win:    #6f8d5a;
  --st-lost:   #b1503f;
  --win:       #5d7e49;
  --win-soft:  #e2e8d7;
  --lost:      #b1503f;
  --lost-soft: #f2ddd6;
  --shadow-sm: 0 1px 2px rgba(60,45,30,.06), 0 1px 3px rgba(60,45,30,.05);
  --shadow-md: 0 2px 6px rgba(60,45,30,.06), 0 10px 24px rgba(60,45,30,.07);
}

/* ---------- tokens: tema escuro ---------- */
.mabe[data-theme="dark"] {
  --bg:        #1a1712;
  --surface:   #221f18;
  --surface-2: #2a261d;
  --raise:     #2e2a20;
  --ink:       #f0ebde;
  --ink-2:     #b4ac9a;
  --ink-3:     #807868;
  --hair:      #38332a;
  --hair-2:    #443e32;
  --accent:    #d27c50;
  --accent-2:  #e08a5d;
  --accent-soft:#3a2a20;
  --st-prospec:#8d8470;
  --st-negoc:  #cda04a;
  --st-prop:   #d68b44;
  --st-win:    #7f9b67;
  --st-lost:   #c4604c;
  --win:       #87a06c;
  --win-soft:  #2c3324;
  --lost:      #c4604c;
  --lost-soft: #38241f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,.32), 0 12px 28px rgba(0,0,0,.34);
}

/* ---------- base ---------- */
.mabe {
  --r: 12px;
  font-family: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  width: 100%; height: 100%;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.mabe *, .mabe *::before, .mabe *::after { box-sizing: border-box; }
.mabe .num { font-variant-numeric: tabular-nums; }
.mabe .mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

/* micro label */
.mabe .ml { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; white-space: nowrap; }

/* ---------- topbar ---------- */
.mabe .top {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px; border-bottom: 1px solid var(--hair);
  background: var(--surface);
}
.mabe .brand { display: flex; align-items: center; gap: 11px; }
.mabe .brand .mark {
  width: 30px; height: 30px; border-radius: 7px; flex: 0 0 auto;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: -.02em;
}
.mabe .brand .bn { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; line-height: 1; }
.mabe .brand .bs { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.mabe .top .nav { display: flex; gap: 4px; margin-left: 18px; }
.mabe .top .nav a { font-size: 13px; color: var(--ink-2); padding: 7px 12px; border-radius: 7px; text-decoration: none; font-weight: 500; }
.mabe .top .nav a.on { color: var(--ink); background: var(--surface-2); }
.mabe .top .sp { flex: 1; }
.mabe .top .search {
  display: flex; align-items: center; gap: 8px; color: var(--ink-3);
  border: 1px solid var(--hair-2); border-radius: 8px; padding: 8px 12px; font-size: 13px;
  background: var(--bg); min-width: 200px;
}
.mabe .top .av { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--hair-2); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:12px; color: var(--ink-2); }

.mabe .btn {
  font-family: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid var(--hair-2); border-radius: 8px; background: var(--surface);
  color: var(--ink); padding: 9px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.mabe .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- canvas/body ---------- */
.mabe .body { flex: 1; overflow: hidden; padding: 22px 28px; display: flex; flex-direction: column; gap: 18px; }
.mabe .page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.mabe .page-h h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.mabe .page-h > div:first-child { min-width: 0; }
.mabe .page-h .crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mabe .page-h .crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 3px; }
.mabe .seg { display: flex; gap: 2px; border: 1px solid var(--hair-2); border-radius: 9px; padding: 3px; background: var(--surface); }
.mabe .seg button { font-family: inherit; border: none; background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.mabe .seg button.on { background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- panel ---------- */
.mabe .panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 18px; }
.mabe .panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mabe .panel-h h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.mabe .panel-h .meta { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; flex: 0 0 auto; }

/* ---------- KPI ---------- */
.mabe .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mabe .kpis.k6 { grid-template-columns: repeat(6, 1fr); }
.mabe .kpis.k6 .kv { font-size: 23px; white-space: nowrap; }
.mabe .kpis.k7 { grid-template-columns: repeat(7, 1fr); }
.mabe .kpis.k7 .kv { font-size: 21px; white-space: nowrap; }
@media (max-width: 1180px) { .mabe .kpis.k6, .mabe .kpis.k7 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .mabe .kpis.k6, .mabe .kpis.k7 { grid-template-columns: repeat(2, 1fr); } }
.mabe .kpi { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 16px 17px; display: flex; flex-direction: column; gap: 9px; }
.mabe .kpi .kl { display: flex; align-items: center; justify-content: space-between; }
.mabe .kpi .kv { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.mabe .kpi .kd { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.mabe .kpi .kd.up { color: var(--win); }
.mabe .kpi .kd.down { color: var(--lost); }
.mabe .kpi.hero { background: var(--accent); border-color: var(--accent); color: #fff; }
.mabe .kpi.clk { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.mabe .kpi.clk:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.mabe .kpi.clk::after { content: '›'; position: absolute; top: 12px; right: 14px; color: var(--ink-3); font-size: 16px; opacity: .5; }
.mabe .kpi { position: relative; }
.mabe .kpi.hero.clk::after { color: rgba(255,255,255,.7); }
.mabe .frow.clk { cursor: pointer; }
.mabe .frow.clk:hover .ftrack { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 7px; }
.mabe .drawer.wide { width: min(660px, 96vw); }
.mabe .drawer .dtot { display: flex; gap: 22px; padding: 12px 22px; border-bottom: 1px solid var(--hair); background: var(--surface-2); }
.mabe .drawer .dtot .tl { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.mabe .drawer .dtot .tv { font-size: 17px; font-weight: 700; margin-top: 2px; }
.mabe .flink { color: var(--accent); font-weight: 600; cursor: pointer; }
.mabe .flink:hover { text-decoration: underline; }
.mabe .demt { text-align: center; color: var(--ink-3); font-size: 13px; padding: 36px 12px; }
.mabe .kpi.hero .ml { color: rgba(255,255,255,.78); }
.mabe .kpi.hero .kd { color: rgba(255,255,255,.85); }
.mabe .ico { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display:flex; align-items:center; justify-content:center; color: var(--ink-2); flex: 0 0 auto; }
.mabe .kpi.hero .ico { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- grid areas ---------- */
.mabe .grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; flex: 1; min-height: 0; }
.mabe .grid-2b { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.mabe .col { display: flex; flex-direction: column; gap: 16px; min-height: 0; }

/* ---------- funnel ---------- */
.mabe .funnel { display: flex; flex-direction: column; gap: 10px; }
.mabe .frow { display: grid; grid-template-columns: 116px 1fr 64px; align-items: center; gap: 12px; }
.mabe .frow .fl { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.mabe .frow .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.mabe .frow .ftrack { height: 28px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.mabe .frow .fbar { height: 100%; border-radius: 7px; display: flex; align-items: center; padding: 0 10px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.mabe .frow .fn { font-size: 12px; color: var(--ink-3); text-align: right; }
.dot.prospec, .fbar.prospec { background: var(--st-prospec); }
.dot.negoc, .fbar.negoc { background: var(--st-negoc); }
.dot.prop, .fbar.prop { background: var(--st-prop); }
.dot.win, .fbar.win { background: var(--st-win); }
.dot.lost, .fbar.lost { background: var(--st-lost); }

/* ---------- chart ---------- */
.mabe .chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.mabe .chart .cbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.mabe .chart .stack { width: 62%; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; border-radius: 6px 6px 0 0; overflow: hidden; background: var(--surface-2); }
.mabe .chart .s1 { background: var(--accent-soft); }
.mabe .chart .s2 { background: var(--st-win); }
.mabe .chart .ccap { font-size: 11px; color: var(--ink-3); }
.mabe .legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2); }
.mabe .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* ---------- table ---------- */
.mabe .tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.mabe .tbl th, .mabe .tbl td { text-align: left; padding: 9px 8px; }
.mabe .tbl thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--hair); }
.mabe .tbl tbody td { border-bottom: 1px solid var(--hair); }
.mabe .tbl tbody tr:last-child td { border-bottom: none; }
.mabe .tbl td.r, .mabe .tbl th.r { text-align: right; }
.mabe .tbl .who { display: flex; align-items: center; gap: 9px; }
.mabe .tbl .sw { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color: var(--ink-2); flex:0 0 auto; }
.mabe .rtpill { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.mabe .tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.mabe .bar-mini { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.mabe .bar-mini > i { display: block; height: 100%; background: var(--accent); }

/* =================================================================
   PELE 1 — ATELIÊ (editorial, papel, hairlines, sem sombra)
   ================================================================= */
.mabe.skin-paper { --r: 0px; }
.mabe.skin-paper .top { background: transparent; border-bottom: 1.5px solid var(--ink); }
.mabe.skin-paper .body { background: var(--bg); gap: 0; padding: 0; }
.mabe.skin-paper .body > * { padding-left: 28px; padding-right: 28px; }
.mabe.skin-paper .page-h { padding-top: 22px; padding-bottom: 18px; }
.mabe.skin-paper .page-h h1 { font-size: 27px; }
.mabe.skin-paper .kpis { gap: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.mabe.skin-paper .kpi { background: transparent; border: none; border-left: 1px solid var(--hair); border-radius: 0; padding: 18px 20px; }
.mabe.skin-paper .kpi:first-child { border-left: none; padding-left: 28px; margin-left: -28px; }
.mabe.skin-paper .kpi.hero { background: transparent; color: var(--ink); }
.mabe.skin-paper .kpi.hero .ml { color: var(--accent); }
.mabe.skin-paper .kpi.hero .kv { color: var(--accent); }
.mabe.skin-paper .kpi.hero .kd { color: var(--ink-2); }
.mabe.skin-paper .kpi .ico { display: none; }
.mabe.skin-paper .kpi .kv { font-size: 32px; }
.mabe.skin-paper .grid-2 { padding-top: 20px; padding-bottom: 22px; }
.mabe.skin-paper .panel { background: transparent; border: none; border-radius: 0; padding: 0; }
.mabe.skin-paper .col > .panel + .panel { border-top: 1px solid var(--hair); padding-top: 18px; }
.mabe.skin-paper .panel-h h3 { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.mabe.skin-paper .frow .ftrack { background: transparent; border-bottom: 1px solid var(--hair); border-radius: 0; height: 30px; }
.mabe.skin-paper .frow .fbar { border-radius: 0; color: var(--ink); background: transparent !important; position: relative; font-weight: 700; padding-left: 0; }
.mabe.skin-paper .frow .fbar::before { content:''; position:absolute; left:0; bottom:0; top:0; width:100%; opacity:.20; }
.mabe.skin-paper .frow.prospec .fbar::before{background:var(--st-prospec);} 
.mabe.skin-paper .frow.negoc .fbar::before{background:var(--st-negoc);}
.mabe.skin-paper .frow.prop .fbar::before{background:var(--st-prop);}
.mabe.skin-paper .frow.win .fbar::before{background:var(--st-win);}
.mabe.skin-paper .frow.lost .fbar::before{background:var(--st-lost);}
.mabe.skin-paper .chart .stack { background: transparent; border-radius: 0; }
.mabe.skin-paper .tbl thead th { border-bottom: 1.5px solid var(--ink); }

/* =================================================================
   PELE 2 — STUDIO (cartões brancos, sombra suave, acento, ícones)
   ================================================================= */
.mabe.skin-studio { --r: 14px; }
.mabe.skin-studio .body { background: var(--bg); }
.mabe.skin-studio .kpi, .mabe.skin-studio .panel { box-shadow: var(--shadow-sm); border-color: var(--hair); }
.mabe.skin-studio .panel { background: var(--surface); }
.mabe.skin-studio .kpi.hero { box-shadow: var(--shadow-md); }
.mabe.skin-studio .frow .ftrack { border-radius: 999px; }
.mabe.skin-studio .frow .fbar { border-radius: 999px; }
.mabe.skin-studio .chart .stack { border-radius: 8px 8px 0 0; }

/* =================================================================
   PELE 3 — MESA TÉCNICA (densa, mono, hairlines, toolbar escura)
   ================================================================= */
.mabe.skin-tech { --r: 8px; font-size: 13px; }
.mabe.skin-tech .top { background: var(--ink); border-bottom: none; padding: 11px 22px; }
.mabe.skin-tech .top, .mabe.skin-tech .top * { color: #f0ebde; }
.mabe.skin-tech .brand .mark { background: var(--accent); }
.mabe.skin-tech .brand .bs { color: rgba(240,235,222,.55); }
.mabe.skin-tech .top .nav a { color: rgba(240,235,222,.7); }
.mabe.skin-tech .top .nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.mabe.skin-tech .top .search { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: rgba(240,235,222,.65); }
.mabe.skin-tech .top .av { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #f0ebde; }
.mabe.skin-tech .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; }
.mabe.skin-tech .btn.primary { background: var(--accent); border-color: var(--accent); }
.mabe.skin-tech .body { padding: 16px 22px; gap: 13px; background: var(--bg);
  background-image: linear-gradient(var(--hair) 1px, transparent 1px), linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 22px 22px; background-position: -1px -1px; }
.mabe.skin-tech .kpis { gap: 10px; }
.mabe.skin-tech .kpi, .mabe.skin-tech .panel { border-radius: 8px; padding: 13px 14px; box-shadow: var(--shadow-sm); }
.mabe.skin-tech .panel { padding: 14px; }
.mabe.skin-tech .kpi .kv { font-size: 26px; font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.mabe.skin-tech .kpi.hero .kv { color: #fff; }
.mabe.skin-tech .num, .mabe.skin-tech .tbl td.r, .mabe.skin-tech .frow .fbar, .mabe.skin-tech .frow .fn {
  font-family: 'IBM Plex Mono', monospace; }
.mabe.skin-tech .frow { grid-template-columns: 122px 1fr 54px; gap: 10px; }
.mabe.skin-tech .frow .ftrack { height: 24px; border-radius: 4px; }
.mabe.skin-tech .frow .fbar { border-radius: 4px; font-size: 11px; }
.mabe.skin-tech .tbl th, .mabe.skin-tech .tbl td { padding: 7px 8px; }
.mabe.skin-tech .tbl tbody td { border-bottom: 1px dotted var(--hair-2); }
.mabe.skin-tech .ico { border-radius: 5px; }
.mabe.skin-tech .seg { border-radius: 7px; }
