/* ============================================================
   SEPOF Painel Estratégico — Global Stylesheet
   Fiocruz Brasília (GEREB)
   ============================================================ */

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* ── Dark theme (padrão) ──────────────────────────────── */
  --bg-primary:    #0D1117;
  --bg-secondary:  #161B22;
  --bg-tertiary:   #21262D;
  --text-primary:  #E6EDF3;
  --text-secondary:#8B949E;
  --text-muted:    #484F58;
  --border:        #30363D;

  /* ── Marca / Paleta OEs 2030 ────────────────────────────── */
  --color-orange:  #E8780A;
  --color-blue:    #1C3A6B;
  --color-purple:  #7C3AED;
  --color-cyan:    #2563EB;
  --color-green:   #00FF9F;
  --color-red:     #FF3B6B;
  --color-yellow:  #FFD600;

  /* ── Aliases legados ────────────────────────────────────── */
  --orange:        var(--color-orange);
  --orange-dim:    rgba(232, 120, 10, 0.15);
  --orange-glow:   rgba(232, 120, 10, 0.35);
  --blue-dark:     var(--color-blue);
  --blue-mid:      var(--color-cyan);
  --purple:        var(--color-purple);
  --green-neon:    var(--color-green);
  --red-neon:      var(--color-red);
  --yellow-neon:   var(--color-yellow);
  --blue-neon:     #00C8FF;
  --border-orange: rgba(232, 120, 10, 0.25);

  /* ── Glows ──────────────────────────────────────────────── */
  --glow-orange:   0 0 24px rgba(232, 120, 10, 0.45);
  --glow-green:    0 0 16px rgba(0, 255, 159, 0.4);
  --glow-red:      0 0 16px rgba(255, 59, 107, 0.4);
  --glow-yellow:   0 0 16px rgba(255, 214, 0, 0.4);

  /* ── Layout ─────────────────────────────────────────────── */
  --sidebar-w:     260px;
  --header-h:      62px;
  --radius:        10px;
  --radius-sm:     6px;

  /* ── Typography ─────────────────────────────────────────── */
  --font:          'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }
img { display: block; }

/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: 1.6rem;  font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: 0.9rem;  font-weight: 600; }
small, .text-sm { font-size: 0.8rem; }
.text-secondary { color: var(--text-secondary); }
.text-orange    { color: var(--orange); }

/* ── Utilities ────────────────────────────────────────────── */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #30363D; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.login-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ── Left branding panel ──────────────────────────────────── */
.login-left {
  position: relative;
  width: 42%;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  overflow: hidden;
  border-right: 1px solid var(--border-orange);
}

/* Subtle grid background */
.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.6;
  pointer-events: none;
}

/* Radial glow centre */
.login-left::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(232, 120, 10, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-branding {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 320px;
}

.login-logo {
  width: 220px;
  margin: 0 auto 2.5rem;
  filter: drop-shadow(0 0 12px rgba(232, 120, 10, 0.3));
}

.login-label-sm {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin: 0.25rem 0;
}

.login-app-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
  line-height: 1.05;
  margin: 0.15rem 0;
}
.login-app-title span {
  color: var(--orange);
  text-shadow: var(--glow-orange);
}

.login-sep-line {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  margin: 1.75rem auto;
  box-shadow: var(--glow-orange);
}

.login-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: center;
}
.login-description strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Bottom accent line */
.login-left-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  box-shadow: var(--glow-orange);
}

/* ── Right form panel ─────────────────────────────────────── */
.login-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: var(--bg-primary);
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-orange);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border);
}

.login-card-header {
  margin-bottom: 2rem;
  text-align: center;
}
.login-card-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}
.login-card-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* Form */
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper > svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.input-wrapper input {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
}
.input-wrapper input::placeholder { color: var(--text-muted); }
.input-wrapper input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

/* Show/hide password toggle */
.btn-toggle-pw {
  position: absolute;
  right: 14px;
  padding: 4px;
  color: var(--text-muted);
  transition: color 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  pointer-events: all;
  z-index: 1;
}
.btn-toggle-pw:hover { color: var(--text-secondary); }
.btn-toggle-pw svg { width: 16px; height: 16px; pointer-events: none; }

/* Extra right padding on password inputs to avoid text/icon overlap */
.input-wrapper input[type="password"] { padding-right: 2.75rem; }

/* Error message */
.login-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 59, 107, 0.1);
  border: 1px solid rgba(255, 59, 107, 0.3);
  border-radius: var(--radius-sm);
  color: var(--red-neon);
  font-size: 0.83rem;
  box-shadow: var(--glow-red);
}
.login-error svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Submit button */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1.5rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #E8780A 0%, #F59E0B 100%);
  color: #0D1117;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  transition: opacity 0.15s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 4px 16px var(--orange-glow);
}
.btn-login:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 4px 28px rgba(232, 120, 10, 0.6);
  transform: translateY(-1px);
}
.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn-login .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13, 17, 23, 0.3);
  border-top-color: #0D1117;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.login-footer {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .login-container { flex-direction: column; }
  .login-left { width: 100%; min-height: auto; padding: 2.5rem 1.5rem; }
  .login-logo { width: 180px; }
  .login-app-title { font-size: 1.5rem; }
  .login-right { padding: 2rem 1rem; }
  .login-card { padding: 1.75rem 1.25rem; }
}

/* ============================================================
   APP SHELL
   ============================================================ */

.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar content";
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────── */
#app-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.btn-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.btn-menu-toggle:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-menu-toggle svg { width: 18px; height: 18px; }

#page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Favoritos — estrela no header ──────────────────────── */
.fav-star {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0.4;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.fav-star:hover { opacity: 0.7; }
.fav-star.fav-star-ativo { opacity: 1; }
.fav-star.fav-star-ativo svg { fill: #F68220; stroke: #F68220; }
@keyframes fav-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.fav-star-pop { animation: fav-pop 0.2s ease; }

/* ── Favoritos — toast ───────────────────────────────────── */
.fav-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
}
.fav-toast.show { opacity: 1; transform: translateY(0); }

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.header-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--orange-dim);
  border: 1.5px solid var(--border-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--orange);
  flex-shrink: 0;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-logout:hover {
  background: rgba(255, 59, 107, 0.1);
  color: var(--red-neon);
  border-color: rgba(255, 59, 107, 0.3);
}
.btn-logout svg { width: 14px; height: 14px; }

/* ── Sidebar ──────────────────────────────────────────────── */
#app-sidebar {
  grid-area: sidebar;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.22s ease, transform 0.22s ease;
  z-index: 50;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.1rem;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}
.sidebar-brand-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
  letter-spacing: 1px;
}
.sidebar-brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.sidebar-logo-img {
  height: 36px;
  width: auto;
  max-width: 210px;
  display: block;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.6rem;
  overflow-y: auto;
}

.nav-section { margin-bottom: 0.25rem; }

.nav-quicklinks {
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem !important;
  border-bottom: 1px solid var(--border);
}

.nav-section-title {
  padding: 0.5rem 0.75rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.nav-item > a,
.nav-item > button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: 100%;
  text-align: left;
  transition: background 0.13s, color 0.13s;
  position: relative;
}
.nav-item > a svg,
.nav-item > button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.nav-item > a:hover,
.nav-item > button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.nav-item.active > a,
.nav-item.active > button {
  background: var(--orange-dim);
  color: var(--orange);
  font-weight: 600;
}
.nav-item.active > a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--orange);
  box-shadow: var(--glow-orange);
}

/* Collapsible group */
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: 100%;
  text-align: left;
  transition: background 0.13s, color 0.13s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-group-toggle:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-group-toggle svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-group-chevron {
  margin-left: auto;
  width: 14px !important;
  height: 14px !important;
  transition: transform 0.2s;
}
.nav-group.open .nav-group-chevron { transform: rotate(90deg); }
.nav-group-label { font-size: 0.85rem; }

.nav-sub {
  display: none;
  padding-left: 1.5rem;
  margin-top: 0.1rem;
}
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item > a {
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
}

