    /* ===================== DESIGN SYSTEM ===================== */
    /* Alpine.js x-cloak global — esconde elementos com [x-cloak] até Alpine montar.
       Definido aqui no base global para sobreviver mesmo se CSS de widget específico
       (copilot_widget.css, etc) não carregar a tempo do first paint. */
    [x-cloak] { display: none !important; }

    /* Oportunidades — segmented toggle (Kanban / Lista). Movido pro base
       global para sobreviver em qualquer página. */
    .opps-view-toggle {
      display: inline-flex;
      background: var(--bg-card, #fff);
      border: 1px solid var(--border, #e2e8f4);
      border-radius: 8px;
      padding: 2px;
      gap: 0;
    }
    .opps-view-tab {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      font-size: 0.82rem;
      font-weight: 500;
      color: var(--text-muted, #6b7280);
      text-decoration: none;
      border-radius: 6px;
      transition: background 0.15s, color 0.15s;
    }
    .opps-view-tab:hover { color: var(--foreground); background: var(--accent); }
    .opps-view-tab--active { background: var(--secondary); color: #fff; }
    .opps-view-tab--active:hover { color: #fff; background: var(--blue-hover, #8a3d8a); }
    .opps-view-tab svg { flex-shrink: 0; }

  /* Acesso rápido ao conteúdo (navegabilidade / a11y) */
  .skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10001;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
  }
  .skip-to-content:focus {
    left: 12px;
    top: 12px;
    width: auto;
    height: auto;
    overflow: visible;
  }

    :root {
      /* ===== T0: Tokens semânticos UPSIGHT (nomenclatura idêntica ao UPSIGHT §2.1) ===== */
      /* Mapeamento por HEX — nunca por nome (trap Uva/Azul documentado em MODULE_design_system.md) */
      --background: #ffffff;
      --foreground: #212146;
      --card: #ffffff;
      --card-foreground: #212146;
      --popover: #ffffff;
      --popover-foreground: #212146;
      --primary: #212146;          /* Azul Under Protection */
      --primary-foreground: #ffffff;
      --secondary: #9d4b97;        /* Uva Under Protection */
      --secondary-foreground: #ffffff;
      --muted: #f4f1f8;
      --muted-foreground: #4a4a4c; /* Grafite — shift de paridade UPSIGHT (era #6b7280) */
      --accent: #e0c7e6;
      --accent-foreground: #212146;
      --destructive: #c0392b;
      --destructive-foreground: #ffffff;
      --border: #d8d6df;
      --input: var(--border);      /* era transparent — .form-input ficava sem borda visível
                                       no light mode (bug achado na tela de login, 2026-07-11,
                                       mas --input é consumido por .form-input/.form-select/
                                       .form-textarea em TODO o design system — ex. filter-bar,
                                       _form_field.html — logo fix é global, não escopado */
      --input-background: #ffffff;
      --switch-background: #cfd2d3;
      --ring: #9d4b97;             /* Uva — anel de foco */
      --radius: 0.75rem;           /* 12px base; derived: sm=8px md=10px lg=12px xl=16px */

      /* Gráficos */
      --chart-1: #212146;
      --chart-2: #9d4b97;
      --chart-3: #7c7eaa;
      --chart-4: #4a4a4c;
      --chart-5: #e0c7e6;

      /* Sidebar UPSIGHT (224px pinned / 56px compacta — paridade BIUPN, 2026-07-10) */
      --sidebar-width: 224px;
      --sidebar-width-compact: 56px;
      --sidebar: #f7f5fa;
      --sidebar-foreground: #212146;
      --sidebar-primary: #212146;
      --sidebar-accent: #e0c7e6;
      --sidebar-border: #d8d6df;
      --sidebar-ring: #9d4b97;

      /* Marca explícita (sempre disponível, light=dark) */
      --upsight-azul: #212146;
      --upsight-uva: #9d4b97;
      --upsight-grafite: #4a4a4c;

      /* Status semântico */
      --status-success-bg: #DCFCE7; --status-success-fg: #15803D;
      --status-warning-bg: #FEF3C7; --status-warning-fg: #A16207;
      --status-danger-bg: #FEE2E2;  --status-danger-fg: #B91C1C;
      --status-info-bg: #DBEAFE;    --status-info-fg: #1E40AF;

      /* ===== Aliases retrocompatíveis (T3/G2/G3 consomem enquanto codemod não rodou) ===== */
      /* --navy e --blue-primary: aliases computados → nunca hex hardcoded aqui */
      /* --navy  → --foreground (texto) — preserva legibilidade em light e dark    */
      /* --blue-primary → --secondary (fill/ativo = Uva) — preserva visual atual   */
      --navy: var(--foreground);
      --navy-light: #2d2d6b;
      --grafite: var(--upsight-grafite);
      --blue-primary: var(--secondary);
      --blue-accent: #b85ab3;
      --blue-hover: #8a3d8a;

      /* Bug pré-existente corrigido (2026-07-10, achado na auditoria de paridade BIUPN,
         registrado em MODULE_design_system.md §9): --purple era usado (ex. gradiente de
         avatar em customer_detail.html) mas nunca definido. Derivado da paleta em vez de
         hex fixo pra funcionar automaticamente em dark mode (color-mix resolve --primary/
         --secondary no cascade do elemento, não no ponto de definição). */
      --purple: color-mix(in srgb, var(--primary) 50%, var(--secondary) 50%);

      /* Fonte mono (paridade BIUPN, 2026-07-10) — carregamento do webfont fica a cargo
         de cada produto consumidor (mesmo padrão já usado pra Montserrat). */
      --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

      /* Aliases legacy → token semântico (retrocompatível para codemod T3) */
      --bg-main: var(--background); /* era var(--muted) — paridade BIUPN, 2026-07-10 */
      --bg-card: var(--card);
      --bg-card-hover: #f8faff;
      --bg-hover: var(--accent);
      --sidebar-bg: var(--sidebar);
      --sidebar-active-bg: var(--sidebar-accent);
      --sidebar-text: var(--sidebar-foreground);
      --sidebar-muted: var(--muted-foreground);
      --text-primary: var(--foreground);
      --text-secondary: var(--muted-foreground);
      --text-muted: var(--muted-foreground);
      --text: var(--foreground);
      --border-focus: var(--ring);

      /* Utilitários de cor não-semânticos (mantidos) */
      --green: #22c55e;
      --yellow: #f59e0b;
      --red: var(--destructive);
      --red-light: #fef2f2;
      --green-light: #f0fdf4;
      --yellow-light: #fffbeb;

      --gap-current-bg: #fef9ee;
      --gap-current-border: #fde68a;
      --gap-ideal-bg: #f0fdf4;
      --gap-ideal-border: #86efac;
      --gap-risk-bg: #fff1f2;
      --gap-risk-border: #fca5a5;

      /* Radii derivados (UPSIGHT theme.css:138-141) */
      --radius-sm: 8px;   /* rounded-sm */
      --radius-md: 10px;  /* rounded-md — botões e inputs */
      --radius-lg: 12px;  /* rounded-lg */
      --radius-xl: 16px;  /* rounded-xl — cards, tabs */

      --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
      --shadow: 0 4px 6px rgba(0,0,0,.07);
      --shadow-lg: 0 10px 15px rgba(0,0,0,.1);
    }

    /* ===== T0: Dark Mode — tokens UPSIGHT completos ===== */
    [data-theme="dark"] {
      --background: #0c0c1f;
      --foreground: #f4f1f8;
      --card: #181836;
      --card-foreground: #f4f1f8;
      --popover: #181836;
      --popover-foreground: #f4f1f8;
      --primary: #9d4b97;          /* Uva ativa no escuro */
      --primary-foreground: #ffffff;
      --secondary: #7c7eaa;        /* lavanda no escuro */
      --secondary-foreground: #0c0c1f;
      --muted: #212146;
      --muted-foreground: #b9b6c9;
      --accent: #2a2a52;
      --accent-foreground: #f4f1f8;
      --destructive: #ef4444;
      --destructive-foreground: #ffffff;
      --border: #2a2a52;
      --input: #212146;
      --input-background: #181836;
      --switch-background: #4a4a4c;
      --ring: #9d4b97;

      --chart-1: #9d4b97;
      --chart-2: #7c7eaa;
      --chart-3: #e0c7e6;
      --chart-4: #cfd2d3;
      --chart-5: #f4f1f8;

      --sidebar: #181836;
      --sidebar-foreground: #f4f1f8;
      --sidebar-primary: #9d4b97;
      --sidebar-accent: #2a2a52;
      --sidebar-border: #2a2a52;

      /* Aliases dark — navy = foreground (legível), blue-primary = secondary (Uva/lavanda) */
      --navy: var(--foreground);
      --navy-light: #c0c0e0;
      --grafite: var(--upsight-grafite);
      --blue-primary: var(--secondary);

      --bg-main: var(--background);
      --bg-card: var(--card);
      --bg-card-hover: #22223a;
      --bg-hover: var(--accent);
      --sidebar-bg: var(--sidebar);
      --sidebar-active-bg: var(--sidebar-accent);
      --sidebar-text: var(--sidebar-foreground);
      --sidebar-muted: var(--muted-foreground);
      --text-primary: var(--foreground);
      --text-secondary: var(--muted-foreground);
      --text-muted: var(--muted-foreground);
      --text: var(--foreground);
      --border-focus: var(--ring);

      --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
      --shadow: 0 4px 12px rgba(0,0,0,0.3);
      --shadow-lg: 0 10px 30px rgba(0,0,0,0.4);

      --status-success-bg: #14532D; --status-success-fg: #86EFAC;
      --status-warning-bg: #713F12; --status-warning-fg: #FDE68A;
      --status-danger-bg: #7F1D1D;  --status-danger-fg: #FCA5A5;
      --status-info-bg: #1E3A8A;    --status-info-fg: #93C5FD;
    }

    /* Dark overrides racionalizados — consomem tokens semânticos (sem !important onde evitável) */
    [data-theme="dark"] .card,
    [data-theme="dark"] .data-table,
    [data-theme="dark"] .modal,
    [data-theme="dark"] .filter-bar {
      background: var(--card);
      border-color: var(--border);
    }
    [data-theme="dark"] .data-table th {
      background: var(--muted);
      color: var(--muted-foreground);
    }
    [data-theme="dark"] .data-table tr:hover td { background: var(--accent); }
    [data-theme="dark"] .form-input, [data-theme="dark"] .form-select, [data-theme="dark"] .form-textarea {
      background: var(--input-background);
      border-color: var(--input);
      color: var(--foreground);
    }
    [data-theme="dark"] .btn-ghost { color: var(--foreground); }
    [data-theme="dark"] .btn-outline { border-color: var(--border); color: var(--foreground); }
    [data-theme="dark"] .badge-gray { background: var(--muted); color: var(--muted-foreground); }
    [data-theme="dark"] .stat-card { background: var(--card); }
    .dark-toggle {
      display:flex; align-items:center; gap:8px; padding:6px 10px; cursor:pointer;
      background:none; border:none; font-size:0.78rem; color:var(--sidebar-muted);
      transition: color 0.15s;
    }
    .dark-toggle:hover { color: var(--sidebar-text); }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    html { font-size: 16px; } /* era 14px — paridade BIUPN/Tailwind default, 2026-07-10 */

    body {
      font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
      background: var(--bg-main);
      color: var(--text-primary);
      min-height: 100vh;
      display: flex;
    }

    /* ===================== SIDEBAR ===================== */

    .sidebar {
      width: var(--sidebar-width);
      min-width: var(--sidebar-width);
      background: var(--sidebar-bg);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0; left: 0; bottom: 0;
      z-index: 100;
      overflow-y: auto;
      overflow-x: hidden;
      transition: width 0.2s ease, min-width 0.2s ease;
    }

    .sidebar-logo {
      padding: 24px 20px 20px;
      display: flex;
      align-items: center;
      gap: 10px;
      border-bottom: 1px solid rgba(33,33,70,0.08);
    }

    .sidebar-collapse-btn {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      margin-left: auto;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-card, #fff);
      color: var(--sidebar-muted);
      cursor: pointer;
      transition: color 0.15s, border-color 0.15s, background 0.15s;
    }
    .sidebar-collapse-btn:hover {
      color: var(--secondary);
      border-color: var(--secondary);
    }
    [data-theme="dark"] .sidebar-collapse-btn {
      background: var(--bg-card);
    }

    .sidebar-logo-brand {
      display: flex;
      align-items: center;
      width: 100%;
      min-height: 50px;
      padding: 4px 0;
    }
    .sidebar-logo-img {
      max-height: 50px;
      max-width: 220px;
      width: auto;
      height: auto;
      object-fit: contain;
      display: none;
    }
    .sidebar-logo-img--compact-icon { display: none; }
    html:not([data-theme="dark"]) .sidebar-logo-img--light-bg { display: block; }
    html[data-theme="dark"] .sidebar-logo-img--dark-bg { display: block; }
    html.sidebar-compact .sidebar-logo-img--light-bg,
    html.sidebar-compact .sidebar-logo-img--dark-bg { display: none !important; }
    html.sidebar-compact .sidebar-logo-img--compact-icon {
      display: block;
      max-width: 40px;
      max-height: 40px;
    }

    .sidebar-search-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      width: calc(100% - 24px);
      margin: 8px 12px;
      padding: 8px 12px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-card, #fff);
      cursor: pointer;
      font-size: 0.78rem;
      color: var(--text-muted);
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .sidebar-search-btn:hover,
    .sidebar-search-btn:focus-visible {
      border-color: var(--ring);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 20%, transparent);
      outline: none;
    }
    .sidebar-search-btn kbd {
      margin-left: auto;
      padding: 1px 6px;
      border: 1px solid var(--border);
      border-radius: 3px;
      font-size: 0.62rem;
      font-family: inherit;
      color: var(--text-muted);
      background: var(--bg-hover, #f5f5fa);
    }
    [data-theme="dark"] .sidebar-search-btn {
      background: var(--bg-card);
      color: var(--text-muted);
    }

    .logo-icon {
      width: 38px; height: 38px;
      background: linear-gradient(135deg, #212146, #9D4B97);
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
    }

    .logo-icon svg { width: 22px; height: 22px; color: white; }

    .logo-text {
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--navy);
      letter-spacing: -0.5px;
    }

    .sidebar-section-label {
      padding: 18px 20px 6px;
      font-size: 0.68rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--sidebar-muted);
      border-top: 1px solid rgba(33,33,70,0.1);
      margin-top: 4px;
    }
    .sidebar-section-label:first-child { border-top: none; margin-top: 0; }

    .sidebar-nav { padding: 8px 12px; flex: 1; }

    .nav-item {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 12px;
      border-radius: var(--radius);
      color: var(--sidebar-text);
      text-decoration: none;
      font-size: 0.9rem;
      font-weight: 500;
      transition: all 0.15s ease;
      margin-bottom: 2px;
    }

    .nav-item:hover {
      background: var(--bg-hover);
      color: var(--navy);
    }
    .nav-item:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    .nav-item.active {
      background: var(--sidebar-accent);
      color: var(--foreground);
      font-weight: 600;
      box-shadow: none;
      border-left: 3px solid var(--secondary);
      padding-left: 9px;
    }
    .nav-item.active svg { color: var(--secondary); }

    .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

    /* ===== NAV-GROUPS (collapsible sidebar groups) ===== */
    .nav-group { margin-bottom: 2px; }

    .nav-group-header {
      display: flex; align-items: center; gap: 10px;
      width: 100%; padding: 10px 12px;
      border: none; border-radius: var(--radius);
      background: none; cursor: pointer;
      color: var(--sidebar-text);
      font-size: 0.9rem; font-weight: 600;
      font-family: inherit;
      transition: background 0.15s, color 0.15s;
      text-align: left;
      margin-bottom: 2px;
    }
    .nav-group-header:hover {
      background: var(--bg-hover);
      color: var(--navy);
    }
    .nav-group-header:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }
    .nav-group-header.group-active {
      color: var(--secondary);
    }
    .nav-group-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      color: inherit;
    }
    .nav-group-icon svg { width: 18px; height: 18px; }
    .nav-group-label { flex: 1; }

    .nav-caret {
      width: 14px; height: 14px; flex-shrink: 0;
      margin-left: auto;
      transition: transform 0.2s ease;
      color: var(--sidebar-muted);
    }
    .nav-caret.rotated { transform: rotate(90deg); }

    .nav-group-items { padding-left: 10px; overflow: hidden; }
    .nav-group-items .nav-item {
      font-size: 0.85rem;
      padding: 8px 12px;
    }
    .nav-group-items .nav-item svg { width: 16px; height: 16px; }

    [data-theme="dark"] .nav-group-header { color: var(--sidebar-text); }
    [data-theme="dark"] .nav-group-header:hover { background: rgba(255,255,255,0.08); }
    /* ===== END NAV-GROUPS ===== */

    .nav-badge-soon {
      margin-left: auto;
      font-size: 0.6rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      padding: 2px 7px;
      border-radius: 100px;
      background: rgba(157,75,151,0.1);
      color: var(--blue-primary);
      white-space: nowrap;
    }

    .sidebar-footer {
      padding: 16px 12px;
      border-top: 1px solid rgba(33,33,70,0.08);
    }

    .user-card {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 12px;
      border-radius: var(--radius);
      transition: background 0.15s;
      cursor: pointer;
      text-decoration: none;
      color: var(--navy);
      max-width: 100%; overflow: hidden;
    }
    .user-card .user-name {
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      max-width: 150px;
    }

    .user-card:hover { background: rgba(255,255,255,0.6); }

    .avatar {
      width: 36px; height: 36px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--navy), var(--blue-primary));
      display: flex; align-items: center; justify-content: center;
      font-size: 0.8rem;
      font-weight: 700;
      color: white;
      flex-shrink: 0;
    }

    .avatar-lg {
      width: 48px; height: 48px;
      font-size: 1rem;
    }

    .user-info { flex: 1; min-width: 0; }
    .user-name { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .user-role { font-size: 0.73rem; color: var(--text-muted); }

    /* ===================== SIDEBAR COMPACTA ===================== */
    html.sidebar-compact {
      --sidebar-width: var(--sidebar-width-compact);
    }

    html.sidebar-compact .sidebar-logo {
      padding: 16px 10px 12px;
      flex-wrap: wrap;
      justify-content: center;
    }

    html.sidebar-compact .sidebar-collapse-btn {
      margin: 4px auto 0;
      order: 3;
      width: 100%;
    }

    html.sidebar-compact .sidebar-logo-brand {
      justify-content: center;
      width: 100%;
      min-height: 44px;
    }

    html.sidebar-compact .sidebar-search-btn {
      width: calc(100% - 16px);
      margin: 8px;
      padding: 10px;
      justify-content: center;
      font-size: 0;
      gap: 0;
    }

    html.sidebar-compact .sidebar-search-btn kbd {
      display: none;
    }

    html.sidebar-compact .nav-group-label,
    html.sidebar-compact .nav-caret,
    html.sidebar-compact .sidebar-section-label {
      display: none !important;
    }

    html.sidebar-compact .nav-group-header {
      justify-content: center;
      padding: 10px 8px;
    }

    html.sidebar-compact .nav-item {
      justify-content: center;
      padding: 10px 8px;
      font-size: 0;
      gap: 0;
      position: relative;
    }

    html.sidebar-compact .nav-item.active {
      padding-left: 8px;
    }

    html.sidebar-compact .nav-item > span[style] {
      font-size: 0.55rem;
      line-height: 1;
      position: absolute;
      top: 4px;
      right: 4px;
    }

    html.sidebar-compact .nav-badge-soon {
      display: none;
    }

    html.sidebar-compact .sidebar-footer .user-info {
      display: none;
    }

    html.sidebar-compact .sidebar-footer .user-card {
      justify-content: center;
      padding: 10px 8px;
    }

    html.sidebar-compact .sidebar-footer > div {
      flex-direction: column;
      gap: 8px;
    }

    html.sidebar-compact .dark-toggle {
      justify-content: center;
      width: 100%;
      padding: 8px;
    }

    html.sidebar-compact .dark-toggle span {
      display: none;
    }

    /* Flyout dos grupos ao passar o mouse (modo compacto) */
    html.sidebar-compact .nav-group {
      position: relative;
    }

    html.sidebar-compact .nav-group-items {
      display: none !important;
      position: absolute;
      left: calc(100% + 4px);
      top: 0;
      min-width: 220px;
      max-height: 70vh;
      overflow-y: auto;
      background: var(--sidebar-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 8px;
      box-shadow: var(--shadow-lg, 0 8px 24px rgba(33, 33, 70, 0.15));
      z-index: 250;
    }

    html.sidebar-compact .nav-group:hover .nav-group-items,
    html.sidebar-compact .nav-group:focus-within .nav-group-items {
      display: block !important;
    }

    html.sidebar-compact .nav-group-items .nav-item {
      font-size: 0.85rem;
      justify-content: flex-start;
      gap: 10px;
      padding: 8px 12px;
    }

    html.sidebar-compact .nav-group-items .nav-item svg {
      width: 16px;
      height: 16px;
    }

    /* ===================== MAIN CONTENT ===================== */
    .main-content {
      flex: 1;
      margin-left: var(--sidebar-width);
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      transition: margin-left 0.2s ease;
    }

    .page-header {
      background: var(--card);
      border-bottom: 1px solid var(--border);
      padding: 18px 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 50;
      box-shadow: 0 1px 0 rgba(33, 33, 70, 0.04);
    }

    .page-breadcrumb {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      font-size: 0.78rem;
      font-weight: 500;
      color: var(--grafite, #4A4A4C);
      margin-bottom: 6px;
    }
    .page-breadcrumb a {
      color: var(--grafite, #4A4A4C);
      text-decoration: none;
    }
    .page-breadcrumb a:hover { color: var(--blue-primary); }
    .page-breadcrumb-sep { opacity: 0.45; user-select: none; }
    .page-breadcrumb-current { color: var(--navy); font-weight: 600; }

    .page-title {
      display: flex; align-items: center; gap: 10px;
      font-size: 1.35rem;
      font-weight: 700;
      color: var(--navy);
      letter-spacing: -0.02em;
    }

    .page-title svg { width: 22px; height: 22px; color: var(--blue-primary); }

    .page-actions { display: flex; align-items: center; gap: 10px; }

    .page-body {
      padding: 24px 28px;
      flex: 1;
    }

    /* ===================== BUTTONS — spec UPSIGHT §3 ===================== */
    /* Base comum (inline-flex, font 600, transition, foco anel uva 3px, disabled opacity .5) */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;                   /* gap-2 */
      height: 36px;               /* h-9 — tamanho default */
      padding: 0 16px;            /* px-4 */
      border-radius: 10px;        /* rounded-md */
      font-family: 'Montserrat', sans-serif;
      font-size: 14px;            /* text-sm */
      font-weight: 600;           /* medium no UPSIGHT = 600 */
      line-height: 1.5;
      cursor: pointer;
      transition: all 0.2s ease;
      border: none;
      text-decoration: none;
      white-space: nowrap;
      outline: none;
    }
    .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
    .btn:focus-visible {
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
      outline: none;
    }
    .btn:disabled, .btn[disabled] { opacity: .5; pointer-events: none; cursor: not-allowed; }

    /* ── Tamanhos ── */
    .btn-sm  { height: 32px; padding: 0 12px; font-size: 14px; } /* h-8 px-3 */
    .btn-md  { height: 36px; padding: 0 16px; }                  /* h-9 px-4 (alias de .btn) */
    .btn-lg  { height: 40px; padding: 0 24px; }                  /* h-10 px-6 */
    .btn-icon { height: 36px; width: 36px; padding: 0; }         /* size-9 */

    /* ── Variantes de cor ── */
    /* default / primary: Azul */
    .btn-primary {
      background: var(--primary);
      color: var(--primary-foreground);
    }
    .btn-primary:hover { filter: brightness(.92); }

    /* secondary: Uva */
    .btn-secondary {
      background: var(--secondary);
      color: var(--secondary-foreground);
    }
    .btn-secondary:hover { filter: brightness(.85); }

    /* destructive */
    .btn-destructive {
      background: var(--destructive);
      color: var(--destructive-foreground);
    }
    .btn-destructive:hover { filter: brightness(.92); }

    /* outline */
    .btn-outline {
      background: var(--background);
      color: var(--foreground);
      border: 1px solid var(--border);
    }
    .btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }

    /* ghost */
    .btn-ghost {
      background: transparent;
      color: var(--foreground);
      border: none;
    }
    .btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }

    /* link */
    .btn-link {
      background: transparent;
      color: var(--primary);
      border: none;
      text-decoration-line: underline;
      text-underline-offset: 4px;
    }
    .btn-link:hover { text-decoration: underline; }

    /* legacy alias (templates usam .btn-danger) */
    .btn-danger {
      background: var(--destructive);
      color: var(--destructive-foreground);
    }
    .btn-danger:hover { filter: brightness(.92); }

    /* ===================== CARDS — spec UPSIGHT §3 card.tsx ===================== */
    .card {
      background: var(--card);
      color: var(--card-foreground);
      border-radius: 16px;        /* rounded-xl */
      border: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 24px;                  /* gap-6 */
    }

    .card-header {
      padding: 24px 24px 0;       /* px-6 pt-6 */
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;                   /* gap-1.5 */
    }

    .card-title {
      font-size: 16px;            /* text-base */
      font-weight: 600;
      color: var(--card-foreground);
      display: flex; align-items: center; gap: 8px;
      line-height: 1;
    }

    .card-title svg { width: 18px; height: 18px; color: var(--secondary); }

    .card-body, .card-content { padding: 0 24px 24px; }  /* px-6 pb-6 */
    .card-footer {
      padding: 0 24px 24px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* stat-card: número text-3xl bold + label text-sm muted */
    .stat-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 24px;
    }
    .stat-card-number {
      font-size: 30px;            /* text-3xl */
      font-weight: 700;
      color: var(--card-foreground);
      line-height: 1.2;
    }
    .stat-card-label {
      font-size: 14px;
      color: var(--muted-foreground);
      margin-top: 4px;
    }

    /* Grid de stat-cards (UPSIGHT §4: grid-cols-1 md:2 lg:4 gap-6 = 24px) */
    .stat-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 24px;                  /* gap-6 */
    }
    @media (min-width: 768px)  { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
    @media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

    /* Grids base (referenciados no override responsivo :1723, antes indefinidos) */
    .grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

    /* ===================== FILTER BAR ===================== */
    .filter-bar {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 18px 20px;
      margin-bottom: 20px;
    }

    .filter-row {
      display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
    }

    .filter-group { display: flex; flex-direction: column; gap: 5px; }

    .filter-label {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    /* ── Inputs/Select/Textarea — spec UPSIGHT §3 ── */
    .form-input, .form-select, .form-textarea {
      height: 36px;               /* h-9 */
      border: 1px solid var(--input);
      border-radius: 10px;        /* rounded-md */
      padding: 0 12px;            /* px-3 */
      font-size: 14px;
      font-family: 'Montserrat', sans-serif;
      color: var(--foreground);
      background: var(--input-background);
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
      width: 100%;
    }
    .form-input:focus, .form-select:focus, .form-textarea:focus {
      border-color: var(--ring);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent);
    }
    .form-input::placeholder, .form-textarea::placeholder { color: var(--muted-foreground); }
    .form-input[aria-invalid="true"], .form-select[aria-invalid="true"], .form-textarea[aria-invalid="true"] {
      border-color: var(--destructive);
    }
    .form-input:disabled, .form-select:disabled, .form-textarea:disabled {
      opacity: .5; cursor: not-allowed;
    }

    /* Checkbox — 16×16px radius 4px */
    .form-check {
      width: 16px; height: 16px;
      border-radius: 4px;
      border: 1px solid var(--input);
      background: var(--input-background);
      appearance: none; -webkit-appearance: none;
      cursor: pointer;
      flex-shrink: 0;
      transition: background 0.2s, border-color 0.2s;
    }
    .form-check:checked {
      background: var(--primary);
      border-color: var(--primary);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 7l4 4 6-7' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: center;
    }
    .form-check:focus-visible {
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
    }

    /* Switch — track 18.4×32px, thumb 16px */
    .form-switch {
      position: relative;
      display: inline-block;
      width: 32px; height: 18.4px;
      flex-shrink: 0;
    }
    .form-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
    .form-switch-track {
      position: absolute; inset: 0;
      border-radius: 9999px;
      background: var(--switch-background);
      cursor: pointer;
      transition: background 0.2s;
    }
    .form-switch input:checked + .form-switch-track { background: var(--primary); }
    .form-switch-track::after {
      content: '';
      position: absolute;
      left: 2px; top: 50%;
      transform: translateY(-50%);
      width: 16px; height: 16px;
      border-radius: 50%;
      background: var(--card);
      transition: transform 0.2s;
    }
    .form-switch input:checked + .form-switch-track::after {
      transform: translateY(-50%) translateX(calc(100% - 2px));
    }
    .form-switch input:focus-visible + .form-switch-track {
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
    }

    .input-icon-wrap { position: relative; }
    .input-icon-wrap .icon {
      position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
      width: 15px; height: 15px; color: var(--text-muted);
    }
    .input-icon-wrap .form-input { padding-left: 32px; }

    .clear-filters {
      color: var(--blue-accent);
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      text-decoration: none;
      background: none; border: none;
      padding: 8px 0;
      margin-top: 4px;
      transition: color 0.15s;
    }

    .clear-filters:hover { color: var(--navy); text-decoration: underline; }

    /* ===================== TABLE — spec UPSIGHT §3 table.tsx ===================== */
    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;            /* text-sm */
    }
    .data-table-wrapper { overflow-x: auto; }

    .data-table thead tr { border-bottom: 1px solid var(--border); }

    .data-table th {
      height: 40px;               /* h-10 */
      padding: 0 8px;             /* px-2 */
      text-align: left;
      font-size: 14px;
      font-weight: 600;           /* font-medium no UPSIGHT = 600 */
      color: var(--muted-foreground);
      vertical-align: middle;
      /* Sem zebra; sem text-transform uppercase (UPSIGHT não tem) */
    }

    .data-table td {
      padding: 8px;               /* p-2 */
      border-bottom: 1px solid var(--border);
      font-size: 14px;
      color: var(--foreground);
      vertical-align: middle;
    }

    .data-table tr:last-child td { border-bottom: none; }
    .data-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 50%, transparent); }
    .data-table tbody tr[data-selected="true"] { background: var(--muted); }

    /* ===================== BADGES — spec UPSIGHT §3 badge.tsx ===================== */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      width: fit-content;
      padding: 2px 8px;           /* py-0.5 px-2 */
      border-radius: 10px;        /* rounded-md */
      font-size: 12px;            /* text-xs */
      font-weight: 600;
      border: 1px solid transparent;
      white-space: nowrap;
    }
    .badge svg { width: 12px; height: 12px; }  /* size-3 */

    /* Variantes UPSIGHT */
    .badge-default, .badge-primary {
      background: var(--primary); color: var(--primary-foreground);
    }
    .badge-secondary, .badge-blue {
      background: var(--secondary); color: var(--secondary-foreground);
    }
    .badge-destructive, .badge-red {
      background: var(--destructive); color: var(--destructive-foreground);
    }
    .badge-outline {
      background: transparent; color: var(--foreground);
      border-color: var(--border);
    }
    /* Legacy */
    .badge-green { background: var(--status-success-bg); color: var(--status-success-fg); border-color: transparent; }
    .badge-yellow { background: var(--status-warning-bg); color: var(--status-warning-fg); border-color: transparent; }
    .badge-gray { background: var(--muted); color: var(--muted-foreground); border-color: transparent; }
    .badge-ai { background: color-mix(in srgb, var(--secondary) 12%, transparent); color: var(--secondary); border-color: color-mix(in srgb, var(--secondary) 25%, transparent); }

    .badge-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: currentColor;
    }

    /* ===================== PROGRESS BAR ===================== */
    .completeness-bar {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 14px 18px;
      margin-bottom: 24px;
    }

    .completeness-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 8px;
    }

    .completeness-label {
      display: flex; align-items: center; gap: 8px;
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--navy);
    }

    .completeness-pct {
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--text-secondary);
    }

    .progress-track {
      height: 8px;
      background: var(--bg-main);
      border-radius: 100px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      border-radius: 100px;
      background: linear-gradient(90deg, #22c55e, #16a34a);
      transition: width 0.6s ease;
    }

    .progress-fill.medium { background: linear-gradient(90deg, #f59e0b, #d97706); }
    .progress-fill.low { background: linear-gradient(90deg, #ef4444, #dc2626); }

    /* ===================== TABS ===================== */
    .tabs-nav {
      display: flex;
      border-bottom: 2px solid var(--border);
      gap: 0;
      margin-bottom: 20px;
      overflow-x: auto;
    }

    .tab-btn {
      display: flex; align-items: center; gap: 7px;
      padding: 12px 18px;
      font-size: 0.88rem;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      border: none;
      background: none;
      border-bottom: 2.5px solid transparent;
      margin-bottom: -2px;
      white-space: nowrap;
      transition: all 0.15s;
      text-decoration: none;
    }

    .tab-btn svg { width: 16px; height: 16px; }

    .tab-btn:hover { color: var(--navy); }

    .tab-btn.active {
      color: var(--blue-primary);
      border-bottom-color: var(--blue-primary);
      font-weight: 600;
    }

    /* ===================== SUB-TABS ===================== */
    .sub-tabs { display: flex; gap: 0; margin-bottom: 20px; }

    .sub-tab-btn {
      padding: 8px 16px;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      border: none;
      background: none;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
      transition: all 0.15s;
    }

    .sub-tab-btn.active {
      color: var(--blue-primary);
      border-bottom-color: var(--blue-primary);
      font-weight: 600;
    }

    /* ===================== GAP CARDS ===================== */
    .gap-card {
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden;
      margin-bottom: 12px;
      background: white;
      transition: box-shadow 0.15s;
    }

    .gap-card:hover { box-shadow: var(--shadow); }

    .gap-card-header {
      padding: 16px 18px;
      display: flex; align-items: flex-start; justify-content: space-between;
      cursor: pointer;
      gap: 10px;
    }

    .gap-title {
      color: var(--navy);
      font-size: 0.92rem;
      font-weight: 600;
      line-height: 1.45;
      flex: 1;
    }

    .gap-meta {
      display: flex; align-items: center; gap: 8px;
      flex-shrink: 0;
    }

    .gap-editor {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .gap-body {
      padding: 0 18px 18px;
      border-top: 1px solid var(--border);
    }

    .gap-description {
      color: var(--text-secondary);
      font-size: 0.87rem;
      line-height: 1.55;
      padding: 14px 0;
    }

    .gap-states {
      display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
      margin: 12px 0;
    }

    .gap-state-box {
      border-radius: var(--radius);
      padding: 14px;
    }

    .gap-state-label {
      font-size: 0.72rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 8px;
      color: var(--text-muted);
    }

    .gap-state-text {
      font-size: 0.85rem;
      line-height: 1.5;
    }

    .state-current { background: var(--gap-current-bg); border: 1px solid var(--gap-current-border); }
    .state-current .gap-state-text { color: #92400e; }

    .state-ideal { background: var(--gap-ideal-bg); border: 1px solid var(--gap-ideal-border); }
    .state-ideal .gap-state-text { color: #166534; }

    .gap-risks-label {
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
      margin-bottom: 8px;
    }

    .gap-risks { display: flex; flex-wrap: wrap; gap: 6px; }

    .risk-tag {
      background: var(--gap-risk-bg);
      border: 1px solid var(--gap-risk-border);
      color: #991b1b;
      padding: 4px 10px;
      border-radius: 100px;
      font-size: 0.78rem;
      font-weight: 500;
    }

    /* ===================== JOURNEY ===================== */
    .journey-phase-card {
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden;
      margin-bottom: 12px;
      background: white;
    }

    .phase-header {
      padding: 16px 18px;
      display: flex; align-items: center; gap: 14px;
      background: #fafbff;
      border-bottom: 1px solid var(--border);
    }

    .phase-number {
      width: 34px; height: 34px;
      border-radius: 50%;
      background: var(--red);
      display: flex; align-items: center; justify-content: center;
      font-size: 0.9rem;
      font-weight: 700;
      color: white;
      flex-shrink: 0;
    }

    .phase-number.normal { background: var(--blue-primary); }
    .phase-number.atencao { background: var(--yellow); }
    .phase-number.concluida { background: var(--green); }

    .phase-name {
      flex: 1;
      font-size: 1rem;
      font-weight: 600;
      color: var(--navy);
    }

    .phase-body {
      padding: 18px;
      display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
    }

    .phase-detail-row {
      display: flex; flex-direction: column; gap: 3px;
    }

    .phase-detail-label {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
      font-weight: 600;
    }

    .phase-detail-value {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--navy);
    }

    .phase-objectives { list-style: none; display: flex; flex-direction: column; gap: 8px; }

    .phase-objective {
      display: flex; align-items: flex-start; gap: 8px;
      font-size: 0.85rem;
      color: var(--text-secondary);
      line-height: 1.45;
    }

    .check-icon { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; margin-top: 2px; }

    /* ===================== EMPTY STATE — spec UPSIGHT §3 EmptyState.tsx ===================== */
    .empty-state {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      padding: 32px 32px 64px;    /* p-8 py-16 */
      text-align: center;
      background: var(--card);
      border-radius: 12px;
      border: 1px dashed var(--border);
    }

    .empty-state-icon {
      width: 64px; height: 64px;
      border-radius: 50%;
      background: color-mix(in srgb, var(--muted) 50%, transparent);
      display: flex; align-items: center; justify-content: center;
      color: var(--muted-foreground);
      margin-bottom: 16px;
    }
    .empty-state-icon svg { width: 24px; height: 24px; }

    /* legacy: SVG direto no empty-state */
    .empty-state > svg {
      width: 48px; height: 48px;
      color: var(--muted-foreground);
      margin-bottom: 14px;
    }

    .empty-state-title {
      font-size: 18px;            /* text-lg */
      font-weight: 600;
      color: var(--card-foreground);
      margin-bottom: 6px;
    }

    .empty-state-desc {
      font-size: 14px;
      color: var(--muted-foreground);
      max-width: 336px;           /* max-w-sm */
    }

    /* ===================== ALERT — spec UPSIGHT §3 alert.tsx ===================== */
    .alert {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 0 12px;
      align-items: start;
      padding: 12px 16px;         /* py-3 px-4 */
      border-radius: 12px;        /* rounded-lg */
      border: 1px solid var(--border);
      font-size: 14px;
      background: var(--card);
      color: var(--card-foreground);
    }
    .alert svg { width: 16px; height: 16px; margin-top: 2px; }
    .alert-title { font-weight: 600; margin-bottom: 2px; }
    .alert-description { color: var(--muted-foreground); }
    .alert-destructive {
      background: var(--card);
      color: var(--destructive);
      border-color: color-mix(in srgb, var(--destructive) 30%, transparent);
    }

    /* ===================== SKELETON — spec UPSIGHT §3 skeleton.tsx ===================== */
    @keyframes ds-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: .4; }
    }
    .skeleton {
      background: var(--accent);
      border-radius: 10px;
      animation: ds-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;
    }

    /* ===================== MODAL — spec UPSIGHT §3 dialog.tsx =====================
       Migrado pra <dialog> nativo em 2026-07-16 (SonarQube Web:S6819 — Igor
       autorizou via Matrix "4a"). .modal agora É o <dialog> (mostrado via
       showModal()) — sem wrapper .modal-backdrop separado; o tingimento de
       fundo é o ::backdrop nativo do <dialog>, centralização explícita via
       position:fixed/transform (mais previsível entre navegadores que o
       auto-centering da UA stylesheet do <dialog>). */
    .modal::backdrop {
      background: rgba(0,0,0,0.5);  /* bg-black/50 */
    }

    /* [open] de propósito no seletor de display: um dialog fechado NÃO tem o
       atributo `open`, e a UA stylesheet só esconde (`display:none`) o
       seletor `dialog:not([open])` — um `.modal{display:grid}` incondicional
       aqui bateria esse default (CSS de autor sempre vence UA stylesheet,
       independente de especificidade) e o modal ficaria visível sempre. */
    .modal[open] {
      position: fixed;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      margin: 0;
      background: var(--card);
      color: var(--card-foreground);
      border-radius: 12px;          /* rounded-lg */
      border: 1px solid var(--border);
      box-shadow: var(--shadow-lg);
      width: 100%;
      max-width: min(512px, calc(100vw - 32px));  /* sm:max-w-lg, calc(100%-2rem) mobile */
      max-height: 90vh;
      overflow-y: auto;
      display: grid;
      gap: 16px;                    /* gap-4 */
      padding: 24px;                /* p-6 */
    }

    .modal-header {
      display: flex;
      flex-direction: column;
      gap: 8px;                     /* gap-2 */
    }

    .modal-title {
      font-size: 18px;              /* text-lg */
      font-weight: 600;
      color: var(--card-foreground);
      line-height: 1;
    }

    .modal-description {
      font-size: 14px;
      color: var(--muted-foreground);
    }

    .modal-close {
      position: absolute;
      top: 16px; right: 16px;
      background: none; border: none; cursor: pointer;
      color: var(--muted-foreground);
      opacity: .7;
      transition: opacity 0.15s;
      padding: 4px;
      border-radius: 4px;
    }
    .modal-close:hover { opacity: 1; }
    .modal-close svg { width: 16px; height: 16px; }

    /* .modal-body: conteúdo livre no grid (sem estilo próprio) */
    .modal-footer {
      display: flex;
      flex-direction: row;
      justify-content: flex-end;
      gap: 8px;
    }

    /* Drawer lateral — spec UPSIGHT §3 sheet.tsx */
    .drawer {
      position: fixed;
      top: 0; bottom: 0; right: 0;
      width: 75%;
      max-width: 384px;             /* sm:max-w-sm */
      background: var(--card);
      border-left: 1px solid var(--border);
      box-shadow: var(--shadow-lg);
      z-index: 300;
      padding: 24px;
      overflow-y: auto;
    }
    .drawer-left { right: auto; left: 0; border-left: none; border-right: 1px solid var(--border); }

    /* ===================== FORM ELEMENTS ===================== */
    .form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }

    .form-label {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-secondary);
    }

    .form-textarea {
      height: auto;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      padding: 10px 12px;
      font-size: 0.88rem;
      font-family: 'Montserrat', sans-serif;
      color: var(--text-primary);
      background: white;
      outline: none;
      resize: vertical;
      min-height: 100px;
      transition: border-color 0.15s;
    }

    .form-textarea:focus {
      border-color: var(--border-focus);
      box-shadow: 0 0 0 3px rgba(157,75,151,0.12);
    }

    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

    /* ===================== ALERTS ===================== */
    .toast {
      position: fixed; bottom: 24px; right: 24px;
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 14px 18px;
      box-shadow: var(--shadow-lg);
      display: flex; align-items: center; gap: 10px;
      z-index: 1000;
      font-size: 0.88rem;
      font-weight: 500;
      animation: slideIn 0.25s ease;
      max-width: 360px;
    }

    .toast.success { border-left: 3px solid var(--green); }
    .toast.error { border-left: 3px solid var(--red); }
    .toast.info { border-left: 3px solid var(--status-info-fg); }

    @keyframes slideIn {
      from { transform: translateX(120%); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    /* ===================== UTILS ===================== */
    .flex { display: flex; }
    .flex-col { flex-direction: column; }
    .items-center { align-items: center; }
    .justify-between { justify-content: space-between; }
    .gap-2 { gap: 8px; }
    .gap-3 { gap: 12px; }
    .gap-4 { gap: 16px; }
    .w-full { width: 100%; }
    .text-sm { font-size: 0.85rem; }
    .text-xs { font-size: 0.75rem; }
    .font-semibold { font-weight: 600; }
    .font-bold { font-weight: 700; }
    .text-muted { color: var(--text-muted); }
    .text-secondary { color: var(--text-secondary); }
    .text-navy { color: var(--navy); }
    .text-blue { color: var(--blue-primary); }
    .text-green { color: var(--green); }
    .text-red { color: var(--red); }
    .mb-1 { margin-bottom: 4px; }
    .mb-2 { margin-bottom: 8px; }
    .mb-3 { margin-bottom: 12px; }
    .mb-4 { margin-bottom: 16px; }
    .mb-6 { margin-bottom: 24px; }
    .mt-2 { margin-top: 8px; }
    .mt-4 { margin-top: 16px; }
    .p-4 { padding: 16px; }
    .rounded { border-radius: var(--radius-md); }
    .border { border: 1px solid var(--border); }
    .bg-white { background: var(--card); }
    .overflow-hidden { overflow: hidden; }
    .divider { height: 1px; background: var(--border); margin: 16px 0; }
    .text-right { text-align: right; }

    /* Paginação (UPSIGHT pagination.tsx: nav centralizado; itens = .btn .btn-outline/.btn-ghost .btn-sm) */
    .pagination {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-top: 16px;
    }

    /* Helpers para partials canônicos (_partials/*.html) */
    .page-header-icon { display: inline-flex; align-items: center; color: var(--secondary); }
    .form-required-mark { color: var(--destructive); margin-left: 2px; }
    .form-field-error { font-size: 12px; color: var(--destructive); margin-top: 2px; display: block; }
    .form-field-help { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; display: block; }

    /* ===================== HTMX LOADING ===================== */
    .htmx-request .htmx-indicator { display: inline-flex !important; }
    .htmx-indicator { display: none; align-items: center; gap: 6px; }

    /* Global top progress bar */
    #htmx-progress {
      position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999;
      background: transparent; pointer-events: none;
    }
    #htmx-progress .bar {
      height: 100%; width: 0; border-radius: 0 2px 2px 0;
      background: linear-gradient(90deg, var(--blue-primary), #9D4B97);
      transition: width 0.3s ease;
    }
    #htmx-progress.active .bar { width: 80%; }
    #htmx-progress.done .bar { width: 100%; transition: width 0.1s ease; }

    @keyframes spin { to { transform: rotate(360deg); } }
    .spinner {
      width: 14px; height: 14px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: white;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
    }

    /* ===================== SCROLLBAR ===================== */
    ::-webkit-scrollbar { width: 5px; height: 5px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: #c8d3eb; border-radius: 10px; }
    ::-webkit-scrollbar-thumb:hover { background: #9aaac8; }

    /* ===================== MOBILE (Fase 7) ===================== */
    /* Burger button (mobile-only) — posicionado no header superior. */
    .mobile-burger {
      display: none;
      position: fixed;
      top: 12px; left: 12px;
      z-index: 210;
      width: 40px; height: 40px;
      border-radius: 10px;
      background: var(--navy);
      color: #fff;
      border: none;
      align-items: center; justify-content: center;
      box-shadow: var(--shadow);
      cursor: pointer;
    }
    .mobile-burger svg { width: 22px; height: 22px; }

    /* Overlay escurecido quando sidebar está aberta no mobile. */
    .sidebar-overlay {
      display: none;
      position: fixed; inset: 0;
      background: rgba(33, 33, 70, 0.55);
      z-index: 150;
    }
    body.sidebar-open .sidebar-overlay { display: block; }

    @media (max-width: 900px) {
      /* shrink de 13px removido 2026-07-10 (paridade BIUPN — sem downscale por viewport;
         16px uniforme também evita zoom automático de input no iOS Safari) */
      .mobile-burger { display: inline-flex; }
      .sidebar-collapse-btn { display: none; }
      html.sidebar-compact { --sidebar-width: 82vw; }

      .sidebar {
        transform: translateX(-105%);
        transition: transform 0.25s ease-in-out;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
        width: 82vw;
        min-width: 0;
        max-width: 320px;
        z-index: 200;
      }
      body.sidebar-open .sidebar {
        transform: translateX(0);
      }

      .main-content {
        margin-left: 0 !important;
        padding-top: 64px;   /* espaço p/ o burger fixo */
        padding-left: 16px;
        padding-right: 16px;
      }

      /* Scroll horizontal sem quebrar colunas (display:block em table desalinha thead/tbody). */
      .table-responsive {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      .table-responsive > table {
        display: table;
        width: 100%;
        min-width: 640px;
      }

      /* Formulários — inputs empilham, não quebram. */
      .form-row, .grid-2, .grid-3 {
        grid-template-columns: 1fr !important;
      }

      /* Pipeline funnel: summary row quebra em 2 linhas em telas estreitas. */
      .funnel-stage summary {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 12px !important;
      }
      .funnel-stage summary > div:last-child {
        text-align: left !important;
      }

      /* Zoho timeline: header do item permite quebra natural. */
      .zoho-timeline .timeline-body > div:first-child {
        flex-wrap: wrap !important;
      }

      /* Pipeline totals: menos padding nas stat-cards no mobile. */
      .pipeline-totals { gap: 8px !important; }
      .pipeline-totals .stat-card {
        padding: 10px !important;
      }
    }

    @media (max-width: 480px) {
      .mobile-burger { width: 36px; height: 36px; top: 8px; left: 8px; }
    }

    /* Respeita safe-area do iOS (notch). */
    @supports (padding: max(0px)) {
      body { padding-left: env(safe-area-inset-left);
             padding-right: env(safe-area-inset-right); }
    }
