/* ============================================================
   Portal predicta — Redesign SaaS (Direção B)
   Tokens + shell (sidebar clara, topbar, collapse, mobile)
   ============================================================ */

:root {
  --brand: #e10096;
  --brand-dark: #c00080;
  --brand-soft: #fce8f4;
  --brand-ring: rgba(225, 0, 150, 0.18);

  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e4e7ec;
  --border-strong: #cdd2dc;

  --text: #101828;
  --text-secondary: #475467;
  --text-muted: #98a2b3;

  --sidebar-w: 280px;
  --sidebar-width-expanded: 280px;
  --sidebar-width-collapsed: 72px;
  --topbar-h: 56px;

  --radius: 8px;
  --radius-sm: 6px;

  --font: 'Roboto', system-ui, sans-serif;
  --font-display: 'Sulphur Point', 'Roboto', sans-serif;

  /* Texto escuro o bastante para contraste; a marca é a cor viva dos pontos. */
  --bronze: #c2410c;
  --bronze-mark: #ea580c;
  --prata: #667085;
  --ouro: #a16207;
  --ouro-mark: #ca8a04;

  /* Schemas outros — paleta de 5 slots */
  --schema-migracao: #0d9488;
  --schema-migracao-bg: #f0fdfa;
  --schema-stg-prata: #2563eb;
  --schema-stg-prata-bg: #eff6ff;
  --schema-3: #7c3aed;
  --schema-3-bg: #f5f3ff;
  --schema-4: #a21caf;
  --schema-4-bg: #fdf4ff;
  --schema-5: #be123c;
  --schema-5-bg: #fff1f2;

  --page-title-color: var(--brand);
  --page-main-title-color: var(--text);
  --page-title-font: var(--font-display);
}

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

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  /* block evita bug Chrome: position:fixed como flex item encolhe à altura do conteúdo */
  display: block;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.20) transparent;
}

body.sidebar-open {
  overflow: hidden;
  touch-action: none;
}

body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.20);
  border-radius: 999px;
}
body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.32);
}

a { color: inherit; text-decoration: none; }

