/* base.css — Design System, Layout, Componentes Valora
 * Extraído automaticamente de index.html
 */

    /* ============================================================
       DESIGN SYSTEM
    ============================================================ */
    :root {
      /* Surfaces */
      --bg: #F5F5F7;
      --bg2: #FFFFFF;
      --surface: #FFFFFF;
      --surface2: #F5F5F7;
      --surface-dark: #1e1e35;

      /* Borders */
      --border: rgba(0, 0, 0, 0.08);
      --border2: rgba(0, 0, 0, 0.15);

      /* Text */
      --text: #1D1D1F;
      --text2: #86868B;
      --text3: #8E8E93; /* reforçado para contraste AA sobre --bg */

      /* Brand / Accent */
      --accent: #0071E3;
      --accent2: #0077ED;
      --accent-rgb: 0, 113, 227;
      --accent-glow: rgba(var(--accent-rgb), 0.25);

      /* BIA (assistente IA) */
      --bia: #7C5CFC;
      --bia-rgb: 124, 92, 252;

      /* Semânticas (cor cheia) */
      --green: #34C759;
      --green-rgb: 52, 199, 89;
      --red: #FF3B30;
      --red-rgb: 255, 59, 48;
      --orange: #FF9500;
      --orange-rgb: 255, 149, 0;
      --blue: #0071E3; /* alias de --accent (legado) */
      --yellow: #FFCC00;
      --yellow-rgb: 255, 204, 0;

      /* Tons semânticos (fundos sutis e bordas) */
      --green-bg: rgba(var(--green-rgb), 0.12);
      --green-border: rgba(var(--green-rgb), 0.25);
      --red-bg: rgba(var(--red-rgb), 0.12);
      --red-border: rgba(var(--red-rgb), 0.25);
      --orange-bg: rgba(var(--orange-rgb), 0.12);
      --orange-border: rgba(var(--orange-rgb), 0.25);
      --yellow-bg: rgba(var(--yellow-rgb), 0.15);
      --yellow-border: rgba(var(--yellow-rgb), 0.35);
      --accent-bg: rgba(var(--accent-rgb), 0.08);
      --accent-border: rgba(var(--accent-rgb), 0.20);
      --bia-bg: rgba(var(--bia-rgb), 0.10);
      --bia-border: rgba(var(--bia-rgb), 0.20);

      /* Tipografia (escala canônica) */
      --fs-xs: 11px;   /* badges, caps, hints */
      --fs-sm: 12px;   /* labels secundários, btn-sm */
      --fs-base: 13.5px; /* body padrão UI */
      --fs-md: 14px;   /* bubble BIA, toast */
      --fs-lg: 16px;   /* inputs mobile, section heads */
      --fs-xl: 18px;   /* modal-title */
      --fs-2xl: 20px;  /* stat-value, dre-card-value */
      --fs-3xl: 24px;  /* page-title */
      --fs-4xl: 32px;  /* display (login hero) */

      /* Border-radius */
      --radius-sm: 10px;
      --radius: 14px;
      --radius-lg: 20px;
      --radius-pill: 99px;

      /* Spacing (escala 4-múltiplo) */
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-5: 20px;
      --space-6: 24px;
      --space-7: 28px;
      --space-8: 32px;

      /* Layout */
      --sidebar-w: 240px;
      --sidebar-w-collapsed: 72px;
      --transition: 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
      --transition-fast: 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);

      /* Sombras */
      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
      --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
      --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
      --shadow-modal: 0 32px 80px rgba(0, 0, 0, 0.25);

      /* z-index scale */
      --z-sidebar: 10;
      --z-sidebar-overlay: 99;
      --z-drawer: 100;
      --z-modal: 100;
      --z-cmdk: 150;
      --z-toast: 999;
      --z-login: 9999;
    }

    /* ── DARK MODE ── */
    [data-theme="dark"] {
      --bg: #0B0B0F;
      --bg2: #141419;
      --surface: #18181E;
      --surface2: #1E1E26;
      --surface-dark: #000000;

      --border: rgba(255, 255, 255, 0.08);
      --border2: rgba(255, 255, 255, 0.15);

      --text: #F5F5F7;
      --text2: #A1A1A6;
      --text3: #86868B;

      --accent: #0A84FF;
      --accent2: #409CFF;
      --accent-rgb: 10, 132, 255;

      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
      --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
      --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
      --shadow-modal: 0 32px 80px rgba(0, 0, 0, 0.7);
    }
    [data-theme="dark"] .logo-icon {
      box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
    }
    [data-theme="dark"] body { color-scheme: dark; }

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

    html,
    body {
      height: 100%;
      font-family: 'Inter', system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      font-size: 14px;
      -webkit-font-smoothing: antialiased;
    }

    /* ── SCROLLBAR ── */
    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.15);
      border-radius: 99px;
    }

    /* ── LAYOUT ── */
    #app {
      display: flex;
      height: 100vh;
      overflow: hidden;
    }

    /* ── SIDEBAR ── */
    #sidebar {
      width: var(--sidebar-w);
      background: var(--bg2);
      border-right: none;
      box-shadow: 1px 0 16px rgba(0,0,0,0.03);
      display: flex;
      flex-direction: column;
      padding: 24px 0;
      flex-shrink: 0;
      z-index: 10;
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 20px 28px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 16px;
    }

    .logo-icon {
      width: 36px;
      height: 36px;
      background: linear-gradient(135deg, #0071E3, #00C6FF);
      color: #ffffff;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      box-shadow: 0 4px 12px var(--accent-glow);
    }

    .logo-text {
      font-size: 22px;
      font-weight: 800;
      letter-spacing: -0.5px;
    }

    .logo-sub {
      font-size: 10px;
      color: var(--text3);
      font-weight: 400;
    }

    nav {
      flex: 1;
      padding: 0 12px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-radius: var(--radius-sm);
      color: var(--text2);
      cursor: pointer;
      transition: background var(--transition), color var(--transition);
      font-size: 13.5px;
      font-weight: 500;
      margin-bottom: 2px;
      user-select: none;
    }

    .nav-item:hover {
      background: var(--surface2);
      color: var(--text);
    }

    .nav-item.active {
      background: var(--surface2);
      color: var(--text);
      font-weight: 600;
      border: none;
    }

    .nav-icon {
      font-size: 20px;
      width: 24px;
      text-align: center;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .sidebar-footer {
      padding: 12px 12px 8px;
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .sidebar-version {
      font-size: 10px;
      font-weight: 600;
      color: var(--text3);
      background: rgba(0, 0, 0, 0.05);
      border-radius: 20px;
      padding: 4px 10px;
      margin: 4px 4px 0;
      text-align: center;
      letter-spacing: 0.4px;
    }

    /* ── LOGIN OVERLAY ── */
    #login-overlay {
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: url('../img/login-bg.jpg') center/cover no-repeat;
      background-color: var(--bg);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    #login-overlay.hidden {
      display: none;
    }

    #forgot-overlay {
      position: fixed;
      inset: 0;
      z-index: 10000;
      background: url('../img/login-bg.jpg') center/cover no-repeat;
      background-color: var(--bg);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    #forgot-overlay.hidden {
      display: none;
    }

    .login-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 48px 44px;
      width: 100%;
      max-width: 400px;
      box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
      animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .login-logo {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 36px;
    }

    .login-logo-icon {
      display: none;
    }

    .login-logo-text {
      font-size: 20px;
      font-weight: 800;
      color: var(--text);
      letter-spacing: -0.5px;
      display: flex;
      align-items: baseline;
    }

    .login-logo-sub {
      font-size: 11px;
      color: var(--text3);
      font-weight: 400;
    }

    .login-title {
      font-size: 26px;
      font-weight: 800;
      color: var(--text);
      letter-spacing: -0.5px;
      margin-bottom: 6px;
    }

    .login-subtitle {
      font-size: 13px;
      color: var(--text3);
      margin-bottom: 32px;
    }

    .login-field {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 16px;
    }

    .login-field label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text3);
    }

    .login-field input {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--text);
      padding: 12px 16px;
      font-size: 14px;
      font-family: inherit;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
    }

    .login-field input::placeholder {
      color: var(--text3);
    }

    .login-field input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
      background: var(--surface);
    }

    .login-btn {
      width: 100%;
      padding: 13px;
      margin-top: 8px;
      background: linear-gradient(135deg, #2563eb, #7c3aed);
      color: #fff;
      border: none;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.2s;
      box-shadow: 0 4px 20px rgba(var(--bia-rgb), 0.4);
    }

    .login-btn:hover {
      box-shadow: 0 6px 24px rgba(var(--bia-rgb), 0.6);
      transform: translateY(-1px);
    }

    .login-btn.loading {
      opacity: 0.8;
      pointer-events: none;
    }

    .login-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 24px;
      padding-top: 24px;
      border-top: 1px solid var(--border);
      font-size: 13px;
    }

    .login-link {
      color: var(--text3);
      text-decoration: none;
      font-weight: 600;
      transition: color 0.2s;
    }

    .login-link:hover {
      color: var(--accent);
    }

    .login-btn:active {
      transform: translateY(0);
    }

    .login-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    .login-error {
      background: rgba(220, 38, 38, 0.15);
      border: 1px solid rgba(220, 38, 38, 0.3);
      border-radius: 8px;
      color: #fca5a5;
      font-size: 13px;
      padding: 10px 14px;
      margin-top: 12px;
      display: none;
      text-align: center;
    }

    .login-error.show {
      display: block;
    }

    .btn-logout {
      display: flex;
      align-items: center;
      gap: 8px;
      background: transparent;
      border: 1px solid transparent;
      border-radius: var(--radius-sm);
      color: var(--text2);
      padding: 8px 12px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      width: 100%;
      transition: all var(--transition);
      font-family: inherit;
    }

    .btn-logout:hover {
      background: rgba(255, 59, 48, 0.08); /* Red style hover only */
      color: var(--red);
    }

    .btn-hide-values {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text2);
      padding: 8px 12px;
      font-size: 12.5px;
      font-weight: 500;
      cursor: pointer;
      width: 100%;
      transition: all var(--transition);
    }

    .btn-hide-values:hover {
      background: rgba(0, 0, 0, 0.05);
      color: var(--text);
    }

    .btn-hide-values.active {
      background: rgba(var(--bia-rgb), 0.15);
      color: var(--accent2);
      border-color: rgba(var(--bia-rgb), 0.3);
    }

    /* Global hide-values class */
    body.values-hidden .money-value {
      font-size: 0 !important;
      user-select: none;
      pointer-events: none;
      transition: all 0.2s;
    }

    body.values-hidden .money-value::after {
      content: "••••••";
      font-size: 15px;
      color: var(--text3);
      letter-spacing: 2px;
    }

    /* ── MAIN ── */
    #main {
      flex: 1;
      overflow-y: auto;
      padding: 32px;
      display: flex;
      flex-direction: column;
    }

    .page {
      display: none;
      flex-direction: column;
      gap: 28px;
      animation: fadeIn 0.3s ease;
    }

    .page.active {
      display: flex;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* ── PAGE HEADER ── */
    .page-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 16px;
      flex-wrap: wrap;
    }

    .page-title {
      font-size: 24px;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.5px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .page-subtitle {
      color: var(--text2);
      font-size: 13px;
      margin-top: 3px;
    }

    /* ── BUTTONS ── */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 10px 18px;
      border-radius: var(--radius-sm);
      font-size: 13.5px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: all var(--transition);
      white-space: nowrap;
    }

    .btn-primary {
      background: var(--accent);
      color: #fff;
      box-shadow: 0 4px 12px var(--accent-glow);
    }

    .btn-primary:hover {
      transform: translateY(-1px);
      background: var(--accent2);
      box-shadow: 0 6px 16px var(--accent-glow);
    }

    .btn-ghost {
      background: var(--surface);
      color: var(--text);
      border: 1px solid var(--border2);
    }

    .btn-ghost:hover {
      background: var(--surface2);
      border-color: var(--border2);
    }

    .btn-icon-outline {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text2);
      transition: all var(--transition);
      cursor: pointer;
      font-size: 16px;
    }

    .btn-icon-outline:hover {
      background: var(--surface2);
      color: var(--accent);
      border-color: var(--border2);
    }

    .btn-icon-outline.danger:hover {
      background: rgba(255, 59, 48, 0.08);
      color: var(--red);
      border-color: rgba(255, 59, 48, 0.2);
    }

    .btn-danger {
      background: rgba(240, 90, 122, 0.15);
      color: var(--red);
      border: 1px solid rgba(240, 90, 122, 0.25);
    }

    .btn-danger:hover {
      background: rgba(240, 90, 122, 0.25);
    }

    .btn-sm {
      padding: 5px 10px;
      font-size: 12px;
    }

    /* Touch target mínimo universal (WCAG 2.5.5) */
    .btn {
      min-height: 44px;
    }
    .btn.btn-sm {
      min-height: 36px;
    }

    /* ── CARDS ── */
    .card {
      background: var(--surface);
      border: none;
      box-shadow: var(--shadow-md);
      border-radius: var(--radius-lg);
      padding: 24px;
    }

    /* ── BIA EXECUTIVE PANEL ── */
    .bia-dashboard-panel {
      background: linear-gradient(135deg, rgba(var(--bia-rgb), 0.05) 0%, rgba(var(--bia-rgb), 0) 100%);
      border: 1px solid rgba(var(--bia-rgb), 0.15);
      border-radius: var(--radius-lg);
      padding: 24px;
      margin-bottom: 24px;
      box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02);
    }
    .bia-dash-header {
      display: flex;
      align-items: flex-start;
      gap: 16px;
      margin-bottom: 24px;
    }
    .bia-dash-avatar {
      width: 48px;
      height: 48px;
      border-radius: 14px;
      background: rgba(var(--bia-rgb), 0.15);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      color: var(--bia);
      flex-shrink: 0;
      animation: biaPulse 3s infinite alternate ease-in-out;
    }
    @keyframes biaPulse {
      0% { box-shadow: 0 0 0 0 rgba(var(--bia-rgb), 0.4); }
      100% { box-shadow: 0 0 0 8px rgba(var(--bia-rgb), 0); }
    }
    .bia-dash-message {
      display: flex;
      flex-direction: column;
      gap: 16px;
      flex: 1;
    }
    .bia-dash-greeting {
      font-size: 16px;
      font-weight: 800;
      color: var(--text);
      letter-spacing: -0.3px;
    }
    .bia-dash-insight {
      font-size: 14.5px;
      color: var(--text2);
      line-height: 1.6;
    }
    .bia-insight-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      padding-bottom: 16px;
      margin-bottom: 16px;
      border-bottom: 1px solid rgba(var(--bia-rgb), 0.15);
    }
    .bia-insight-item:last-child {
      border-bottom: none;
      padding-bottom: 0;
      margin-bottom: 0;
    }
    .bia-insight-text {
      flex: 1;
      min-width: 200px;
    }
    .bia-insight-btn {
      font-size: 11.5px;
      padding: 0 14px;
      height: 28px;
      border-radius: 20px;
      color: var(--text);
      border: 1px solid var(--border2);
      background: var(--surface);
      cursor: pointer;
      font-weight: 600;
      transition: all 0.2s;
      white-space: nowrap;
    }
    .bia-insight-btn:hover {
      background: var(--surface2);
      border-color: var(--text3);
    }

    /* ── STATS GRID ── */
    .stat-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 16px;
    }

    .stat-card {
      background: var(--surface);
      border: none;
      box-shadow: var(--shadow-md);
      border-radius: var(--radius-lg);
      padding: 24px;
      position: relative;
      overflow: hidden;
      transition: box-shadow var(--transition), transform var(--transition);
    }

    .stat-card:hover {
      box-shadow: var(--shadow-lg);
      transform: translateY(-2px);
    }



    .stat-label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text2);
      margin-bottom: 10px;
    }

    .stat-value {
      font-size: 19px;
      font-weight: 800;
      letter-spacing: -0.5px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .stat-value.purple {
      color: var(--accent2);
    }

    .stat-value.green {
      color: var(--green);
    }

    .stat-value.orange {
      color: var(--orange);
    }

    .stat-value.blue {
      color: var(--blue);
    }

    .stat-change {
      font-size: 11px;
      color: var(--text3);
      margin-top: 4px;
    }

    /* ── TABLE ── */
    .table-wrap {
      background: var(--surface);
      border: none;
      box-shadow: var(--shadow-md);
      border-radius: var(--radius-lg);
      overflow: hidden;
    }

    /* Wrapper de scroll horizontal para tabelas em mobile */
    .table-scroll-wrap {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .table-scroll-wrap table {
      min-width: 600px;
    }

    .table-toolbar {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 16px 24px;
      border-bottom: 1px solid var(--border);
      flex-wrap: wrap;
    }

    .search-input {
      flex: 1;
      min-width: 180px;
      background: var(--surface2);
      border: 1px solid var(--border2);
      border-radius: var(--radius-sm);
      color: var(--text);
      padding: 8px 12px;
      font-size: 13px;
      outline: none;
      transition: border-color var(--transition);
    }

    .search-input::placeholder {
      color: var(--text3);
    }

    .filter:focus,
    .search-input:focus {
      border-color: var(--border2);
    }

    input[type="month"].filter {
      padding: 6px 12px;
      font-family: inherit;
      color: var(--text);
      background: transparent;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      font-size: 13px;
      height: 36px;
      box-sizing: border-box;
      outline: none;
      transition: all var(--transition);
    }
    input[type="month"].filter:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
    }

    select.filter {
      background: var(--surface2);
      border: 1px solid var(--border2);
      border-radius: var(--radius-sm);
      color: var(--text);
      padding: 8px 10px;
      font-size: 12px;
      outline: none;
      cursor: pointer;
    }

    table {
      width: 100%;
      border-collapse: collapse;
    }

    thead th {
      text-align: left;
      padding: 12px 24px;
      font-size: 11.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      color: var(--text3);
      border-bottom: 1px solid var(--border);
      background: var(--bg);
    }

    tbody tr {
      transition: background var(--transition);
    }

    tbody tr:hover {
      background: var(--surface2);
    }

    tbody tr:not(:last-child) {
      border-bottom: 1px solid var(--border);
    }

    td {
      padding: 16px 24px;
      vertical-align: middle;
    }

    .td-title {
      font-weight: 600;
      font-size: 13.5px;
    }

    .td-sub {
      font-size: 11px;
      color: var(--text2);
      margin-top: 2px;
    }

    .table-actions {
      display: flex;
      gap: 6px;
    }

    .empty-row td {
      text-align: center;
      color: var(--text3);
      padding: 48px;
      font-size: 13px;
    }

    /* ── BADGES ── */
    .badge {
      display: inline-flex;
      align-items: center;
      padding: 3px 10px;
      border-radius: 99px;
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
    }

    .badge-palestra {
      background: rgba(77, 184, 255, 0.15);
      color: var(--blue);
    }

    .badge-workshop {
      background: rgba(var(--bia-rgb), 0.15);
      color: var(--bia);
    }

    .badge-keynote {
      background: rgba(240, 208, 96, 0.15);
      color: var(--yellow);
    }

    .badge-curso {
      background: rgba(34, 201, 138, 0.15);
      color: var(--green);
    }

    .badge-confirmado {
      background: rgba(34, 201, 138, 0.15);
      color: var(--green);
    }

    .badge-proposta {
      background: rgba(240, 160, 32, 0.15);
      color: var(--orange);
    }

    .badge-cancelado {
      background: rgba(240, 90, 122, 0.15);
      color: var(--red);
    }

    .badge-realizado {
      background: rgba(90, 90, 122, 0.15);
      color: var(--text2);
    }

    .badge-pago {
      background: rgba(34, 201, 138, 0.15);
      color: var(--green);
    }

    .badge-pendente {
      background: rgba(240, 160, 32, 0.15);
      color: var(--orange);
    }

    .badge-atrasado {
      background: rgba(240, 90, 122, 0.15);
      color: var(--red);
    }

    /* ── MODAL ── */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(6px);
      z-index: 100;
      display: none;
      padding: 20px;
    }

    .modal-overlay.open {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .modal {
      background: var(--surface);
      border: none;
      border-radius: 20px;
      width: 100%;
      max-width: 560px;
      max-height: 90vh;
      overflow-y: auto;
      animation: slideUp 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
      box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25);
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .modal-header {
      padding: 24px 24px 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .modal-title {
      font-size: 17px;
      font-weight: 700;
    }

    .modal-close {
      background: var(--surface2);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      border: none;
      color: var(--text2);
      font-size: 16px;
      cursor: pointer;
      line-height: 1;
      padding: 0;
      transition: background var(--transition), color var(--transition);
    }

    .modal-close:hover {
      background: var(--border);
      color: var(--text);
    }

    .modal-body {
      padding: 20px 24px 24px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    /* ── FORM ── */
    .form-row {
      display: grid;
      gap: 14px;
    }

    .form-row.cols-2 {
      grid-template-columns: 1fr 1fr;
    }

    .form-row.cols-3 {
      grid-template-columns: 1fr 1fr 1fr;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .field label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      color: var(--text2);
    }

    .field input,
    .field select,
    .field textarea {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      padding: 10px 14px;
      font-size: 13.5px;
      font-family: inherit;
      outline: none;
      transition: border-color var(--transition), box-shadow var(--transition);
    }
    
    /* Inputs dentro de containers cinzas viram brancos para manter contraste */
    div[style*="var(--surface2)"] .field input,
    div[style*="var(--surface2)"] .field select,
    div[style*="var(--surface2)"] .field textarea,
    div[style*="#f9fafb"] .field input,
    div[style*="#f9fafb"] .field select,
    div[style*="#f9fafb"] .field textarea {
        background: var(--surface);
    }

    .field input:focus,
    .field select:focus,
    .field textarea:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
    }

    .field textarea {
      resize: vertical;
      min-height: 72px;
    }

    .modal-footer {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      padding: 24px;
      flex-shrink: 0;
      border-top: none;
      background: transparent;
    }

    /* Responsividade para botões laterais (Mobile) */
    @media (max-width: 768px) {
      .modal-overlay {
        flex-direction: column;
        padding: 10px;
        gap: 20px;
        overflow-y: auto;
        justify-content: flex-start;
      }
      .modal {
        max-height: none;
        margin-top: 40px;
      }
      .modal-footer {
        flex-direction: row;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        padding: 16px 20px 24px 20px;
        margin-top: 0;
        order: 2;
      }
      .modal-footer .btn {
        flex: 1;
        width: auto;
        justify-content: center;
        padding: 14px 8px; 
        font-size: 14px;
        min-height: 48px;
        white-space: nowrap;
      }
      .hide-mobile {
        display: none !important;
      }
      .modal-header {
        padding: 16px 20px !important;
      }

      /* ── Modal de Projetos: colapsa grids para mobile ── */
      .form-row.cols-2,
      .form-row.cols-3 {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
      }

      /* Agenda Tempo Total: data/hora em coluna no mobile */
      .horario-row > div[style*="display:flex"][style*="align-items:center"][style*="gap:8px"],
      div[style*="margin-top:20px"] > div[style*="align-items:center"][style*="gap:8px"] {
        flex-wrap: wrap !important;
      }
      
      .horario-row input[type="date"],
      .horario-row input[type="time"],
      div[style*="margin-top:20px"] input[type="date"],
      div[style*="margin-top:20px"] input[type="time"] {
        flex: 1 1 120px !important;
        min-width: 0 !important;
      }

      /* Modal body sem overflow horizontal */
      .modal-body {
        overflow-x: hidden !important;
      }

      /* Botões de ação do modal (gerar contrato, subir NF) */
      .modal-footer .btn {
        font-size: 12px;
        padding: 12px 6px;
      }

      /* Tags de status e linha de botões de ação no cabeçalho */
      #projeto-action-bar,
      div[id*="btn-row"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
      }

      /* Garante que inputs com width fixa não estourem */
      .modal input,
      .modal select,
      .modal textarea {
        max-width: 100% !important;
        box-sizing: border-box !important;
      }

      /* Financeiro: Data de pagamento e forma de recebimento */
      #secao-financeiro .form-row,
      #secao-financeiro div[style*="display:flex"][style*="align-items:center"][style*="gap:10px"] {
        flex-wrap: wrap !important;
      }

      /* Hospedagem: check-in / check-out em coluna */

      #secao-logistica-hospedagem .form-row {
        grid-template-columns: 1fr !important;
      }

      /* Parcelas: tabela scrollável horizontalmente */
      #parcelas-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
      }
    }


    /* ── AGENDA (CALENDAR) ── */
    .cal-nav {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .cal-month-label {
      font-size: 18px;
      font-weight: 700;
      min-width: 180px;
    }

    .cal-grid {
      background: var(--surface);
      border: none;
      box-shadow: var(--shadow-md);
      border-radius: var(--radius-lg);
      overflow: hidden;
    }

    .cal-days-header {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      border-bottom: 1px solid var(--border);
    }

    .cal-day-name {
      text-align: center;
      padding: 12px 4px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      color: var(--text3);
    }

    .cal-body {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .cal-cell {
      min-height: 90px;
      padding: 8px;
      border-right: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      position: relative;
      transition: background var(--transition);
    }

    .cal-cell:hover {
      background: var(--surface2);
    }

    .cal-cell:nth-child(7n) {
      border-right: none;
    }

    .cal-cell.other-month .cal-cell-num {
      color: var(--text3);
    }

    .cal-cell.today .cal-cell-num {
      background: var(--accent);
      color: #fff;
      box-shadow: 0 2px 8px var(--accent-glow);
    }

    /* Calendar blocking by event status */
    .cal-cell.blocked-proposta {
      background: rgba(234, 179, 8, 0.08);
      border-left: 3px solid #ca8a04;
    }

    .cal-cell.blocked-proposta:hover {
      background: rgba(234, 179, 8, 0.14);
    }

    .cal-cell.blocked-confirmado {
      background: rgba(5, 150, 105, 0.08);
      border-left: 3px solid #059669;
    }

    .cal-cell.blocked-confirmado:hover {
      background: rgba(5, 150, 105, 0.14);
    }

    .cal-cell.blocked-realizado {
      background: rgba(2, 132, 199, 0.08);
      border-left: 3px solid #0284c7;
    }

    .cal-cell-status-badge {
      position: absolute;
      top: 7px;
      right: 7px;
      font-size: 10px;
      font-weight: 700;
      padding: 2px 5px;
      border-radius: 4px;
      white-space: nowrap;
    }

    .cal-cell-status-badge.proposta {
      background: rgba(202, 138, 4, 0.15);
      color: #ca8a04;
    }

    .cal-cell-status-badge.confirmado {
      background: rgba(5, 150, 105, 0.15);
      color: #059669;
    }

    .cal-cell-status-badge.realizado {
      background: rgba(2, 132, 199, 0.15);
      color: #0284c7;
    }

    .cal-cell-num {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .cal-event {
      font-size: 10px;
      padding: 2px 5px;
      border-radius: 4px;
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: default;
      font-weight: 500;
    }

    .cal-event.palestra {
      background: rgba(77, 184, 255, 0.2);
      color: var(--blue);
    }

    .cal-event.workshop {
      background: rgba(var(--bia-rgb), 0.2);
      color: var(--bia);
    }

    .cal-event.keynote {
      background: rgba(240, 208, 96, 0.2);
      color: var(--yellow);
    }

    .cal-event.curso {
      background: rgba(34, 201, 138, 0.2);
      color: var(--green);
    }

    /* ── CACHE (FINANCE) ── */
    .finance-summary {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 16px;
    }

    .finance-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      transition: border-color var(--transition);
      box-shadow: var(--shadow-sm);
    }

    .finance-card:hover {
      border-color: var(--border2);
    }

    .finance-label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text3);
      margin-bottom: 8px;
    }

    .finance-value {
      font-size: 20px;
      font-weight: 700;
      letter-spacing: -0.3px;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ── UPCOMING LIST ── */
    .event-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .event-item {
      display: flex;
      align-items: center;
      gap: 14px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 12px 16px;
      transition: border-color var(--transition), transform var(--transition);
    }

    .event-item:hover {
      border-color: var(--border2);
      transform: translateX(2px);
    }

    .event-date-badge {
      text-align: center;
      min-width: 44px;
      flex-shrink: 0;
    }

    .event-date-day {
      font-size: 22px;
      font-weight: 800;
      line-height: 1;
    }

    .event-date-month {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      color: var(--text2);
      letter-spacing: 0.5px;
    }

    .event-info {
      flex: 1;
    }

    .event-info-title {
      font-weight: 600;
      font-size: 13.5px;
    }

    .event-info-sub {
      font-size: 11.5px;
      color: var(--text2);
      margin-top: 2px;
    }

    .event-right {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
    }

    .event-valor {
      font-size: 14px;
      font-weight: 700;
      color: var(--green);
    }

    /* ── TOAST ── */
    #toast-container {
      position: fixed;
      bottom: 24px;
      right: 24px;
      z-index: 999;
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-width: 360px;
    }

    .toast {
      background: var(--surface-dark);
      border: 1px solid var(--border2);
      border-radius: var(--radius-sm);
      padding: 12px 16px;
      font-size: 13px;
      color: #ffffff;
      animation: toastIn 0.25s ease;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .toast.success {
      border-left: 3px solid var(--green);
    }

    .toast.error {
      border-left: 3px solid var(--red);
    }

    @keyframes toastIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* ── ADMIN ── */
    .admin-tabs {
      display: flex;
      gap: 4px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 4px;
      width: fit-content;
    }

    .admin-tab {
      padding: 7px 16px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      color: var(--text2);
      transition: all var(--transition);
      border: none;
      background: none;
    }

    .admin-tab.active {
      background: var(--surface2);
      color: var(--text);
    }

    .admin-tab:hover:not(.active) {
      color: var(--text);
    }

    .admin-panel {
      display: none;
      flex-direction: column;
      gap: 20px;
    }

    .admin-panel.active {
      display: flex;
    }

    .admin-section-title {
      font-size: 15px;
      font-weight: 700;
      margin-bottom: 4px;
    }

    .admin-section-sub {
      font-size: 12px;
      color: var(--text2);
      margin-bottom: 14px;
    }

    /* RBAC */
    .hide-finance { display: none !important; }

    .tipo-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .tipo-item {
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 10px 14px;
      margin-bottom: 6px;
    }

    .tipo-edit-row {
      background: var(--surface);
      border: 1px solid var(--border2);
      border-radius: var(--radius-sm);
      padding: 8px 12px;
      margin-bottom: 6px;
      flex-wrap: wrap;
    }

    .tipo-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .tipo-name {
      flex: 1;
      font-size: 13px;
      font-weight: 500;
    }

    .tipo-tag {
      font-size: 11px;
      color: var(--text3);
    }

    .add-tipo-row {
      display: flex;
      gap: 8px;
      margin-top: 4px;
    }

    .color-picker {
      width: 38px;
      height: 36px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border2);
      background: var(--surface2);
      cursor: pointer;
      padding: 2px;
    }

    /* ================== RESPONSIVIDADE COMPLETA ================== */

    /* Botão hambúrguer — ID (#btn-hamburger) e classe (.page-hamburger) compartilham o mesmo estilo.
       Use a classe em páginas novas; o ID é mantido para compat com JS legado. */
    .page-hamburger,
    #btn-hamburger {
      display: none;
      align-items: center;
      justify-content: center;
      width: 40px; height: 40px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      cursor: pointer;
      font-size: 18px;
      flex-shrink: 0;
      transition: background var(--transition);
    }
    .page-hamburger:hover,
    #btn-hamburger:hover { background: var(--bg2); }

    /* Overlay para fechar sidebar no mobile */
    #sidebar-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.5);
      z-index: 99;
      backdrop-filter: blur(2px);
    }
    #sidebar-overlay.active { display: block; }

    @media (max-width: 768px) {
      /* Sidebar vira drawer overlay */
      #sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 240px;
        z-index: 100;
        transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
        box-shadow: none;
        overflow-y: auto;
      }
      #sidebar.open {
        left: 0;
        box-shadow: 8px 0 40px rgba(0,0,0,0.18);
      }

      /* Mostrar hambúrguer (classe e ID legado) */
      .page-hamburger,
      #btn-hamburger { display: flex; }

      /* Main ocupa 100% da largura */
      #main {
        padding: 16px 14px;
        width: 100%;
      }

      /* Page header adaptado */
      .page-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 16px;
      }
      .page-header .page-title { font-size: 20px; }
      .page-header .btn { width: 100%; justify-content: center; }

      /* Stat cards: 2 colunas */
      .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
      }
      .stat-card {
        padding: 16px;
        min-height: unset;
      }

      /* Finance summary: Fluido via auto-fit */
      .finance-summary {
        grid-template-columns: 1fr;
        gap: 12px;
      }
    } /* ← Fechando @media (max-width: 768px) */

    /* ── BIA AI ASSISTANT ── */
    #page-bia {
      display: none;
      flex-direction: column;
      height: 100%;
      background: var(--surface);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      overflow: hidden;
    }

    #page-bia.active {
      display: flex;
    }

    .bia-header {
      padding: 24px 32px;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .bia-chat-container {
      flex: 1;
      overflow-y: auto;
      padding: 32px;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    .bia-msg {
      display: flex;
      gap: 12px;
      max-width: 80%;
    }

    .bia-msg.user {
      align-self: flex-end;
      flex-direction: row-reverse;
    }

    .bia-bubble {
      padding: 14px 18px;
      border-radius: 16px;
      font-size: 14px;
      line-height: 1.5;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    }
    .bia-bubble p {
      margin-top: 0;
      margin-bottom: 8px;
    }
    .bia-bubble p:last-child {
      margin-bottom: 0;
    }
    .bia-bubble ul, .bia-bubble ol {
      margin-top: 0;
      margin-bottom: 8px;
      padding-left: 20px;
    }
    .bia-bubble li {
      margin-bottom: 4px;
    }

    .bia-msg.ai .bia-bubble {
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text);
      border-top-left-radius: 4px;
    }

    .bia-msg.user .bia-bubble {
      background: var(--accent);
      color: #fff;
      border-top-right-radius: 4px;
    }

    .bia-suggestions {
      display: flex;
      gap: 10px;
      padding: 0 32px 16px;
      flex-wrap: wrap;
    }

    .bia-suggest-btn {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 99px;
      padding: 8px 16px;
      font-size: 12.5px;
      color: var(--text2);
      cursor: pointer;
      transition: all var(--transition);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .bia-suggest-btn:hover {
      background: var(--bg2);
      color: var(--text);
      border-color: var(--border2);
    }

    .bia-input-area {
      padding: 20px 32px;
      background: var(--surface);
      border-top: 1px solid var(--border);
      flex-shrink: 0;
    }

    .bia-input-box {
      display: flex;
      align-items: center;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 4px 4px 4px 20px;
      transition: border-color var(--transition);
    }

    .bia-input-box:focus-within {
      border-color: var(--accent);
      background: var(--surface);
    }

    .bia-input {
      flex: 1;
      border: none;
      background: transparent;
      outline: none;
      font-size: 14px;
      color: var(--text);
      font-family: inherit;
    }

    .bia-send-btn {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--accent);
      color: white;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 16px;
      transition: transform 0.1s, filter 0.2s;
    }

    .bia-send-btn:hover {
      filter: brightness(1.1);
      transform: scale(1.05);
    }

    .bia-send-btn:active {
      transform: scale(0.95);
    }

    .typing-indicator {
      display: flex;
      gap: 4px;
      padding: 4px 8px;
    }

    .typing-dot {
      width: 6px;
      height: 6px;
      background: var(--text3);
      border-radius: 50%;
      animation: typing 1.4s infinite ease-in-out;
    }

    .typing-dot:nth-child(1) {
      animation-delay: -0.32s;
    }

    .typing-dot:nth-child(2) {
      animation-delay: -0.16s;
    }

    @keyframes typing {

      0%,
      80%,
      100% {
        transform: scale(0);
        opacity: 0.5;
      }

      40% {
        transform: scale(1);
        opacity: 1;
      }
    }

    /* ── ANIMAÇÃO SPINNER (Loading Insights / BIA) ── */
    @keyframes spin {
      from { transform: rotate(0deg); }
      to   { transform: rotate(360deg); }
    }

    /* Suporte ao ph-spin do Phosphor Icons (garante funcionar mesmo sem o CDN ter carregado a animação) */
    .ph-spin {
      animation: spin 1s linear infinite !important;
      display: inline-block;
    }

    /* ── INTL-TEL-INPUT OVERRIDES ── */
    .iti {
      width: 100%;
      display: block;
    }
    .valora-phone {
      width: 100% !important;
      padding-left: 50px !important; /* reserve space for flag */
    }

    /* ── BIA MOBILE RESPONSIVENESS ── */
    @media (max-width: 768px) {
      #page-bia {
        height: 100%;
        overflow: hidden;
      }

      .bia-header {
        padding: 14px 16px;
      }

      .bia-chat-container {
        padding: 16px 14px;
      }

      .bia-suggestions {
        padding: 0 14px 12px;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
      }
      .bia-suggestions::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
      }

      .bia-suggest-btn {
        flex-shrink: 0;
        font-size: 12px;
        padding: 6px 12px;
      }

      /* Área de input: padding compacto no mobile */
      .bia-input-area {
        padding: 10px 14px 14px;
      }

      /* Garante que a input-box não transborde na tela */
      .bia-input-box {
        padding: 4px 4px 4px 14px;
        min-width: 0;
      }

      .bia-input {
        font-size: 16px; /* evita zoom automático no iOS */
        min-width: 0;
      }

      /* Painel de voz: compacto e sem overflow */
      #bia-voice-panel > div:first-child {
        padding: 8px 10px 4px;
        flex-wrap: nowrap;
        gap: 6px;
        overflow: hidden;
      }

      #bia-voice-status {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
      }

      /* Botões do painel de voz menores no mobile */
      #bia-voice-panel button[onclick*="copyVoiceTranscript"] {
        font-size: 11px;
        padding: 4px 8px;
        white-space: nowrap;
        flex-shrink: 0;
      }

      #bia-voice-transcript {
        max-height: 120px;
        padding: 4px 10px 8px;
      }
    }

    /* ── FINANCEIRO DRE TABS & CARDS ── */
    .finance-tabs {
      display: flex;
      gap: 12px;
      margin-bottom: 24px;
      border-bottom: 1px solid var(--border);
      padding-bottom: 0px;
    }

    .finance-tab {
      padding: 10px 16px;
      font-size: 14px;
      font-weight: 600;
      color: var(--text3);
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      cursor: pointer;
      transition: all var(--transition);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .finance-tab:hover {
      color: var(--text2);
    }

    .finance-tab.active {
      color: var(--accent);
      border-bottom: 2px solid var(--accent);
    }

    .finance-panel {
      display: none;
    }

    .finance-panel.active {
      display: block;
      animation: fadeIn 0.3s ease;
    }

    .dre-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      box-shadow: var(--shadow-sm);
      position: relative;
      overflow: hidden;
    }

    .dre-card-title {
      font-size: 11px;
      font-weight: 600;
      color: var(--text3);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .dre-card-value {
      font-size: 20px;
      font-weight: 700;
      letter-spacing: -0.3px;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .dre-accordion {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      margin-top: 24px;
      overflow: hidden;
    }

    .dre-acc-header {
      padding: 16px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      background: var(--surface2);
      transition: background 0.2s;
    }

    .dre-acc-header:hover {
      background: var(--bg2);
    }

    .dre-acc-content {
      padding: 0;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.4s ease, padding 0.4s ease;
    }

    .dre-acc-content.open {
      padding: 16px 24px;
      max-height: 2000px; /* large enough for content */
      border-top: 1px solid var(--border);
    }

    .dre-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }

    .dre-table th, .dre-table td {
      padding: 12px 0;
      border-bottom: 1px dashed var(--border);
    }

    .dre-table th {
      text-align: left;
      font-weight: 700;
      color: var(--text2);
    }

    .dre-table td.value {
      text-align: right;
      font-weight: 600;
      font-variant-numeric: tabular-nums;
    }

    /* Term tooltip helper */
    .dre-term {
      border-bottom: 1px dotted var(--text3);
      cursor: help;
      position: relative;
    }

    .dre-term:hover::after {
      content: attr(data-tooltip);
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%);
      background: var(--surface-dark);
      color: #fff;
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 11px;
      white-space: nowrap;
      pointer-events: none;
      z-index: 100;
      margin-bottom: 6px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      font-weight: 500;
    }

    .waterfall-bar {
      border-radius: 4px;
      min-height: 24px;
      display: flex;
      align-items: center;
      padding: 0 8px;
      font-size: 11px;
      font-weight: 800;
      color: white;
    }

    /* ============================================================
       SKIP LINK (acessibilidade por teclado)
    ============================================================ */
    .skip-link {
      position: absolute;
      top: -40px;
      left: 12px;
      background: var(--accent);
      color: #fff;
      padding: 8px 14px;
      border-radius: var(--radius-sm);
      font-weight: 600;
      font-size: var(--fs-sm);
      z-index: var(--z-login);
      transition: top var(--transition-fast);
      text-decoration: none;
    }
    .skip-link:focus {
      top: 12px;
      outline: 3px solid rgba(var(--accent-rgb), 0.4);
    }

    /* ============================================================
       SKELETON LOADING
    ============================================================ */
    .skeleton {
      background: linear-gradient(90deg,
        var(--surface2) 0%,
        rgba(0, 0, 0, 0.04) 50%,
        var(--surface2) 100%);
      background-size: 200% 100%;
      animation: skeletonShimmer 1.4s linear infinite;
      border-radius: var(--radius-sm);
      display: block;
    }
    [data-theme="dark"] .skeleton {
      background: linear-gradient(90deg,
        var(--surface2) 0%,
        rgba(255, 255, 255, 0.04) 50%,
        var(--surface2) 100%);
      background-size: 200% 100%;
    }
    @keyframes skeletonShimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }
    .skeleton-text { height: 12px; margin-bottom: 8px; }
    .skeleton-text.sm { height: 10px; width: 40%; }
    .skeleton-text.md { height: 14px; width: 70%; }
    .skeleton-text.lg { height: 20px; width: 50%; }
    .skeleton-card {
      background: var(--surface);
      border-radius: var(--radius-lg);
      padding: var(--space-6);
      box-shadow: var(--shadow-md);
    }
    .skeleton-row {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      padding: var(--space-4) var(--space-6);
      border-bottom: 1px solid var(--border);
    }
    .skeleton-circle {
      width: 36px; height: 36px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    /* ============================================================
       ALERT / BANNER
    ============================================================ */
    .alert {
      display: flex;
      align-items: flex-start;
      gap: var(--space-3);
      padding: var(--space-3) var(--space-4);
      border-radius: var(--radius-sm);
      border: 1px solid;
      font-size: var(--fs-base);
      line-height: 1.5;
    }
    .alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
    .alert-body { flex: 1; min-width: 0; }
    .alert-title { font-weight: 700; margin-bottom: 2px; }
    .alert-close {
      background: none;
      border: none;
      cursor: pointer;
      color: inherit;
      opacity: 0.6;
      padding: 2px 4px;
      font-size: 14px;
      flex-shrink: 0;
      transition: opacity var(--transition-fast);
    }
    .alert-close:hover { opacity: 1; }
    .alert-info    { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent); }
    .alert-success { background: var(--green-bg);  border-color: var(--green-border);  color: var(--green); }
    .alert-warning { background: var(--orange-bg); border-color: var(--orange-border); color: var(--orange); }
    .alert-danger  { background: var(--red-bg);    border-color: var(--red-border);    color: var(--red); }
    .alert-bia     { background: var(--bia-bg);    border-color: var(--bia-border);    color: var(--bia); }
    .alert .alert-body { color: var(--text); }

    /* ============================================================
       FILTER CHIPS
    ============================================================ */
    .filter-chips {
      display: flex;
      gap: var(--space-2);
      flex-wrap: wrap;
      align-items: center;
    }
    .filter-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px;
      border-radius: var(--radius-pill);
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text2);
      font-size: var(--fs-sm);
      font-weight: 600;
      cursor: pointer;
      transition: all var(--transition-fast);
      white-space: nowrap;
      min-height: 32px;
    }
    .filter-chip:hover {
      background: var(--bg2);
      color: var(--text);
      border-color: var(--border2);
    }
    .filter-chip.active {
      background: var(--accent-bg);
      border-color: var(--accent-border);
      color: var(--accent);
    }
    .filter-chip .chip-count {
      background: rgba(0, 0, 0, 0.08);
      border-radius: var(--radius-pill);
      padding: 1px 7px;
      font-size: 10px;
      font-weight: 700;
    }
    .filter-chip.active .chip-count {
      background: rgba(var(--accent-rgb), 0.20);
    }

    /* ============================================================
       EMPTY STATE (rich)
    ============================================================ */
    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: var(--space-3);
      padding: var(--space-8) var(--space-5);
      text-align: center;
      color: var(--text2);
    }
    .empty-state-icon {
      font-size: 48px;
      color: var(--text3);
      opacity: 0.6;
      margin-bottom: var(--space-2);
    }
    .empty-state-title {
      font-size: var(--fs-lg);
      font-weight: 700;
      color: var(--text);
    }
    .empty-state-sub {
      font-size: var(--fs-base);
      color: var(--text2);
      max-width: 420px;
      line-height: 1.5;
    }
    .empty-state .btn { margin-top: var(--space-3); }

    /* ============================================================
       KPI GRID (Dashboard executivo)
    ============================================================ */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: var(--space-4);
    }
    .kpi-card {
      background: var(--surface);
      border-radius: var(--radius-lg);
      padding: var(--space-5);
      box-shadow: var(--shadow-md);
      display: flex;
      flex-direction: column;
      gap: var(--space-2);
      transition: transform var(--transition), box-shadow var(--transition);
      position: relative;
      overflow: hidden;
    }
    .kpi-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-lg);
    }
    .kpi-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-2);
    }
    .kpi-label {
      font-size: var(--fs-xs);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text2);
    }
    .kpi-icon {
      width: 32px; height: 32px;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
    }
    .kpi-icon.accent { background: var(--accent-bg); color: var(--accent); }
    .kpi-icon.green  { background: var(--green-bg);  color: var(--green); }
    .kpi-icon.orange { background: var(--orange-bg); color: var(--orange); }
    .kpi-icon.bia    { background: var(--bia-bg);    color: var(--bia); }
    .kpi-icon.red    { background: var(--red-bg);    color: var(--red); }
    .kpi-value {
      font-size: var(--fs-2xl);
      font-weight: 800;
      letter-spacing: -0.5px;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .kpi-foot {
      font-size: var(--fs-xs);
      color: var(--text3);
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .kpi-delta.up    { color: var(--green); }
    .kpi-delta.down  { color: var(--red); }
    @media (max-width: 1024px) {
      .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    }
    @media (max-width: 480px) {
      .kpi-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
      .kpi-card { padding: var(--space-4); }
      .kpi-value { font-size: var(--fs-xl); }
    }

    /* ============================================================
       SIDEBAR COLAPSÁVEL (desktop)
    ============================================================ */
    .sidebar-collapse-btn {
      display: none;
      align-items: center;
      justify-content: center;
      width: 28px; height: 28px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 50%;
      color: var(--text2);
      cursor: pointer;
      font-size: 14px;
      position: absolute;
      top: 24px;
      right: -14px;
      z-index: 2;
      transition: all var(--transition-fast);
      box-shadow: var(--shadow-sm);
    }
    #sidebar { position: relative; }
    .sidebar-collapse-btn:hover {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent);
    }
    @media (min-width: 769px) {
      .sidebar-collapse-btn { display: flex; }
    }
    #sidebar.collapsed {
      width: var(--sidebar-w-collapsed);
    }
    #sidebar.collapsed .logo-text,
    #sidebar.collapsed .logo-sub,
    #sidebar.collapsed .nav-item span:not(.nav-icon),
    #sidebar.collapsed .sidebar-footer > div,
    #sidebar.collapsed .btn-hide-values .hide-label,
    #sidebar.collapsed .btn-logout span:not(.nav-icon),
    #sidebar.collapsed .sidebar-version,
    #sidebar.collapsed #nav-feedback-badge {
      display: none !important;
    }
    #sidebar.collapsed .logo {
      justify-content: center;
      padding: 0 0 var(--space-6);
    }
    #sidebar.collapsed .nav-item,
    #sidebar.collapsed .btn-logout,
    #sidebar.collapsed .btn-hide-values {
      justify-content: center;
      padding: 10px;
      position: relative;
    }
    #sidebar.collapsed .nav-item[title]:hover::after,
    #sidebar.collapsed .btn-logout[title]:hover::after {
      content: attr(title);
      position: absolute;
      left: calc(100% + 10px);
      top: 50%;
      transform: translateY(-50%);
      background: var(--surface-dark);
      color: #fff;
      padding: 6px 12px;
      border-radius: 6px;
      font-size: var(--fs-xs);
      white-space: nowrap;
      z-index: 200;
      pointer-events: none;
      box-shadow: var(--shadow-md);
    }
    #sidebar.collapsed .sidebar-collapse-btn i {
      transform: rotate(180deg);
    }

    /* ============================================================
       THEME TOGGLE
    ============================================================ */
    .theme-toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-pill);
      padding: 4px;
      cursor: pointer;
      transition: background var(--transition-fast);
    }
    .theme-toggle-option {
      width: 28px; height: 28px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      color: var(--text3);
      transition: all var(--transition-fast);
      background: transparent;
      border: none;
      cursor: pointer;
    }
    .theme-toggle-option.active {
      background: var(--surface);
      color: var(--accent);
      box-shadow: var(--shadow-sm);
    }

    /* ============================================================
       COMMAND PALETTE (Cmd+K)
    ============================================================ */
    .cmdk-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(8px);
      z-index: var(--z-cmdk);
      display: none;
      padding: 10vh 20px 20px;
      justify-content: center;
      align-items: flex-start;
    }
    .cmdk-overlay.open { display: flex; }
    .cmdk-modal {
      background: var(--surface);
      width: 100%;
      max-width: 640px;
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-modal);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      max-height: 70vh;
      animation: slideUp 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    }
    .cmdk-input-wrap {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      padding: var(--space-4) var(--space-5);
      border-bottom: 1px solid var(--border);
    }
    .cmdk-input-wrap i { font-size: 20px; color: var(--text3); }
    .cmdk-input {
      flex: 1;
      border: none;
      background: transparent;
      outline: none;
      font-family: inherit;
      font-size: var(--fs-md);
      color: var(--text);
    }
    .cmdk-hint {
      font-size: var(--fs-xs);
      color: var(--text3);
      background: var(--surface2);
      border: 1px solid var(--border);
      padding: 2px 8px;
      border-radius: 4px;
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    }
    .cmdk-results { overflow-y: auto; flex: 1; padding: var(--space-2) 0; }
    .cmdk-group-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text3);
      padding: var(--space-3) var(--space-5) var(--space-1);
    }
    .cmdk-item {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      padding: 10px var(--space-5);
      cursor: pointer;
      color: var(--text);
      font-size: var(--fs-base);
      transition: background var(--transition-fast);
      border-left: 2px solid transparent;
    }
    .cmdk-item:hover,
    .cmdk-item.highlighted {
      background: var(--surface2);
      border-left-color: var(--accent);
    }
    .cmdk-item i { font-size: 18px; color: var(--text2); width: 20px; text-align: center; }
    .cmdk-item-label { flex: 1; }
    .cmdk-item-sub { font-size: var(--fs-xs); color: var(--text3); }
    .cmdk-empty { padding: var(--space-6); text-align: center; color: var(--text3); font-size: var(--fs-base); }

    /* ============================================================
       NOTIFICAÇÕES (dropdown)
    ============================================================ */
    .notif-btn {
      position: relative;
      width: 40px; height: 40px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text2);
      cursor: pointer;
      transition: all var(--transition-fast);
      font-size: 18px;
    }
    .notif-btn:hover { background: var(--surface2); color: var(--text); }
    .notif-dot {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 8px; height: 8px;
      background: var(--red);
      border-radius: 50%;
      border: 2px solid var(--surface);
    }
    .notif-dropdown {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 360px;
      max-width: calc(100vw - 32px);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow-lg);
      display: none;
      flex-direction: column;
      overflow: hidden;
      z-index: var(--z-drawer);
    }
    .notif-dropdown.open { display: flex; }
    .notif-head {
      padding: var(--space-3) var(--space-4);
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .notif-title { font-weight: 700; font-size: var(--fs-base); }
    .notif-clear {
      background: none;
      border: none;
      cursor: pointer;
      font-size: var(--fs-xs);
      color: var(--accent);
      font-weight: 600;
    }
    .notif-list { max-height: 400px; overflow-y: auto; }
    .notif-item {
      display: flex;
      gap: var(--space-3);
      padding: var(--space-3) var(--space-4);
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background var(--transition-fast);
    }
    .notif-item:hover { background: var(--surface2); }
    .notif-item.unread { background: var(--accent-bg); }
    .notif-item-icon {
      width: 32px; height: 32px;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: 16px;
    }
    .notif-item-body { flex: 1; min-width: 0; }
    .notif-item-title { font-weight: 600; font-size: var(--fs-base); margin-bottom: 2px; }
    .notif-item-sub { font-size: var(--fs-xs); color: var(--text3); }
    .notif-empty { padding: var(--space-6); text-align: center; color: var(--text3); font-size: var(--fs-base); }

    /* ============================================================
       ZERO-FRICTION INPUT (inline add em Kanban/CRM)
    ============================================================ */
    .quick-add {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      background: var(--surface);
      border: 1px dashed var(--border2);
      border-radius: var(--radius-sm);
      padding: var(--space-2) var(--space-3);
      margin-bottom: var(--space-3);
      transition: border-color var(--transition-fast), background var(--transition-fast);
    }
    .quick-add:focus-within {
      border-color: var(--accent);
      border-style: solid;
      background: var(--surface);
      box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.10);
    }
    .quick-add i { color: var(--text3); font-size: 16px; }
    .quick-add input {
      flex: 1;
      border: none;
      background: transparent;
      outline: none;
      font-family: inherit;
      font-size: var(--fs-base);
      color: var(--text);
    }
    .quick-add input::placeholder { color: var(--text3); }

    /* ============================================================
       SEARCH INPUT COM ÍCONE PHOSPHOR (substitui emoji no placeholder)
    ============================================================ */
    .search-with-icon {
      position: relative;
      flex: 1;
      min-width: 180px;
    }
    .search-with-icon i.ph {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text3);
      font-size: 16px;
      pointer-events: none;
    }
    .search-with-icon .search-input {
      padding-left: 36px;
      width: 100%;
    }

    /* ============================================================
       TOAST v2 (pause-on-hover, close button, aria-live)
    ============================================================ */
    .toast {
      position: relative;
      animation: toastIn 0.25s ease;
    }
    .toast.paused { animation-play-state: paused; }
    .toast-body { flex: 1; min-width: 0; }
    .toast-close {
      background: none;
      border: none;
      cursor: pointer;
      color: inherit;
      opacity: 0.6;
      font-size: 14px;
      padding: 0 2px;
      transition: opacity var(--transition-fast);
      flex-shrink: 0;
    }
    .toast-close:hover { opacity: 1; }

    /* ============================================================
       SAFE-AREA MOBILE (notch iOS)
    ============================================================ */
    @supports (padding-top: env(safe-area-inset-top)) {
      @media (max-width: 768px) {
        #main { padding-top: calc(16px + env(safe-area-inset-top)); }
        #sidebar { padding-top: calc(24px + env(safe-area-inset-top)); }
      }
    }

    /* ============================================================
       FOCUS VISIBLE (teclado)
    ============================================================ */
    :focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    .btn:focus-visible,
    .nav-item:focus-visible,
    .filter-chip:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    /* Remove outline nativo quadrado onde já temos box-shadow como indicador */
    .field input:focus-visible,
    .field select:focus-visible,
    .field textarea:focus-visible,
    .search-input:focus-visible,
    .cmdk-input:focus-visible {
      outline: none;
    }

    /* ============================================================
       REDUCED MOTION
    ============================================================ */
    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
      }

    /* ============================================================
       BIA: Sugestões colapsáveis (top-4 + expandir "Mais")
    ============================================================ */
    .bia-suggest-extra {
      display: none;
    }
    .bia-suggestions.expanded .bia-suggest-extra {
      display: inline-flex;
    }
    .bia-suggest-more {
      order: 99;
    }
    .bia-suggestions.expanded .bia-suggest-more i {
      transform: rotate(180deg);
      transition: transform var(--transition);
    }

    /* ============================================================
       White-label: ocultar assinatura "by Gustavo Melles"
       Quando body.white-label estiver presente (set via JS após hydrateTheme)
    ============================================================ */
    body.white-label .sidebar-version-signature {
      display: none;
    }
    body.white-label .logo-beta-badge {
      display: none;
    }

    /* ── ALERTS VISUAIS DE INTERAÇÃO ── */
    @keyframes pulseEditBtn {
      0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.7); }
      50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
      100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
    }

    .pulse-edit-btn {
      animation: pulseEditBtn 0.4s ease-out;
      background-color: var(--accent) !important;
      color: white !important;
    }
    }