/* Sub-submenu aninhado (ex: Relatórios dentro do CGEP) */
.nav-sub-nested {
  padding-left: 0.75rem;
  margin-top: 0;
}
.nav-sub-nested .nav-item > a {
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  opacity: 0.85;
}
.nav-sub-nested .nav-item > a:hover { opacity: 1; }
.nav-group-toggle-sub {
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nav-group-toggle-sub:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-group-toggle-sub .nav-group-chevron { margin-left: auto; }

/* Sidebar footer */
.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-version {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Main content ─────────────────────────────────────────── */
#app-content {
  grid-area: content;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-primary);
}

/* ── Sidebar oculta (toggle ☰) ────────────────────────────── */
.app-body.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}
.app-body.sidebar-collapsed #app-sidebar {
  transform: translateX(-100%);
  width: var(--sidebar-w);
}

/* ── Loading overlay ──────────────────────────────────────── */
#auth-loading {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 1rem;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-shadow: var(--glow-orange);
}
.loading-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================================
   COMPONENT TOKENS — Cards, Badges, Buttons, Tables
   ============================================================ */

/* Card */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: rgba(0,255,159,0.12);  color: var(--green-neon);  box-shadow: 0 0 8px rgba(0,255,159,0.2); }
.badge-yellow { background: rgba(255,214,0,0.12);  color: var(--yellow-neon); box-shadow: 0 0 8px rgba(255,214,0,0.2); }
.badge-red    { background: rgba(255,59,107,0.12); color: var(--red-neon);    box-shadow: 0 0 8px rgba(255,59,107,0.2); }
.badge-blue   { background: rgba(37,99,235,0.15);  color: #60A5FA; }
.badge-gray   { background: rgba(139,148,158,0.12); color: var(--text-secondary); }
.badge-orange { background: var(--orange-dim); color: var(--orange); }

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.progress-fill.green  { background: var(--green-neon);  box-shadow: var(--glow-green); }
.progress-fill.yellow { background: var(--yellow-neon); box-shadow: var(--glow-yellow); }
.progress-fill.red    { background: var(--red-neon);    box-shadow: var(--glow-red); }
.progress-fill.orange { background: var(--orange);      box-shadow: var(--glow-orange); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary {
  background: linear-gradient(135deg, #E8780A, #F59E0B);
  color: #0D1117;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--orange-glow);
}
.btn-primary:hover { opacity: 0.88; box-shadow: 0 2px 20px rgba(232,120,10,0.5); }
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: #2D333B; border-color: rgba(255,255,255,0.12); }
.btn-danger {
  background: rgba(255,59,107,0.1);
  color: var(--red-neon);
  border-color: rgba(255,59,107,0.25);
}
.btn-danger:hover { background: rgba(255,59,107,0.2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.data-table thead tr {
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Placeholder / empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-secondary);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 1rem; opacity: 0.3; }
.empty-state h3 { font-size: 1rem; margin-bottom: 0.4rem; color: var(--text-secondary); }
.empty-state p  { font-size: 0.84rem; color: var(--text-muted); }

/* Construction placeholder */
.construcao {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  color: var(--text-secondary);
}
.construcao-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}
.construcao h2 { font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.construcao p  { font-size: 0.85rem; color: var(--text-secondary); }

/* ============================================================
   DASHBOARD
   ============================================================ */

/* ── Filter bar ───────────────────────────────────────────── */
.dash-filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dash-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.dash-filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.dash-select {
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B949E' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  min-width: 160px;
  transition: border-color 0.15s;
}
.dash-select:focus { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-dim); }
.dash-update-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  align-self: flex-end;
  padding-bottom: 0.45rem;
  margin-left: auto;
}

/* ── Summary cards ────────────────────────────────────────── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) { .dash-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .dash-cards { grid-template-columns: 1fr; } }

.dash-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dash-card:hover {
  border-color: color-mix(in srgb, var(--dash-card-color) 40%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--dash-card-color) 20%, transparent);
}
.dash-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.dash-card-value {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--dash-card-color, var(--orange));
  text-shadow: 0 0 24px color-mix(in srgb, var(--dash-card-color, var(--orange)) 60%, transparent);
  margin-bottom: 0.5rem;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
}
.dash-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.dash-card-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in srgb, var(--dash-card-color) 80%, transparent),
    transparent
  );
}

/* ── Chart containers ─────────────────────────────────────── */
.dash-chart-wrap {
  position: relative;
}
.dash-chart-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  z-index: 2;
}
.dash-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 1;
}
.dash-chart-empty[hidden] { display: none; }

/* ── 2-column grid (uso genérico) ───────────────────────── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 820px) { .dash-grid-2 { grid-template-columns: 1fr; } }

/* ── Grid dos 5 gráficos do dashboard ───────────────────── */
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  grid-template-rows: auto auto auto;
  gap: 1rem;
}
.chart-projetos { grid-area: 1 / 1 / 2 / 2; }
.chart-produtos { grid-area: 2 / 1 / 3 / 2; }
.chart-macro    { grid-area: 1 / 2 / 3 / 3; }
.chart-faixas   { grid-area: 3 / 1 / 4 / 2; }
.chart-execucao { grid-area: 3 / 2 / 4 / 3; }
@media (max-width: 820px) {
  .dashboard-charts-grid { grid-template-columns: 1fr; }
  .chart-projetos, .chart-produtos, .chart-macro,
  .chart-faixas, .chart-execucao { grid-area: unset; }
}

/* ── Faixas table ─────────────────────────────────────────── */
.dash-faixa-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.dash-faixa-count {
  text-align: right;
  font-weight: 700;
  font-size: 1rem;
}
.dash-faixa-pct {
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.dash-faixas-note {
  padding: 0.6rem 0.9rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

/* ── Error banner ─────────────────────────────────────────── */
.dash-error-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: rgba(255,59,107,0.1);
  border: 1px solid rgba(255,59,107,0.3);
  border-radius: var(--radius-sm);
  color: var(--red-neon);
  font-size: 0.84rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--glow-red);
}
.dash-error-banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.dash-error-banner code {
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* ── CSS aliases (usados pelo módulo SAGE e por toda a app) ── */
:root {
  --surface-1:   var(--bg-secondary);
  --surface-2:   var(--bg-tertiary);
  --accent:      #E8780A;       /* Laranja Fiocruz — cor de destaque principal */
  --accent-rgb:  232, 120, 10;  /* Para uso em rgba(var(--accent-rgb), 0.x) */
}

/* ============================================================
   SAGE MODULE — Iniciativas (Cadastro + Metas Físicas)
   ============================================================ */

/* ── Page layout ─────────────────────────────────────────── */
.sage-page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

/* ── Filter bar ──────────────────────────────────────────── */
.sage-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sage-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sage-filter-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sage-search {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 0.4rem 0.65rem;
  min-width: 200px;
  outline: none;
  transition: border-color 0.15s;
}
.sage-search:focus { border-color: var(--accent); }

/* Filtro ativo: destaque laranja no dropdown/input */
.dash-select.filter-active,
.sage-search.filter-active {
  border-color: var(--accent);
  background-color: rgba(var(--accent-rgb), 0.06);
}

/* Info "Exibindo X de Y registros" */
.sage-filter-info {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 0.15rem;
  letter-spacing: 0.02em;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.sage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sage-toolbar-left,
.sage-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-danger {
  background: rgba(255,59,107,0.12);
  color: var(--red-neon);
  border: 1px solid rgba(255,59,107,0.3);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-danger:hover:not(:disabled) { background: rgba(255,59,107,0.22); box-shadow: var(--glow-red); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Excel Table wrapper ─────────────────────────────────── */
.xt-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
}
.xt-scroll {
  flex: 1;
  overflow: auto;
}
.xt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  color: var(--text-primary);
  outline: none;
  table-layout: auto;
}
.xt-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.xt-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
  user-select: none;
}
.xt-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  vertical-align: middle;
}
.xt-table tbody tr:hover td { background: rgba(246,130,32,0.05); }
.xt-table tbody tr:last-child td { border-bottom: none; }
.xt-chk-col {
  width: 36px;
  min-width: 36px !important;
  text-align: center !important;
  padding: 0.45rem 0.4rem !important;
}
.xt-table input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.xt-td { position: relative; }
.xt-sel { background: rgba(var(--accent-rgb),0.12) !important; outline: 2px solid var(--accent) !important; outline-offset: -2px; }
.xt-row-sel td { background: rgba(var(--accent-rgb),0.06); }
.xt-row-sel td.xt-sel { background: rgba(var(--accent-rgb),0.18) !important; }
.xt-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Cell edit input ─────────────────────────────────────── */
.xt-inp {
  width: 100%;
  background: var(--surface-2);
  border: 2px solid var(--accent);
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 0.83rem;
  font-family: inherit;
  padding: 0.15rem 0.4rem;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,212,255,0.15);
  min-width: 80px;
}

