/* Integra SYS — Design System (estilo Integra Code) */

:root {
  --ic-blue: #2E7CF6;
  --ic-blue-light: #4B8FF7;
  --ic-green: #10D9A3;
  --ic-mint: #10D9A3;
  --ic-purple: #7C3FE4;
  --ic-navy: #0F1B3D;
  --ic-text: #0F172A;
  --ic-muted: #475569;
  --ic-border: rgba(226, 232, 240, 0.95);
  --ic-bg: #F5F8FF;
  --ic-card: rgba(255, 255, 255, 0.78);
  --ic-sidebar: rgba(255, 255, 255, 0.72);
  --ic-radius: 12px;
  --ic-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --sidebar-w: 260px;
  --ic-glow: 0 0 0 rgba(46, 124, 246, 0);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-border-soft: rgba(226, 232, 240, 0.9);
  --glass-blur: 16px;
  --brand-bg-wave: url('/static/brand/bg-wave-dots.png');
  --brand-bg-hero: url('/static/brand/bg-hero-logo.png');
}

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

body, .app-body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, sans-serif;
  background:
    linear-gradient(180deg, rgba(245, 248, 255, 0.55) 0%, rgba(255, 255, 255, 0.72) 100%),
    url('/static/brand/bg-wave-dots.png') center top / cover no-repeat fixed;
  background-color: var(--ic-bg);
  color: var(--ic-text);
}

.app-topbar,
.app-card,
.metric-card,
.table-wrap,
.module-tabs-wrap,
.login-card,
.landing-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Sidebar clara — apenas fora do painel mockup (evita texto branco em fundo branco) */
body:not(.mockup-theme) .app-sidebar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.82) !important;
  border-right: 1px solid rgba(226, 232, 240, 0.85);
}

/* Sidebar glass light — painel /app/* e /master/* (detalhes em glass-light.css) */
body.mockup-theme .app-sidebar,
body.mockup-theme .app-sidebar.mockup-sidebar {
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.7) !important;
  color: #0F172A;
}

.app-topbar {
  background: rgba(255, 255, 255, 0.78) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.app-card,
.metric-card,
.table-wrap {
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

/* Do NOT animate .app-sidebar with transform — fill-mode "both" overrides
   mobile off-canvas translateX(-100%) and keeps the drawer stuck open. */
.app-main,
.app-topbar,
.app-card,
.metric-card,
.table-wrap,
.module-tabs-wrap {
  animation: fadeSlide 380ms ease both;
}

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

.app-shell {
  display: flex;
  min-height: 100dvh;
  background: transparent;
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
  background: transparent;
}

/* ── Sidebar ── */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--ic-sidebar);
  border-right: 1px solid var(--ic-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transform: translateX(0);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--ic-border);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 12px rgba(37, 99, 235, 0.20));
}

.sidebar-title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--ic-navy);
  margin: 0;
  line-height: 1.2;
}

.sidebar-sub {
  font-size: 0.6875rem;
  color: var(--ic-muted);
  margin: 0;
}

.sidebar-close {
  margin-left: auto;
  background: var(--ic-bg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--ic-muted);
  cursor: pointer;
}

.sidebar-company {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--ic-border);
}

.sidebar-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--ic-blue), var(--ic-purple));
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.sidebar-company-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ic-navy);
  margin: 0.5rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-branch {
  font-size: 0.6875rem;
  color: var(--ic-muted);
  margin: 0.25rem 0 0;
}