/* ---------- Sidebar clara ---------- */
.sidebar {
  width: var(--sidebar-width-expanded);
  background: var(--surface);
  border-right: 1px solid var(--border);
  color: var(--text);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  /* top+bottom com height:auto estica no viewport; min-height reforça mobile/iOS */
  height: auto;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  /* Rolagem só no nav — evita scroll duplo e itens cortados no fim */
  overflow: hidden;
  transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-header,
.sidebar-brand {
  position: relative;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.sidebar-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.sidebar-brand .logo,
.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 5px;
  flex-shrink: 0;
}

.sidebar-header-brand h1,
.sidebar-header-brand p.sidebar-brand-text,
.sidebar-brand-text {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-header-brand h1 .mark,
.sidebar-brand-text .mark,
.sidebar-brand .mark {
  color: var(--brand);
  background: transparent;
  padding: 0;
  font-size: 1.20em;
}

.sidebar-brand-text .brand-suffix {
  display: inline-block;
  min-width: 9ch;
  font-size: 0.82em;
}

.brand-suffix.is-typing::after {
  content: '|';
  display: inline-block;
  margin-left: 1px;
  animation: brand-caret-blink 0.7s step-end infinite;
}

@keyframes brand-caret-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-suffix.is-typing::after {
    animation: none;
  }
}

.sidebar-collapse-toggle {
  display: none;
}

.sidebar-collapse-icon-collapsed {
  display: none;
}

.sidebar-menu,
.sidebar-nav {
  padding: 12px 10px;
  flex: 1 1 auto;
  min-height: 0; /* necessário para overflow funcionar em flex column */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.sidebar-menu::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-menu::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.menu-section {
  margin-bottom: 8px;
}

.menu-section-title,
.nav-label {
  padding: 10px 10px 6px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.menu-item,
.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  text-align: left;
  text-decoration: none;
  border-left: none;
  transition: background 0.12s, color 0.12s;
}

.menu-item i,
.nav-item i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  opacity: 0.85;
  flex-shrink: 0;
}

.menu-item:hover,
.nav-item:hover {
  background: var(--bg);
  color: var(--text);
  padding-left: 10px;
}

.menu-item.active,
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.menu-item.active i,
.nav-item.active i {
  color: var(--brand);
  opacity: 1;
}

.menu-item.disabled {
  cursor: default;
  opacity: 0.85;
}

.submenu-toggle-icon,
.nav-item .chevron {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.menu-item.has-submenu.submenu-open .submenu-toggle-icon {
  transform: rotate(180deg);
}

/* Submenu Dashboards */
.submenu {
  padding: 2px 0 6px 28px;
  background: transparent;
}

.submenu:not(.open) {
  display: none;
}

.submenu-section {
  margin-bottom: 4px;
}

.submenu-section-header {
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: inherit;
}

.submenu-section-title {
  padding: 0;
  font-size: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.submenu-section-items:not(.open) {
  display: none;
}

.submenu-section-toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.submenu-section.open .submenu-section-toggle-icon {
  transform: rotate(180deg);
}

.submenu-item,
.submenu a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
  transition: background 0.12s, color 0.12s;
}

.submenu-title {
  color: var(--text);
  font-weight: 550;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submenu-item:hover,
.submenu a:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.submenu-item:hover .submenu-title,
.submenu a:hover .submenu-title {
  color: var(--brand);
}

.submenu-item.active,
.submenu a.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.submenu-item.active .submenu-title,
.submenu a.active .submenu-title {
  color: var(--brand);
}

.submenu-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}

.submenu-item.active .submenu-indicator {
  background: var(--brand);
}

.sidebar-footer {
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-top: auto;
  background: var(--surface);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer .meta { min-width: 0; flex: 1; }
.sidebar-footer .meta strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.sidebar-footer .meta span,
.sidebar-footer .meta a {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.sidebar-footer .meta a:hover { color: var(--brand); }

.sidebar-footer-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-footer-actions a {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.sidebar-footer-actions a:hover {
  background: var(--bg);
  color: var(--text);
}

/* ---------- Shell / Topbar ---------- */
.main-content,
.shell {
  margin-left: var(--sidebar-width-expanded);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-nav a:hover { color: var(--text); }
.breadcrumb-nav strong { color: var(--text); font-weight: 550; }
.breadcrumb-nav i { font-size: 0.65rem; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:hover {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

.content-wrapper,
.content {
  padding: 24px 32px 48px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  flex: 1;
}

.content.full-bleed,
.content-wrapper.full-bleed {
  max-width: none;
  padding: 20px 24px 32px;
}

/* Layout sem sidebar (auth) */
.no-sidebar-layout .main-content,
.no-sidebar-layout .shell {
  margin-left: 0;
}

.no-sidebar-layout .content-wrapper {
  max-width: 100%;
  padding: 0;
}

.no-sidebar-layout .topbar,
.no-sidebar-layout .site-footer,
.login-page .topbar,
.login-page .site-footer,
.login-page .mobile-toggle {
  display: none !important;
}

/* Mobile toggle */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  background: var(--brand);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.2em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.15);
}

.mobile-toggle:hover { background: var(--brand-dark); }

/* Desktop: sidebar recolhível */
@media (min-width: 769px) {
  .sidebar-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
  }

  .sidebar-collapse-toggle:hover {
    background: var(--bg);
    color: var(--text);
  }

  .sidebar-collapse-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }

  html.sidebar-collapsed .sidebar,
  body.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed);
    overflow-x: hidden;
  }

  html.sidebar-collapsed .main-content,
  body.sidebar-collapsed .main-content,
  html.sidebar-collapsed .shell,
  body.sidebar-collapsed .shell {
    margin-left: var(--sidebar-width-collapsed);
  }

  html.sidebar-collapsed .sidebar-header,
  body.sidebar-collapsed .sidebar-header {
    padding: 0 8px;
    justify-content: center;
    flex-direction: column;
    height: auto;
    min-height: var(--topbar-h);
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px;
  }

  html.sidebar-collapsed .sidebar-collapse-toggle,
  body.sidebar-collapsed .sidebar-collapse-toggle {
    order: -1;
  }

  html.sidebar-collapsed .sidebar-collapse-icon-expanded,
  body.sidebar-collapsed .sidebar-collapse-icon-expanded {
    display: none;
  }

  html.sidebar-collapsed .sidebar-collapse-icon-collapsed,
  body.sidebar-collapsed .sidebar-collapse-icon-collapsed {
    display: block;
  }

  html.sidebar-collapsed .sidebar-brand-text,
  body.sidebar-collapsed .sidebar-brand-text,
  html.sidebar-collapsed .sidebar-header-brand h1,
  body.sidebar-collapsed .sidebar-header-brand h1 {
    display: none;
  }

  html.sidebar-collapsed .sidebar-header-brand,
  body.sidebar-collapsed .sidebar-header-brand {
    justify-content: center;
    flex: 0;
  }

  html.sidebar-collapsed .menu-section-title,
  body.sidebar-collapsed .menu-section-title {
    display: none;
  }

  html.sidebar-collapsed .menu-item,
  body.sidebar-collapsed .menu-item {
    justify-content: flex-start;
    padding: 10px 14px;
    gap: 0;
  }

  html.sidebar-collapsed .menu-item span,
  body.sidebar-collapsed .menu-item span,
  html.sidebar-collapsed .menu-item .submenu-toggle-icon,
  body.sidebar-collapsed .menu-item .submenu-toggle-icon {
    display: none;
  }

  html.sidebar-collapsed .submenu,
  body.sidebar-collapsed .submenu {
    display: none !important;
  }

  html.sidebar-collapsed .sidebar-footer .meta,
  body.sidebar-collapsed .sidebar-footer .meta,
  html.sidebar-collapsed .sidebar-footer-actions,
  body.sidebar-collapsed .sidebar-footer-actions {
    display: none;
  }

  html.sidebar-collapsed .sidebar-footer,
  body.sidebar-collapsed .sidebar-footer {
    justify-content: center;
    padding: 12px 8px;
  }
}

@media (max-width: 768px) {
  .sidebar-collapse-toggle {
    display: none !important;
  }

  .sidebar {
    width: min(var(--sidebar-width-expanded), 86vw);
    top: 0;
    left: 0;
    bottom: 0;
    height: auto;
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    max-height: none;
    transform: translateX(-100%);
    /* visibilidade durante o slide — evita “painel curto” */
    visibility: visible;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content,
  .shell {
    margin-left: 0;
  }

  .mobile-toggle {
    display: grid;
    place-items: center;
  }

  /* Com drawer aberto, o botão flutuante some (fecha pelo overlay / Escape) */
  body.sidebar-open .mobile-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .content-wrapper,
  .content {
    padding: 16px;
    padding-top: 64px;
  }

  .topbar {
    padding-left: 64px;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* Footer */
.site-footer,
footer.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  padding: 14px 20px;
  margin-top: auto;
  font-size: 0.78rem;
}

/* ---------- Componentes compartilhados ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.page-head p {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 0.9rem;
}

.greet {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.card-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 550;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  transition: all 0.12s;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-portal:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-portal-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-portal-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.btn-portal:disabled,
.btn-portal-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-portal-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-bronze,
.badge-prata,
.badge-ouro,
.badge-migracao,
.badge-stg-prata,
.badge-schema-3,
.badge-schema-4,
.badge-schema-5,
.badge-schema,
.badge-success,
.badge-danger {
  --bs-badge-padding-x: 8px;
  --bs-badge-padding-y: 2px;
  --bs-badge-font-size: 0.7rem;
  --bs-badge-font-weight: 600;
  --bs-badge-border-radius: 999px;
}

.badge-bronze::before,
.badge-prata::before,
.badge-ouro::before,
.badge-migracao::before,
.badge-stg-prata::before,
.badge-schema-3::before,
.badge-schema-4::before,
.badge-schema-5::before,
.badge-schema::before,
.badge-success::before,
.badge-danger::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.badge-bronze { background: #fff4ed; color: var(--bronze); }
.badge-bronze::before { background: var(--bronze-mark); }
.badge-prata { background: #f2f4f7; color: var(--prata); }
.badge-prata::before { background: var(--prata); }
.badge-ouro { background: #fef9e8; color: var(--ouro); }
.badge-ouro::before { background: var(--ouro-mark); }
.badge-migracao { background: var(--schema-migracao-bg); color: var(--schema-migracao); }
.badge-migracao::before { background: var(--schema-migracao); }
.badge-stg-prata { background: var(--schema-stg-prata-bg); color: var(--schema-stg-prata); }
.badge-stg-prata::before { background: var(--schema-stg-prata); }
.badge-schema-3 { background: var(--schema-3-bg); color: var(--schema-3); }
.badge-schema-3::before { background: var(--schema-3); }
.badge-schema-4 { background: var(--schema-4-bg); color: var(--schema-4); }
.badge-schema-4::before { background: var(--schema-4); }
.badge-schema-5 { background: var(--schema-5-bg); color: var(--schema-5); }
.badge-schema-5::before { background: var(--schema-5); }
.badge-schema { background: #f2f4f7; color: var(--text-secondary); }
.badge-schema::before { background: var(--text-secondary); }
.badge-success { background: #ecfdf3; color: #027a48; }
.badge-success::before { background: #027a48; }
.badge-danger { background: #fef3f2; color: #b42318; }
.badge-danger::before { background: #b42318; }

.warn-banner {
  background: #fff6e6;
  border: 1px solid #f5d78e;
  color: #7a5a00;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* Bootstrap primary → marca magenta no portal */
.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
}
body.login-page {
  display: block;
  min-height: 100vh;
}

.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.login-brand-panel {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
    linear-gradient(150deg, #1a1a1a 0%, #3d0a2c 55%, var(--brand-dark) 130%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  position: relative;
}

.login-brand-content { max-width: 460px; }

.login-brand-panel .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 10px;
  margin-bottom: 22px;
}

.login-brand-panel h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.login-brand-panel h1 span { color: var(--brand); }

.login-brand-panel h1 .brand-suffix {
  display: inline-block;
  min-width: 9ch;
  color: #fff;
}

.login-brand-panel .tagline {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 32px;
}

.login-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-highlights li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
}

.login-highlights li i {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(225, 0, 150, 0.18);
  color: #f9a8d4;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.login-brand-foot {
  position: absolute;
  bottom: 28px;
  left: 64px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.login-form-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  min-height: 100vh;
}

.login-form-inner {
  width: 100%;
  max-width: 360px;
}

.login-form-inner h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.login-form-inner .sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 32px;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.login-actions .btn-portal {
  width: 100%;
  height: 48px;
  justify-content: center;
  font-size: 0.95rem;
}

.login-actions .btn-portal-primary { font-weight: 600; }

.login-foot {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.login-alt-access {
  display: inline-block;
  margin-top: 28px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-alt-access:hover { color: var(--text-secondary); }

.login-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .home-grid { grid-template-columns: 1fr; }
  .meta-strip { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .meta-strip { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Toast — notificações temporárias (feedback de ações AJAX)
   ============================================================ */
.predicta-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.predicta-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.predicta-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.predicta-toast i {
  font-size: 1rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.predicta-toast-success { border-left-color: #12b76a; }
.predicta-toast-success i { color: #12b76a; }
.predicta-toast-error { border-left-color: #f04438; }
.predicta-toast-error i { color: #f04438; }
.predicta-toast-warning { border-left-color: #f79009; }
.predicta-toast-warning i { color: #f79009; }
.predicta-toast-info { border-left-color: var(--brand); }
.predicta-toast-info i { color: var(--brand); }

@media (max-width: 768px) {
  .predicta-toast-container {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

/* ---------- Páginas de erro (403 / 404) ---------- */
body.error-page.no-sidebar-layout {
  background: var(--bg);
  overflow-x: hidden;
}

.content-wrapper--error {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--topbar-h) - 80px);
  padding: 32px 16px;
}

body.no-sidebar-layout .content-wrapper--error {
  min-height: 100vh;
}

.error-stage {
  position: relative;
  width: min(100%, 520px);
  isolation: isolate;
}

.error-stage__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: error-float 9s ease-in-out infinite;
}

.error-stage__glow--a {
  width: 240px;
  height: 240px;
  top: -60px;
  left: -40px;
  background: rgba(225, 0, 150, 0.22);
}

.error-stage__glow--b {
  width: 200px;
  height: 200px;
  right: -30px;
  bottom: -50px;
  background: rgba(16, 24, 40, 0.08);
  animation-delay: -3.5s;
  animation-duration: 11s;
}

.error-stage__panel {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 36px 40px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(228, 231, 236, 0.9);
  backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 24px 60px rgba(16, 24, 40, 0.08);
  overflow: hidden;
  animation: error-rise 0.55s ease-out both;
}

.error-stage__watermark {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(7rem, 28vw, 10rem);
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.04em;
}

.error-stage__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  animation: error-rise 0.55s ease-out 0.06s both;
}

.error-stage__brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 4px;
}

.error-stage__brand-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.01em;
}

.error-stage__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #fff 0%, var(--brand-soft) 100%);
  color: var(--brand);
  font-size: 1.9rem;
  border: 1px solid rgba(225, 0, 150, 0.12);
  box-shadow: 0 10px 24px rgba(225, 0, 150, 0.12);
  animation: error-bob 3.8s ease-in-out infinite;
}

.error-stage__code {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}

.error-stage__title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4vw, 1.95rem);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.error-stage__message {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 auto 30px;
  max-width: 34ch;
}

.error-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.error-stage__actions .btn-portal {
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.error-stage__actions .btn-portal:hover {
  transform: translateY(-1px);
}

.error-stage__cta.btn-portal-primary {
  box-shadow: 0 8px 20px rgba(225, 0, 150, 0.22);
}

@keyframes error-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -10px) scale(1.05); }
}

@keyframes error-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes error-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .error-stage__glow,
  .error-stage__icon,
  .error-stage__panel,
  .error-stage__brand { animation: none; }
  .error-stage__actions .btn-portal:hover { transform: none; }
}