/* ── Footer + Pagination ─────────────────────────────────── */
.xt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  gap: 0.5rem;
  flex-wrap: wrap;
}
.xt-total {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.xt-pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.xt-pg-btn {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s;
}
.xt-pg-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text-primary); }
.xt-pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.xt-pg-nums { display: flex; align-items: center; gap: 0.2rem; }
.xt-pg {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
  min-width: 28px;
  text-align: center;
  transition: background 0.12s, border-color 0.12s;
}
.xt-pg:hover { background: var(--surface-2); border-color: var(--border); color: var(--text-primary); }
.xt-pg-cur {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #000 !important;
  font-weight: 600;
}
.xt-pg-dots {
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0 0.15rem;
}

/* ── Faixa badge ─────────────────────────────────────────── */
.faixa-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}

/* ── Pct progress bar ────────────────────────────────────── */
.pct-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 110px;
}
.pct-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.pct-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.pct-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 38px;
  text-align: right;
}

/* ── Modal overlay ───────────────────────────────────────── */
.sage-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.sage-modal-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.15s ease;
}
@keyframes modalIn {
  from { opacity:0; transform: scale(0.95) translateY(-8px); }
  to   { opacity:1; transform: scale(1)    translateY(0);    }
}
.sage-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.sage-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.sage-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
}
.sage-modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.sage-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
.sage-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.sage-modal-err {
  font-size: 0.82rem;
  color: var(--red-neon);
  flex: 1;
  margin: 0;
}

/* ── Form inside modal ───────────────────────────────────── */
.sage-form { display: flex; flex-direction: column; gap: 0.75rem; }
.sage-form-row { display: flex; flex-direction: column; gap: 0.3rem; }
.sage-form-row label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.sage-inp {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  padding: 0.45rem 0.65rem;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.sage-inp:focus { border-color: var(--accent); }
.sage-inp[readonly] { opacity: 0.6; cursor: not-allowed; }
textarea.sage-inp { resize: vertical; min-height: 60px; }
.sage-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.sage-form-info { flex-direction: row; align-items: center; gap: 0.5rem; }
.sage-form-info label { white-space: nowrap; }
.sage-form-info span { color: var(--text-secondary); font-size: 0.85rem; }

/* ── Export modal ────────────────────────────────────────── */
.export-options {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
}
.export-option-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-primary);
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.export-option-btn:hover { border-color: var(--accent); background: rgba(0,212,255,0.06); }
.export-option-btn .export-icon { font-size: 2rem; }
.export-option-btn .export-label { font-size: 0.95rem; font-weight: 600; }
.export-option-btn .export-desc  { font-size: 0.75rem; color: var(--text-muted); text-align: center; }

/* ============================================================
   EXCEL TABLE — Melhorias v2: resize, sticky, scroll shadows
   ============================================================ */

/* ── Cabeçalho com posição relativa (para handle) ─────────── */
.xt-table th { position: relative !important; }

/* ── Handle de redimensionamento ─────────────────────────── */
.xt-resizer {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 7px;
  cursor: col-resize;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.xt-resizer::after {
  content: '';
  width: 2px;
  height: 55%;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.15s;
}
.xt-table th:hover .xt-resizer::after { opacity: 0.6; }
.xt-wrap.xt-resizing { cursor: col-resize !important; }
.xt-wrap.xt-resizing * { cursor: col-resize !important; user-select: none !important; }
.xt-wrap.xt-resizing .xt-resizer::after { opacity: 1 !important; }

/* ── Coluna fixa (#) ──────────────────────────────────────── */
.xt-col-sticky {
  position: sticky;
  left: 0;
  z-index: 1;
}
.xt-table thead .xt-col-sticky { z-index: 3; }

.xt-th-num {
  text-align: center !important;
  width: 48px;
  min-width: 48px !important;
  background: var(--bg-tertiary) !important;
  border-right: 1px solid rgba(255,255,255,0.1) !important;
}
.xt-td-num {
  text-align: center;
  font-size: 0.71rem;
  color: var(--text-muted);
  user-select: none;
  cursor: pointer;
  width: 48px;
  min-width: 48px !important;
  padding: 0.45rem 0.35rem !important;
  background: var(--bg-secondary);
  border-right: 1px solid rgba(255,255,255,0.06);
  transition: background 0.1s, color 0.1s;
}
.xt-table tbody tr:hover .xt-td-num {
  background: rgba(246,130,32,0.09);
  color: var(--text-secondary);
  box-shadow: inset 3px 0 0 var(--color-orange);
}
.xt-table tbody tr.xt-row-sel .xt-td-num {
  background: rgba(var(--accent-rgb),0.08);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-orange);
}
.xt-table tbody tr.xt-row-sel:hover .xt-td-num {
  background: rgba(var(--accent-rgb),0.13);
}

/* ── Sombras de scroll (left / right) ─────────────────────── */
.xt-scroll { transition: box-shadow 0.2s; }
.xt-scroll.xt-shadow-left {
  box-shadow: inset 10px 0 14px -7px rgba(0,0,0,0.55);
}
.xt-scroll.xt-shadow-right {
  box-shadow: inset -10px 0 14px -7px rgba(0,0,0,0.55);
}
.xt-scroll.xt-shadow-left.xt-shadow-right {
  box-shadow:
    inset 10px  0 14px -7px rgba(0,0,0,0.55),
    inset -10px 0 14px -7px rgba(0,0,0,0.55);
}

/* ── Scrollbar fina tema escuro ───────────────────────────── */
.xt-scroll::-webkit-scrollbar        { width: 5px; height: 5px; }
.xt-scroll::-webkit-scrollbar-track  { background: transparent; }
.xt-scroll::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.18); border-radius: 3px; }
.xt-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }
.xt-scroll::-webkit-scrollbar-corner { background: var(--bg-secondary); }

/* ============================================================
   TEMA LIGHT — variáveis e overrides
   ============================================================ */
[data-theme="light"] {
  --bg-primary:    #F5F5F0;
  --bg-secondary:  #FFFFFF;
  --bg-tertiary:   #EAEAEA;
  --text-primary:  #1A1A2E;
  --text-secondary:#555577;
  --text-muted:    #888899;
  --border:        #D0D0D0;
  --surface-1:     var(--bg-secondary);
  --surface-2:     var(--bg-tertiary);
  --glow-orange:   0 0 20px rgba(232,120,10,0.3);
  --glow-green:    0 0 14px rgba(0,255,159,0.25);
  --glow-red:      0 0 14px rgba(255,59,107,0.25);
  --glow-yellow:   0 0 14px rgba(255,214,0,0.25);
}

/* ── Overrides para cores hardcoded dark-only ───────────── */
[data-theme="light"] .btn-secondary:hover {
  background: #e2e2de;
  border-color: rgba(0,0,0,0.18);
}
[data-theme="light"] .btn-secondary { color: var(--text-primary); }