.sidebar-status { font-size: 0.6875rem; margin: 0.35rem 0 0; }
.sidebar-status.ok { color: var(--ic-green); }
.sidebar-status.warn { color: #F59E0B; }

.sidebar-nav {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.35rem 0.65rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.sidebar-nav-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

.nav-section {
  padding: 1rem 0.75rem 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
}

/* ── Sidebar groups + pager ── */
.sidebar-pager {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem 0.15rem;
  flex-shrink: 0;
}

.sidebar-pager-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.sidebar-pager-btn:hover {
  background: #F8FAFC;
  color: #1D4ED8;
  border-color: #BFDBFE;
}

.sidebar-pager-dots {
  flex: 1;
  display: flex;
  gap: 0.3rem;
  justify-content: center;
}

.sidebar-pager-dot {
  min-width: 2.4rem;
  height: 28px;
  padding: 0 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748B;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
}

.sidebar-pager-dot.is-active,
.sidebar-pager-dot[aria-selected="true"] {
  background: rgba(29, 78, 216, 0.1);
  color: #1D4ED8;
  border-color: rgba(29, 78, 216, 0.22);
}

.sidebar-pager-label {
  margin: 0 0.75rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748B;
  letter-spacing: 0.02em;
}

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

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem 0.3rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #94A3B8;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group-toggle:hover { color: #64748B; }

.nav-group-chevron {
  font-size: 0.55rem;
  transition: transform 0.18s ease;
  opacity: 0.7;
}

.nav-group.is-open .nav-group-chevron {
  transform: rotate(180deg);
}

.nav-group-body {
  display: none;
  padding-bottom: 0.15rem;
}

.nav-group.is-open .nav-group-body {
  display: block;
}

.nav-group[data-nav-hidden="1"] {
  display: none;
}

.sidebar-foot-stack {
  flex-shrink: 0;
  border-top: 1px solid var(--ic-border);
  background: inherit;
  padding-top: 0.35rem;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ic-muted);
  text-decoration: none;
  transition: background 0.18s, color 0.18s, transform 0.18s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: #F8FAFC;
  color: var(--ic-navy);
  transform: translateX(2px);
}

.nav-item.is-hovering .nav-icon {
  color: var(--ic-blue);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.08));
  color: var(--ic-blue);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.nav-item.active .nav-icon { color: var(--ic-blue); }

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 0.75rem;
  color: #94A3B8;
}

.sidebar-foot {
  padding: 1rem;
  border-top: 1px solid var(--ic-border);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ic-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-logout:hover {
  background: #FEF2F2;
  color: #DC2626;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
}

.sidebar-overlay.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

@media (max-width: 1023px) {
  .app-sidebar {
    transform: translate3d(-100%, 0, 0);
    box-shadow: 8px 0 32px rgba(0,0,0,0.12);
    padding-left: env(safe-area-inset-left);
  }
  .app-sidebar.open { transform: translate3d(0, 0, 0); }
  .app-content { margin-left: 0; }
  .sidebar-overlay.open {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
}

@media (min-width: 1024px) {
  .app-content { margin-left: var(--sidebar-w); }
  .lg\:hidden { display: none !important; }
}

/* ── Topbar ── */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--ic-card);
  border-bottom: 1px solid var(--ic-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sidebar-toggle {
  background: var(--ic-bg);
  border: 1px solid var(--ic-border);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--ic-navy);
  cursor: pointer;
  flex-shrink: 0;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ic-navy);
  margin: 0;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.75rem;
  color: var(--ic-muted);
  margin: 0.15rem 0 0;
}

.page-modules {
  font-size: 0.625rem;
  color: #94A3B8;
  margin: 0.15rem 0 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.chip-lic.active, .chip-ok { background: #DCFCE7; color: #15803D; }
.chip-lic.trial, .chip-warn { background: #FEF3C7; color: #B45309; }
.chip-lic.blocked { background: #FEE2E2; color: #B91C1C; }
.chip-pdv { background: #EDE9FE; color: #6D28D9; }

.topbar-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--ic-border);
  background: var(--ic-bg);
  color: var(--ic-muted);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.topbar-icon:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--ic-border);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ic-purple), var(--ic-blue));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(124, 58, 237, 0.28);
}

.topbar-username {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ic-navy);
}

@media (max-width: 640px) {
  .topbar-username { display: none; }
  .page-title { font-size: 1.05rem; }
}

/* ── Main ── */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 1rem max(1rem, env(safe-area-inset-right)) calc(2rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  min-width: 0;
}

@media (min-width: 768px) {
  .app-main { padding: 1.25rem 1.75rem 2.5rem; }
}

@media (min-width: 1280px) {
  .app-main { padding: 1.5rem 2rem 3rem; }
}

/* ── Cards & Metrics ── */
.app-card, .metric-card {
  background: var(--ic-card);
  border: 1px solid var(--ic-border);
  border-radius: var(--ic-radius);
  box-shadow: var(--ic-shadow);
  backdrop-filter: saturate(120%) blur(2px);
}

.app-card { padding: 1.25rem; }

.metric-card {
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.metric-card:hover {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-3px);
}

.metric-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ic-muted);
  margin: 0;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ic-navy);
  margin: 0.35rem 0 0;
  line-height: 1.1;
}

.metric-trend {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ic-green);
  margin: 0.35rem 0 0;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.fin-metric-blue .metric-value { color: var(--ic-blue); }
