  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }

  :root {
    --bg: #f7f7f7; --bg2: #f0f2f5; --surface: #ffffff; --surface2: rgba(255,255,255,0.98);
    --border: #e8eaed; --text: #1a2332; --text2: #1e293b; --text3: #374151;
    --text4: #4b5563; --text5: #6b7280; --blue: #2563eb; --blue2: #1d4ed8;
    --orange: #f97316; --orange2: #ea6e0d; --amber: #f59e0b; --green: #10b981;
    --red: #ef4444;
    --header-bg: #162640;
    --header-text: #e2e8f0;
    --card-bg: #ffffff;
    --card-hover: #f9fafb;
    --input-bg: #ffffff;
    --card: #ffffff;
    --card-border: #e8eaed;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.07);
    --card-shadow-hover: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.10);
    --adm-tab-active-bg: #eff6ff; --adm-tab-active-color: #1d4ed8;
    --adm-badge-bg: #f1f5f9; --adm-badge-color: #4b5563;
    --adm-badge-adm-bg: #eff6ff; --adm-badge-adm-color: #1d4ed8;
    --adm-btn-bg: #f8fafc; --adm-btn-border: #d1d5db;
    --adm-approve-bg: #f0fdf4; --adm-approve-color: #16a34a; --adm-approve-border: #bbf7d0;
  }
  .dark {
    --bg: #080f1a; --bg2: #0d1526; --surface: #334155; --surface2: rgba(51,65,85,0.95);
    --border: #475569; --text: #f8fafc; --text2: #f1f5f9; --text3: #e2e8f0;
    --text4: #cbd5e1; --text5: #94a3b8;
    --header-bg: #0d1526;
    --header-text: #e2e8f0;
    --card-bg: #334155; --card-hover: #3f4f67; --input-bg: rgba(51,65,85,0.8); --card: rgba(15,23,42,0.72); --card-border: rgba(51,65,85,0.5);
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.25);
    --card-shadow-hover: 0 2px 8px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
    --adm-tab-active-bg: #1e3a5f; --adm-tab-active-color: #3b82f6;
    --adm-badge-bg: #1e293b; --adm-badge-color: #94a3b8;
    --adm-badge-adm-bg: #1e3a5f; --adm-badge-adm-color: #3b82f6;
    --adm-btn-bg: #1e293b; --adm-btn-border: #334155;
    --adm-approve-bg: #064e3b; --adm-approve-color: #34d399; --adm-approve-border: #065f46;
    --fa-map-fill: #1e293b; --fa-map-stroke: #334155;
  }

  body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

  /* ─── CARD SHADOWS (light mode) ─── */
  #fat-content [style*="background:var(--card)"],
  #desp-content [style*="background:var(--card)"],
  #rent-content [style*="background:var(--card)"] {
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease;
  }
  #fat-content [style*="background:var(--card)"]:hover,
  #desp-content [style*="background:var(--card)"]:hover,
  #rent-content [style*="background:var(--card)"]:hover {
    box-shadow: var(--card-shadow-hover);
  }

  /* ─── DARK MODE: glassmorphism cards ─── */
  .dark #fat-content [style*="background:var(--card)"],
  .dark #desp-content [style*="background:var(--card)"],
  .dark #rent-content [style*="background:var(--card)"] {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* ─── LIGHT MODE: subtitle text colors ─── */
  :not(.dark) #fat-content [style*="color:#94a3b8"],
  :not(.dark) #desp-content [style*="color:#94a3b8"],
  :not(.dark) #rent-content [style*="color:#94a3b8"] {
    color: #6b7280 !important;
  }
  :not(.dark) #fat-content [style*="color:#64748b"],
  :not(.dark) #desp-content [style*="color:#64748b"],
  :not(.dark) #rent-content [style*="color:#64748b"] {
    color: #9ca3af !important;
  }

  /* ─── LIGHT: page content background ─── */
  :not(.dark) #fat-content,
  :not(.dark) #desp-content,
  :not(.dark) #rent-content {
    background: #f7f7f7 !important;
  }

  /* ─── DARK: page content background ─── */
  .dark #fat-content,
  .dark #desp-content,
  .dark #rent-content {
    background: #080f1a !important;
  }



  /* ─── AUTH — UI/UX Pro Max ─── */
  #login-screen { display: flex; min-height: 100vh; }
  .login-left { display: none; width: 22%; position: relative; background: linear-gradient(160deg, #0d1f3c 0%, #1e3a5f 100%); padding: 0; overflow: hidden; }
  .login-left-inner { position: relative; z-index: 10; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 24px; }
  .login-center { display: none; width: 53%; position: relative; overflow: hidden; }
  .login-right { width: 100%; position: relative; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
  .login-right-bg { position: absolute; inset: 0; background: linear-gradient(160deg, #f8fafc 0%, #ffffff 40%, #eff6ff 100%); }
  .dark .login-right-bg { background: linear-gradient(160deg, #0f172a 0%, #1e293b 40%, #0f172a 100%); }
  @media(min-width: 1024px) { .login-left { display: flex; flex-direction: column; } .login-center { display: flex; } .login-right { width: 25%; } }

  .login-bg-overlay { position: absolute; inset: 0; background: linear-gradient(160deg, #0d1f3c 0%, #162640 50%, #1e3a5f 100%); }
  .login-center-bg { position: absolute; inset: 0; background: #0a1628; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800'%3E%3Crect width='1200' height='800' fill='%230a1628'/%3E%3C!-- Grid de linhas de circuito --%3E%3Cg stroke='%231e3a5f' stroke-width='1' opacity='0.6'%3E%3Cline x1='0' y1='100' x2='1200' y2='100'/%3E%3Cline x1='0' y1='200' x2='1200' y2='200'/%3E%3Cline x1='0' y1='300' x2='1200' y2='300'/%3E%3Cline x1='0' y1='400' x2='1200' y2='400'/%3E%3Cline x1='0' y1='500' x2='1200' y2='500'/%3E%3Cline x1='0' y1='600' x2='1200' y2='600'/%3E%3Cline x1='0' y1='700' x2='1200' y2='700'/%3E%3Cline x1='100' y1='0' x2='100' y2='800'/%3E%3Cline x1='200' y1='0' x2='200' y2='800'/%3E%3Cline x1='300' y1='0' x2='300' y2='800'/%3E%3Cline x1='400' y1='0' x2='400' y2='800'/%3E%3Cline x1='500' y1='0' x2='500' y2='800'/%3E%3Cline x1='600' y1='0' x2='600' y2='800'/%3E%3Cline x1='700' y1='0' x2='700' y2='800'/%3E%3Cline x1='800' y1='0' x2='800' y2='800'/%3E%3Cline x1='900' y1='0' x2='900' y2='800'/%3E%3Cline x1='1000' y1='0' x2='1000' y2='800'/%3E%3Cline x1='1100' y1='0' x2='1100' y2='800'/%3E%3C/g%3E%3C!-- Trilhas de circuito --%3E%3Cg stroke='%232563eb' stroke-width='1.5' fill='none' opacity='0.4'%3E%3Cpath d='M50 150 L150 150 L150 250 L350 250 L350 150 L500 150'/%3E%3Cpath d='M200 400 L200 300 L450 300 L450 500 L700 500'/%3E%3Cpath d='M600 200 L750 200 L750 350 L900 350'/%3E%3Cpath d='M100 600 L300 600 L300 500 L550 500 L550 650 L800 650'/%3E%3Cpath d='M850 100 L850 250 L1050 250 L1050 400 L950 400'/%3E%3Cpath d='M400 700 L600 700 L600 600 L900 600 L900 700 L1100 700'/%3E%3C/g%3E%3C!-- Nós de circuito --%3E%3Cg fill='%233b82f6' opacity='0.5'%3E%3Ccircle cx='150' cy='150' r='4'/%3E%3Ccircle cx='350' cy='250' r='4'/%3E%3Ccircle cx='500' cy='150' r='3'/%3E%3Ccircle cx='200' cy='300' r='4'/%3E%3Ccircle cx='450' cy='500' r='4'/%3E%3Ccircle cx='750' cy='200' r='4'/%3E%3Ccircle cx='750' cy='350' r='3'/%3E%3Ccircle cx='300' cy='600' r='4'/%3E%3Ccircle cx='550' cy='500' r='3'/%3E%3Ccircle cx='850' cy='250' r='4'/%3E%3Ccircle cx='1050' cy='250' r='3'/%3E%3Ccircle cx='600' cy='700' r='4'/%3E%3Ccircle cx='900' cy='600' r='4'/%3E%3C/g%3E%3C!-- Chips / componentes --%3E%3Cg fill='none' stroke='%231d4ed8' stroke-width='1' opacity='0.35'%3E%3Crect x='220' y='120' width='60' height='60' rx='4'/%3E%3Crect x='470' y='270' width='80' height='50' rx='4'/%3E%3Crect x='670' y='170' width='60' height='60' rx='4'/%3E%3Crect x='820' y='370' width='70' height='55' rx='4'/%3E%3Crect x='320' y='520' width='90' height='50' rx='4'/%3E%3Crect x='950' y='150' width='65' height='65' rx='4'/%3E%3C/g%3E%3C!-- Pontos brilhantes --%3E%3Cg fill='%2393c5fd' opacity='0.3'%3E%3Ccircle cx='350' cy='150' r='2'/%3E%3Ccircle cx='700' cy='500' r='2'/%3E%3Ccircle cx='900' cy='350' r='2'/%3E%3Ccircle cx='550' cy='650' r='2'/%3E%3Ccircle cx='1050' cy='400' r='2'/%3E%3C/g%3E%3C!-- Gradiente overlay para escurecer bordas --%3E%3CdR x='0' y='0' width='1200' height='800' fill='url(%23vignette)'/%3E%3Cdefs%3E%3CradialGradient id='vignette' cx='50%25' cy='50%25' r='70%25'%3E%3Cstop offset='0%25' stop-color='transparent'/%3E%3Cstop offset='100%25' stop-color='%230a1628' stop-opacity='0.6'/%3E%3C/radialGradient%3E%3C/defs%3E%3C/svg%3E"); background-size: cover; background-position: center; }

  .weather-icon-wrap { padding: 6px; background: rgba(255,255,255,0.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; }

  .login-form-wrapper { width: 100%; max-width: 360px; position: relative; z-index: 10; animation: loginFadeIn .5s ease both; }
  @keyframes loginFadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
  .login-logo { display: flex; justify-content: center; margin-bottom: 16px; }
  .login-logo img { height: 80px; width: auto; }
  .login-tagline { text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--text5); margin-bottom: 24px; letter-spacing: .03em; text-transform: uppercase; }
  .login-card { background: rgba(255,255,255,0.95); backdrop-filter: blur(16px); border-radius: 16px; border: 1px solid rgba(226,232,240,0.6); box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04); padding: 28px 24px; }
  .dark .login-card { background: rgba(30,41,59,0.92); border-color: rgba(71,85,105,0.4); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
  .login-card-title { text-align: center; font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
  .login-card-sub { text-align: center; font-size: 0.78rem; color: var(--text5); font-weight: 500; margin-bottom: 0; }
  .login-divider { height: 1px; background: linear-gradient(to right, transparent, var(--border), transparent); margin: 20px 0; }
  .form-group { margin-bottom: 16px; }
  .form-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
  .form-input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.875rem; background: var(--input-bg); color: var(--text); outline: none; font-family: 'Inter', sans-serif; }
  .form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
  .form-input::placeholder { color: var(--text5); }
  .btn-login { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 16px; background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 40%, #1e40af 100%); color: white; border: none; border-radius: 10px; font-size: 0.85rem; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(37,99,235,0.25); transition: all 0.2s ease; font-family: 'Inter', sans-serif; position: relative; overflow: hidden; }
  .btn-login::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%); pointer-events: none; }
  .btn-login:hover { box-shadow: 0 6px 20px rgba(37,99,235,0.35); transform: translateY(-1px); }
  .btn-login:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(37,99,235,0.2); }
  .btn-login:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
  .btn-login:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
  .login-btn-arrow { opacity: .6; transition: transform .2s; }
  .btn-login:hover .login-btn-arrow { transform: translateX(3px); opacity: 1; }
  .login-hint { font-size: 0.72rem; color: var(--text5); text-align: center; margin-top: 16px; line-height: 1.6; }
  .error-box { padding: 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; color: #b91c1c; font-size: 0.75rem; font-weight: 500; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px; }
  .dark .error-box { background: rgba(127,29,29,0.15); border-color: rgba(248,113,113,0.3); color: #fca5a5; }
  .login-footer { text-align: center; font-size: 0.72rem; color: var(--text5); margin-top: 28px; letter-spacing: .02em; }

  /* News left panel */
  .news-carousel { background: rgba(255,255,255,0.1); backdrop-filter: blur(8px); border-radius: 16px; padding: 16px; margin-bottom: 24px; color: white; }
  .news-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .news-title { font-size: 1.125rem; font-weight: 700; }
  .news-nav { display: flex; gap: 4px; }
  .news-nav-btn { padding: 4px; border-radius: 50%; border: none; background: transparent; cursor: pointer; color: white; transition: background 0.2s; }
  .news-nav-btn:hover { background: rgba(255,255,255,0.2); }
  .news-item-title { font-size: 0.875rem; font-weight: 600; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .news-item-desc { font-size: 0.75rem; color: rgba(255,255,255,0.8); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
  .news-dots { display: flex; justify-content: center; gap: 4px; margin-top: 12px; }
  .news-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); border: none; cursor: pointer; transition: background 0.2s; }
  .news-dot.active { background: white; }

  /* Weather */
  .weather-widget { background: linear-gradient(135deg, rgba(30,58,95,0.9) 0%, rgba(29,78,216,0.9) 100%); backdrop-filter: blur(8px); border-radius: 12px; border: 1px solid rgba(59,130,246,0.3); padding: 16px; color: white; }
  .weather-main { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .weather-temp { font-size: 2rem; font-weight: 700; text-align: right; }
  .weather-minmax { font-size: 0.75rem; color: #bfdbfe; }
  .weather-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .weather-item { display: flex; align-items: center; gap: 8px; }
  .weather-label { font-size: 0.7rem; color: #bfdbfe; }
  .weather-val { font-size: 0.875rem; font-weight: 500; }
  .weather-footer { display: flex; justify-content: space-between; font-size: 0.75rem; color: #bfdbfe; padding-top: 12px; border-top: 1px solid rgba(59,130,246,0.3); }

  /* ─── APP LAYOUT ─── */
  #app-screen { display: none; }
  .header { position: fixed; top: 0; left: 0; right: 0; background: var(--header-bg); border-bottom: 1px solid rgba(255,255,255,0.08); z-index: 50; height: 48px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
  .header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; padding: 0 16px; }
  .header-left { display: flex; align-items: center; gap: 24px; }
  .logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; }
  .logo-link:hover { opacity: 0.8; }
  .logo-img { height: 36px; width: auto; filter: brightness(1.1); }
  .logo-text { font-size: 1rem; font-weight: 700; color: #e2e8f0; }
  .header-right { display: flex; align-items: center; gap: 16px; }

  /* Dropdown */
  .dropdown { position: relative; }
  .dropdown-trigger { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 0.8rem; font-weight: 500; color: #c8d3e0; background: transparent; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif; }
  .dropdown-trigger:hover, .dropdown-trigger.open { background: rgba(255,255,255,0.1); color: #ffffff; }
  .dropdown-trigger svg { width: 16px; height: 16px; }
  .chevron { transition: transform 0.2s; }
  .chevron.open { transform: rotate(180deg); }
  .dropdown-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.12); padding: 8px 0; z-index: 1000; display: none; backdrop-filter: blur(20px); }
  .dropdown-menu.open { display: block; }
  .dropdown-arrow { position: absolute; top: -5px; left: 16px; width: 10px; height: 10px; background: var(--surface2); border: 1px solid var(--border); border-bottom: none; border-right: none; transform: rotate(45deg); }
  .dropdown-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; font-size: 0.875rem; color: var(--text3); cursor: pointer; transition: all 0.15s; border: none; background: transparent; width: 100%; text-align: left; font-family: 'Inter', sans-serif; }
  .dropdown-item:hover { background: var(--border); color: var(--text); }
  .dropdown-item.danger { color: #ef4444; }
  .dropdown-item.danger:hover { background: #fef2f2; }
  .dark .dropdown-item.danger:hover { background: rgba(239,68,68,0.1); }
  .dropdown-item svg { width: 16px; height: 16px; }

  /* Search */
  .search-wrapper { position: relative; flex: 1; max-width: 400px; }
  .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text5); width: 16px; height: 16px; pointer-events: none; }
  .search-input { width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.875rem; background: var(--card-bg); color: var(--text); outline: none; font-family: 'Inter', sans-serif; }
  .search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
  .search-input::placeholder { color: var(--text5); }
  .search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); max-height: 320px; overflow-y: auto; z-index: 1000; display: none; }
  .search-results.show { display: block; }
  .search-result-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
  .search-result-item:last-child { border-bottom: none; }
  .search-result-item:hover { background: var(--border); }
  .search-result-icon { padding: 6px; background: #dcfce7; border-radius: 6px; flex-shrink: 0; }
  .dark .search-result-icon { background: rgba(16,185,129,0.15); }
  .search-result-title { font-size: 0.875rem; font-weight: 500; color: var(--text2); }
  .search-result-path { font-size: 0.75rem; color: var(--text5); margin-top: 2px; }
  .search-result-count { padding: 8px 12px; font-size: 0.75rem; font-weight: 500; color: var(--text5); border-bottom: 1px solid var(--border); }

  /* Theme toggle */
  .theme-toggle { padding: 6px; border-radius: 6px; background: rgba(255,255,255,0.12); border: none; cursor: pointer; color: #c8d3e0; transition: all 0.2s; }
  .theme-toggle:hover { background: rgba(255,255,255,0.2); color: #ffffff; }
  .theme-toggle svg { width: 16px; height: 16px; }

  .notif-bell { position: relative; padding: 6px; border-radius: 6px; background: rgba(255,255,255,0.12); border: none; cursor: pointer; color: #c8d3e0; transition: all 0.2s; }
  .notif-bell:hover { background: rgba(255,255,255,0.2); color: #ffffff; }
  .notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700; font-family: Inter, sans-serif; display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 2px 6px rgba(239,68,68,0.4); animation: notifPulse 2s ease-in-out infinite; }
  @keyframes notifPulse { 0%,100%{ box-shadow: 0 2px 6px rgba(239,68,68,0.4); } 50%{ box-shadow: 0 2px 12px rgba(239,68,68,0.7); } }

  /* Main */
  main { padding: 64px 24px 24px; }

  /* Cards */
  .card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--card-shadow); transition: all 0.2s; border-top: 6px solid #808080; }
  .card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); border-color: #93c5fd; border-top-color: #6b7280; }
  .card.clickable { cursor: pointer; }
  .card.clickable:hover { transform: scale(1.02); }

  /* Trending section */
  .section-glow-amber { position: relative; }
  .section-glow-amber::before { content: ''; position: absolute; inset: -4px; background: linear-gradient(to right, #fbbf24, #f59e0b, #fbbf24); border-radius: 16px; opacity: 0.15; filter: blur(8px); z-index: -1; }
  .section-glow-green { position: relative; }
  .section-glow-green::before { content: ''; position: absolute; inset: -4px; background: linear-gradient(to right, #34d399, #10b981, #34d399); border-radius: 16px; opacity: 0.15; filter: blur(8px); z-index: -1; }
  .section-inner { background: rgba(255,255,255,0.85); border-radius: 12px; padding: 16px; border: 1px solid var(--border); backdrop-filter: blur(8px); }
  .dark .section-inner { background: rgba(51,65,85,0.85); }
  .section-inner.amber { border-color: #fde68a; }
  .dark .section-inner.amber { border-color: #92400e; }
  .section-inner.green { border-color: #a7f3d0; }
  .dark .section-inner.green { border-color: #064e3b; }

  .section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
  .section-icon { padding: 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
  .section-icon svg { width: 16px; height: 16px; color: white; }
  .section-icon.amber { background: linear-gradient(135deg, #f59e0b, #eab308); }
  .section-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
  .section-title { font-size: 1rem; font-weight: 700; color: var(--text2); }
  .section-sub { font-size: 0.75rem; }
  .section-sub.amber { color: #b45309; }
  .dark .section-sub.amber { color: #fcd34d; }
  .section-sub.green { color: #065f46; }
  .dark .section-sub.green { color: #6ee7b7; }

  .reports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .report-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; transition: all 0.2s; }
  .report-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: scale(1.01); }
  .report-card.featured { background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 100%); border-color: #fde68a; }
  .dark .report-card.featured { background: linear-gradient(135deg, rgba(120,53,15,0.2) 0%, rgba(113,63,18,0.2) 100%); border-color: #92400e; }
  .report-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; gap: 8px; }
  .report-card-title { font-size: 0.75rem; font-weight: 600; color: var(--text2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
  .report-card-path { font-size: 0.7rem; color: var(--text5); margin-bottom: 4px; }
  .report-card-desc { font-size: 0.7rem; color: var(--text4); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
  .tags-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
  .tag { padding: 2px 6px; border-radius: 20px; font-size: 0.65rem; }
  .tag.blue { background: #dbeafe; color: #1d4ed8; }
  .dark .tag.blue { background: rgba(37,99,235,0.2); color: #93c5fd; }
  .tag.amber { background: #fef3c7; color: #b45309; }
  .dark .tag.amber { background: rgba(245,158,11,0.2); color: #fcd34d; }
  .view-count { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 500; color: var(--text4); }
  .view-count svg { width: 14px; height: 14px; }
  .fav-btn { background: transparent; border: none; cursor: pointer; padding: 2px; color: var(--text5); transition: color 0.2s; display: flex; align-items: center; justify-content: center; }
  .fav-btn:hover { color: #ef4444; }
  .fav-btn.active { color: #ef4444; }
  .fav-btn svg { width: 12px; height: 12px; }
  .star-icon { color: #f59e0b; }
  .star-icon svg { width: 12px; height: 12px; fill: #f59e0b; }

  /* Categories */
  .categories-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
  .categories-icon { padding: 8px; background: #dbeafe; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
  .dark .categories-icon { background: rgba(37,99,235,0.2); }
  .categories-icon svg { width: 20px; height: 20px; color: var(--blue); }
  .categories-title { font-size: 1.25rem; font-weight: 700; color: var(--text2); }
  .categories-sub { font-size: 0.875rem; color: var(--text5); }
  .categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
  .category-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; transition: all 0.2s; animation: fadeIn 0.3s ease; }
  .category-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); border-color: #93c5fd; transform: scale(1.02); }
  .cat-icon-wrapper { padding: 6px; border-radius: 8px; display: inline-flex; margin-right: 8px; flex-shrink: 0; }
  .cat-icon-wrapper svg { width: 16px; height: 16px; }
  .cat-name-row { display: flex; align-items: center; margin-bottom: 8px; }
  .cat-name { font-size: 0.9rem; font-weight: 600; color: var(--text2); line-height: 1.3; }
  .cat-count { color: var(--text5); font-weight: 400; font-size: 0.85rem; }
  .cat-desc { font-size: 0.7rem; color: var(--text4); margin-bottom: 10px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cat-link { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 500; }
  .cat-link svg { width: 12px; height: 12px; }

  .rh-container { display: flex; flex-direction: column; gap: 24px; }
  .rh-top-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .rh-title-area { display: flex; align-items: center; gap: 10px; }
  .rh-page-title { font-size: 1.15rem; font-weight: 800; color: var(--text2); letter-spacing: -0.01em; }
  .rh-page-sub { font-size: 0.78rem; color: var(--text5); }
  .rh-search-wrap { position: relative; min-width: 220px; flex: 0 1 320px; }
  .rh-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text5); pointer-events: none; }
  .rh-search { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--text2); font-size: 0.82rem; outline: none; transition: border-color 0.2s; }
  .rh-search:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }
  .rh-sections { display: flex; flex-direction: column; gap: 28px; }
  .rh-section { animation: fadeIn 0.3s ease; }
  .rh-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .rh-section-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; font-size: 0.9rem; flex-shrink: 0; }
  .rh-section-name { font-size: 0.92rem; font-weight: 700; color: var(--text2); }
  .rh-section-count { font-size: 0.72rem; font-weight: 500; color: var(--text5); background: var(--border); border-radius: 10px; padding: 1px 8px; }
  .rh-subgroup { margin-bottom: 14px; }
  .rh-subgroup-header { font-size: 0.82rem; font-weight: 600; color: var(--text3); margin-bottom: 8px; padding: 4px 0 4px 4px; display: flex; align-items: center; gap: 6px; border-left: 3px solid #8b5cf6; padding-left: 10px; }
  .rh-subgroup-count { font-size: 0.68rem; font-weight: 500; color: var(--text5); background: var(--border); border-radius: 10px; padding: 1px 7px; }
  .rh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
  .rh-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: all 0.18s; display: flex; flex-direction: column; gap: 4px; }
  .rh-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #93c5fd; transform: translateY(-1px); }
  .rh-card.rh-fav { border-left: 3px solid #ef4444; }
  .rh-card.rh-feat { background: linear-gradient(135deg, rgba(251,191,36,0.06) 0%, rgba(245,158,11,0.04) 100%); }
  .dark .rh-card.rh-feat { background: linear-gradient(135deg, rgba(120,53,15,0.15) 0%, rgba(113,63,18,0.1) 100%); }
  .rh-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
  .rh-card-title { font-size: 0.78rem; font-weight: 600; color: var(--text2); line-height: 1.35; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .rh-card-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
  .rh-star { display: inline-flex; }
  .rh-fav-btn { background: none; border: none; cursor: pointer; padding: 2px; color: var(--text5); border-radius: 4px; display: inline-flex; transition: color 0.15s; }
  .rh-fav-btn:hover, .rh-fav-btn.active { color: #ef4444; }
  .rh-card-desc { font-size: 0.7rem; color: var(--text4); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .rh-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
  .rh-tags { display: flex; gap: 4px; flex-wrap: wrap; }
  .rh-tag { font-size: 0.6rem; padding: 1px 6px; border-radius: 4px; background: rgba(59,130,246,0.08); color: #3b82f6; font-weight: 500; }
  .dark .rh-tag { background: rgba(59,130,246,0.15); color: #60a5fa; }
  .rh-views { display: flex; align-items: center; gap: 3px; font-size: 0.65rem; color: var(--text5); white-space: nowrap; }
  .rh-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px; color: var(--text5); font-size: 0.85rem; }

  @media (max-width: 768px) {
    .rh-top-bar { flex-direction: column; align-items: stretch; }
    .rh-search-wrap { min-width: unset; flex: 1; }
    .rh-grid { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 480px) {
    .rh-grid { grid-template-columns: 1fr; }
  }

  @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes spin { to { transform: rotate(360deg); } }
  .animate-spin { animation: spin 1s linear infinite; }

  /* Report detail view */
  .report-view { display: none; }
  .report-view.show { display: block; }
  .report-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text5); margin-bottom: 16px; flex-wrap: wrap; }
  .breadcrumb-link { color: var(--blue); cursor: pointer; background: none; border: none; font-size: 0.875rem; font-family: 'Inter', sans-serif; }
  .breadcrumb-link:hover { text-decoration: underline; }
  .report-header-card { padding: 20px; border-radius: 12px; background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%); border: 1px solid #bfdbfe; margin-bottom: 20px; }
  .dark .report-header-card { background: linear-gradient(135deg, rgba(37,99,235,0.1) 0%, var(--card-bg) 100%); border-color: rgba(37,99,235,0.3); }
  .report-header-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
  .report-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
  .report-meta-item { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--text4); }
  .report-meta-item svg { width: 14px; height: 14px; }
  .iframe-container { width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--card-bg); }
  .iframe-placeholder { height: 600px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text5); }
  .iframe-placeholder svg { width: 48px; height: 48px; opacity: 0.4; }
  .iframe-placeholder-text { font-size: 0.875rem; }

  /* Admin panel */
  .admin-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
  .tab-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text4); font-size: 0.875rem; font-weight: 500; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.15s; }
  .tab-btn:hover { border-color: var(--blue); color: var(--blue); }
  .tab-btn.active { background: var(--blue); border-color: var(--blue); color: white; }

  /* Loading */
  .loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px; gap: 8px; }
  .loading-icon { color: var(--blue); }
  .loading-icon svg { width: 32px; height: 32px; animation: spin 1s linear infinite; }
  .loading-text { font-size: 0.875rem; color: var(--text5); }

  /* Page header */
  .page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
  .page-icon { padding: 8px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
  .page-icon svg { width: 20px; height: 20px; }
  .page-title { font-size: 1.25rem; font-weight: 700; color: var(--text2); }
  .page-sub { font-size: 0.875rem; color: var(--text5); }

  .back-btn { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 0.875rem; color: var(--text4); font-family: 'Inter', sans-serif; transition: all 0.15s; margin-bottom: 16px; }
  .back-btn:hover { border-color: var(--blue); color: var(--blue); }
  .back-btn svg { width: 16px; height: 16px; }

  /* Favorites page */
  .empty-state { text-align: center; padding: 48px; }
  .empty-icon { margin: 0 auto 16px; opacity: 0.4; }
  .empty-icon svg { width: 64px; height: 64px; color: var(--text5); }
  .empty-title { font-size: 1.25rem; font-weight: 600; color: var(--text3); margin-bottom: 8px; }
  .empty-desc { font-size: 0.875rem; color: var(--text5); }

  /* Active nav state */
  .nav-active-indicator { position: relative; }

  /* User profile chip */
  .user-chip { display: flex; align-items: center; gap: 6px; }
  .user-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--orange)); display: flex; align-items: center; justify-content: center; color: white; font-size: 0.75rem; font-weight: 700; overflow: hidden; flex-shrink: 0; }
  .user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
  .profile-badge { font-size: 0.65rem; padding: 1px 6px; border-radius: 10px; background: #dbeafe; color: #1d4ed8; font-weight: 600; }
  .dark .profile-badge { background: rgba(37,99,235,0.2); color: #93c5fd; }
  .profile-badge.adm { background: #fef3c7; color: #b45309; }
  .dark .profile-badge.adm { background: rgba(245,158,11,0.2); color: #fcd34d; }

  /* Fullscreen */
  .fullscreen-mode { position: fixed; inset: 0; z-index: 200; background: var(--card-bg); display: flex; flex-direction: column; }
  .fullscreen-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .fullscreen-iframe { flex: 1; width: 100%; border: none; }
  .iframe-real { width: 100%; aspect-ratio: 16/9; border: none; }

  /* Annotation box */
  .annotation-box { position: absolute; background: rgba(255,255,255,0.95); border: 2px solid #3b82f6; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); overflow: hidden; z-index: 100; min-width: 180px; min-height: 100px; }
  .dark .annotation-box { background: rgba(30,41,59,0.95); }
  .annotation-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; background: rgba(59,130,246,0.1); border-bottom: 1px solid rgba(59,130,246,0.3); cursor: move; user-select: none; }
  .annotation-actions { display: flex; gap: 2px; }
  .annotation-action-btn { padding: 3px; border: none; background: transparent; cursor: pointer; border-radius: 4px; color: var(--text4); }
  .annotation-action-btn:hover { background: rgba(0,0,0,0.08); }
  .annotation-textarea { width: 100%; height: calc(100% - 38px); resize: none; border: none; outline: none; padding: 8px; font-family: 'Inter', sans-serif; font-size: 13px; background: transparent; color: var(--text); }
  .annotation-textarea::placeholder { color: var(--text5); }
  .resize-handle { position: absolute; width: 10px; height: 10px; background: #3b82f6; border-radius: 50%; }
  .resize-se { bottom: -5px; right: -5px; cursor: se-resize; }
  .annotation-container { position: absolute; inset: 0; pointer-events: none; }
  .annotation-container .annotation-box { pointer-events: all; }
  #annotation-layer { position: relative; }

  /* News panel floating button */
  .news-fab { position: fixed; bottom: 24px; right: 24px; width: 52px; height: 52px; border-radius: 50%; background: var(--blue); color: white; border: none; cursor: pointer; box-shadow: 0 4px 16px rgba(37,99,235,0.4); display: flex; align-items: center; justify-content: center; z-index: 40; transition: all 0.2s; font-size: 1.3rem; }
  .news-fab:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(37,99,235,0.5); }
  .news-fab-badge { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; background: #ef4444; color: white; border-radius: 50%; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

  /* Modal */
  .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9998; display: flex; align-items: center; justify-content: center; padding: 16px; }
  .modal-box { background: var(--card-bg); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); width: 100%; max-width: 640px; max-height: 80vh; overflow-y: auto; }
  .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
  .modal-title { display: flex; align-items: center; gap: 12px; font-size: 1.125rem; font-weight: 600; color: var(--text2); }
  .modal-close { padding: 6px; border: none; background: transparent; cursor: pointer; color: var(--text5); border-radius: 6px; }
  .modal-close:hover { background: var(--border); color: var(--text2); }
  .modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
  .news-item-card { padding: 16px; border: 1px solid var(--border); border-radius: 10px; display: flex; gap: 12px; }
  .news-type-icon { flex-shrink: 0; font-size: 1.2rem; }
  .news-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
  .news-item-card-title { font-size: 0.875rem; font-weight: 600; color: var(--text2); }
  .news-badge { font-size: 0.65rem; padding: 2px 6px; border-radius: 20px; font-weight: 600; }
  .badge-feature { background: #fef3c7; color: #b45309; }
  .badge-update { background: #dbeafe; color: #1d4ed8; }
  .badge-news { background: #dcfce7; color: #15803d; }
  .news-item-body { font-size: 0.8rem; color: var(--text4); line-height: 1.5; margin-bottom: 4px; }
  .news-item-date { font-size: 0.7rem; color: var(--text5); }

  /* Quick access favorites bar */
  .quick-fav-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .quick-fav-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; font-size: 0.75rem; color: var(--text4); cursor: pointer; transition: all 0.15s; white-space: nowrap; }
  .quick-fav-chip:hover { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
  .dark .quick-fav-chip:hover { background: rgba(37,99,235,0.1); }
  .quick-fav-chip svg { width: 12px; height: 12px; }

  /* Report action buttons */
  .btn-action { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; font-family: 'Inter', sans-serif; }
  .btn-action svg { width: 16px; height: 16px; }
  .btn-dark { background: #1e293b; color: white; }
  .dark .btn-dark { background: #475569; }
  .btn-dark:hover { background: #0f172a; }
  .btn-blue { background: var(--blue); color: white; }
  .btn-blue:hover { background: var(--blue2); }
  .btn-outline { background: var(--card-bg); border: 1px solid var(--border); color: var(--text4); }
  .btn-outline:hover { border-color: var(--blue); color: var(--blue); }
  .btn-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

  .btn-sm { padding: 4px 10px; font-size: 0.75rem; border-radius: 6px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text4); cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.15s; }
  .btn-sm:hover { border-color: var(--blue); color: var(--blue); }
  .btn-sm.danger:hover { border-color: #ef4444; color: #ef4444; }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
  .dark ::-webkit-scrollbar-thumb { background: #475569; }

  /* Mobile */
  @media(max-width: 640px) {
    .header-left { gap: 8px; }
    .search-wrapper { display: none; }
    main { padding: 72px 16px 16px; }
    .reports-grid { grid-template-columns: 1fr 1fr; }
    .categories-grid { grid-template-columns: 1fr 1fr; }
  }

  /* Toast */
  #toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
  .toast { padding: 12px 16px; border-radius: 10px; font-size: 0.875rem; font-weight: 500; box-shadow: 0 4px 20px rgba(0,0,0,0.15); animation: toastIn 0.3s ease; max-width: 300px; }
  .toast.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
  .toast.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
  .dark .toast.success { background: rgba(6,95,70,0.9); color: #6ee7b7; }
  .dark .toast.error { background: rgba(153,27,27,0.9); color: #fca5a5; }
  @keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── Gauge card pulse border ─────────────────────────────────── */
@keyframes pulse-border {
  0%   { box-shadow: 0 0 0 0   rgba(239,68,68,0.7), 0 0 0 0   rgba(239,68,68,0.4); border-color: #ef4444; }
  50%  { box-shadow: 0 0 0 5px rgba(239,68,68,0.3), 0 0 0 10px rgba(239,68,68,0.1); border-color: #fca5a5; }
  100% { box-shadow: 0 0 0 0   rgba(239,68,68,0.7), 0 0 0 0   rgba(239,68,68,0.4); border-color: #ef4444; }
}
.gauge-card-over {
  border: 1.5px solid #ef4444 !important;
  animation: pulse-border 1.8s ease-in-out infinite;
}

/* ── Gauge card green border (within budget) ─────────────────── */
@keyframes pulse-border-green {
  0%   { box-shadow: 0 0 0 0   rgba(34,197,94,0.5); border-color: #22c55e; }
  50%  { box-shadow: 0 0 0 5px rgba(34,197,94,0.1); border-color: #4ade80; }
  100% { box-shadow: 0 0 0 0   rgba(34,197,94,0.5); border-color: #22c55e; }
}
.gauge-card-ok {
  border: 1.5px solid #22c55e !important;
  animation: pulse-border-green 2.5s ease-in-out infinite;
}

/* ── Justify button pulse ────────────────────────────────────────── */
@keyframes pulse-just-btn {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); background: rgba(239,68,68,0.08); }
  50%  { box-shadow: 0 0 0 7px rgba(239,68,68,0); background: rgba(239,68,68,0.18); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); background: rgba(239,68,68,0.08); }
}
.just-btn-pulse {
  animation: pulse-just-btn 1.6s ease-in-out infinite !important;
}

/* ─── SEGMENTED BUTTON GROUP ──────────────────────────────────────────────── */
.seg-group {
  display: inline-flex;
  align-items: center;
  background: rgba(15,23,42,0.6);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.35), inset 0 1px 2px rgba(0,0,0,0.25);
}

/* Light mode seg-group */
:not(.dark) .seg-group {
  background: #e4e8ed;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.12), inset 0 1px 2px rgba(0,0,0,0.08);
}

.seg-btn {
  position: relative;
  padding: 4px 11px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.13s ease;
  white-space: nowrap;
  user-select: none;
  outline: none;
  box-shadow: none;
  transform: translateY(0) scale(1);
  font-family: inherit;
  letter-spacing: .01em;
}

/* Light mode seg-btn normal */
:not(.dark) .seg-btn {
  color: #4b5563;
}

.seg-btn:hover:not(.seg-active) {
  background: rgba(255,255,255,0.07);
  color: #94a3b8;
}

:not(.dark) .seg-btn:hover:not(.seg-active) {
  background: rgba(255,255,255,0.6);
  color: #374151;
}

.seg-btn.seg-active {
  background: #1e3a5f;
  color: #7cb9f4;
  font-weight: 650;
  box-shadow:
    0 1px 0   rgba(57,88,125,0.15),
    0 3px 7   rgba(57,88,125,0.35),
    0 6px 14  rgba(57,88,125,0.18),
    0 1px 2   rgba(0,0,0,0.25);
  transform: translateY(-1px) scale(1.015);
  border-top: 1px solid rgba(124,185,244,0.2);
}

/* Light mode seg-active */
:not(.dark) .seg-btn.seg-active {
  background: #ffffff;
  color: #162640;
  box-shadow:
    0 1px 0   rgba(22,38,64,0.06),
    0 3px 8   rgba(22,38,64,0.18),
    0 6px 16  rgba(22,38,64,0.10),
    0 1px 2   rgba(0,0,0,0.08);
}

.seg-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(124,185,244,0.08);
  opacity: 0;
  transition: opacity 0.1s;
}
.seg-btn:active::after { opacity: 1; }

/* ─── LIGHT MODE DASHBOARD OVERRIDES ─────────────────────────────────────── */
/* Section labels (currently hardcoded #94a3b8 in templates) */
:not(.dark) #fat-content [style*="color:#94a3b8"],
:not(.dark) #desp-content [style*="color:#94a3b8"],
:not(.dark) #rent-content [style*="color:#94a3b8"] {
  color: #6b7280 !important;
}

/* Muted text currently #64748b */
:not(.dark) #fat-content [style*="color:#64748b"],
:not(.dark) #desp-content [style*="color:#64748b"],
:not(.dark) #rent-content [style*="color:#64748b"] {
  color: #9ca3af !important;
}

/* Table rows in light mode */
:not(.dark) #fat-rank-tbody tr:nth-child(even),
:not(.dark) #desp-table-body tr:nth-child(even) {
  background: #f9fafb;
}
:not(.dark) #fat-rank-tbody tr:hover,
:not(.dark) #desp-table-body tr:hover {
  background: #f0f4ff;
}

/* Badge/chip style for data-badge in light mode */
:not(.dark) #fat-data-badge {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}

/* Dark header stays dark in both modes */
.header { background: #162640 !important; }
.dark .header { background: #0d1526 !important; }

/* Fundo geométrico SVG — ocultar no modo claro */
:not(.dark) #desp-content > div > div:first-child svg,
:not(.dark) #fat-content  > div > div:first-child svg {
  display: none;
}

/* Bordas dos cards em modo claro mais sutis */
:not(.dark) #fat-content [style*="border:1px solid var(--border)"],
:not(.dark) #desp-content [style*="border:1px solid var(--border)"],
:not(.dark) #rent-content [style*="border:1px solid var(--border)"] {
  border-color: #e8eaed !important;
}

/* Hide geometric SVG bg in light mode */
:not(.dark) .dark-only-geo { display: none !important; }

/* ─── LOADERS: texto visível no fundo claro ─── */
#fat-loading .pre-status, #desp-loading .pre-status, #rent-loading .pre-status {
  color: #4b5563;
}
#fat-loading .pre-pct, #desp-loading .pre-pct, #rent-loading .pre-pct {
  color: rgba(42,198,212,0.9);
}

/* ─── LIGHT MODE: cabeçalhos das tabelas de rentabilidade ─── */
:not(.dark) #rent-pivot-thead th,
:not(.dark) #rent-det-thead th {
  color: #374151 !important;
  background: #eef1f5 !important;
}

/* ─── LIGHT MODE: título da página Rentabilidade ─── */
:not(.dark) #rent-content h2 {
  color: #1a2332 !important;
}
:not(.dark) #rent-content .rent-page-subtitle {
  color: #6b7280 !important;
}

/* ─── FLAT NAV (comexport-style icon + label) ─────────────────────────────── */
.flat-nav {
  display: flex;
  align-items: stretch;
  height: 48px;
  gap: 0;
}

.flat-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.flat-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 14px;
  height: 48px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
  min-width: 72px;
}

.flat-nav-btn:hover,
.flat-nav-item:hover > .flat-nav-btn {
  background: rgba(255,255,255,0.08);
  border-bottom-color: #2ac6d4;
}

.flat-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flat-nav-label {
  font-size: 0.58rem;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sub-dropdown for Relatório PBI */
.flat-sub-menu {
  position: absolute;
  top: 64px;
  left: 0;
  min-width: 200px;
  background: var(--card-bg, #1e293b);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 200;
  display: none;
  padding: 4px 0;
}

.flat-sub-menu .dropdown-arrow {
  display: none;
}

.flat-nav-item:hover .flat-sub-menu,
.flat-sub-menu:hover {
  display: block;
}

/* Keep sub-menu visible when child is focused */
.flat-nav-item.sub-open .flat-sub-menu {
  display: block;
}

/* Dark mode sub-menu */
.dark .flat-sub-menu {
  background: #1e293b;
}

/* Active nav item (current page) */
.flat-nav-btn.nav-active {
  border-bottom-color: #2ac6d4;
  background: rgba(42,198,212,0.08);
}
.flat-nav-btn.nav-active .flat-nav-label {
  color: #2ac6d4;
}

/* flat-sub-menu overrides: show on hover via parent class */
.flat-nav-item.sub-open .flat-sub-menu,
.flat-nav-item:hover .flat-sub-menu {
  display: block !important;
}

/* flat-sub-menu positioning */
.flat-sub-menu.dropdown-menu {
  top: 45px !important;
  left: 0 !important;
  border-radius: 0 0 10px 10px;
  border-top: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ─── CARD SHARP CORNERS + HOVER TOP BORDER ─────────────────────────────── */
/* Remove border-radius from ALL card-like divs globally */
[style*="background:var(--card)"],
[style*="background: var(--card)"] {
  border-radius: 0 !important;
}

/* Hover: darken the top border on inline-style cards */
[style*="border-top:6px solid #808080"]:hover,
[style*="border-top: 6px solid #808080"]:hover {
  border-top-color: #6b7280 !important;
  transition: border-top-color 0.2s;
}

/* Ensure transition on all cards */
[style*="background:var(--card)"],
[style*="background: var(--card)"] {
  transition: border-top-color 0.2s, box-shadow 0.2s;
}

/* ─── TABLE ALTERNATING ROWS (light mode) ────────────────────────────────── */
:root table tbody tr:nth-child(odd)  { background: #ffffff; }
:root table tbody tr:nth-child(even) { background: #f5f5f5; }
:root table tbody tr:hover           { background: #eaf0f7 !important; }
:root table thead tr                 { background: #f0f2f5; }
:root table tfoot tr                 { background: rgba(59,130,246,0.06); }

/* Dark mode: keep original transparent/dark behavior */
.dark table tbody tr:nth-child(odd)  { background: transparent; }
.dark table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.dark table tbody tr:hover           { background: rgba(255,255,255,0.04) !important; }
.dark table thead tr                 { background: transparent; }

/* Table text color in light mode */
:root table tbody td { color: var(--text); }
:root table thead th { color: #4b5563; }

/* Remove inline background overrides on tr in light mode - handled above */
:root table tbody tr[style*="background:transparent"] { background: #ffffff !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRELOADER
   ═══════════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════
   PRELOADER — Professional animated screen
═══════════════════════════════════════════════════════════════════════════ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a1628;
  overflow: hidden;
}

/* Animated dot grid background */
.pre-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(42,198,212,0.18) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: preGridPan 12s linear infinite;
  opacity: 0.6;
}

@keyframes preGridPan {
  0%   { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}

/* Central radial glow */
.pre-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42,198,212,0.12) 0%, transparent 70%);
  animation: preGlowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes preGlowPulse {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%       { transform: scale(1.15); opacity: 1;   }
}

/* Content stack */
.pre-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: preFadeIn 0.6s ease both;
}

@keyframes preFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Spinning ring ───────────────────────────────────── */
.pre-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pre-ring {
  position: absolute;
  inset: 0;
  width: 130px;
  height: 130px;
  animation: preRingSpin 2.2s linear infinite;
}

@keyframes preRingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.pre-ring-track {
  fill: none;
  stroke: rgba(42,198,212,0.12);
  stroke-width: 4;
}

.pre-ring-arc {
  fill: none;
  stroke: #2ac6d4;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100 228;
  filter: drop-shadow(0 0 6px rgba(42,198,212,0.8));
}

.pre-ring-inner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pre-logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  animation: preLogoPulse 2s ease-in-out infinite;
}

@keyframes preLogoPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.06); }
}

.pre-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2ac6d4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── Chart bars ─────────────────────────────────────── */
.pre-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 62px;
}

.pre-bar {
  width: 12px;
  height: var(--h, 36px);
  background: linear-gradient(180deg, var(--c, #2ac6d4) 0%, rgba(42,198,212,0.2) 100%);
  border-radius: 3px 3px 0 0;
  animation: preBarBounce 1s var(--d, 0s) ease-in-out infinite alternate;
  box-shadow: 0 0 8px rgba(42,198,212,0.35);
}

@keyframes preBarBounce {
  0%   { transform: scaleY(0.28); opacity: 0.35; }
  100% { transform: scaleY(1);    opacity: 1;    }
}

/* ── Status text ─────────────────────────────────────── */
.pre-status {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 1.1em;
}

/* ── Progress bar ────────────────────────────────────── */
.pre-progress-track {
  position: relative;
  width: 260px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.pre-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2ac6d4, #22c55e, #2ac6d4);
  background-size: 200% 100%;
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(.4,0,.2,1);
  animation: preShimmer 1.8s linear infinite;
}

@keyframes preShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.pre-pct {
  font-size: 0.68rem;
  color: rgba(42,198,212,0.65);
  letter-spacing: 0.08em;
  margin-top: -10px;
}

/* ── Fade-out exit ───────────────────────────────────── */
#preloader.pre-hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* ─── DASHBOARD MINI-LOADER ANIMATIONS ──────────────────────────────────── */
@keyframes dashSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes dashBar {
  0%   { transform: scaleY(0.2); opacity: 0.3; }
  100% { transform: scaleY(1);   opacity: 1;   }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN CENTER — Animated title + bars
═══════════════════════════════════════════════════════════════════════════ */
.lc-anim-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.lc-badge {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(42,198,212,0.2), rgba(34,197,94,0.15));
  border: 1px solid rgba(42,198,212,0.3);
  display: flex; align-items: center; justify-content: center;
  color: #2ac6d4;
  animation: lcFadeDown .5s ease both;
}
.lc-features {
  display: flex; flex-direction: column; gap: 10px;
  animation: lcFadeUp .6s .6s ease both;
}
.lc-feat {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 500; color: rgba(255,255,255,0.7);
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}
.lc-feat svg { flex-shrink: 0; opacity: .7; }

/* Title */
.lc-title { text-align: center; animation: lcFadeDown .7s .1s ease both; }
.lc-title-main {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: .02em;
  text-shadow: 0 2px 24px rgba(0,0,0,.5), 0 0 40px rgba(42,198,212,.2);
}
.lc-title-sub {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 10px;
  font-weight: 600;
  animation: lcSubAnim 3s .5s ease-in-out infinite alternate;
}
@keyframes lcSubAnim {
  0%   { opacity: .7; text-shadow: 0 0 10px rgba(255,255,255,.2); letter-spacing: .10em; }
  100% { opacity: 1;  text-shadow: 0 0 30px rgba(255,255,255,.6), 0 0 60px rgba(42,198,212,.3); letter-spacing: .16em; }
}

/* Mini bars — identical style to preloader */
.lc-mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  animation: lcFadeUp .6s .4s ease both;
}
.lc-mb {
  width: 10px;
  height: var(--h, 40px);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--c, #2ac6d4), rgba(0,0,0,0));
  box-shadow: 0 0 8px color-mix(in srgb, var(--c, #2ac6d4) 50%, transparent);
  animation: lcMbBounce 1.1s var(--d, 0s) ease-in-out infinite alternate;
}
@keyframes lcMbBounce {
  0%   { transform: scaleY(.25); opacity: .35; }
  100% { transform: scaleY(1);   opacity: 1; }
}

/* Shared keyframes */
@keyframes lcFadeDown { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:translateY(0); } }
@keyframes lcFadeUp   { from { opacity:0; transform:translateY(16px);  } to { opacity:1; transform:translateY(0); } }

/* ═══════════════════════════════════════════════════════════════
   SHARED DASHBOARD — UI/UX Pro Max Base
   ═══════════════════════════════════════════════════════════════ */

.dash-page { padding: 28px 32px; font-family: 'Inter', sans-serif; }
@media (max-width: 768px) { .dash-page { padding: 16px; } }

.dash-card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
}
.dash-card:hover {
  box-shadow: var(--card-shadow-hover);
}
.dark .dash-card {
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.dash-section {
  margin-bottom: 20px;
  animation: dashFadeIn 0.4s ease both;
}
.dash-section:nth-child(2) { animation-delay: 0.05s; }
.dash-section:nth-child(3) { animation-delay: 0.1s; }
.dash-section:nth-child(4) { animation-delay: 0.15s; }
.dash-section:nth-child(5) { animation-delay: 0.2s; }
.dash-section:nth-child(6) { animation-delay: 0.25s; }
.dash-section:nth-child(7) { animation-delay: 0.3s; }
@keyframes dashFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.dash-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dash-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
}
.dash-section-icon svg { width: 15px; height: 15px; stroke-width: 2; }

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}
.dash-header-left h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  letter-spacing: -0.02em;
}
.dash-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: white;
  flex-shrink: 0;
}
.dash-title-icon svg { width: 22px; height: 22px; stroke-width: 2; }
.dash-header-subtitle {
  font-size: 0.75rem;
  color: var(--text5);
  margin: 6px 0 0;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dash-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.dash-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text5);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.dash-filter-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dash-filter-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
  outline: none;
}
.dash-filter-btn {
  background: var(--bg2);
  color: var(--text4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-filter-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 5%, transparent);
}
.dash-filter-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dash-kpi-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text5);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.dash-kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.dash-kpi-sub {
  font-size: 0.78rem;
  color: var(--text5);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.dash-chart-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.dash-chart-wrap canvas { display: block; width: 100% !important; height: 100% !important; }

.dash-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--text5);
  font-weight: 500;
}
.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-collapse-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text5);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.dash-collapse-btn:hover { border-color: var(--blue); color: var(--blue); }
.dash-collapse-btn svg { width: 16px; height: 16px; transition: transform 0.25s ease; }
.dash-collapse-btn.collapsed svg { transform: rotate(-90deg); }

.dash-collapsible {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  max-height: 3000px;
  opacity: 1;
}
.dash-collapsible.collapsed {
  max-height: 0;
  opacity: 0;
}

.dash-row-grid {
  display: grid;
  gap: 18px;
}
.dash-row-4 { grid-template-columns: repeat(4, 1fr); }
.dash-row-3 { grid-template-columns: repeat(3, 1fr); }
.dash-row-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1024px) {
  .dash-row-4 { grid-template-columns: repeat(2, 1fr); }
  .dash-row-3 { grid-template-columns: 1fr; }
  .dash-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-row-4 { grid-template-columns: 1fr; }
}

.dash-table-btn {
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text5);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dash-table-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 5%, transparent);
}
.dash-table-btn svg { width: 14px; height: 14px; }

.dash-metric-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0 4px;
}

.dash-progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.dash-progress-track {
  flex: 1;
  height: 7px;
  background: rgba(100,116,139,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.dash-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dash-progress-label {
  font-size: 0.72rem;
  color: var(--text5);
  min-width: 36px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.dash-sparkline-wrap {
  position: relative;
  height: 44px;
  margin-top: 10px;
}

.dash-indicator-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(100,116,139,0.06);
}
.dash-indicator-row:last-child { border-bottom: none; }
.dash-indicator-label { color: var(--text5); font-weight: 500; }
.dash-indicator-value { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════
   RENTABILIDADE PAGE — Tab & Dropdown Styles
   ═══════════════════════════════════════════════════════════════ */

.rent-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 0 -24px 16px -24px;
  padding: 0 24px;
}
.rent-tab {
  padding: 12px 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text5);
  cursor: pointer;
  position: relative;
  top: 1px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s, border-color 0.15s;
}
.rent-tab:hover { color: var(--text3); }
.rent-tab-active {
  border-bottom-color: #22c55e;
  color: #22c55e;
}

.rent-exec-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.rent-exec-btn:hover {
  background: color-mix(in srgb, #22c55e 5%, transparent);
  border-color: color-mix(in srgb, #22c55e 30%, var(--border));
}

.rent-table-exec {
  border-collapse: collapse;
  font-size: 0.8125rem;
  white-space: nowrap;
  width: 100%;
}
.rent-table-exec thead th {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rent-table-exec tbody tr {
  transition: background 0.15s;
}
.rent-table-exec tbody tr:hover {
  background: color-mix(in srgb, #22c55e 4%, transparent);
}

.rent-table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.rent-dropdown {
  border-radius: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   FATURAMENTO PAGE — View Tabs (Geral / Análise de Clientes)
   ═══════════════════════════════════════════════════════════════ */

.fat-view-tabs {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.fat-view-tab {
  padding: 7px 16px;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text5);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}
.fat-view-tab:hover { color: var(--text3); background: color-mix(in srgb, var(--blue) 5%, transparent); }
.fat-view-tab svg { width: 13px; height: 13px; }
.fat-view-tab-active {
  background: var(--card-bg);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}

/* Executive Faturamento additions */
.fat-data-badge-exec {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.15);
  color: #22c55e;
  white-space: nowrap;
}
.dark .fat-data-badge-exec { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.2); }
.fat-periodo-group {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 14px;
}
.fat-kpi-card-exec {
  transition: box-shadow 0.25s, transform 0.25s;
}
.fat-kpi-card-exec:hover {
  transform: translateY(-1px);
}
.fat-kpi-indicators .dash-indicator-row {
  padding: 6px 0;
}
.fat-rank-table-exec thead th {
  background: var(--bg2);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text5);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}
.fat-rank-table-exec tbody tr {
  transition: background 0.15s;
}
.fat-rank-table-exec tbody tr:hover {
  background: color-mix(in srgb, var(--blue) 4%, transparent);
}
.fat-rank-table-exec tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.fat-rank-table-exec tfoot td {
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.8125rem;
}

/* ═══════════════════════════════════════════════════════════════
   COMEX RADAR PAGE — Executive Design
   ═══════════════════════════════════════════════════════════════ */

.cr-kpi-card-exec {
  transition: box-shadow 0.25s, transform 0.25s;
}
.cr-kpi-card-exec:hover {
  transform: translateY(-1px);
}

.cr-card-exec {
  transition: box-shadow 0.25s, transform 0.25s;
}
.cr-card-exec:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

.cr-map-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-map-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cr-map-header img {
  height: 18px;
  opacity: 0.9;
}

.cr-imp-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .cr-imp-grid { grid-template-columns: 1fr; }
}

.cr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.cr-table th {
  padding: 10px 12px;
  font-weight: 700;
  color: var(--text5);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}
.cr-table th:hover { color: var(--text3); }
.cr-table th.cr-sort-active { color: var(--orange); }
.cr-table th svg { vertical-align: middle; margin-left: 4px; }
.cr-table td { padding: 8px 12px; }
.cr-table tr { border-bottom: 1px solid var(--border); }
.cr-table tbody tr:nth-child(even) { background: var(--bg); }
.cr-table tbody tr:nth-child(odd) { background: var(--card-bg); }
.cr-table .cr-total-row {
  background: color-mix(in srgb, var(--orange) 6%, var(--bg)) !important;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
}
.cr-table-exec thead th {
  background: var(--bg2);
}
.cr-table-exec tbody tr {
  transition: background 0.15s;
}
.cr-table-exec tbody tr:hover {
  background: color-mix(in srgb, var(--orange) 4%, transparent);
}
.cr-table-exec tbody td {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   FINANC. CLIENTES PAGE — Executive Design
   ═══════════════════════════════════════════════════════════════ */

.fc-card-exec {
  transition: box-shadow 0.25s, transform 0.25s;
}
.fc-card-exec:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

.fc-filter-label-exec {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.fc-exec-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.fc-exec-btn:hover {
  background: color-mix(in srgb, #8b5cf6 5%, transparent);
  border-color: color-mix(in srgb, #8b5cf6 30%, var(--border));
}

.fc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  color: var(--text);
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.fc-icon-btn:hover {
  background: color-mix(in srgb, #8b5cf6 5%, transparent);
  border-color: color-mix(in srgb, #8b5cf6 30%, var(--border));
}
.fc-icon-btn-danger {
  border-color: #fca5a5;
  background: color-mix(in srgb, #ef4444 5%, var(--card-bg));
  color: #dc2626;
}
.fc-icon-btn-danger:hover {
  background: color-mix(in srgb, #ef4444 10%, var(--card-bg));
}

.fc-table-card-exec {
  overflow: hidden;
}
.fc-table-card-exec:hover {
  transform: none;
}

.fc-table-header-exec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.fc-table-exec {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.fc-table-exec thead tr {
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
}
.fc-table-exec tbody tr {
  transition: background 0.15s;
}
.fc-table-exec tbody tr:hover {
  background: color-mix(in srgb, #8b5cf6 3%, transparent);
}

.fc-filter-card-exec {
  transition: box-shadow 0.25s;
}
.fc-filter-card-exec:hover {
  transform: none;
}

/* ═══════════════════════════════════════════════════════════════
   DESPESAS PAGE — UI/UX Pro Max Improvements
   Rules applied: card-radius, whitespace-balance, font-scale,
   weight-hierarchy, visual-hierarchy, progressive-disclosure,
   no-emoji-icons, elevation-consistent, data-density,
   number-tabular, gridline-subtle, spacing-scale
   ═══════════════════════════════════════════════════════════════ */

.desp-page { padding: 24px; font-family: 'Inter', sans-serif; }

.desp-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.desp-card:hover { box-shadow: var(--card-shadow-hover); }
.dark .desp-card { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.desp-section {
  margin-bottom: 20px;
  animation: despFadeIn 0.4s ease both;
}
.desp-section:nth-child(2) { animation-delay: 0.05s; }
.desp-section:nth-child(3) { animation-delay: 0.1s; }
.desp-section:nth-child(4) { animation-delay: 0.15s; }
.desp-section:nth-child(5) { animation-delay: 0.2s; }
@keyframes despFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.desp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.desp-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.desp-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}
.desp-section-icon svg { width: 16px; height: 16px; stroke-width: 2; }

.desp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.desp-header-left h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.desp-header-left h2 .desp-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  flex-shrink: 0;
}
.desp-header-left h2 .desp-title-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.desp-header-subtitle {
  font-size: 0.8125rem;
  color: var(--text5);
  margin: 4px 0 0;
}

.desp-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.desp-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.desp-filter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text5);
  white-space: nowrap;
}
.desp-filter-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.desp-filter-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}
.desp-filter-btn {
  background: var(--surface);
  color: var(--text4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.desp-filter-btn:hover {
  background: var(--border);
  border-color: var(--text5);
}

.desp-kpi-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.desp-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.desp-kpi-sub {
  font-size: 0.8125rem;
  color: var(--text5);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.desp-kpi-secondary-label {
  font-size: 0.6875rem;
  color: var(--text5);
  margin-top: 10px;
}
.desp-kpi-secondary-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text4);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.desp-sparkline-label {
  font-size: 0.6875rem;
  color: var(--text5);
  margin-bottom: 4px;
  margin-top: 12px;
}
.desp-sparkline-wrap {
  position: relative;
  height: 48px;
}
.desp-sparkline-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.desp-metric-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0 4px;
}

.desp-row-grid {
  display: grid;
  gap: 20px;
}
.desp-row-3 { grid-template-columns: 240px 1fr 240px; }
.desp-row-2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 1024px) {
  .desp-row-3 { grid-template-columns: 1fr; }
  .desp-row-2 { grid-template-columns: 1fr; }
}

.desp-progress-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.desp-progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.desp-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.desp-progress-label {
  font-size: 0.75rem;
  color: var(--text5);
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}

.desp-growth-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.desp-growth-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.desp-growth-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text5);
  display: flex;
  align-items: center;
  gap: 6px;
}
.desp-growth-label svg { width: 14px; height: 14px; }
.desp-growth-value {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.desp-growth-bar {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.desp-growth-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.desp-growth-status {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
}

.desp-chart-wrap {
  position: relative;
  height: 220px;
  width: 100%;
  overflow: hidden;
}
.desp-chart-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.desp-legend {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text5);
  flex-wrap: wrap;
}
.desp-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.desp-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.desp-legend-line {
  width: 24px;
  height: 2px;
  display: inline-block;
}

.desp-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.desp-table-btn {
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text5);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.desp-table-btn:hover {
  background: var(--border);
  color: var(--text3);
}
.desp-table-btn svg { width: 14px; height: 14px; }

.desp-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text5);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background 0.15s, transform 0.2s;
}
.desp-collapse-btn:hover { background: var(--border); }
.desp-collapse-btn svg { width: 16px; height: 16px; transition: transform 0.25s ease; }
.desp-collapse-btn.collapsed svg { transform: rotate(-90deg); }

.desp-collapsible {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  max-height: 2000px;
  opacity: 1;
}
.desp-collapsible.collapsed {
  max-height: 0;
  opacity: 0;
}

.desp-gauge-stats {
  display: flex;
  gap: 20px;
  font-size: 0.75rem;
  margin-top: 8px;
}
.desp-gauge-stat {
  text-align: center;
}
.desp-gauge-stat-label {
  color: var(--text5);
  font-weight: 500;
  font-size: 0.6875rem;
}
.desp-gauge-stat-value {
  font-weight: 700;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ─── DESPESAS V2 ────────────────────────────────────────────────────────── */
.dv2-page { padding: 28px 32px; font-family: 'Inter', sans-serif; }
@media (max-width: 768px) { .dv2-page { padding: 16px; } }

/* ── EXECUTIVE HEADER ── */
.dv2-header-exec {
  margin-bottom: 28px;
}
.dv2-header-exec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.dv2-header-left { display: flex; flex-direction: column; gap: 6px; }
.dv2-title-exec {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  letter-spacing: -0.02em;
}
.dv2-title-exec > span { display: flex; flex-direction: column; }
.dv2-title-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text5);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 2px;
}
.dv2-title-icon-exec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(6,182,212,0.08));
  color: #3b82f6;
  flex-shrink: 0;
}
.dark .dv2-title-icon-exec { background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(6,182,212,0.12)); }
.dv2-title-icon-exec svg { width: 22px; height: 22px; }
.dv2-header-right-exec {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dv2-period-badge-exec {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #3b82f6;
  background: rgba(59,130,246,0.07);
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(59,130,246,0.12);
}
.dark .dv2-period-badge-exec { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.2); }
.dv2-fmt-btn-exec {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg2);
  color: var(--text5);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.dv2-fmt-btn-exec:hover { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.04); }
.dv2-filters-exec {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.dv2-filter-group { display: flex; flex-direction: column; gap: 5px; }
.dv2-filter-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dv2-filter-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: auto;
}
.dv2-filter-select:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }
.dv2-filter-btn-cc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 140px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  gap: 8px;
  transition: border-color 0.15s;
}
.dv2-filter-btn-cc:hover { border-color: #3b82f6; }

/* ── KPI GRID EXECUTIVE ── */
.dv2-kpi-grid-exec {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 1024px) { .dv2-kpi-grid-exec { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .dv2-kpi-grid-exec { grid-template-columns: 1fr; } }

.dv2-kpi-card-exec {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
  position: relative;
}
.dv2-kpi-card-exec:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.dark .dv2-kpi-card-exec { backdrop-filter: blur(8px); }
.dark .dv2-kpi-card-exec:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.dv2-kpi-card-inner {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dv2-kpi-card-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dv2-kpi-val-exec {
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.dv2-kpi-meta-exec {
  font-size: 0.7rem;
  color: var(--text5);
  font-weight: 500;
}
.dv2-spark-exec {
  width: 100%;
  height: 36px;
  margin: 4px 0 2px;
}
.dv2-spark-exec canvas { display: block; }

/* Hero KPI (Execution) */
.dv2-kpi-hero { grid-row: span 1; }
.dv2-kpi-hero-ok { border-color: rgba(34,197,94,0.25); }
.dv2-kpi-hero-ok::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-radius: 14px 14px 0 0;
}
.dv2-kpi-hero-danger { border-color: rgba(239,68,68,0.25); }
.dv2-kpi-hero-danger::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ef4444, #dc2626);
  border-radius: 14px 14px 0 0;
}
.dv2-exec-pct-big {
  font-size: 2.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.dv2-exec-track-exec {
  width: 100%;
  height: 7px;
  background: rgba(100,116,139,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}
.dv2-exec-fill-exec {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}
.dv2-kpi-status-exec {
  font-size: 0.72rem;
  font-weight: 600;
}

/* ── CARD EXECUTIVE ── */
.dv2-card-exec {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.05);
  transition: box-shadow 0.25s, transform 0.25s;
  position: relative;
  overflow: hidden;
}
.dv2-card-exec:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.08);
}
.dark .dv2-card-exec { backdrop-filter: blur(8px); }
.dark .dv2-card-exec:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 12px 40px rgba(0,0,0,0.2); }

.dv2-card-table-exec { padding-bottom: 16px; }

.dv2-card-header-exec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.dv2-card-title-exec {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}
.dv2-card-icon-exec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(59,130,246,0.08);
  color: #3b82f6;
  flex-shrink: 0;
}
.dark .dv2-card-icon-exec { background: rgba(59,130,246,0.15); }
.dv2-card-icon-exec svg { width: 15px; height: 15px; }
.dv2-badge-exec {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(100,116,139,0.06);
  border: 1px solid var(--border);
}

/* ── SECTION GRID — single 2-col grid for uniform row-gap + column-gap ── */
.dv2-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 24px;
  column-gap: 24px;
}
@media (max-width: 900px) { .dv2-section-grid { grid-template-columns: 1fr; }
  .dv2-section-grid > [style*="grid-column"] { grid-column: 1 !important; }
}

/* ── GRID EXECUTIVE (legacy, kept for compat) ── */
.dv2-grid-exec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .dv2-grid-exec { grid-template-columns: 1fr; } }

/* ── CHART CONTAINER ── */
.dv2-chart-container {
  position: relative;
  height: 270px;
  min-height: 200px;
}
.dv2-chart-container canvas { display: block; width: 100% !important; height: 100% !important; }

/* ── LEGEND EXECUTIVE ── */
.dv2-legend-exec {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(100,116,139,0.08);
}
.dv2-legend-item-exec {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text5);
}
.dv2-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dv2-line-dot {
  width: 18px;
  height: 2.5px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── DESVIOS EXECUTIVE ── */
.dv2-desvios-exec {
  display: flex;
  flex-direction: column;
  max-height: 310px;
  overflow-y: auto;
}
@keyframes dv2DesvSlide {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.dv2-desv-row-exec {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(100,116,139,0.06);
  animation: dv2DesvSlide 0.3s ease both;
  transition: background 0.15s;
}
.dv2-desv-row-exec:hover { background: rgba(59,130,246,0.03); }
.dv2-desv-row-exec:last-child { border-bottom: none; }
.dv2-desv-rank {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text5);
  background: rgba(100,116,139,0.08);
  border-radius: 6px;
  flex-shrink: 0;
}
.dv2-desv-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dv2-desv-name-exec {
  font-size: 0.73rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.dv2-desv-bar-wrap {
  height: 5px;
  background: rgba(100,116,139,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.dv2-desv-bar-exec {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.dv2-desv-val-exec {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 80px;
}

/* ── TABLE EXECUTIVE ── */
.dv2-table-actions-exec {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dv2-action-btn-exec {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg2);
  color: var(--text5);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.dv2-action-btn-exec:hover { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.04); }
.dv2-action-btn-exec svg { width: 13px; height: 13px; }

.dv2-table-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 14px;
}
.dv2-table-search-input {
  font-size: 0.8125rem;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  width: 280px;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dv2-table-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}
.dv2-table-search-clear {
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text5);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.dv2-table-search-clear:hover { border-color: #ef4444; color: #ef4444; }

.dv2-table-wrap-exec {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.dv2-table-exec {
  width: 100%;
  border-collapse: collapse;
}
.dv2-tbl-head-exec {
  background: var(--bg2);
}
.dark .dv2-tbl-head-exec { background: rgba(30,41,59,0.9); }
.dv2-tbl-th-exec {
  padding: 10px 16px;
  font-size: 0.62rem;
  color: var(--text5);
  text-align: right;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.dv2-tbl-th-exec:hover { color: #3b82f6; }
.dv2-tbl-th-first {
  text-align: left;
  padding-left: 16px;
  min-width: 200px;
}
.dv2-tbl-row-exec {
  transition: background 0.12s;
}
.dv2-tbl-row-exec:hover {
  background: rgba(59,130,246,0.03) !important;
}
.dark .dv2-tbl-row-exec:hover {
  background: rgba(59,130,246,0.06) !important;
}
.dv2-tbl-td-exec {
  padding: 9px 16px;
  border-bottom: 1px solid rgba(100,116,139,0.08);
  color: var(--text);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dv2-tbl-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dv2-tbl-chevron {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  transition: transform 0.2s ease;
  opacity: 0.45;
}

/* ── ANIMATIONS ── */
@keyframes dv2FadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.dv2-kpi-grid-exec,
.dv2-grid-exec,
.dv2-section-grid > .dv2-card-exec,
.dv2-page > .dv2-card-exec {
  animation: dv2FadeIn 0.4s ease both;
}
.dv2-kpi-grid-exec { animation-delay: 0s; }
.dv2-section-grid > .dv2-card-exec:nth-child(2) { animation-delay: 0.03s; }
.dv2-section-grid > .dv2-card-exec:nth-child(3) { animation-delay: 0.06s; }
.dv2-section-grid > .dv2-card-exec:nth-child(4) { animation-delay: 0.08s; }
.dv2-section-grid > .dv2-card-exec:nth-child(5) { animation-delay: 0.10s; }
.dv2-section-grid > .dv2-card-exec:nth-child(n+6) { animation-delay: 0.14s; }
.dv2-grid-exec:nth-child(3) { animation-delay: 0.06s; }
.dv2-grid-exec:nth-child(4) { animation-delay: 0.12s; }
.dv2-page > .dv2-card-exec:last-child { animation-delay: 0.18s; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .dv2-header-exec-top { flex-direction: column; align-items: flex-start; }
  .dv2-filters-exec { gap: 10px; }
  .dv2-table-search-input { width: 100%; }
  .dv2-table-actions-exec { flex-wrap: wrap; gap: 6px; }
  .dv2-card-header-exec { flex-direction: column; align-items: flex-start; }
}

/* ─── DRE ──────────────────────────────────────────────────────────────────── */
.dre-exec-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.dre-exec-btn:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
  background: color-mix(in srgb, #8b5cf6 5%, transparent);
}
.dre-exec-btn-active {
  background: #8b5cf6 !important;
  color: #fff !important;
  border-color: #8b5cf6 !important;
  font-weight: 600 !important;
}
.dre-filter-card-exec {
  transition: box-shadow 0.25s, transform 0.25s;
}
.dre-filter-label-exec {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.dre-filter-divider {
  width: 1px;
  height: 22px;
  background: var(--border, #e2e8f0);
  flex-shrink: 0;
}
.dre-table-card-exec {
  transition: box-shadow 0.25s, transform 0.25s;
}
.dre-table-card-exec:hover {
  transform: translateY(-1px);
}
.dre-table-header-exec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border, #e2e8f0);
  flex-wrap: wrap;
  gap: 10px;
}
.dre-table-exec thead th {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text5);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.dre-row-n1 td { padding: 10px 14px; border-bottom: 1px solid var(--border, #e2e8f0); background: var(--table-header-bg, #f8fafc); font-variant-numeric: tabular-nums; }
.dre-row-n2 td { padding: 8px 14px; border-bottom: 1px solid var(--border, #e2e8f0); font-variant-numeric: tabular-nums; }
.dre-row-n3 td { padding: 6px 14px; border-bottom: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 50%, transparent); font-variant-numeric: tabular-nums; font-size: 0.75rem; }
.dre-row-total td { padding: 12px 14px; font-variant-numeric: tabular-nums; }
.dre-row-n1:hover td { background: color-mix(in srgb, #8b5cf6 5%, transparent); }
.dre-row-n2:hover td { background: color-mix(in srgb, #8b5cf6 3%, transparent); }
.dre-chevron { display: inline-flex; align-items: center; width: 20px; transition: transform 0.15s ease; }
.dre-chevron.open { transform: rotate(90deg); }
body.dark .dre-row-n1 td { background: rgba(30, 41, 59, 0.5); }
body.dark .dre-row-n1:hover td { background: rgba(139, 92, 246, 0.08); }


/* ─── FISCAL MAP ──────────────────────────────────────────────────────────── */
.fis-card-exec {
  transition: box-shadow 0.25s, transform 0.25s;
}
.fis-card-exec:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

.fis-exec-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.fis-exec-btn:hover {
  background: color-mix(in srgb, #8b5cf6 5%, transparent);
  border-color: color-mix(in srgb, #8b5cf6 30%, var(--border));
}

.fis-exec-btn-green:hover {
  background: color-mix(in srgb, #22c55e 5%, transparent);
  border-color: color-mix(in srgb, #22c55e 30%, var(--border));
}

.fis-exec-btn-danger:hover {
  background: color-mix(in srgb, #ef4444 5%, transparent);
  border-color: color-mix(in srgb, #ef4444 30%, var(--border));
  color: #ef4444;
}

.fis-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  color: var(--text3);
  padding: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.fis-icon-btn:hover {
  background: color-mix(in srgb, #8b5cf6 5%, transparent);
  border-color: color-mix(in srgb, #8b5cf6 30%, var(--border));
  color: #8b5cf6;
}

.fis-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.fis-input-exec {
  padding: 7px 10px 7px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.82rem;
  outline: none;
  transition: border 0.2s;
  width: 100%;
  font-family: 'Inter', sans-serif;
}
.fis-input-exec:focus {
  border-color: #8b5cf6;
}

.fis-table-card-exec {
  overflow: hidden;
}
.fis-table-card-exec:hover {
  transform: none;
}

.fis-table-header-exec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.fis-table-exec {
  width: 100%;
  border-collapse: collapse;
}
.fis-table-exec thead tr {
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
}
.fis-table-exec thead th {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text4);
  padding: 8px 10px;
  white-space: nowrap;
  user-select: none;
}
.fis-table-exec tbody tr {
  transition: background 0.15s;
}
.fis-table-exec tbody tr:hover {
  background: color-mix(in srgb, #8b5cf6 3%, transparent);
}

.fis-info-panel {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #8b5cf6 15%, transparent);
  background: color-mix(in srgb, #8b5cf6 4%, transparent);
  margin-bottom: 12px;
  transition: border-color 0.25s, background 0.25s;
}
.fis-info-panel[data-color="cyan"] {
  border-color: color-mix(in srgb, #06b6d4 15%, transparent);
  background: color-mix(in srgb, #06b6d4 4%, transparent);
}

.fis-state-btn {
  padding: 6px 18px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  font-family: 'Inter', sans-serif;
}
.fis-state-btn.active-rj {
  border-color: #8b5cf6;
  background: #8b5cf6;
  color: #fff;
  font-weight: 700;
}
.fis-state-btn.active-sc {
  border-color: #06b6d4;
  background: #06b6d4;
  color: #fff;
  font-weight: 700;
}

.fis-map-card {
  width: 340px;
  min-width: 260px;
  flex-shrink: 0;
  padding: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.25s;
}
.fis-map-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.fis-meta-card {
  flex: 1;
  min-width: 380px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--card-shadow);
}

.fis-pagination-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text3);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, border-color 0.15s;
}
.fis-pagination-btn:hover:not(:disabled) {
  background: color-mix(in srgb, #8b5cf6 5%, transparent);
  border-color: color-mix(in srgb, #8b5cf6 30%, var(--border));
}
.fis-pagination-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════════
   DRE V2 PAGE
   ═══════════════════════════════════════════════════════════════ */
.drev2-exec-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.drev2-exec-btn:hover {
  background: color-mix(in srgb, #8b5cf6 5%, transparent);
  border-color: color-mix(in srgb, #8b5cf6 30%, var(--border));
}

.drev2-table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.drev2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.drev2-th {
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text5);
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
}
.drev2-th-left { text-align: left; }
.drev2-th-right { text-align: right; }
.drev2-th-sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bg2);
}

.drev2-subheader .drev2-th-sub {
  padding: 5px 14px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8b5cf6;
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
}

.drev2-td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}
.drev2-td-label {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.drev2-td-val { text-align: right; font-variant-numeric: tabular-nums; }
.drev2-td-pct { text-align: right; color: var(--text5); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.drev2-td-n2 {
  padding-left: 36px !important;
  font-weight: 400;
  color: var(--text3);
  font-size: 0.75rem;
}

.drev2-row-n1 { transition: background 0.15s; }
.drev2-row-n1:hover { background: color-mix(in srgb, #8b5cf6 3%, transparent); }
.drev2-row-n1 .drev2-th-sticky { background: var(--card-bg, #fff); }

.drev2-row-result {
  font-weight: 700;
}
.drev2-row-result .drev2-td { font-weight: 700; }
.drev2-row-result .drev2-td-label { color: var(--text); }
.drev2-row-result .drev2-th-sticky { background: var(--card-bg, #fff); }

.drev2-row-n2 { background: color-mix(in srgb, #8b5cf6 2%, transparent); }
.drev2-row-n2:hover { background: color-mix(in srgb, #8b5cf6 5%, transparent); }
.drev2-row-n2 .drev2-th-sticky { background: color-mix(in srgb, #8b5cf6 2%, var(--card-bg, #fff)); }
.drev2-row-pct { background: color-mix(in srgb, #8b5cf6 5%, transparent); border-top: none; }
.drev2-row-pct td { padding-top: 0 !important; padding-bottom: 6px !important; font-size: 0.72rem; color: #8b5cf6; font-weight: 600; }
.drev2-row-pct .drev2-th-sticky { background: color-mix(in srgb, #8b5cf6 5%, var(--card-bg, #fff)); }

.drev2-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  color: #8b5cf6;
  transition: transform 0.2s, background 0.15s;
  flex-shrink: 0;
}
.drev2-chevron:hover { background: rgba(139,92,246,0.1); }
.drev2-chevron-open { transform: rotate(90deg); }

/* ─── PAGE NAV DESPESAS ─── */
.dv2-page-nav { display: flex; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.dv2-page-nav-btn { padding: 6px 14px; font-size: 0.8125rem; font-weight: 600; font-family: Inter, sans-serif; color: var(--text5); background: transparent; border: none; cursor: pointer; transition: all 0.18s; position: relative; white-space: nowrap; }
.dv2-page-nav-btn:hover { color: var(--text2); background: rgba(59,130,246,0.06); }
.dv2-page-nav-active { color: #fff !important; background: #3b82f6 !important; }
.dark .dv2-page-nav { background: rgba(30,41,59,0.6); border-color: rgba(71,85,105,0.3); }
.dv2-page-nav-divider { width: 1px; height: 20px; background: var(--border); }

/* ─── HEATMAP DESPESAS ─── */
.dv2-hm-wrap { overflow-x: auto; border-radius: 10px; }
.dv2-hm-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dv2-hm-th-name { text-align: left; padding: 10px 14px; font-size: 0.75rem; font-weight: 700; color: var(--text5); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); width: 140px; background: rgba(15,23,42,0.03); }
.dark .dv2-hm-th-name { background: rgba(15,23,42,0.5); }
.dv2-hm-th { text-align: center; padding: 10px 4px; font-size: 0.75rem; font-weight: 600; color: var(--text5); border-bottom: 1px solid var(--border); }
.dv2-hm-th-total { text-align: center; padding: 10px 8px; font-size: 0.75rem; font-weight: 700; color: var(--text5); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); width: 80px; background: rgba(15,23,42,0.03); }
.dark .dv2-hm-th-total { background: rgba(15,23,42,0.5); }
.dv2-hm-td-name { padding: 8px 14px; font-size: 0.78rem; font-weight: 600; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; background: rgba(15,23,42,0.02); }
.dark .dv2-hm-td-name { background: rgba(15,23,42,0.3); }
.dv2-hm-td { padding: 4px 3px; text-align: center; cursor: pointer; }
.dv2-hm-td-total { padding: 4px 6px; text-align: center; background: rgba(15,23,42,0.02); }
.dark .dv2-hm-td-total { background: rgba(15,23,42,0.3); }
.dv2-hm-cell { border-radius: 6px; padding: 6px 2px; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; min-height: 30px; transition: transform 0.12s, box-shadow 0.12s; }
.dv2-hm-td:hover .dv2-hm-cell { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.dv2-hm-cell span { font-size: 0.72rem; font-weight: 700; }
.dv2-hm-foot { border-top: 2px solid var(--border); }
.dv2-hm-foot .dv2-hm-td-name { background: rgba(15,23,42,0.05); }
.dark .dv2-hm-foot .dv2-hm-td-name { background: rgba(15,23,42,0.5); }

.dv2-hm-legend { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 14px; flex-wrap: wrap; }
.dv2-hm-legend-label { font-size: 0.68rem; color: var(--text5); font-weight: 500; margin-right: 6px; }
.dv2-hm-legend-item { display: flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 5px; border: 1px solid transparent; }
.dv2-hm-legend-dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.dv2-hm-legend-item span { font-size: 0.6rem; font-weight: 600; }
.dv2-hm-legend-note { font-size: 0.6rem; color: var(--text5); margin-left: 8px; }

.dv2-hm-tooltip { position: fixed; transform: translate(-50%, -100%); background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.18); z-index: 9999; pointer-events: none; font-size: 0.75rem; color: var(--text); display: none; min-width: 180px; }
.dark .dv2-hm-tooltip { background: #1e293b; border-color: rgba(51,65,85,0.8); box-shadow: 0 8px 32px rgba(0,0,0,0.4); color: #f8fafc; }
.dv2-hm-tip-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 0.72rem; }

.dv2-alert-panel { background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.18); border-radius: 10px; padding: 14px 18px; margin-top: 18px; }
.dark .dv2-alert-panel { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.25); }
.dv2-alert-header { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; color: #dc2626; margin-bottom: 10px; }
.dark .dv2-alert-header { color: #f87171; }
.dv2-alert-list { display: flex; flex-wrap: wrap; gap: 8px; }
.dv2-alert-item { display: flex; align-items: center; gap: 6px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.15); border-radius: 7px; padding: 5px 10px; cursor: default; transition: background 0.15s, border-color 0.15s; }
.dv2-alert-item:hover { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.28); }
.dark .dv2-alert-item { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.22); }
.dark .dv2-alert-item:hover { background: rgba(239,68,68,0.20); border-color: rgba(239,68,68,0.35); }
.dv2-alert-icon { color: #ef4444; flex-shrink: 0; }
.dark .dv2-alert-icon { color: #f87171; }
.dv2-alert-cr { font-size: 0.75rem; font-weight: 700; color: var(--text2); }
.dv2-alert-detail { font-size: 0.68rem; color: var(--text5); font-weight: 500; }

#fa-brazil-map svg path { transition: fill 0.2s, opacity 0.2s, filter 0.2s; }
#fa-brazil-map svg path:hover { opacity: 0.85; }
#fa-brazil-map svg path[id="BR-RJ"]:hover { fill: #7c3aed !important; filter: drop-shadow(0 0 10px rgba(139,92,246,0.7)); }
#fa-brazil-map svg path[id="BR-SC"]:hover { fill: #0891b2 !important; filter: drop-shadow(0 0 10px rgba(6,182,212,0.7)); }
#fa-map-tooltip { position: fixed; pointer-events: none; z-index: 9999; background: rgba(15,23,42,0.92); color: #f1f5f9; font-size: 0.72rem; padding: 6px 10px; border-radius: 6px; backdrop-filter: blur(4px); white-space: nowrap; opacity: 0; transition: opacity 0.15s; }
#fa-map-tooltip.visible { opacity: 1; }