[data-theme="light"] .xt-th-num {
  border-right-color: rgba(0,0,0,0.15) !important;
}
[data-theme="light"] .xt-td-num {
  border-right-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .xt-wrap.xt-resizing .xt-resizer::after { opacity: 1 !important; }

[data-theme="light"] .xt-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
}
[data-theme="light"] .xt-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.35);
}
[data-theme="light"] .xt-scroll::-webkit-scrollbar-corner { background: #eaeaea; }
[data-theme="light"] .xt-scroll.xt-shadow-left  { box-shadow: inset 10px 0 14px -7px rgba(0,0,0,0.12); }
[data-theme="light"] .xt-scroll.xt-shadow-right { box-shadow: inset -10px 0 14px -7px rgba(0,0,0,0.12); }
[data-theme="light"] .xt-scroll.xt-shadow-left.xt-shadow-right {
  box-shadow: inset 10px 0 14px -7px rgba(0,0,0,0.12), inset -10px 0 14px -7px rgba(0,0,0,0.12);
}
[data-theme="light"] .xt-inp { background: #fff; }
[data-theme="light"] .sage-modal-close:hover { background: rgba(0,0,0,0.07); }
[data-theme="light"] .sage-modal-overlay { background: rgba(0,0,0,0.35); }

/* ═══════════════════════════════════════════════════════════════
   DRAWER — painel lateral deslizante (cadastro/edição)
═══════════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-overlay.visivel { opacity: 1; pointer-events: auto; }

.drawer-right {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 520px;
  max-width: 100vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -6px 0 40px rgba(0, 0, 0, 0.45);
}
.drawer-right.aberto { transform: translateX(0); }

/* ── Header ─────────────────────────────────────────────── */
.drawer-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}
.drawer-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-orange);
  margin: 0;
}
.drawer-title {
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}
.drawer-title em {
  font-style: italic;
  color: var(--color-orange);
}
.drawer-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.drawer-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ── Body ────────────────────────────────────────────────── */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem;
}
.drawer-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* ── Form fields ─────────────────────────────────────────── */
.drawer-field { display: flex; flex-direction: column; gap: 6px; }
.drawer-field-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.drawer-inp {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.drawer-inp:focus {
  border-color: var(--color-orange);
  outline: none;
  box-shadow: 0 0 0 2px rgba(246,130,32,0.15);
}
textarea.drawer-inp { resize: vertical; }
.drawer-field-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.6rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.drawer-field-info strong { color: var(--text-primary); font-size: 0.9rem; }
.drawer-field-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.drawer-sep { border: none; border-top: 1px solid var(--border); margin: 0.1rem 0; }

/* ── Footer ─────────────────────────────────────────────── */
.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-secondary);
  flex-wrap: wrap;
}
.drawer-footer-hint {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.drawer-footer-btns { display: flex; gap: 0.5rem; }
.drawer-err {
  width: 100%;
  font-size: 0.8rem;
  color: #FF3B6B;
  margin: 0 0 0.35rem;
  order: -1;
}

/* ── Light mode ─────────────────────────────────────────── */
[data-theme="light"] .drawer-right  { background: #fff; }
[data-theme="light"] .drawer-footer { background: #fff; }
[data-theme="light"] .drawer-inp    { background: #f9fafb; color: #1a1a2e; border-color: #d1d5db; }
[data-theme="light"] .drawer-field-info { background: #f3f4f6; }

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 560px) { .drawer-right { width: 100vw; } }

/* ── Table row hover: light mode ────────────────────────── */
[data-theme="light"] .xt-table tbody tr:hover td       { background: rgba(246,130,32,0.06); }
[data-theme="light"] .xt-table tbody tr:hover .xt-td-num { background: rgba(246,130,32,0.10); }

/* ── Gráficos: neons mais opacos no fundo claro ─────────── */
[data-theme="light"] .dash-faixa-item[style*="color:#00FF9F"],
[data-theme="light"] .dash-faixa-item[style*="color:#FF3B6B"] { opacity: 0.9; }

/* ── Scroll da sidebar (light) ───────────────────────────── */
[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); }

/* ============================================================
   TRANSIÇÃO SUAVE DE TEMA
   Classe aplicada temporariamente via JS durante a troca
   ============================================================ */
.theme-transitioning,
.theme-transitioning * {
  transition:
    background-color 0.35s ease,
    color 0.25s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease !important;
}

/* ============================================================
   TOGGLE DE TEMA — Sidebar footer
   ============================================================ */
.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}
.sidebar-version {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-align: center;
}
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.theme-icon {
  font-size: 0.9rem;
  user-select: none;
  line-height: 1;
}
.theme-icon.ti-dark  { opacity: 0.5; }
.theme-icon.ti-light { opacity: 0.5; }
[data-theme="dark"]  .theme-icon.ti-dark  { opacity: 1; }
[data-theme="light"] .theme-icon.ti-light { opacity: 1; }

.theme-pill {
  width: 42px;
  height: 22px;
  border-radius: 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s;
}
.theme-pill:hover { border-color: var(--accent); }
.theme-pill-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.25s ease, background 0.25s;
  pointer-events: none;
}
[data-theme="light"] .theme-pill {
  background: var(--accent);
  border-color: var(--accent);
}
[data-theme="light"] .theme-pill-thumb {
  transform: translateX(20px);
  background: #fff;
}

/* ═══════════════════════════════════════════════════════════
   Direcionamento Estratégico
═══════════════════════════════════════════════════════════ */

/* ── Container ───────────────────────────────────────────── */
.de-page {
  min-height: 100%;
  padding: 0 0 2rem;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

/* ── Animação de entrada (ativada pelo IntersectionObserver) */
.de-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.de-section.de-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Seção 1: Hero ──────────────────────────────────────── */
.de-hero {
  min-height: 25vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232,120,10,0.08) 0%, transparent 65%);
}

.de-hero-inner {
  max-width: 680px;
  width: 100%;
}

.de-logo-wrap {
  margin-bottom: 1.75rem;
  display: flex;
  justify-content: center;
}

.de-logo {
  max-width: 180px;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 20px rgba(232,120,10,0.38));
  transition: filter 0.3s ease;
}
.de-logo:hover { filter: drop-shadow(0 0 32px rgba(232,120,10,0.65)); }

.de-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.de-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 2.25rem;
}

.de-divider {
  display: flex;
  justify-content: center;
}
.de-divider-line {
  display: block;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, transparent, var(--accent) 40%, var(--accent) 60%, transparent);
  border-radius: 2px;
  transition: width 1.1s cubic-bezier(.22,.68,0,1.2) 0.5s;
}
.de-hero.de-visible .de-divider-line { width: 220px; }