.fin-metric-green .metric-value { color: var(--ic-green); }
.fin-metric-red .metric-value { color: #EF4444; }

/* Grid responsivo */
.metrics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .metrics-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .metrics-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Alert bar (estilo Integra Code) ── */
.alert-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--ic-radius);
  font-size: 0.8125rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.alert-bar.warn {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.alert-bar.info {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

/* ── Module page ── */
.module-header {
  margin-bottom: 1.25rem;
}

.module-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.module-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--ic-card);
  border: 1px solid var(--ic-border);
  border-radius: var(--ic-radius);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: #1E293B;
  border: 1px solid #94A3B8;
  background: #FFFFFF;
  transition: all 0.18s;
  white-space: nowrap;
}

.filter-chip:hover { border-color: #64748B; color: #0F172A; background: #F8FAFC; }

.filter-chip.active {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #fff;
}

.filter-search {
  flex: 1;
  min-width: 140px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  background: var(--ic-bg);
}

.filter-search:focus {
  outline: none;
  border-color: var(--ic-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ic-border);
  border-radius: var(--ic-radius);
  background: var(--ic-card);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.table-wrap th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ic-muted);
  padding: 0.75rem 1rem;
  background: #F8FAFC;
  border-bottom: 1px solid var(--ic-border);
}

.table-wrap td {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid #F1F5F9;
}

.table-wrap tr:hover td { background: #FAFBFC; }

.table-wrap tr {
  transition: transform 0.15s ease;
}

.table-wrap tr:hover {
  transform: translateY(-1px);
}

/* ── Tabs ── */
.module-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  border-bottom: 1px solid var(--ic-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
  background: var(--ic-card);
  border-radius: var(--ic-radius) var(--ic-radius) 0 0;
  padding: 0 0.5rem;
}

.module-tab-btn {
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--ic-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}

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

.module-tab-btn.tab-active,
.module-tab-btn.border-brand-blue {
  color: var(--ic-blue) !important;
  border-bottom-color: var(--ic-blue) !important;
}

.module-tabs-wrap {
  background: var(--ic-card);
  border: 1px solid var(--ic-border);
  border-radius: var(--ic-radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.module-tab-panels { padding: 1.25rem; }

.module-tab-panel { display: none; animation: tabFade 0.2s ease; }
.module-tab-panel.active { display: block; }

@keyframes tabFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.tab-panel-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #F8FAFC;
  border: 1px dashed var(--ic-border);
  border-radius: var(--ic-radius);
}

.tab-panel-empty-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(124,58,237,0.1));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ic-blue);
  font-size: 1.25rem;
}

.tab-panel-empty h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ic-navy);
  margin: 0 0 0.5rem;
}

.tab-panel-empty p {
  font-size: 0.875rem;
  color: var(--ic-muted);
  margin: 0;
  max-width: 28rem;
  margin-inline: auto;
}

.tab-panel-tip { margin-top: 0.75rem !important; font-size: 0.75rem !important; color: #94A3B8 !important; }

/* ── Login ── */
.login-page {
  min-height: 100dvh;
  margin: 0;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.42) 0%, rgba(245, 248, 255, 0.78) 55%, rgba(255, 255, 255, 0.88) 100%),
    url('/static/brand/bg-hero-logo.png') center / cover no-repeat fixed;
  background-color: #F5F8FF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-wrap { width: 100%; max-width: 420px; }

.login-brand { text-align: center; margin-bottom: 1.5rem; }

.login-logo-wrap { display: inline-block; margin-bottom: 0.5rem; }

.login-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
}

.nav-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-icon-official {
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-sizing: border-box;
}

.brand-logo-official {
  object-fit: contain;
  background: transparent !important;
  display: block;
  height: auto;
  max-width: 100%;
}

.nav-brand-icon.brand-icon-official,
.hero-brand-icon.brand-icon-official {
  padding: 0;
}

.nav-wordmark {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ic-navy);
  letter-spacing: -0.02em;
}

.nav-wordmark-accent {
  color: #2E7CF6;
  font-weight: 800;
}

.hero-brand-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
}

.hero-wordmark {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--ic-navy);
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0 0 1.5rem;
}

.hero-wordmark-accent {
  color: #2E7CF6;
  font-weight: 800;
}

.hero-logo { width: 200px; height: 200px; object-fit: contain; }
.nav-logo { width: 40px; height: 40px; object-fit: contain; }

.brand-logo-anim {
  animation: logoFloat 4.2s ease-in-out infinite;
  transform-origin: center;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 6px 12px rgba(37, 99, 235, 0.20)); }
  50% { transform: translateY(-4px); filter: drop-shadow(0 12px 18px rgba(37, 99, 235, 0.24)); }
}

.login-brand h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ic-navy);
  margin: 0;
}

