  :root{
    /* Cores vêm de /css/brand.css (tokens da marca); os valores após a vírgula são reserva. */
    --ink:var(--fs-ink,#0D1626); --ink-soft:var(--fs-ink-2,#121E33); --ink-softer:var(--fs-ink-3,#182742);
    --orange:var(--fs-blue,#3455DB); --orange-bright:var(--fs-blue-hover,#4A69EC); /* ação principal (nome legado) */
    --text:var(--fs-text,#EEF2F8); --text-muted:var(--fs-muted,#93A3BC); --line:rgba(238,242,248,0.12);
    --good:#4CAF7D; --bad:#E4594F;
    --sidebar-bg:var(--fs-ink-2,#121E33); --sidebar-line:var(--fs-line,#243A5C); --amber:var(--fs-teal,#13C6B5); /* destaque (nome legado) */
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  body{
    background:var(--ink); color:var(--text); font-family:'Inter',sans-serif;
    min-height:100vh; display:flex; flex-direction:column;
  }
  .logo{display:flex; align-items:center; gap:9px; justify-content:center; margin-bottom:28px;}
  .logo-text{font-family:'Archivo',sans-serif; font-weight:700; font-size:20px;}
  .logo .tick{color:var(--orange);}
  .card{background:var(--ink-soft); border:1px solid var(--line); border-radius:12px; padding:24px; box-shadow:0 10px 28px -16px rgba(0,0,0,0.5);}
  .card-title{font-family:'Archivo',sans-serif; font-size:16px; font-weight:700;}
  h1{font-family:'Archivo',sans-serif; font-size:22px; font-weight:700; margin-bottom:6px;}
  .sub{color:var(--text-muted); font-size:13.5px; margin-bottom:24px;}
  label{font-size:11px; font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted); display:block; margin-bottom:5px;}
  input{
    width:100%; background:var(--ink-softer); border:1px solid var(--line); border-radius:6px;
    padding:10px 12px; color:var(--text); font-size:14px; margin-bottom:16px; font-family:inherit;
  }
  input:focus{outline:2px solid var(--orange); outline-offset:1px;}
  button.primary{
    background:var(--orange); color:#fff; border:none; border-radius:6px;
    padding:12px; font-size:14px; font-weight:700; cursor:pointer; font-family:inherit;
  }
  button.primary:hover{background:var(--orange-bright);}
  button.primary:disabled{opacity:0.6; cursor:default;}
  button.ghost{
    background:transparent; color:var(--text-muted); border:1px solid var(--line); border-radius:6px;
    padding:10px 16px; font-size:13.5px; cursor:pointer; font-family:inherit;
  }
  button.ghost:hover{color:var(--text); border-color:var(--text-muted);}
  button.compact{padding:9px 16px; font-size:13px;}
  .hidden{display:none !important;}

  .status-badge{display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:20px; font-size:12px; font-family:'IBM Plex Mono',monospace;}
  .status-badge.connected{background:rgba(76,175,125,0.12); color:var(--good);}
  .status-badge.disconnected{background:rgba(232,163,61,0.12); color:#E8A33D;}
  .dot{width:6px; height:6px; border-radius:50%; background:currentColor;}

  /* Selo "régua" de margem — mesmo gradiente vermelho->laranja->verde do
     login e da tela de planos. */
  .margin-badge{display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; white-space:nowrap;}
  .margin-badge .dot{width:7px; height:7px;}
  .margin-badge.prejuizo{background:rgba(139,30,30,0.18); color:#E85D5D;}
  .margin-badge.baixo{background:rgba(217,83,79,0.14); color:#D9534F;}
  .margin-badge.medio{background:rgba(232,163,61,0.14); color:#E8A33D;}
  .margin-badge.alto{background:rgba(79,180,119,0.14); color:#4FB477;}
  .margin-badge.sem-dado{background:rgba(156,150,140,0.14); color:var(--text-muted);}

  /* Barra "régua" com marcador — vai ao lado do selo de texto */
  .regua-bar{position:relative; width:64px; height:6px; border-radius:3px; flex-shrink:0; background:#2B4062;}
  .regua-marker{position:absolute; top:50%; width:10px; height:10px; border-radius:50%; background:#fff; border:2px solid var(--ink-soft); transform:translate(-50%,-50%); box-shadow:0 0 0 1px rgba(0,0,0,0.35);}

  /* Tela de Configuração de Régua — cards por faixa, mais dinâmicos que um
     bloco de texto corrido. Cada faixa tem cor própria (prejuízo é um
     vermelho mais escuro/intenso que "baixo", pra não confundir os dois). */
  .settings-hero{display:flex; align-items:center; gap:14px; margin-bottom:22px;}
  .settings-hero-icon{width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; background:linear-gradient(135deg, rgba(217,83,79,0.18), rgba(79,180,119,0.18)); flex-shrink:0;}
  .regua-preview-bar{position:relative; width:100%; height:14px; border-radius:7px; margin:18px 0 26px; background:#2B4062;}
  .regua-tier-card{display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:14px 18px; border-radius:10px; margin-bottom:10px; border:1px solid var(--line); background:var(--ink-softer); transition:transform .15s ease, border-color .15s ease;}
  .regua-tier-card:hover{transform:translateX(2px);}
  .regua-tier-left{display:flex; align-items:center; gap:12px;}
  .regua-tier-dot{width:13px; height:13px; border-radius:50%; flex-shrink:0; box-shadow:0 0 0 4px rgba(255,255,255,0.05);}
  .regua-tier-label{font-weight:700; font-size:14px;}
  .regua-tier-desc{font-size:12.5px; color:var(--text-muted); margin-top:2px;}
  .regua-tier-range{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-muted); white-space:nowrap;}
  .regua-tier-range input{width:64px; text-align:right;}
  .regua-tier-card.prejuizo{border-left:4px solid #E85D5D;}
  .regua-tier-card.baixo{border-left:4px solid #D9534F;}
  .regua-tier-card.medio{border-left:4px solid #E8A33D;}
  .regua-tier-card.alto{border-left:4px solid #4FB477;}
  .regua-tier-card.prejuizo .regua-tier-dot{background:#E85D5D;}
  .regua-tier-card.baixo .regua-tier-dot{background:#D9534F;}
  .regua-tier-card.medio .regua-tier-dot{background:#E8A33D;}
  .regua-tier-card.alto .regua-tier-dot{background:#4FB477;}
  .regua-tier-fixed-tag{font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:10px; background:rgba(156,150,140,0.16); color:var(--text-muted); text-transform:uppercase; letter-spacing:.03em;}

  /* Modal genérico (usado hoje na análise de performance por produto) */
  .modal-overlay{position:fixed; inset:0; background:rgba(10,14,20,0.72); display:flex; align-items:center; justify-content:center; z-index:1000; padding:20px;}
  .modal-overlay.hidden{display:none;}
  .modal-panel{background:var(--ink-soft); border:1px solid var(--line); border-radius:12px; padding:24px; max-width:720px; width:100%; max-height:88vh; overflow-y:auto;}

  .icon-btn{display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; border:1px solid var(--line); background:var(--ink-softer); color:var(--text-muted); cursor:pointer; font-size:13px; transition:border-color .15s ease, color .15s ease;}
  .icon-btn:hover{border-color:var(--amber); color:var(--amber);}
  .field-synced-tag{font-size:10px; font-weight:600; padding:1px 7px; border-radius:9px; background:rgba(79,180,119,0.14); color:#4FB477; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap;}

  .grid-stats{display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin:20px 0;}
  @media (max-width:480px){.grid-stats{grid-template-columns:1fr;}}
  .stat-card{background:var(--ink-soft); border:1px solid var(--line); border-radius:8px; padding:16px 18px;}
  .stat-label{font-family:'Inter',sans-serif; font-size:10.5px; font-weight:500; color:var(--text-muted);}
  .stat-value{font-family:'Inter',sans-serif; font-size:24px; font-weight:700; margin-top:4px;}

  .account-row{display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid var(--line);}
  .account-row:last-child{border-bottom:none;}
  .account-reconnect-link{display:inline-flex; align-items:center; gap:4px; padding:5px 11px; border-radius:20px; border:1px solid var(--line); background:var(--ink-softer); color:var(--text-muted); font-size:12px; font-weight:600; text-decoration:none; white-space:nowrap; cursor:pointer; transition:border-color .15s ease, color .15s ease;}
  .account-reconnect-link:hover{border-color:var(--amber); color:var(--amber);}
  .muted{color:var(--text-muted); font-size:12.5px;}

  /* ============================================================
     PAINEL — shell com sidebar fixa
     ============================================================ */
  #dashboard-screen{display:flex; flex-direction:column; min-height:100vh; width:100%;}
  .sidebar{display:none; width:224px; flex-shrink:0; background:var(--sidebar-bg); border-right:1px solid var(--sidebar-line); flex-direction:column; position:sticky; top:0; height:100vh;}
  .sidebar-brand{display:flex; align-items:center; gap:10px; padding:20px 18px; border-bottom:1px solid var(--sidebar-line);}
  .sidebar-brand-text{font-family:'Archivo',sans-serif; font-weight:700; font-size:15px; color:#EDF1F5;}
  .sidebar-brand-text span{color:var(--amber);}
  .sidebar-nav{flex:1; overflow-y:auto; padding:14px 10px;}
  .sidebar-group-label{font-family:'IBM Plex Mono',monospace; font-size:10px; text-transform:uppercase; letter-spacing:0.06em; color:#6B7684; padding:14px 12px 6px;}
  .sidebar-group-label:first-child{padding-top:4px;}
  .sidebar-link{display:block; padding:9px 12px; border-radius:6px; color:#C9D4E5; font-size:13.5px; text-decoration:none; cursor:pointer; margin-bottom:2px;}
  .sidebar-link:hover{background:rgba(255,255,255,0.04); color:#EDF1F5;}
  .sidebar-link.active{background:rgba(19,198,181,0.14); color:var(--amber); font-weight:600;}
  .sidebar-group-toggle{display:flex; align-items:center; justify-content:space-between; padding:9px 12px; border-radius:6px; color:#C9D4E5; font-size:13.5px; cursor:pointer; margin-bottom:2px;}
  .sidebar-group-toggle:hover{background:rgba(255,255,255,0.04); color:#EDF1F5;}
  .sidebar-group-chevron{font-size:10px; color:#6B7684; transition:transform .15s ease;}
  .sidebar-icon{display:inline-block; width:16px; text-align:center; margin-right:2px; opacity:0.85; font-size:12.5px;}
  .sidebar-group-toggle.open .sidebar-group-chevron{transform:rotate(180deg);}
  .sidebar-subgroup{max-height:0; overflow:hidden; transition:max-height .18s ease;}
  .sidebar-subgroup.open{max-height:260px;}
  .sidebar-sublink{padding-left:30px;}
  .sidebar-sublink-disabled{display:flex; align-items:center; padding:9px 12px 9px 30px; border-radius:6px; color:#5B6470; font-size:13.5px; cursor:default; margin-bottom:2px;}
  .badge-beta, .badge-soon{font-family:'IBM Plex Mono',monospace; font-size:9px; text-transform:uppercase; letter-spacing:0.04em; padding:2px 6px; border-radius:4px; margin-left:6px; vertical-align:middle; white-space:nowrap;}
  .badge-beta{background:rgba(19,198,181,0.18); color:var(--amber);}
  .badge-soon{background:rgba(255,255,255,0.06); color:#6B7684;}
  .sidebar-footer{border-top:1px solid var(--sidebar-line); padding:14px 18px;}
  .sidebar-user-email{font-size:12px; color:var(--text-muted); margin-bottom:6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .sidebar-logout{font-size:12.5px; color:var(--text-muted); text-decoration:underline; cursor:pointer;}
  .sidebar-logout:hover{color:#EDF1F5;}
  /* ---------- Menu horizontal (desktop) - substitui a sidebar acima de 860px ---------- */
  .topnav{
    display:flex; align-items:center; gap:4px; padding:0 22px; height:60px; flex-shrink:0;
    background:var(--sidebar-bg); border-bottom:1px solid var(--sidebar-line);
    position:sticky; top:0; z-index:50;
  }
  .topnav-brand{display:flex; align-items:center; gap:9px; margin-right:16px; cursor:pointer; flex-shrink:0;}
  .topnav-brand-text{font-family:'Archivo',sans-serif; font-weight:700; font-size:15px; color:#EDF1F5; white-space:nowrap;}
  .topnav-brand-text span{color:var(--amber);}
  .topnav-items{display:flex; align-items:center; gap:2px; flex:1; min-width:0;}
  .topnav-link, .topnav-dd-trigger{
    display:flex; align-items:center; gap:5px; padding:9px 12px; border-radius:7px; color:#C9D4E5;
    font-size:13.5px; text-decoration:none; cursor:pointer; white-space:nowrap; background:none; border:none; font-family:inherit;
  }
  .topnav-link:hover, .topnav-dd-trigger:hover{background:rgba(255,255,255,0.05); color:#EDF1F5;}
  .topnav-link.active, .topnav-dd-trigger.active{background:rgba(19,198,181,0.14); color:var(--amber); font-weight:600;}
  .topnav-dd-chevron{font-size:9px; opacity:0.7; transition:transform .15s ease;}
  .topnav-dd-trigger.open .topnav-dd-chevron{transform:rotate(180deg);}
  .topnav-dd-wrap{position:relative;}
  .topnav-dd-panel{
    display:none; position:absolute; top:calc(100% + 6px); left:0; min-width:224px;
    background:var(--ink-soft); border:1px solid var(--line); border-radius:10px; padding:6px;
    box-shadow:0 18px 40px -16px rgba(0,0,0,0.6); z-index:60;
  }
  .topnav-dd-panel.open{display:block;}
  .topnav-dd-item{display:block; padding:9px 12px; border-radius:7px; color:#C9D4E5; font-size:13px; text-decoration:none; cursor:pointer;}
  .topnav-dd-item:hover{background:rgba(255,255,255,0.05); color:#EDF1F5;}
  .topnav-dd-item.active{color:var(--amber); font-weight:600;}
  .topnav-dd-item-disabled{display:flex; align-items:center; padding:9px 12px; border-radius:7px; color:#5B6470; font-size:13px; cursor:default;}
  .topnav-actions{display:flex; align-items:center; gap:6px; flex-shrink:0; margin-left:10px;}
  .topnav-icon-btn{
    width:36px; height:36px; border-radius:9px; background:none; border:1px solid transparent; color:#C9D4E5;
    display:flex; align-items:center; justify-content:center; font-size:15px; cursor:pointer; text-decoration:none;
  }
  .topnav-icon-btn:hover{background:rgba(255,255,255,0.05); border-color:var(--sidebar-line); color:#EDF1F5;}
  .topnav-avatar{
    width:34px; height:34px; border-radius:50%; background:rgba(19,198,181,0.16); color:var(--amber);
    display:flex; align-items:center; justify-content:center; font-family:'IBM Plex Mono',monospace; font-weight:700;
    font-size:12.5px; cursor:pointer; border:none;
  }
  .topnav-user-email{font-size:11.5px; color:var(--text-muted); padding:8px 12px 10px; border-bottom:1px solid var(--sidebar-line); margin-bottom:6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

  .mobile-topbar{display:none;}
  .sidebar-overlay{display:none;}
  @media (max-width:860px){
    .mobile-topbar{
      display:flex; align-items:center; gap:14px; width:100%;
      position:sticky; top:0; z-index:40;
      background:var(--sidebar-bg); border:1px solid var(--sidebar-line); border-radius:8px;
      padding:12px 14px; margin-bottom:20px;
      box-sizing:border-box;
    }
    .mobile-menu-btn{
      background:none; border:1px solid var(--sidebar-line); color:#EDF1F5;
      width:38px; height:38px; border-radius:8px; font-size:18px; line-height:1; cursor:pointer;
      display:flex; align-items:center; justify-content:center; flex-shrink:0; padding:0;
    }
    .mobile-topbar-brand{font-family:'Archivo',sans-serif; font-weight:700; font-size:15px; color:#EDF1F5;}
    .mobile-topbar-brand span{color:var(--amber);}
    .topnav{ display:none; }
    .sidebar{
      display:flex; position:fixed; top:0; left:0; width:250px; height:100vh; z-index:60;
      transform:translateX(-100%); transition:transform .2s ease;
    }
    .sidebar.mobile-open{transform:translateX(0); box-shadow:8px 0 28px rgba(0,0,0,0.45);}
    .sidebar-overlay{
      display:block; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:55;
      opacity:0; pointer-events:none; transition:opacity .2s ease;
    }
    .sidebar-overlay.show{opacity:1; pointer-events:auto;}
  }

  .dashboard-main{flex:1; min-width:0; padding:32px 40px 60px; max-width:1680px; margin:0 auto; width:100%;}
  .dashboard-section{width:100%;}
  .section-header{display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:20px;}
  .section-header-actions{display:flex; gap:8px; flex-shrink:0; align-items:center; flex-wrap:wrap;}
  .period-select{background:var(--ink-softer); border:1px solid var(--line); color:var(--text); border-radius:6px; padding:8px 10px; font-size:13px; font-family:inherit; width:auto; margin-bottom:0;}
  .period-date-input{background:var(--ink-softer); border:1px solid var(--line); color:var(--text); border-radius:6px; padding:7px 8px; font-size:12.5px; font-family:inherit; width:auto; margin-bottom:0;}

  /* ---------- Painel — ajustes de mobile ---------- */
  html, body { overflow-x: hidden; }
  #dashboard-screen { overflow-x: hidden; }
  .section-header > div:first-child { min-width:0; }
  @media (max-width:600px){
    .dashboard-main{ padding:20px 16px 40px; }
    .section-header{ flex-wrap:wrap; }
    .section-header > div:first-child{ width:100%; }
    .section-header-actions{ width:100%; }
    .period-select, .period-date-input{ font-size:13px; }
  }

  .metric-cards{display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:16px; margin-bottom:24px;}
  .charts-grid{display:grid; grid-template-columns:1fr 1fr; gap:24px;}
  @media (max-width:900px){.charts-grid{grid-template-columns:1fr;}}
  .chart-card{padding:24px;}
  .metric-card{
    position:relative; background:linear-gradient(155deg, var(--ink-soft) 0%, var(--ink-softer) 100%);
    border:1px solid var(--line); border-radius:12px; padding:18px 20px 20px; overflow:hidden;
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
  .metric-card::before{content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--accent, var(--amber));}
  .metric-card:hover{transform:translateY(-3px); box-shadow:0 14px 28px -10px rgba(0,0,0,0.55); border-color:rgba(255,255,255,0.22);}
  .metric-card-icon{width:32px; height:32px; border-radius:9px; background:var(--accent, var(--amber)); display:flex; align-items:center; justify-content:center; font-size:15px; margin-bottom:14px; box-shadow:0 6px 14px -6px var(--accent, var(--amber));}
  .kpi-mode-toggle{display:inline-flex; align-items:center; background:var(--surface-2); border:1px solid var(--line); border-radius:20px; padding:3px; gap:2px;}
  .kpi-mode-btn{font-family:'Inter',sans-serif; font-size:12px; font-weight:600; color:var(--text-muted); background:transparent; border:none; border-radius:16px; padding:6px 14px; cursor:pointer; transition:background .15s ease, color .15s ease;}
  .kpi-mode-btn.active{background:var(--orange); color:#fff;}
  .kpi-advanced{display:none;}
  .kpi-advanced.kpi-show{display:block;}
  .metric-cards-divider{grid-column:1/-1; font-family:'Inter',sans-serif; font-size:11px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; color:var(--text-faint); padding-top:14px; margin-top:2px; border-top:1px solid var(--line);}
  .overview-metric-cards{grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));}
  .overview-metric-cards .metric-card{padding:20px 20px 22px; min-height:184px; display:flex; flex-direction:column;}
  .overview-metric-cards .metric-card.kpi-advanced{display:none;}
  .overview-metric-cards .metric-card.kpi-advanced.kpi-show{display:flex;}
  .overview-metric-cards .metric-card-icon{width:38px; height:38px; font-size:17px; border-radius:10px;}
  .overview-metric-cards .stat-label{font-size:11px;}
  .overview-metric-cards .stat-value{font-size:27px;}
  .pending-live-badge{
    display:inline-flex; align-items:center; gap:7px; margin-top:10px;
    padding:5px 10px 5px 8px; background:rgba(232,163,61,0.14);
    border:1px solid rgba(232,163,61,0.35); border-radius:20px;
    font-size:11.5px; color:var(--amber); line-height:1.35;
  }
  .pending-live-badge strong{color:inherit; font-weight:700;}
  .pending-live-badge .live-dot{
    width:7px; height:7px; border-radius:50%; background:var(--amber);
    flex-shrink:0; animation:live-pulse 1.6s infinite;
  }
  @keyframes live-pulse{
    0%{box-shadow:0 0 0 0 rgba(232,163,61,0.55);}
    70%{box-shadow:0 0 0 7px rgba(232,163,61,0);}
    100%{box-shadow:0 0 0 0 rgba(232,163,61,0);}
  }

  .data-table{width:100%; border-collapse:collapse; font-size:13px;}
  .data-table th{padding:10px 14px; font-family:'IBM Plex Mono',monospace; font-size:10px; text-transform:uppercase; color:var(--text-muted); letter-spacing:0.04em; text-align:left; border-bottom:1px solid var(--line); white-space:nowrap;}
  .data-table td{padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle;}
  .data-table th.sortable-th{cursor:pointer; user-select:none;}
  .data-table th.sortable-th:hover{color:var(--text);}
  .data-table th.sortable-th::after{content:'\2195'; margin-left:5px; opacity:0.3; font-size:10px;}
  .data-table th.sortable-th.sort-asc::after{content:'\2191'; opacity:1; color:var(--amber);}
  .data-table th.sortable-th.sort-desc::after{content:'\2193'; opacity:1; color:var(--amber);}
  .data-table tr:last-child td{border-bottom:none;}

  /* Demonstrativo tipo DRE — linhas de receita/dedução/subtotal, lidas de cima pra baixo como um documento contábil */
  .dre-table{width:100%; border-collapse:collapse; font-size:14px;}
  .dre-table td{padding:9px 2px; border-bottom:1px solid var(--line); font-variant-numeric:tabular-nums;}
  .dre-table td:last-child{text-align:right; white-space:nowrap;}
  .dre-table tr.dre-deduction td{color:var(--text-muted);}
  .dre-table tr.dre-deduction td:first-child{padding-left:16px;}
  .dre-table tr.dre-fee-detail td{color:var(--text-muted); font-size:12px;}
  .dre-table tr.dre-fee-detail td:first-child{padding-left:32px;}
  .dre-table tr.dre-subtotal td{font-weight:700; border-top:1px solid var(--line);}
  .dre-table tr.dre-final td{font-weight:700; font-size:16px; color:var(--amber); border-top:2px solid var(--amber); border-bottom:none; padding-top:12px;}
  .dre-table tr.dre-margin td{color:var(--text-muted); font-size:12.5px; border-bottom:none; padding-top:2px;}

  .product-thumb{width:32px; height:32px; border-radius:6px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; color:#fff; object-fit:cover;}
  .product-cell{display:flex; align-items:center; gap:10px; min-width:200px;}
  .product-thumb-upload{position:relative; width:44px; height:44px; border-radius:8px; flex-shrink:0; cursor:pointer; overflow:hidden;}
  .product-thumb-upload .product-thumb{width:44px; height:44px; border-radius:8px; font-size:16px;}
  .product-thumb-upload input[type="file"]{position:absolute; inset:0; opacity:0; cursor:pointer;}
  .product-thumb-upload::after{content:'📷'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,0.55); font-size:15px; opacity:0; transition:opacity .15s ease; pointer-events:none; border-radius:8px;}
  .product-thumb-upload:hover::after{opacity:1;}
  .product-thumb-upload.uploading::after{content:'⏳'; opacity:1;}
  .product-cell-name{font-size:13px; color:var(--text); line-height:1.3;}
  .product-cell-sku{font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--text-muted); margin-top:1px;}

  .inline-num-input{width:78px; text-align:right; margin-bottom:0; padding:6px 8px; font-size:13px;}
  .inline-text-input{width:130px; text-align:left; margin-bottom:0; padding:6px 8px; font-size:13px;}

  .toggle-panel{margin-top:14px;}

  .placeholder-note{background:var(--ink-soft); border:1px dashed var(--line); border-radius:10px; padding:32px; text-align:center; color:var(--text-muted); font-size:13.5px; line-height:1.7;}

  /* ---- Pedidos (cards expansíveis com quebra de margem por item) ---- */
  .orders-filters{display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; margin-bottom:18px;}
  .orders-filters .field{margin-bottom:0;}
  .orders-filters .field label{margin-bottom:5px;}
  .orders-filters input, .orders-filters select{margin-bottom:0; min-width:150px;}
  .orders-filters select{width:auto;}

  .order-status-badge{display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; white-space:nowrap;}
  .order-status-badge.pending{background:rgba(19,198,181,0.14); color:var(--amber);}
  .order-status-badge.shipped{background:rgba(99,179,237,0.14); color:#63B3ED;}
  .order-status-badge.delivered{background:rgba(76,175,125,0.14); color:var(--good);}
  .order-status-badge.canceled{background:rgba(228,89,79,0.14); color:var(--bad);}
  .order-status-badge.refunded{background:rgba(156,150,140,0.14); color:var(--text-muted);}

  .order-card{background:var(--ink-soft); border:1px solid var(--line); border-radius:10px; margin-bottom:12px; overflow:hidden;}
  .order-card-header{display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; cursor:pointer; flex-wrap:wrap;}
  .order-card-header:hover{background:rgba(242,239,233,0.03);}
  .order-card-main{display:flex; align-items:center; gap:12px; min-width:0;}
  .order-marketplace-badge{width:22px; height:22px; border-radius:6px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11px; color:#1A1F26;}
  .order-chevron{display:inline-block; color:var(--text-muted); font-size:12px; transition:transform 0.15s ease; flex-shrink:0;}
  .order-card.open .order-chevron{transform:rotate(90deg);}
  .order-card-id{font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--text); font-weight:600;}
  .order-card-meta{color:var(--text-muted); font-size:12px; margin-top:3px;}
  .order-card-stats{display:flex; align-items:center; gap:22px; flex-wrap:wrap;}
  .order-card-stats .stat-label{font-size:10px;}
  .order-card-stats .stat-value-sm{font-family:'Archivo',sans-serif; font-size:16px; font-weight:700; margin-top:2px;}
  .order-card-stats .stat-value-sm.profit-pos{color:var(--good);}
  .order-card-stats .stat-value-sm.profit-neg{color:var(--bad);}
  .order-card-body{border-top:1px solid var(--line);}
  .order-item-block{padding:16px 18px; border-bottom:1px solid var(--line);}
  .order-item-block:last-child{border-bottom:none;}
  .order-item-top{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px;}
  .order-item-qty{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--text-muted); flex-shrink:0;}
  .order-item-breakdown{display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:10px 12px;}
  .breakdown-cell{min-width:0; display:flex; align-items:flex-start; gap:9px; background:var(--ink-softer); border:1px solid var(--line); border-radius:8px; padding:10px 12px; position:relative; overflow:hidden;}
  .breakdown-cell::before{content:''; position:absolute; top:0; left:0; right:0; height:2px; background:var(--accent, var(--line));}
  .breakdown-cell-icon{width:24px; height:24px; border-radius:7px; background:var(--accent-soft, rgba(139,151,166,0.16)); display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0;}
  .breakdown-cell-body{min-width:0;}
  .breakdown-cell .stat-label{font-size:9.5px;}
  .breakdown-cell .value{font-size:13.5px; margin-top:3px; white-space:nowrap;}
  .breakdown-cell .value.profit-pos{color:var(--good);}
  .breakdown-cell .value.profit-neg{color:var(--bad);}
  .breakdown-cell-margin{grid-column:span 2; align-items:center;}
  @media (max-width:480px){.breakdown-cell-margin{grid-column:span 1;}}
  .extra-cost-list{margin-top:10px; font-size:12px; color:var(--text-muted);}
  .extra-cost-list .extra-cost-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:5px 0;}
  .extra-cost-remove{color:var(--bad); cursor:pointer; font-size:11px; background:none; border:none; font-family:inherit; padding:0;}
  .extra-cost-form{display:flex; gap:8px; align-items:flex-end; margin-top:10px; flex-wrap:wrap;}
  .extra-cost-form input{margin-bottom:0; min-width:120px;}
  .add-extra-cost-btn{margin-top:12px;}
  .orders-pager{display:flex; align-items:center; justify-content:center; gap:14px; margin-top:18px; color:var(--text-muted); font-size:13px;}


  /* Tela de assinatura do painel (status + cartões de plano) */
  .subHero{display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap; background:var(--ink-soft); border:1px solid var(--line); border-radius:12px; padding:26px 28px;}
  .subHeroLeft{display:flex; align-items:center; gap:18px;}
  .subHeroIcon{width:50px; height:50px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:22px; flex-shrink:0;}
  .subHeroIcon.trial{background:rgba(19,198,181,0.14); color:var(--amber);}
  .subHeroIcon.active{background:rgba(76,175,125,0.14); color:var(--good);}
  .subHeroIcon.warn{background:rgba(228,89,79,0.14); color:var(--bad);}
  .subHeroTitle{font-family:'Archivo',sans-serif; font-size:18px; font-weight:700;}
  .subHeroSub{color:var(--text-muted); font-size:13px; margin-top:4px; line-height:1.5;}
  .subProgressTrack{width:230px; max-width:60vw; height:6px; border-radius:3px; background:var(--ink-softer); margin-top:12px; overflow:hidden;}
  .subProgressFill{height:100%; background:var(--amber); border-radius:3px; transition:width .3s ease;}
  .subHeroActions{display:flex; align-items:center; gap:16px; flex-shrink:0;}
  .subCancelLink{color:var(--text-muted); font-size:12.5px; text-decoration:underline; cursor:pointer;}
  .subCancelLink:hover{color:var(--text);}

  .subPlansGrid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:22px;}
  @media (max-width:900px){.subPlansGrid{grid-template-columns:1fr;}}
  .subPlanCard{position:relative; background:var(--ink-soft); border:1px solid var(--line); border-radius:10px; padding:24px 22px 22px;}
  .subPlanCard.current{border-color:var(--amber);}
  .subPlanBadge{position:absolute; top:-10px; right:18px; background:var(--amber); color:#1B1204; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; padding:3px 10px; border-radius:20px;}
  .subPlanName{font-family:'Archivo',sans-serif; font-size:16px; font-weight:700;}
  .subPlanTagline{color:var(--text-muted); font-size:12.5px; margin-top:7px; min-height:34px; line-height:1.5;}
  .subPriceRow{margin-top:14px; display:flex; align-items:baseline; gap:6px;}
  .subPriceOld{color:var(--text-muted); font-size:12px; text-decoration:line-through;}
  .subPriceNew{font-family:'Archivo',sans-serif; font-size:21px; font-weight:700; color:var(--amber);}
  .subPricePeriod{color:var(--text-muted); font-size:12px;}
  .subFeatures{list-style:none; margin-top:16px;}
  .subFeatures li{display:flex; align-items:baseline; gap:8px; font-size:12.5px; color:var(--text-muted); padding:7px 0; border-top:1px solid var(--line);}
  .subFeatures li:first-child{border-top:none;}
  .subFeatures li.on{color:var(--text);}
  .subTick{width:3px; height:10px; background:var(--line); flex-shrink:0;}
  .subFeatures li.on .subTick{background:var(--amber);}
  .subPlanCta{width:100%; margin-top:18px; padding:10px; font-size:13px; font-weight:600; border-radius:6px; cursor:pointer; border:1px solid var(--line); background:transparent; color:var(--text); font-family:inherit;}
  .subPlanCta.primary{background:var(--amber); color:#1B1204; border:none;}
  .subPlanCta:disabled{opacity:0.6; cursor:default;}
  .subPlansNote{color:var(--text-muted); font-size:11.5px; margin-top:14px;}
  .subUsageBox{display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; background:var(--ink-soft); border:1px solid var(--line); border-radius:10px; padding:14px 18px; margin-top:16px;}
  .subUsageBox .subUsageLabel{font-size:13px; color:var(--text-muted);}
  .subUsageBox .subUsageValue{font-family:'IBM Plex Mono',monospace; font-size:13px; font-weight:600;}
  .subUsageBox.over{background:rgba(232,163,61,0.10); border-color:rgba(232,163,61,0.35);}
  .subUsageBox.over .subUsageValue{color:var(--amber);}
  .subUsageTrack{width:100%; height:6px; border-radius:3px; background:var(--ink-softer); margin-top:8px; overflow:hidden;}
  .subUsageFill{height:100%; border-radius:3px; background:var(--good); transition:width .3s ease;}
  .subUsageFill.over{background:var(--amber);}
  .subErrorBox{background:rgba(228,89,79,0.12); border:1px solid rgba(228,89,79,0.35); color:#F0B0AB; font-size:13px; padding:10px 14px; border-radius:6px; margin-top:16px;}
  .subSuccessBox{background:rgba(76,175,125,0.12); border:1px solid rgba(76,175,125,0.35); color:#8FE0B6; font-size:13px; padding:10px 14px; border-radius:6px; margin-top:16px;}

  /* ============================================================
     LOGIN / CADASTRO — visual "régua" (paleta própria, azul + âmbar)
     ============================================================ */
  .grAuthStage{display:flex; width:100%; min-height:100vh; font-family:'Inter',sans-serif; background:var(--ink); color:#EDF1F5;}
  .grRulePanel{width:42%; background:linear-gradient(180deg,#121E33 0%,#0D1626 100%); border-right:1px solid var(--sidebar-line); display:flex; flex-direction:column; justify-content:space-between; padding:56px 48px; position:relative; overflow:hidden;}
  .grBrand{display:flex; align-items:center; gap:12px;}
  .grBrandMark{border-radius:8px; display:block;}
  .grBrandText{font-family:'Archivo',sans-serif; font-weight:700; font-size:20px; letter-spacing:-0.01em;}
  .grBrandText span{color:var(--amber);}
  .grMobileBrand{display:none; align-items:center; justify-content:center; gap:10px; margin-bottom:36px;}
  .grRuleVisual{position:relative; flex:1; display:flex; align-items:center; margin:40px 0;}
  .grRuler{position:relative; width:100%; height:340px; display:flex; align-items:flex-end; gap:3px;}
  .grLoginTick{flex:1; height:14px; border-radius:1px;}
  .grLoginTick.major{height:26px;}
  .grLoginTick.reading{box-shadow:0 0 18px currentColor;}
  .grReadingCallout{position:absolute; left:62%; bottom:100px; text-align:left;}
  .grReadingCallout .value{font-family:'Archivo',sans-serif; font-size:44px; font-weight:700; color:#4FB477; line-height:1;}
  .grReadingCallout .label{font-size:13px; color:var(--text-muted); margin-top:6px;}
  .grPitch h1{font-family:'Archivo',sans-serif; font-size:28px; font-weight:600; line-height:1.25; letter-spacing:-0.01em; max-width:360px;}
  .grPitch p{color:var(--text-muted); font-size:14.5px; line-height:1.6; margin-top:14px; max-width:340px;}
  .grFormPanel{width:58%; display:flex; align-items:center; justify-content:center; padding:40px;}
  .grFormWrap{width:100%; max-width:380px;}
  .grFormWrap h2{font-family:'Archivo',sans-serif; font-size:24px; font-weight:600;}
  .grSub{color:var(--text-muted); font-size:14px; margin-top:6px; margin-bottom:36px;}
  .grField{margin-bottom:22px;}
  .grField label{display:block; font-size:13px; color:var(--text-muted); margin-bottom:8px; font-family:'Inter',sans-serif; text-transform:none; letter-spacing:normal;}
  .grField input{width:100%; background:transparent; border:none; border-bottom:1px solid var(--sidebar-line); color:#EDF1F5; font-size:15px; font-family:'Inter',sans-serif; padding:8px 2px 10px; outline:none; transition:border-color 0.15s ease; margin-bottom:0; border-radius:0;}
  .grField input:focus{border-bottom-color:var(--amber); outline:none;}
  .grBtnPrimary{width:100%; background:var(--orange); color:#fff; border:none; padding:13px; font-size:15px; font-weight:600; border-radius:6px; cursor:pointer; font-family:'Inter',sans-serif; margin-top:6px;}
  .grBtnPrimary:hover{background:var(--orange-bright);}
  .grBtnPrimary:disabled{opacity:0.7; cursor:default;}
  .grDivider{display:flex; align-items:center; gap:14px; color:var(--text-muted); font-size:12.5px; margin:28px 0;}
  .grDivider::before,.grDivider::after{content:''; flex:1; height:1px; background:var(--sidebar-line);}
  .grSignupLine{text-align:center; font-size:14px; color:var(--text-muted);}
  .grSignupLine a{color:var(--amber); text-decoration:none; cursor:pointer;}
  .grErrorBanner{background:rgba(217,92,92,0.12); border:1px solid rgba(217,92,92,0.35); color:#E8A3A3; font-size:13.5px; padding:10px 14px; border-radius:6px; margin-bottom:20px;}
  @media (max-width:860px){.grRulePanel{display:none;} .grFormPanel{width:100%;} .grMobileBrand{display:flex;}}

  /* ============================================================
     ESCOLHA DE PLANO
     ============================================================ */
  .grPlansWrap{font-family:'Inter',sans-serif; background:var(--ink); color:#EDF1F5; min-height:100vh; padding:64px 40px 100px;}
  .grPlansTop{text-align:center; max-width:520px; margin:0 auto 48px;}

  /* Selo chamativo do trial de 15 dias — usado no cadastro (acima do botão
     principal) e no topo da tela de planos. Âmbar sobre o fundo escuro,
     com leve glow, sem sair da paleta já usada no resto do sistema. */
  .grTrialBadge{display:inline-flex; align-items:center; gap:10px; background:rgba(232,163,61,0.12); border:1px solid rgba(232,163,61,0.45); border-radius:30px; padding:10px 18px; box-shadow:0 0 22px rgba(232,163,61,0.18);}
  .grTrialBadge .grTrialIcon{font-size:19px; line-height:1;}
  .grTrialBadge .grTrialDays{color:var(--amber); font-weight:800; font-size:15.5px; letter-spacing:-0.01em;}
  .grTrialBadge .grTrialRest{color:#C9D4E5; font-size:13px;}
  @media (max-width:480px){.grTrialBadge{padding:9px 14px;} .grTrialBadge .grTrialRest{display:block; margin-top:2px;}}
  .grPlansTop h1{font-family:'Archivo',sans-serif; font-size:34px; font-weight:600; letter-spacing:-0.01em;}
  .grPlansTop p{color:var(--text-muted); font-size:15px; margin-top:10px; line-height:1.6;}
  .grScaleRule{max-width:1080px; margin:48px auto 6px; height:34px; display:flex; align-items:flex-end; gap:2px;}
  .grScaleTick{flex:1; height:8px; border-radius:1px;}
  .grScaleTick.mark{height:16px;}
  .grScaleTick.point{height:26px; box-shadow:0 0 14px currentColor;}
  .grPromoNote{color:var(--text-muted); font-size:11.5px; margin-top:4px; line-height:1.4;}
  .grPlansError{max-width:480px; margin:0 auto 24px; background:rgba(217,92,92,0.12); border:1px solid rgba(217,92,92,0.35); color:#E8A3A3; font-size:13.5px; padding:10px 14px; border-radius:6px; text-align:center;}
  .grPlansLoading{text-align:center; color:var(--text-muted); padding:60px 0;}
  .grPlansGrid{display:grid; grid-template-columns:1fr 1fr 1fr; max-width:1080px; margin:0 auto; border-top:1px solid var(--sidebar-line);}
  .grPlanCol{padding:32px 34px; border-left:1px solid var(--sidebar-line);}
  .grPlanCol:first-child{border-left:none;}
  .grPlanCol.featured{background:linear-gradient(180deg,rgba(19,198,181,0.06),transparent 30%);}
  .grPlanName{font-family:'Archivo',sans-serif; font-size:19px; font-weight:600;}
  .grSelectedBadge{display:inline-block; vertical-align:middle; margin-left:8px; font-family:'Inter',sans-serif; font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:0.03em; color:#fff; background:var(--orange); padding:3px 8px; border-radius:20px;}
  .grPlanTagline{color:var(--text-muted); font-size:13px; margin-top:8px; line-height:1.5; min-height:40px;}
  .grPriceRow{margin-top:26px; display:flex; align-items:baseline; gap:8px;}
  .grPriceOld{color:#4A5568; font-size:14px; text-decoration:line-through;}
  .grPriceNew{font-family:'Archivo',sans-serif; font-size:32px; font-weight:700; color:var(--amber);}
  .grPricePeriod{color:var(--text-muted); font-size:13px;}
  .grFeatures{list-style:none; margin-top:28px;}
  .grFeatures li{display:flex; align-items:baseline; gap:10px; font-size:13.5px; color:#C9D4E5; padding:9px 0; border-top:1px solid var(--sidebar-line);}
  .grFeatures li:first-child{border-top:none;}
  .grTick{width:3px; height:12px; background:var(--amber); flex-shrink:0;}
  .grFeatures li.off{color:#4A5568;}
  .grFeatures li.off .grTick{background:#2B4062;}
  .grPlanCta{width:100%; margin-top:30px; padding:12px; font-family:'Inter',sans-serif; font-size:14.5px; font-weight:600; border-radius:6px; cursor:pointer; border:1px solid var(--sidebar-line); background:transparent; color:#EDF1F5;}
  .grPlanCol.featured .grPlanCta{background:var(--orange); color:#fff; border:none;}
  .grPlanCta:disabled{opacity:0.6; cursor:default;}
  @media (max-width:860px){.grPlansGrid{grid-template-columns:1fr;} .grPlanCol{border-left:none; border-top:1px solid var(--sidebar-line);} .grPlanCol:first-child{border-top:none;}}

  /* ---------- Painel Pro: selo de saude, sparkline nos KPIs, central de alertas ---------- */
  .health-score-pill{display:inline-flex; align-items:center; gap:8px; padding:7px 14px 7px 10px; border-radius:20px; font-size:12.5px; font-weight:700; font-family:'IBM Plex Mono',monospace; border:1px solid; white-space:nowrap;}
  .health-score-pill .ring{width:9px; height:9px; border-radius:50%; flex:0 0 auto;}
  .alert-item{display:flex; align-items:flex-start; gap:12px; padding:13px 15px; border-radius:10px; background:var(--ink-softer); border:1px solid var(--line); border-left:3px solid var(--sev, var(--text-muted)); margin-bottom:9px;}
  .alert-item:last-child{margin-bottom:0;}
  .alert-item .alert-ic{font-size:16px; line-height:1.3;}
  .alert-item .alert-body{flex:1; min-width:0;}
  .alert-item .alert-title{font-size:13px; font-weight:700; display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
  .alert-item .alert-desc{font-size:12px; color:var(--text-muted); margin-top:3px; line-height:1.5;}
  .sev-tag{font-family:'IBM Plex Mono',monospace; font-size:9px; text-transform:uppercase; letter-spacing:0.04em; padding:2px 7px; border-radius:20px; font-weight:700;}
  .alert-cta{font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--text); background:var(--ink-soft); border:1px solid var(--line); padding:6px 12px; border-radius:7px; white-space:nowrap; cursor:pointer; flex-shrink:0;}
  .alert-cta:hover{border-color:var(--orange); color:var(--orange-bright);}
  .alert-empty{color:var(--text-muted); font-size:13px; padding:18px; text-align:center;}
  .roadmap-row{display:grid; grid-template-columns:repeat(auto-fit, minmax(220px,1fr)); gap:14px; margin-top:12px;}
  .roadmap-card{background:var(--ink-softer); border:1px dashed var(--line); border-radius:10px; padding:16px;}
  .roadmap-card .rm-title{font-size:13px; font-weight:700; display:flex; align-items:center; gap:8px;}
  .roadmap-card .rm-desc{font-size:12px; color:var(--text-muted); margin-top:6px; line-height:1.55;}

  /* ---------- KPI cards no estilo "icone solido no canto" + selo de variacao vs periodo anterior ---------- */
  .overview-metric-cards .metric-card{padding:18px 20px 20px;}
  .overview-metric-cards .metric-card-icon{
    position:absolute; top:18px; right:18px; width:40px; height:40px; border-radius:12px;
    background:var(--accent); color:#191205; margin-bottom:0; box-shadow:0 8px 18px -8px var(--accent);
  }
  .overview-metric-cards .stat-label{padding-right:48px;}
  .overview-metric-cards .stat-value{margin-bottom:9px;}
  .stat-delta-row{display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-height:20px;}
  .stat-delta{font-family:'IBM Plex Mono',monospace; font-size:11.5px; font-weight:700; padding:3px 9px; border-radius:20px; white-space:nowrap;}
  .stat-delta.up{background:rgba(76,175,125,0.16); color:var(--good);}
  .stat-delta.down{background:rgba(228,89,79,0.16); color:var(--bad);}
  .stat-delta.flat{background:rgba(255,255,255,0.07); color:var(--text-muted);}
  .stat-delta-caption{font-size:11px; color:var(--text-muted);}