/* ── Seção 2: Missão + Visão ─────────────────────────────── */
.de-mv-section {
  padding: 0 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.de-mv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

.de-mv-card {
  padding: 32px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.de-mv-card:hover { transform: translateY(-5px); }

/* Missão — gradiente roxo */
.de-missao {
  background: linear-gradient(135deg, #2D1B69 0%, #1C1040 100%);
  border: 1px solid rgba(124,58,237,0.45);
  box-shadow: 0 0 32px rgba(124,58,237,0.14), inset 0 1px 0 rgba(255,255,255,0.06);
  border-radius: var(--radius) 0 0 var(--radius);
  border-right-width: 0;
}
.de-missao:hover {
  box-shadow: 0 0 60px rgba(124,58,237,0.28), 0 10px 40px rgba(0,0,0,0.45),
              inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Visão — gradiente azul */
.de-visao {
  background: linear-gradient(135deg, #1C3A6B 0%, #0D1F3C 100%);
  border: 1px solid rgba(37,99,235,0.45);
  box-shadow: 0 0 32px rgba(37,99,235,0.14), inset 0 1px 0 rgba(255,255,255,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.de-visao:hover {
  box-shadow: 0 0 60px rgba(37,99,235,0.28), 0 10px 40px rgba(0,0,0,0.45),
              inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Separador entre os dois cards */
.de-mv-grid::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.08) 30%, rgba(255,255,255,0.08) 70%, transparent);
  pointer-events: none;
}

.de-mv-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 1rem;
  line-height: 1;
}

.de-mv-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.de-mv-text {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(230,237,243,0.85);
  margin: 0;
}

/* ── Seção 3: Valores ────────────────────────────────────── */
.de-valores-section {
  padding: 0 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.de-section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.de-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.de-section-accent {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 auto;
}

/* Grid 3×2 */
.de-valores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Cards individuais */
.de-valor-card {
  position: relative;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid rgba(var(--card-rgb), 0.3);
  box-shadow: 0 0 20px rgba(var(--card-rgb), 0.07);
  overflow: hidden;
  cursor: default;
  /* Animação própria dos cards (ativada pelo IO) */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out,
              box-shadow 0.28s ease, border-color 0.28s ease;
}
.de-valor-card.de-visible {
  opacity: 1;
  transform: translateY(0);
}
.de-valor-card:hover {
  transform: translateY(-4px) scale(1.025);
  border-color: var(--card-color);
  box-shadow: 0 0 45px rgba(var(--card-rgb), 0.25), 0 10px 30px rgba(0,0,0,0.4);
}

/* Barra lateral colorida */
.de-valor-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--card-color), transparent);
  opacity: 0.6;
  transition: opacity 0.25s;
}
.de-valor-card:hover::before { opacity: 1; }

/* Número em marca d'água — laranja fixo, opacity 0.15 */
.de-valor-num {
  position: absolute;
  top: -0.5rem;
  right: 0.5rem;
  font-size: 80px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  color: rgba(232, 120, 10, 0.15);
  user-select: none;
  pointer-events: none;
}

.de-valor-nome {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
  padding-top: 2.5rem;
}

/* ── Seção 4: Timeline ───────────────────────────────────── */
.de-footer-section {
  padding: 0 2rem 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
}

.de-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.de-timeline-badge {
  display: inline-block;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.38rem 1.1rem;
  border-radius: 100px;
}

.de-tl-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 480px;
}

.de-tl-year {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 38px;
  text-align: center;
}

.de-tl-track {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.de-tl-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0.5));
  border-radius: 4px;
  transition: width 1.3s cubic-bezier(.22,.68,0,1.1) 0.15s;
}

.de-tl-now {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  padding: 0.28rem 0.9rem;
  border-radius: 100px;
}

/* ── Light mode ──────────────────────────────────────────── */
[data-theme="light"] .de-hero {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232,120,10,0.05) 0%, transparent 70%);
}
[data-theme="light"] .de-logo {
  filter: none;
}
[data-theme="light"] .de-missao {
  background: linear-gradient(135deg, #EDE9FE 0%, #F5F3FF 100%);
  border-color: rgba(124,58,237,0.3);
  box-shadow: 0 0 20px rgba(124,58,237,0.06);
}
[data-theme="light"] .de-missao:hover {
  box-shadow: 0 0 40px rgba(124,58,237,0.14), 0 8px 28px rgba(0,0,0,0.1);
}
[data-theme="light"] .de-visao {
  background: linear-gradient(135deg, #DBEAFE 0%, #EFF6FF 100%);
  border-color: rgba(37,99,235,0.3);
  box-shadow: 0 0 20px rgba(37,99,235,0.06);
}
[data-theme="light"] .de-visao:hover {
  box-shadow: 0 0 40px rgba(37,99,235,0.14), 0 8px 28px rgba(0,0,0,0.1);
}
[data-theme="light"] .de-mv-text {
  color: var(--text-primary);
}
[data-theme="light"] .de-mv-grid::after {
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.1) 30%, rgba(0,0,0,0.1) 70%, transparent);
}
[data-theme="light"] .de-valor-card {
  background: #FFFFFF;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
[data-theme="light"] .de-valor-num {
  color: rgba(var(--card-rgb), 0.08);
}
[data-theme="light"] .de-valor-card:hover {
  box-shadow: 0 0 32px rgba(var(--card-rgb), 0.15), 0 8px 20px rgba(0,0,0,0.1);
}

/* ── Light mode: watermark mais sutil */
[data-theme="light"] .de-valor-num {
  color: rgba(232, 120, 10, 0.10);
}

/* ── Responsividade ──────────────────────────────────────── */

/* Tablet (≤768px): Missão/Visão empilhados, Valores 2 colunas */
@media (max-width: 768px) {
  .de-page { gap: 40px; }
  .de-mv-grid { grid-template-columns: 1fr; }
  .de-missao {
    border-radius: var(--radius) var(--radius) 0 0;
    border-right-width: 1px;
    border-bottom-width: 0;
  }
  .de-visao { border-radius: 0 0 var(--radius) var(--radius); }
  .de-mv-grid::after { display: none; }
  .de-valores-grid { grid-template-columns: repeat(2, 1fr); }
  .de-mv-card { padding: 24px; }
  .de-valor-card { padding: 24px; }
}

/* Mobile (≤480px): tudo em coluna única */
@media (max-width: 480px) {
  .de-page { gap: 28px; }
  .de-valores-grid { grid-template-columns: 1fr; }
  .de-hero { padding: 2rem 1rem 1.5rem; min-height: 0; }
  .de-mv-section, .de-valores-section, .de-footer-section { padding-left: 1rem; padding-right: 1rem; }
  .de-mv-card, .de-valor-card { padding: 20px; }
  .de-logo { max-width: 140px; }
}

/* ═══════════════════════════════════════════════════════════
   Objetivos Estratégicos
═══════════════════════════════════════════════════════════ */

/* ── Layout geral ───────────────────────────────────────── */
.oe-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.oe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1.5rem 2rem 1.25rem;
}

.oe-page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ── Botão toggle ───────────────────────────────────────── */
.oe-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.1rem;
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 100px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.oe-toggle-btn:hover {
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.2);
}
.oe-toggle-btn:active { transform: scale(0.97); }

/* ── Container do mapa ──────────────────────────────────── */
.oe-mapa-wrap {
  padding: 0 2rem 2rem;
  flex: 1;
}

#mapa-container {
  line-height: 0;
  max-width: 85%;
  margin: 0 auto;
  display: block;
}

#overlays-container {
  position: absolute;
  inset: 0;
  pointer-events: none; /* deixa cliques passarem para a imagem */
}
#overlays-container .oe-overlay {
  pointer-events: auto;
}

.oe-mapa-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  width: 600px;
  max-width: 100%;
  line-height: 1.5;
}
.oe-mapa-placeholder code {
  font-size: 0.8rem;
  background: var(--bg-tertiary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* ── Grid de cards (modo desempenho) ─────────────────────── */
.oe-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
  padding: 0 2rem 2.5rem;
  align-items: start;
}
.oe-cards-grid[hidden] { display: none; }

/* ── Card individual ─────────────────────────────────────── */
.oe-card {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-card, #1a1a2e);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Imagem de ilustração (ocupa todo o card) */
.oe-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Fallback quando a imagem PNG não existe */
.oe-card-fb {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Gradiente escuro no fundo do card para legibilidade do footer */
.oe-card-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0)      0%,
    rgba(0,0,0,0.15)  40%,
    rgba(0,0,0,0.65)  75%,
    rgba(0,0,0,0.85) 100%
  );
}

/* ── Overlay do gauge ────────────────────────────────────── */
.oe-gauge-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -10%);
  z-index: 10;
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

/* Entrada animada (fadeIn + scale) */
@keyframes gaugeEnter {
  from { opacity: 0; transform: translate(-50%, -10%) scale(0.5); }
  to   { opacity: 1; transform: translate(-50%, -10%) scale(1);   }
}
.oe-gauge-anim { animation: gaugeEnter 0.4s ease-out both; }
.oe-gauge-show { opacity: 1; }