.login-brand p {
  color: var(--ic-muted);
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}

.login-card {
  background: var(--ic-card);
  border-radius: var(--ic-radius);
  border: 1px solid var(--ic-border);
  padding: 2rem;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
  animation: popIn 420ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ic-navy);
  margin: 0 0 0.25rem;
}

.login-sub {
  font-size: 0.8125rem;
  color: var(--ic-muted);
  margin: 0 0 1.5rem;
}

.login-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.login-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 1rem;
}

.login-form input {
  display: block;
  width: 100%;
  margin-top: 0.375rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ic-border);
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--ic-navy);
  background: #F8FAFC;
}

.login-form input:focus {
  border-color: var(--ic-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
  outline: none;
}

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 2.75rem; }

.pwd-wrap button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0.5rem;
}

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
}

.login-row a { color: var(--ic-blue); text-decoration: none; }
.login-row a:hover { text-decoration: underline; }
.login-lic { color: #94A3B8; }

.login-submit {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

.login-submit:hover {
  opacity: 0.96;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.28);
  background: linear-gradient(135deg, #1E40AF, #1D4ED8);
}

.login-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.login-foot {
  text-align: center;
  font-size: 0.75rem;
  color: #94A3B8;
  margin: 1.25rem 0 0;
}

/* ── Toast & Modal ── */
.integra-toast {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  right: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--ic-navy);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  max-width: 360px;
  margin-left: auto;
}

.integra-toast.show { transform: translateY(0); opacity: 1; }
.integra-toast.ok { background: #059669; }
.integra-toast.err { background: #DC2626; }
.integra-toast.warn { background: #D97706; }
.integra-toast.hidden { display: none; }

/* ── Ramos de atividade (50 segmentos) ── */
.sidebar-vertical-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 0.35rem; padding: 0.2rem 0.5rem; border-radius: 6px;
  font-size: 0.65rem; font-weight: 700; color: #2E7CF6;
  background: rgba(46,124,246,0.1); border: 1px solid rgba(46,124,246,0.2);
}
.vertical-hub-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.vertical-op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.vertical-op-card {
  display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.1rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  text-decoration: none; color: inherit;
}
.vertical-op-card:hover { border-color: #2E7CF6; box-shadow: 0 4px 20px rgba(46,124,246,0.12); transform: translateY(-1px); }
.vertical-op-icon { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg,#2E7CF6,#7C3FE4); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.vertical-op-label { font-weight: 600; font-size: 0.875rem; color: #0B1440; flex: 1; }
.vertical-op-arrow { color: #94a3b8; font-size: 0.75rem; }
.vertical-module-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1.25rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; margin-bottom: 1.5rem; }
.vertical-module-icon { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg,#2E7CF6,#10D9A3); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.vertical-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; max-height: 420px; overflow-y: auto; }
.vertical-select-card {
  display: flex; flex-direction: column; gap: 0.15rem; padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.vertical-select-card strong { font-size: 0.8rem; color: #0B1440; }
.vertical-select-card span { font-size: 0.65rem; color: #64748b; text-transform: capitalize; }
.vertical-select-card.active, .vertical-select-card:hover { border-color: #2E7CF6; background: rgba(46,124,246,0.06); }

#integra-modal.hidden { display: none; }

.integra-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.integra-modal-box {
  background: var(--ic-card);
  border-radius: var(--ic-radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.integra-modal-box.cadastro-wide { max-width: 640px; }

.integra-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--ic-bg);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  color: var(--ic-muted);
  cursor: pointer;
  line-height: 1;
}

.integra-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ic-navy);
  margin: 0 0 1rem;
  padding-right: 2rem;
}

.integra-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.875rem;
}

.integra-form input,
.integra-form select,
.integra-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  font-size: 0.875rem;
}

.integra-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  padding: 0.625rem 1.125rem;
  background: #1D4ED8;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.integra-btn-primary:hover { background: #1E40AF; color: #FFFFFF; }
.integra-btn-primary:disabled {
  background: #E2E8F0;
  color: #64748B;
  opacity: 1;
  cursor: not-allowed;
}

/* Login full-width primary (somente formulário de auth) */
.login-form .integra-btn-primary,
.login-card .integra-btn-primary {
  width: 100%;
  padding: 0.75rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }

input:focus, button:focus-visible { outline: none; }
.metric-icon.bg-brand-blue { background: linear-gradient(135deg, #2563EB, #3B82F6); }
.metric-icon.bg-brand-purple { background: linear-gradient(135deg, #7C3AED, #8B5CF6); }
.metric-icon.bg-brand-teal { background: linear-gradient(135deg, #10B981, #34D399); }
.metric-icon.bg-indigo-500 { background: linear-gradient(135deg, #4F46E5, #6366F1); }
.metric-icon.bg-red-500 { background: linear-gradient(135deg, #EF4444, #F87171); }
.metric-icon.bg-amber-500 { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.metric-icon.bg-slate-600 { background: linear-gradient(135deg, #475569, #64748B); }
.metric-icon.bg-emerald-600 { background: linear-gradient(135deg, #059669, #10B981); }
.metric-icon.bg-violet-500 { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.metric-icon.bg-rose-500 { background: linear-gradient(135deg, #F43F5E, #FB7185); }
.metric-icon.bg-orange-500 { background: linear-gradient(135deg, #F97316, #FB923C); }
.metric-icon.bg-cyan-600 { background: linear-gradient(135deg, #0891B2, #22D3EE); }

.row-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0F172A;
  background: #FFFFFF;
  border: 1px solid #94A3B8;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.row-edit-btn i { color: inherit; }

.row-edit-btn:hover {
  background: #F8FAFC;
  border-color: #64748B;
  color: #0F1B3D;
}

tr[data-row-click]:hover td { background: #F8FAFC !important; }

button:focus-visible { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
  color: #94A3B8;
}
.crumb-link { color: var(--ic-blue); text-decoration: none; font-weight: 500; }
.crumb-link:hover { text-decoration: underline; }
.crumb-current { color: #64748B; font-weight: 600; }
.crumb-sep { font-size: 0.55rem; opacity: 0.5; }

/* Paginação */
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #F8FAFC;
  border-radius: 10px;
  border: 1px solid var(--ic-border);
}
.list-meta { font-size: 0.75rem; color: #64748B; }
.page-controls { display: flex; align-items: center; gap: 0.25rem; }
.page-btn, .page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: #334155;
  background: #fff;
  border: 1px solid #94A3B8;
  transition: all 0.15s;
}
.page-btn:hover, .page-num:hover { border-color: #64748B; color: #0F172A; background: #F8FAFC; }
.page-num.active { background: #1D4ED8; color: #fff; border-color: #1D4ED8; }
.page-btn.disabled {
  opacity: 1;
  pointer-events: none;
  color: #94A3B8;
  background: #F1F5F9;
  border-color: #E2E8F0;
}
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: var(--ic-blue); }

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; gap: 0.5rem; max-height: 420px; overflow-y: auto; }
.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--ic-border);
  background: #FAFBFC;
  transition: transform 0.15s;
}
.activity-item:hover { transform: translateX(2px); }
.activity-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #EFF6FF;
  color: var(--ic-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
}
.activity-summary { font-size: 0.8rem; color: var(--ic-navy); font-weight: 500; margin: 0; }
.activity-time { font-size: 0.7rem; color: #94A3B8; margin: 0.15rem 0 0; }

/* Alert links dashboard */
.alert-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid;
  text-decoration: none;
  font-size: 0.85rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.alert-link:hover { transform: translateY(-1px); box-shadow: var(--ic-shadow); }
.alert-link.warn { border-color: #FDE68A; background: #FFFBEB; color: #92400E; }
.alert-link.err { border-color: #FECACA; background: #FEF2F2; color: #991B1B; }
.alert-link.info { border-color: #BFDBFE; background: #EFF6FF; color: #1E40AF; }

.fld-invalid { border-color: #EF4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,0.15); }

.anim-fade-in { animation: fadeSlide 0.45s ease-out both; }

.filter-chip.filter-save { border-style: dashed; }
.filter-chip.filter-reset { color: #64748B; }
.saved-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-top: 0.5rem; width: 100%; }
.saved-filters .saved-label { font-size: 0.7rem; color: #94A3B8; font-weight: 600; }
.saved-chip { font-size: 0.7rem !important; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.25rem; }
.sort-link:hover { color: var(--ic-blue); }

.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #94A3B8; margin-left: 6px; vertical-align: middle; }
.sync-dot.sync-live { background: #22C55E; box-shadow: 0 0 6px rgba(34,197,94,0.6); animation: pulseSync 2s infinite; }
@keyframes pulseSync { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.wizard-steps { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.wizard-step { padding: 0.25rem 0.6rem; border-radius: 999px; background: #F1F5F9; font-weight: 600; color: #64748B; }
.wizard-step.active { background: #2563EB; color: #fff; }
.page-limit-select { background: var(--ic-card); color: var(--ic-text); }