/* Círculo do gauge — fundo 100% opaco, glow laranja */
.oe-gauge-circle {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--bg-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

/* Subtexto abaixo do círculo */
.oe-gauge-subtext {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ── Footer do card (nome + tipo) ────────────────────────── */
.oe-card-footer {
  position: relative;
  z-index: 2;
  padding: 0.6rem 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.oe-card-tipo-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15em 0.6em;
  border-radius: 100px;
  border: 1px solid transparent;
  width: fit-content;
}
.oe-fin {
  color: #F68220;
  background: rgba(246,130,32,0.15);
  border-color: rgba(246,130,32,0.4);
}
.oe-int {
  color: #C4E8FA;
  background: rgba(196,232,250,0.12);
  border-color: rgba(196,232,250,0.35);
}

.oe-card-nome {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Light mode overrides ────────────────────────────────── */
[data-theme="light"] #mapa-img {
  box-shadow: 0 4px 24px rgba(0,0,0,0.18) !important;
}
[data-theme="light"] .oe-gauge-circle {
  background: #ffffff;
}
[data-theme="light"] .oe-gauge-subtext { color: rgba(0,0,0,0.65); }
[data-theme="light"] .oe-card-nome     { color: rgba(255,255,255,0.95); }

/* ── Responsividade ─────────────────────────────────────── */
@media (max-width: 768px) {
  .oe-header    { padding: 1rem 1rem 0.75rem; }
  .oe-mapa-wrap { padding: 0 1rem 2rem; }
  .oe-cards-grid { padding: 0 1rem 2rem; gap: 1rem; }
}
@media (max-width: 480px) {
  .oe-page-title { font-size: 0.95rem; }
  .oe-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .oe-card { min-height: 250px; }
  .oe-gauge-circle { width: 140px; height: 140px; }
}

/* ============================================================
   CGEP — Painel de Indicadores
   ============================================================ */

.cgep-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem 2rem 2.5rem;
  min-height: 100%;
}

.cgep-header { margin-bottom: 0.25rem; }
.cgep-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}
.cgep-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Filtros ────────────────────────────────────────────────── */
.cgep-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.cgep-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 180px;
}
.cgep-filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cgep-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cgep-select:focus { border-color: #3B82F6; }

/* ── Grid 4 colunas: 2×2 KPIs + donut (span 2 colunas × 2 linhas) */
.indicadores-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-metas-atingidas     { grid-area: 1 / 1 / 2 / 2; }
.kpi-esforco             { grid-area: 1 / 2 / 2 / 3; }
.kpi-sem-meta            { grid-area: 2 / 1 / 3 / 2; }
.kpi-resultado           { grid-area: 2 / 2 / 3 / 3; }
.chart-distribuicao-wrap { grid-area: 1 / 3 / 3 / 5; }
.cgep-kpi-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
  min-height: 200px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: transform 0.18s, box-shadow 0.18s;
  text-align: center;
}
.cgep-kpi-card:hover {
  transform: translateY(-3px);
}
.cgep-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cgep-kpi-icon svg { width: 22px; height: 22px; }
.cgep-kpi-value {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.cgep-kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
}

.cgep-kpi-atingidos {
  border-top: 3px solid #00FF9F;
  box-shadow: 0 4px 24px rgba(0,255,159,0.12);
}
.cgep-kpi-atingidos .cgep-kpi-icon { background: rgba(0,255,159,0.12); color: #00FF9F; }
.cgep-kpi-atingidos .cgep-kpi-value { color: #00FF9F; }

.cgep-kpi-esforco {
  border-top: 3px solid #C4E8FA;
  box-shadow: 0 4px 24px rgba(196,232,250,0.10);
}
.cgep-kpi-esforco .cgep-kpi-icon { background: rgba(196,232,250,0.12); color: #C4E8FA; }
.cgep-kpi-esforco .cgep-kpi-value { color: #C4E8FA; }

.cgep-kpi-naodef {
  border-top: 3px solid #F68220;
  box-shadow: 0 4px 24px rgba(246,130,32,0.12);
}
.cgep-kpi-naodef .cgep-kpi-icon { background: rgba(246,130,32,0.12); color: #F68220; }
.cgep-kpi-naodef .cgep-kpi-value { color: #F68220; }

.cgep-kpi-resultado {
  border-top: 3px solid #FFD600;
  box-shadow: 0 4px 24px rgba(255,214,0,0.10);
}
.cgep-kpi-resultado .cgep-kpi-icon { background: rgba(255,214,0,0.10); color: #FFD600; }
.cgep-kpi-resultado .cgep-kpi-value { color: #FFD600; }

/* ── Donut card ──────────────────────────────────────────────── */
.cgep-donut-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.chart-distribuicao-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.cgep-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cgep-donut-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.cgep-donut-wrap canvas { flex-shrink: 0; max-width: 220px; }
.chart-distribuicao-wrap .cgep-donut-wrap {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 1.25rem;
}
.chart-distribuicao-wrap .cgep-donut-wrap canvas {
  max-width: 260px;
  max-height: 260px;
  width: auto;
  height: auto;
}
.chart-distribuicao-wrap .cgep-donut-legend {
  text-align: center;
  font-size: 0.82rem;
}
.cgep-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}
.cgep-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.cgep-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cgep-legend-label { color: var(--text-secondary); flex: 1; }
.cgep-legend-val   { color: var(--text-primary); font-weight: 600; }

/* ── Tabela ─────────────────────────────────────────────────── */
.cgep-table-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.cgep-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
}
.cgep-table-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 0.2rem 0.65rem;
}
.cgep-table-wrap { overflow-x: auto; }
.cgep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.cgep-th {
  text-align: left;
  padding: 0.6rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cgep-th-sort {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.cgep-th-sort:hover { color: var(--text-primary); }

.cgep-tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.cgep-tr-alt { background: rgba(255,255,255,0.02); }
.cgep-tr-clickable { cursor: pointer; }
.cgep-tr-clickable:hover .cgep-td { background: rgba(246,130,32,0.05); }
.cgep-tr-clickable:hover .cgep-td:first-child { box-shadow: inset 3px 0 0 #F68220; }

.cgep-td {
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  vertical-align: middle;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.cgep-td-desc  { max-width: 260px; }
.cgep-td-fmt   { color: var(--text-secondary); font-size: 0.75rem; }
.cgep-td-num   { font-variant-numeric: tabular-nums; text-align: right; }
.cgep-td-bar   { min-width: 120px; }

.cgep-badge-id {
  font-family: monospace;
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.cgep-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.cgep-badge-resultado { background: rgba(59,130,246,0.15); color: #3B82F6; }
.cgep-badge-esforco   { background: rgba(245,158,11,0.15);  color: #F59E0B; }

.cgep-bar-wrap {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2px;
}
.cgep-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.cgep-bar-pct { font-size: 0.72rem; font-weight: 600; }

.cgep-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}
.cgep-status-txt { font-size: 0.75rem; color: var(--text-secondary); }

/* ── Expand row ─────────────────────────────────────────────── */
.cgep-expand-row { background: var(--bg-tertiary); }
.cgep-expand-td { padding: 0; border-bottom: 1px solid var(--border); }
.cgep-expand-content { padding: 1rem 1.25rem; }
.cgep-expand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.cgep-expand-col { display: flex; flex-direction: column; gap: 0.85rem; }
.cgep-expand-field { display: flex; flex-direction: column; gap: 0.2rem; }
.cgep-expand-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cgep-expand-val { font-size: 0.8rem; color: var(--text-primary); }
.cgep-expand-chart-col { justify-content: flex-start; }
.cgep-mini-chart-wrap {
  margin-top: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 0.5rem;
}

/* ── Paginação ──────────────────────────────────────────────── */
.cgep-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  flex-wrap: wrap;
}
.cgep-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cgep-page-btn:hover:not(:disabled) { background: rgba(59,130,246,0.15); color: #3B82F6; }
.cgep-page-btn:disabled { opacity: 0.35; cursor: default; }
.cgep-page-active { background: #3B82F6 !important; color: #fff !important; border-color: #3B82F6 !important; }
.cgep-page-ellipsis { font-size: 0.8rem; color: var(--text-muted); padding: 0 0.25rem; }

/* ── Estados ────────────────────────────────────────────────── */
.cgep-loading, .cgep-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.cgep-empty-txt { font-size: 0.8rem; color: var(--text-muted); }

/* ── Light mode ─────────────────────────────────────────────── */
[data-theme="light"] .cgep-select { background: #fff; color: #1a1a2e; border-color: #d1d5db; }
[data-theme="light"] .cgep-tr-alt { background: rgba(0,0,0,0.025); }
[data-theme="light"] .cgep-tr-clickable:hover .cgep-td { background: rgba(246,130,32,0.04); }
[data-theme="light"] .cgep-expand-row { background: #f3f4f6; }
[data-theme="light"] .cgep-mini-chart-wrap { background: #fff; }

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .indicadores-main-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  .chart-distribuicao-wrap { grid-area: 3 / 1 / 4 / 3; height: auto; }
  .kpi-metas-atingidas { grid-area: 1 / 1 / 2 / 2; }
  .kpi-esforco         { grid-area: 1 / 2 / 2 / 3; }
  .kpi-sem-meta        { grid-area: 2 / 1 / 3 / 2; }
  .kpi-resultado       { grid-area: 2 / 2 / 3 / 3; }
}
@media (max-width: 600px) {
  .cgep-page { padding: 1rem; }
  .indicadores-main-grid { grid-template-columns: 1fr; }
  .kpi-metas-atingidas, .kpi-esforco,
  .kpi-sem-meta, .kpi-resultado,
  .chart-distribuicao-wrap { grid-area: unset; }
  .cgep-expand-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   DASHBOARD — Tela Início
   ============================================================ */

/* ── Skeleton shimmer ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  display: block;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Animação de entrada das seções ──────────────────────── */
.dash-section,
.dash-divider {
  opacity: 0;
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}
.dash-section-sage   { transform: translateY(-22px); }
.dash-section-pe     { transform: translateY(22px);  }
.dash-divider        { transform: translateX(-32px); transition-delay: 150ms; }
#dash-pe             { transition-delay: 300ms; }
.dash-anim-in        { opacity: 1 !important; transform: none !important; }

/* ── Section spacing ─────────────────────────────────────── */
.dash-section { margin-bottom: 2rem; }

/* ── Banner SAGE ─────────────────────────────────────────── */
.dash-sage-banner {
  background: linear-gradient(135deg, #1C3A6B 0%, #0D5F6B 50%, #0A7A6A 100%);
  border-radius: 12px;
  padding: 20px 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 24px rgba(28, 58, 107, 0.4);
}
.dash-sage-eyebrow {
  font-size: 0.68rem;
  font-weight: 300;
  color: rgba(230, 237, 243, 0.75);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dash-sage-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #E6EDF3;
  line-height: 1.2;
  margin-bottom: 6px;
}
.dash-sage-sub {
  font-size: 0.8rem;
  color: rgba(230, 237, 243, 0.65);
}

/* ── Cross-filter badges ─────────────────────────────────── */
#cross-filter-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: rgba(232, 120, 10, 0.06);
  border: 1px solid rgba(232, 120, 10, 0.2);
  border-radius: var(--radius-sm);
}
#cross-filter-badges::before {
  content: '🔍 Filtro ativo:';
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.cross-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(232, 120, 10, 0.15);
  border: 1px solid var(--color-orange);
  border-radius: 20px;
  padding: 3px 6px 3px 10px;
  font-size: 0.75rem;
  color: var(--color-orange);
}
.cross-filter-badge strong {
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-badge-remove {
  background: none;
  border: none;
  color: var(--color-orange);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.cf-badge-remove:hover { opacity: 1; }

/* ── Filter bar ──────────────────────────────────────────── */
.dash-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.dash-filter-group { display: flex; flex-direction: column; gap: 5px; }
.dash-filter-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.dash-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  min-width: 180px;
}
.dash-update-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  align-self: flex-end;
  padding-bottom: 0.45rem;
}

/* ── Chart wrap ──────────────────────────────────────────── */
.dash-chart-wrap { position: relative; }
.dash-chart-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  z-index: 2;
  border-radius: var(--radius);
}

/* ── Grid 2 colunas ──────────────────────────────────────── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Divisória / Cabeçalho Planejamento Estratégico ──────── */
.dash-divider {
  height: 80px;
  background: linear-gradient(135deg,
    #1C3A6B 0%,
    #6263A0 30%,
    #F68220 65%,
    #FCE5CB 100%
  );
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.5rem 0;
  position: relative;
  overflow: hidden;
  padding: 20px 32px;
}
.dash-divider::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: inherit;
  z-index: 0;
}
.dash-divider::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
  animation: divShine 3.5s ease-in-out infinite;
  z-index: 1;
}
@keyframes divShine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.dash-divider-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 2;
}
.dash-divider-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.dash-divider-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* ── KPI cards (Planejamento Estratégico) ────────────────── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dash-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.dash-card:hover { border-color: var(--dash-card-color, var(--orange)); }
.dash-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--dash-card-color, var(--orange));
  opacity: 0.8;
}
.dash-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.dash-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dash-card-color, var(--text-primary));
  line-height: 1;
  margin-bottom: 0.35rem;
}
.dash-card-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Placeholder panels ──────────────────────────────────── */
.dash-pe-placeholders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.dash-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1.5rem;
  border: 2px dashed rgba(232, 120, 10, 0.35);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.dash-placeholder:hover {
  border-color: var(--orange);
  background: var(--orange-dim);
  color: var(--orange);
}
.dash-placeholder svg {
  width: 32px;
  height: 32px;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.dash-placeholder:hover svg { opacity: 1; }
.dash-placeholder-title { font-size: 0.9rem; font-weight: 600; }
.dash-placeholder-sub   { font-size: 0.72rem; color: var(--text-muted); }

/* ── Faixas table ────────────────────────────────────────── */
.dash-faixa-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.dash-faixa-count { text-align: right; font-weight: 700; font-size: 0.9rem; }
.dash-faixa-pct   { text-align: right; font-size: 0.8rem; color: var(--text-secondary); }
.dash-faixas-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  font-style: italic;
}

/* ── Progress bar (faixas) ───────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Error banner ────────────────────────────────────────── */
.dash-error-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,59,107,0.1);
  border: 1px solid rgba(255,59,107,0.35);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  color: #FF3B6B;
}
.dash-error-banner svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── KPI cards — Tela Metas Físicas ─────────────────────── */
.met-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.met-kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--kc, var(--color-orange));
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.met-kpi-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.8;
}
.met-kpi-body { min-width: 0; }
.met-kpi-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.met-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--kc, var(--text-primary));
  margin: 0;
  line-height: 1;
}
.met-kpi-pct {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}
.met-kpi-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin: 3px 0 0;
}
.met-exec-card { padding-bottom: 0.5rem; }
@media (max-width: 900px) { .met-kpi-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px)  { .met-kpi-row { grid-template-columns: 1fr; } }

/* ── Light mode overrides ────────────────────────────────── */
[data-theme="light"] .dash-select { background: #fff; color: #1a1a2e; border-color: #d1d5db; }
[data-theme="light"] .dash-divider-title { text-shadow: none; }
[data-theme="light"] .dash-chart-spinner { background: #f3f4f6; }
[data-theme="light"] .dash-card { background: #fff; }

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
  .dash-pe-placeholders { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dash-cards { grid-template-columns: 1fr 1fr; }
  .dash-divider { height: 70px; }
  .dash-divider-title { font-size: 0.8rem; letter-spacing: 0.06em; }
  .dash-filter-bar { flex-direction: column; align-items: stretch; }
  .dash-select { min-width: unset; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   CGEP — Status das Ações (#cgep-status)
═══════════════════════════════════════════════════════════ */

/* ── Status badge ────────────────────────────────────────── */
.cs-badge {
  display: inline-block;
  padding: 0.22em 0.65em;
  border-radius: 100px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ── Progress bar cell ───────────────────────────────────── */
.cs-pct-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cs-pct-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border-color, rgba(255,255,255,0.06));
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.cs-pct-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.cs-pct-lbl {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 2.8em;
  text-align: right;
}

/* ── Table ───────────────────────────────────────────────── */
.cs-table { width: 100%; }
.cs-table thead th { font-size: 0.72rem; }
.cs-td-mono { font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: 0.8rem; }
.cs-td-nome { font-weight: 500; }
.cs-td-obj  { font-size: 0.82rem; color: var(--text-secondary, #8B949E); }
.cs-td-btns { display: flex; gap: 0.3rem; align-items: center; }

/* ── Row states ──────────────────────────────────────────── */
.cs-row { cursor: pointer; transition: background 0.15s; }
.cs-row:hover td { background: rgba(246,130,32,0.05) !important; }
.cs-row.cs-row-expanded td { background: rgba(246,130,32,0.08) !important; border-bottom: none; }
.cs-row.cs-row-expanded td:first-child { box-shadow: inset 3px 0 0 var(--color-orange, #F68220); }

/* ── Expanded history panel ──────────────────────────────── */
.cs-expand-row td {
  padding: 0 !important;
  background: rgba(246,130,32,0.04) !important;
  border-top: none !important;
}
.cs-hist-panel {
  padding: 0.75rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.06));
}
.cs-hist-table { width: 100%; }
.cs-hist-table th { font-size: 0.68rem; color: var(--text-muted, #666); background: transparent; }
.cs-hist-table td { font-size: 0.8rem; background: transparent; }
.cs-hist-table tbody tr:hover td { background: rgba(255,255,255,0.02) !important; }
.cs-hist-empty { padding: 0.75rem; color: var(--text-muted, #666); font-size: 0.82rem; margin: 0; }

/* ── Icon buttons ────────────────────────────────────────── */
.cs-icon-btn {
  background: none;
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 6px;
  padding: 0.22rem 0.45rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text-secondary, #8B949E);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  line-height: 1;
}
.cs-icon-btn:hover     { border-color: var(--color-orange, #F68220); color: var(--color-orange, #F68220); background: rgba(246,130,32,0.08); }
.cs-icon-active        { border-color: var(--color-orange, #F68220) !important; color: var(--color-orange, #F68220) !important; background: rgba(246,130,32,0.1) !important; }

/* ── Range slider ────────────────────────────────────────── */
.cs-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color, rgba(255,255,255,0.1));
  outline: none;
  cursor: pointer;
  margin-top: 0.5rem;
}
.cs-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-orange, #F68220);
  box-shadow: 0 0 8px rgba(246,130,32,0.5);
  cursor: pointer;
}
.cs-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-orange, #F68220);
  border: none;
  cursor: pointer;
}

/* ── Light mode overrides ────────────────────────────────── */
[data-theme="light"] .cs-table thead th { background: rgba(0,0,0,0.03); }
[data-theme="light"] .cs-row:hover td   { background: rgba(246,130,32,0.04) !important; }
[data-theme="light"] .cs-row.cs-row-expanded td { background: rgba(246,130,32,0.06) !important; }
[data-theme="light"] .cs-icon-btn       { border-color: rgba(0,0,0,0.12); color: #555; }
[data-theme="light"] .cs-pct-bar-wrap   { background: rgba(0,0,0,0.08); }
[data-theme="light"] .cs-slider         { background: rgba(0,0,0,0.1); }

/* ── cs2 — novo layout Status das Ações ──────────────────── */
.cs2-page { gap: 1rem; display: flex; flex-direction: column; }

.cs2-donut-card { padding: 1.25rem; }
.cs2-donut-row {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}
.cs2-donut-canvas-wrap {
  flex-shrink: 0;
  width: 260px;
  height: 260px;
}
.cs2-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}
.cs2-legend-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.84rem;
}
.cs2-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cs2-legend-label {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}
.cs2-legend-count {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

/* Tabela */
.cs2-table-scroll { overflow-x: auto; }
.cs2-table {
  width: 100%;
  border-collapse: collapse;
}
.cs2-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}
.cs2-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  vertical-align: middle;
}
.cs2-expand-col { width: 40px; text-align: center; }
.cs2-desemp-col { width: 120px; text-align: center; }
.cs2-status-col { width: 44px; text-align: center; }

.cs2-action-row {
  cursor: pointer;
  transition: background 0.12s;
}
.cs2-action-row:hover td { background: rgba(33,150,243,0.04); }
.cs2-action-row.cs2-row-open td {
  background: rgba(33,150,243,0.07);
  border-bottom-color: transparent;
}

.cs2-kr-row td {
  background: rgba(0,0,0,0.04);
  font-size: 0.81rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.cs2-kr-row:last-child td { border-bottom: 1px solid var(--border); }

.cs2-expand-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.13s, color 0.13s;
}
.cs2-expand-btn:hover {
  border-color: #2196F3;
  color: #2196F3;
}
.cs2-row-open .cs2-expand-btn {
  border-color: #2196F3;
  color: #2196F3;
}

.cs2-acao-id {
  display: inline-block;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 0.4rem;
}
.cs2-acao-nome { font-weight: 500; }
.cs2-kr-nome   { padding-left: 1.5rem !important; }
.cs2-kr-alvo   { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.cs2-status-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.cs2-status-dot-sm {
  width: 10px;
  height: 10px;
}
.cs2-pct-badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Light theme adjustments */
[data-theme="light"] .cs2-kr-row td { background: rgba(0,0,0,0.025); }
[data-theme="light"] .cs2-action-row:hover td { background: rgba(33,150,243,0.06); }

/* ============================================================
   STATUS DAS AÇÕES — #cgep-status
   ============================================================ */
.status-page { padding: 1.5rem 2rem; }
.status-filtros {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.status-filtro-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 200px;
}
.status-filtro-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.status-select {
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
}
.status-chart-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.status-donut-wrap { flex-shrink: 0; }
.status-legenda {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.status-legenda-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}
.status-legenda-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-legenda-label {
  color: var(--text-secondary);
  min-width: 120px;
}
.status-legenda-val {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.status-table-wrap {
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.status-table th {
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.status-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.status-row-acao td { color: var(--text-primary); font-weight: 500; }
.status-row-acao:hover td { background: rgba(246,130,32,0.05); }
.status-row-acao:hover td:first-child { box-shadow: inset 3px 0 0 #F68220; }
.status-row-kr td {
  background: var(--bg-secondary);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.status-row-kr:hover td { background: rgba(246,130,32,0.025); }
.status-expand-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  font-family: inherit;
  line-height: 1;
}
.status-expand-btn:hover { background: var(--border); }
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}
[data-theme="light"] .status-row-acao:hover td { background: rgba(246,130,32,0.04); }
[data-theme="light"] .status-row-kr td        { background: rgba(0,0,0,0.025); }
[data-theme="light"] .status-row-kr:hover td  { background: rgba(246,130,32,0.02); }

/* ── Status Ações — KPIs ────────────────────────────────── */
.status-kpis {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--border);
  margin-left: auto;
  flex-shrink: 0;
}
.status-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 90px;
}
.status-kpi-valor {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.status-kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.status-kpi-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}
.status-kpi-divider {
  width: 1px;
  height: 50px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Relatório Geral OE7 — blocos e grade ──────────────── */
.rg-bloco-atual {
  background: rgba(180,178,169,0.08);
  border: 1px dashed #B4B2A9;
  border-radius: 12px;
  padding: 10px 12px 12px;
  margin-bottom: 10px;
}
.rg-bloco-sug {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px 12px;
}
.rg-bloco-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rg-bloco-tag::before { content: ''; width: 10px; height: 1px; }
.rg-bloco-tag::after  { content: ''; flex: 1; height: 1px; }
.rg-bloco-tag-atual                { color: #888780; }
.rg-bloco-tag-atual::before        { background: #888780; }
.rg-bloco-tag-atual::after         { background: #B4B2A9; }
.rg-bloco-tag-sug                  { color: #3D2E7C; }
.rg-bloco-tag-sug::before          { background: #3D2E7C; }
.rg-bloco-tag-sug::after           { background: #AFA9EC; }
.rg-atual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rg-sug-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.rg-eq-wrap { margin-top: 10px; }
.rg-eq-op   { font-size: 11px; color: var(--text-muted); }
.rg-nota    { font-size: 9px; color: var(--text-muted); text-align: center; margin-top: 8px; }
