/* Integra SYS ? Mockup Theme (Integra Code) */

.mockup-theme {
  --sidebar-w: 248px;
  --sidebar-bg: rgba(255, 255, 255, 0.72);
  --sidebar-text: #1E293B;
  --sidebar-active: #1D4ED8;
  --header-h: 64px;
  --page-bg: #F5F8FF;
  --card-radius: 12px;
  --primary: #1D4ED8;
  --success: #047857;
  --warning: #D97706;
  --danger: #B91C1C;
}

.mockup-theme.app-body {
  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(--page-bg);
}

/* Glass Light Sidebar */
body.mockup-theme .mockup-sidebar.app-sidebar,
.mockup-sidebar.app-sidebar {
  width: var(--sidebar-w);
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 4px 0 28px rgba(15, 23, 42, 0.05);
}

.mockup-sidebar .sidebar-head {
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  padding: 1rem 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 64px;
}

.sidebar-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}

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

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

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

.sidebar-brand-logo {
  height: 40px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
  display: block;
  background: transparent !important;
}

.sidebar-brand-icon.brand-icon-official { padding: 0; }

.login-brand-icon.brand-icon-official,
.hero-brand-icon.brand-icon-official,
.nav-brand-icon.brand-icon-official {
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.sidebar-wordmark {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0F1B3D;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

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

.login-brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.login-brand-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.login-wordmark {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #0B1440;
  letter-spacing: -0.03em;
}

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

.login-brand-sub {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: #64748B;
  text-align: center;
}

@media (max-width: 1023px) {
  .sidebar-brand-icon { width: 36px; height: 36px; }
  .sidebar-wordmark { font-size: 1rem; }
}

@media (max-width: 380px) {
  .sidebar-wordmark { font-size: 0.9rem; }
  .sidebar-brand-icon { width: 32px; height: 32px; }
}

.sidebar-logo-link,
.sidebar-logo-lockup { display: none; }

.mockup-sidebar .nav-section {
  color: #64748B;
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.625rem;
}

.mockup-sidebar .nav-item {
  color: var(--sidebar-text);
  border-radius: 10px;
  margin: 2px 0.5rem;
  padding: 0.7rem 0.875rem;
  font-weight: 500;
}

.mockup-sidebar .nav-item:hover {
  background: rgba(46, 124, 246, 0.08);
  color: #0F172A;
  transform: none;
}

.mockup-sidebar .nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(46, 124, 246, 0.28);
}

.mockup-sidebar .nav-icon {
  color: inherit;
  opacity: 0.9;
}

.mockup-sidebar .sidebar-close {
  background: rgba(241, 245, 249, 0.95);
  color: #334155;
}

.mockup-sidebar .sidebar-plan-card {
  margin: 0.75rem;
  padding: 0.875rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
}

a.sidebar-plan-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

a.sidebar-plan-card-link:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(16, 217, 163, 0.35);
}

a.sidebar-plan-card-link .sidebar-plan-btn {
  pointer-events: none;
}

.mockup-sidebar .sidebar-plan-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 0.25rem;
}

.mockup-sidebar .sidebar-plan-exp {
  font-size: 0.625rem;
  color: #64748B;
  margin: 0 0 0.5rem;
}

.mockup-sidebar .sidebar-plan-bar {
  height: 4px;
  background: #E2E8F0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.mockup-sidebar .sidebar-plan-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #059669, #10D9A3);
  border-radius: 8px;
}

.mockup-sidebar .sidebar-plan-pct {
  font-size: 0.625rem;
  color: #64748B;
  margin: 0 0 0.5rem;
}

.mockup-sidebar .sidebar-plan-btn {
  display: block;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #FFFFFF;
  background: #1D4ED8;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.45rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.mockup-sidebar .sidebar-plan-btn:hover {
  background: #1E40AF;
  color: #FFFFFF;
}

.mockup-sidebar .sidebar-help {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0.75rem 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #475569;
  text-decoration: none;
}

.mockup-sidebar .sidebar-help:hover { color: #1D4ED8; }

.mockup-sidebar .sidebar-foot {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.mockup-sidebar .sidebar-logout {
  color: #64748B;
}

.mockup-sidebar .sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #B91C1C;
}

/* ?? Global Header ?? */
.global-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #E8EDF5;
  min-height: var(--header-h);
  flex-shrink: 0;
}

.global-header-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.company-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
}

.company-selector-main { display: flex; flex-direction: column; }

.company-selector-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
}

.company-selector-cnpj {
  font-size: 0.625rem;
  color: #94A3B8;
}

.company-selector-chevron { font-size: 0.625rem; color: #94A3B8; }

.branch-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.branch-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.global-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 480px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}

.global-search-wrap i { color: #94A3B8; font-size: 0.875rem; }

.global-search {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  color: #0F172A;
  outline: none;
}

.global-search-wrap kbd {
  font-size: 0.625rem;
  font-weight: 600;
  color: #94A3B8;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
}

.global-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.global-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  cursor: pointer;
  transition: background 0.15s;
}

.global-icon-btn:hover { background: #fff; }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #EF4444;
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 800;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.notif-backdrop.open { opacity: 1; pointer-events: auto; }

.notif-panel {
  position: fixed;
  top: 64px;
  right: 1rem;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(70vh, 520px);
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  z-index: 201;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.notif-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #E2E8F0;
}
.notif-panel-head h3 { margin: 0; font-size: 0.9375rem; font-weight: 700; color: #0A1931; display: flex; align-items: center; gap: 0.5rem; }
.notif-close { width: 32px; height: 32px; border: none; background: #F1F5F9; border-radius: 8px; cursor: pointer; color: #64748B; }

.notif-panel-body { overflow-y: auto; padding: 0.5rem; flex: 1; }
.notif-empty { padding: 1.5rem; text-align: center; color: #94A3B8; font-size: 0.875rem; }

.notif-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.35rem;
}
.notif-item:hover { background: #F8FAFC; }
.notif-item-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item--warn .notif-item-icon { background: #FEF3C7; color: #D97706; }
.notif-item--err .notif-item-icon { background: #FEE2E2; color: #DC2626; }
.notif-item--info .notif-item-icon { background: #DBEAFE; color: #2563EB; }
.notif-item--ok .notif-item-icon { background: #DCFCE7; color: #16A34A; }
.notif-item-body strong { display: block; font-size: 0.8125rem; color: #0F172A; }
.notif-item-body p { margin: 0.15rem 0 0; font-size: 0.75rem; color: #64748B; line-height: 1.4; }
.notif-item-body time { font-size: 0.625rem; color: #94A3B8; }
.notif-item-link { font-size: 0.6875rem; font-weight: 700; color: #0066FF; white-space: nowrap; align-self: center; }

.notif-panel-foot { padding: 0.75rem 1rem; border-top: 1px solid #E2E8F0; text-align: center; }
.notif-see-all { font-size: 0.8125rem; font-weight: 600; color: #0066FF; text-decoration: none; }

.notif-table-badge { font-size: 0.6875rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 6px; }
.notif-table-badge--warn { background: #FEF3C7; color: #B45309; }
.notif-table-badge--err { background: #FEE2E2; color: #B91C1C; }
.notif-table-badge--info { background: #DBEAFE; color: #1D4ED8; }
.notif-table-badge--ok { background: #DCFCE7; color: #15803D; }

body.notif-open { overflow: hidden; }

.global-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid #E2E8F0;
}

.global-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C3AED, #0066FF);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-user-info { display: flex; flex-direction: column; }

.global-user-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
}

.global-user-role {
  font-size: 0.625rem;
  color: #94A3B8;
}

/* ?? Page Header ?? */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem;
  flex-wrap: wrap;
}

.page-title-main {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.02em;
}

.page-subtitle-main {
  font-size: 0.8125rem;
  color: #64748B;
  margin: 0.25rem 0 0;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-date-meta {
  font-size: 0.75rem;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-mockup-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
  transition: background 0.15s, transform 0.15s;
}

.btn-mockup-primary i { color: inherit; }

.btn-mockup-primary:hover { background: #1E40AF; transform: translateY(-1px); color: #fff; }
.btn-mockup-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-mockup-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.875rem;
  background: #fff;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-mockup-outline i { color: inherit; }

.btn-mockup-outline:hover { background: #F8FAFC; color: #0F1B3D; border-color: #94A3B8; }

.btn-mockup-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.875rem;
  background: #F1F5F9;
  color: #1E293B;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-mockup-ghost i { color: inherit; }

.btn-mockup-ghost:hover {
  background: #E2E8F0;
  color: #0F172A;
  border-color: #94A3B8;
}

.btn-mockup-green {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.28);
}

.btn-mockup-green:hover { background: #065F46; color: #fff; }

.btn-mockup-green i { color: inherit; }

.page-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ?? KPI Cards (mobile-first) ?? */
.kpi-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
  grid-template-columns: 1fr;
}

.kpi-cols-4,
.kpi-cols-3,
.kpi-cols-2 { grid-template-columns: 1fr; }

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

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

.kpi-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.125rem 1.25rem;
  background: #fff;
  border-radius: var(--card-radius);
  border: 1px solid #E8EDF5;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}

.mockup-theme .kpi-card,
.mockup-theme .widget-card,
.mockup-theme .mock-filter-row,
.mockup-theme .report-cat-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(226, 232, 240, 0.9);
}

.kpi-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748B;
  margin: 0 0 0.35rem;
}

.kpi-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.6875rem;
  color: #94A3B8;
  margin: 0.25rem 0 0;
}

.kpi-trend {
  font-size: 0.6875rem;
  font-weight: 600;
  margin: 0.35rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-neutral { color: #94A3B8; }

.kpi-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.5rem;
  text-decoration: none;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.kpi-blue .kpi-icon { background: #EFF6FF; color: #2563EB; }
.kpi-green .kpi-icon { background: #ECFDF5; color: #16A34A; }
.kpi-orange .kpi-icon { background: #FFF7ED; color: #EA580C; }
.kpi-purple .kpi-icon { background: #F5F3FF; color: #7C3AED; }
.kpi-red .kpi-icon { background: #FEF2F2; color: #DC2626; }
.kpi-teal .kpi-icon { background: #F0FDFA; color: #0D9488; }
.kpi-indigo .kpi-icon { background: #EEF2FF; color: #4F46E5; }

/* ?? Filters ?? */
.mock-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #E8EDF5;
  border-radius: var(--card-radius);
  margin-bottom: 1rem;
}

.mock-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748B;
}

.mock-select {
  padding: 0.45rem 0.75rem;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #334155;
  background: #fff;
  min-width: 120px;
}

.mock-filter-clear {
  font-size: 0.75rem;
  color: #94A3B8;
  text-decoration: none;
  padding: 0.45rem 0;
  margin-left: auto;
}

.mock-filter-clear:hover { color: var(--primary); }

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.875rem;
  background: #fff;
  border: 1px solid #94A3B8;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1E293B;
  text-decoration: none;
  transition: all 0.15s;
}

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

.cat-pill.active {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #fff;
}

.cat-count {
  font-size: 0.625rem;
  font-weight: 700;
  opacity: 0.8;
}

/* ?? Tables ?? */
.mockup-theme .table-wrap {
  background: #fff;
  border: 1px solid #E8EDF5;
  border-radius: var(--card-radius);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

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

.mockup-theme .table-wrap thead {
  background: #F8FAFC;
  border-bottom: 1px solid #E8EDF5;
}

.mockup-theme .table-wrap th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94A3B8;
  text-align: left;
}

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

.mockup-theme .table-wrap tbody tr:hover {
  background: #F8FAFC;
}

/* ?? Status Pills ?? */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.status-green { background: #DCFCE7; color: #065F46; }
.status-red { background: #FEE2E2; color: #B91C1C; }
.status-orange { background: #FEF3C7; color: #B45309; }
.status-blue { background: #DBEAFE; color: #1D4ED8; }
.status-purple { background: #EDE9FE; color: #6D28D9; }
.status-gray { background: #F1F5F9; color: #64748B; }

/* ?? Widgets ?? */
.widget-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

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

.widget-card {
  background: #fff;
  border: 1px solid #E8EDF5;
  border-radius: var(--card-radius);
  padding: 1.125rem 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.widget-head h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.widget-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

/* ?? Rank & Movement lists ?? */
.rank-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #F1F5F9;
}

.rank-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #F1F5F9;
  font-size: 0.6875rem;
  font-weight: 800;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rank-title { font-size: 0.8125rem; font-weight: 600; color: #0F172A; margin: 0; }
.rank-meta { font-size: 0.6875rem; color: #94A3B8; margin: 0.1rem 0 0; }
.rank-value { margin-left: auto; font-size: 0.8125rem; font-weight: 700; color: #0F172A; }
.rank-badge {
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #FEF3C7;
  color: #B45309;
}

.movement-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #F1F5F9;
}

.movement-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.mov-in { background: #ECFDF5; color: #16A34A; }
.mov-out { background: #FEF2F2; color: #DC2626; }
.mov-transfer { background: #EFF6FF; color: #2563EB; }

.movement-title { font-size: 0.8125rem; font-weight: 600; margin: 0; }
.movement-meta { font-size: 0.6875rem; color: #94A3B8; margin: 0; }
.movement-right { margin-left: auto; text-align: right; }
.movement-qty { font-size: 0.8125rem; font-weight: 700; display: block; }
.movement-time { font-size: 0.625rem; color: #94A3B8; }

/* ?? Report categories ?? */
.report-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) { .report-cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .report-cat-grid { grid-template-columns: 1fr; } }

.report-cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #E8EDF5;
  border-radius: var(--card-radius);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.report-cat-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.report-cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.report-cat-blue .report-cat-icon { background: #EFF6FF; color: #2563EB; }
.report-cat-orange .report-cat-icon { background: #FFF7ED; color: #EA580C; }
.report-cat-green .report-cat-icon { background: #ECFDF5; color: #16A34A; }
.report-cat-purple .report-cat-icon { background: #F5F3FF; color: #7C3AED; }
.report-cat-indigo .report-cat-icon { background: #EEF2FF; color: #4F46E5; }
.report-cat-teal .report-cat-icon { background: #F0FDFA; color: #0D9488; }

.report-cat-label { font-size: 0.875rem; font-weight: 700; color: #0F172A; }
.report-cat-count { font-size: 0.6875rem; color: #94A3B8; }

/* ?? Main content area ?? */
.mockup-theme .app-main {
  padding: 0 1.5rem 2rem;
}

.mockup-theme .app-card {
  background: #fff;
  border: 1px solid #E8EDF5;
  border-radius: var(--card-radius);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.mockup-theme .metrics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

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

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

.mockup-theme .filter-bar {
  background: #fff;
  border: 1px solid #E8EDF5;
  border-radius: var(--card-radius);
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}

.mockup-theme .filter-chip {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #94A3B8;
  background: #fff;
  color: #1E293B;
  text-decoration: none;
  font-weight: 600;
}

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

.mockup-theme .module-tabs-bar {
  border-bottom: 1px solid #E8EDF5;
  margin-bottom: 1rem;
}

.mockup-theme .module-tab-btn {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748B;
  padding: 0.625rem 1rem;
  border-bottom: 2px solid transparent;
}

.mockup-theme .module-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ?? Dashboard charts ?? */
.dashboard-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dashboard-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 1024px) {
  .dashboard-charts-row,
  .dashboard-bottom-row { grid-template-columns: 1fr; }
  .global-search-wrap { display: none; }
  .branch-selector { display: none; }
}

/* ?? Empty state ?? */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #F1F5F9;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
}

.empty-state-title { font-size: 0.875rem; font-weight: 600; color: #64748B; margin: 0; }
.empty-state-msg { font-size: 0.75rem; color: #94A3B8; margin: 0.25rem 0 0; }

/* ?? Vertical hub ?? */
.vertical-hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.vertical-op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.vertical-op-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  background: #fff;
  border: 1px solid #E8EDF5;
  border-radius: var(--card-radius);
  text-decoration: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.vertical-op-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.1);
}

.vertical-op-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #EFF6FF;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vertical-op-label { font-size: 0.8125rem; font-weight: 600; color: #0F172A; flex: 1; }
.vertical-op-arrow { color: #CBD5E1; font-size: 0.75rem; }

.vertical-hub-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}
.vertical-hub-badge--blue { background: #DBEAFE; color: #1D4ED8; }
.vertical-hub-badge--orange { background: #FFEDD5; color: #C2410C; }
.vertical-hub-badge--purple { background: #EDE9FE; color: #6D28D9; }
.vertical-hub-badge--cyan { background: #CFFAFE; color: #0E7490; }
.vertical-hub-badge--green { background: #D1FAE5; color: #047857; }
.vertical-hub-badge--indigo { background: #E0E7FF; color: #4338CA; }

html[data-vertical-tone="orange"] { --primary: #F59E0B; --sidebar-accent: #FBBF24; }
html[data-vertical-tone="purple"] { --primary: #8B5CF6; --sidebar-accent: #A78BFA; }
html[data-vertical-tone="cyan"] { --primary: #0EA5E9; --sidebar-accent: #38BDF8; }
html[data-vertical-tone="green"] { --primary: #10B981; --sidebar-accent: #34D399; }
html[data-vertical-tone="indigo"] { --primary: #6366F1; --sidebar-accent: #818CF8; }

.mockup-sidebar .sidebar-nav { max-height: calc(100vh - 220px); overflow-y: auto; }

/* P?gina personalizada do ramo */
.ramo-page { display: flex; flex-direction: column; gap: 1.5rem; }
.ramo-hero {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.5rem; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(239,246,255,0.92) 100%);
  color: #0F1B3D;
  border: 1px solid rgba(255,255,255,0.75);
  box-shadow: 0 8px 24px rgba(15,23,42,0.06);
}
.ramo-page--orange .ramo-hero { background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(255,237,213,0.92) 100%); color: #0F1B3D; }
.ramo-page--green .ramo-hero { background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(236,253,245,0.92) 100%); color: #0F1B3D; }
.ramo-page--purple .ramo-hero { background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(245,243,255,0.92) 100%); color: #0F1B3D; }
.ramo-page--cyan .ramo-hero { background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(236,254,255,0.92) 100%); color: #0F1B3D; }
.ramo-page--indigo .ramo-hero { background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(238,242,255,0.92) 100%); color: #0F1B3D; }
.ramo-title { margin: 0.5rem 0 0; font-size: 1.75rem; font-weight: 800; }
.ramo-subtitle { margin: 0.35rem 0 0; font-size: 0.9rem; opacity: 0.85; }
.ramo-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; }
.ramo-tag { font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 8px; background: rgba(46,124,246,0.1); color: #1E40AF; }
.ramo-hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ramo-section-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; color: #0F172A; }
.ramo-section-head p { margin: 0.25rem 0 0; font-size: 0.8rem; color: #64748B; }
.ramo-op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.ramo-op-card {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem;
  border: 1px solid #E2E8F0; border-radius: 12px; background: #fff; text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ramo-op-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(0,102,255,0.1); }
.ramo-op-icon { width: 36px; height: 36px; border-radius: 10px; background: #EFF6FF; color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ramo-op-label { font-size: 0.8125rem; font-weight: 600; color: #0F172A; }
.ramo-cadastro-bar {
  margin: 1.25rem 0 1.5rem; padding: 1rem 1.125rem; border: 1px solid #E2E8F0; border-radius: 12px; background: #F8FAFC;
}
.ramo-cadastro-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.ramo-areas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.ramo-area-card { padding: 1rem; border: 1px solid #E2E8F0; border-radius: 12px; background: #fff; }
.ramo-area-card h3 { margin: 0 0 0.75rem; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #64748B; }
.ramo-area-links { display: flex; flex-direction: column; gap: 0.35rem; }
.ramo-area-link { font-size: 0.8125rem; font-weight: 600; color: #0F172A; text-decoration: none; display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; }
.ramo-area-link:hover { color: var(--primary); }
.ramo-sections-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ramo-section-pill { font-size: 0.75rem; font-weight: 600; padding: 0.35rem 0.75rem; border-radius: 999px; background: #F1F5F9; color: #475569; display: inline-flex; align-items: center; gap: 0.35rem; }

.ramo-pack-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem 1.25rem;
  border: 1px solid #E2E8F0; border-radius: 12px; background: #fff;
}
.ramo-pack-stat { text-align: center; min-width: 72px; }
.ramo-pack-stat strong { display: block; font-size: 1.35rem; color: var(--primary); }
.ramo-pack-stat span { font-size: 0.68rem; font-weight: 700; color: #64748B; text-transform: uppercase; }

.ramo-features { display: flex; flex-direction: column; gap: 1rem; }
.ramo-features-head { display: flex; flex-direction: column; gap: 0.75rem; }
.ramo-features-back { font-size: 0.8rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.ramo-features-tabs { display: flex; gap: 0.5rem; }
.ramo-features-tab {
  padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  border: 1px solid #E2E8F0; background: #fff; color: #475569; text-decoration: none;
}
.ramo-features-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ramo-features-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.ramo-features-search {
  flex: 1; min-width: 200px; padding: 0.65rem 0.85rem; border: 1px solid #E2E8F0; border-radius: 10px;
}
.ramo-features-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ramo-feat-chip {
  padding: 0.35rem 0.65rem; border-radius: 999px; border: 1px solid #E2E8F0; background: #fff;
  font-size: 0.72rem; font-weight: 700; color: #64748B; cursor: pointer;
}
.ramo-feat-chip.active { background: #EFF6FF; border-color: var(--primary); color: var(--primary); }
.ramo-feat-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 65vh; overflow-y: auto; }
.ramo-feat-row {
  display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 1rem;
  border: 1px solid #E2E8F0; border-radius: 10px; background: #fff; text-decoration: none; color: inherit;
}
.ramo-feat-row--ok { border-color: #86EFAC; background: #F0FDF4; }
.ramo-feat-id { font-size: 0.72rem; font-weight: 800; color: var(--primary); min-width: 42px; }
.ramo-feat-body { flex: 1; min-width: 0; }
.ramo-feat-body strong { display: block; font-size: 0.8125rem; color: #0F172A; }
.ramo-feat-body small { display: block; margin-top: 0.2rem; font-size: 0.72rem; color: #64748B; line-height: 1.4; }
.ramo-feat-badge { font-size: 0.65rem; font-weight: 800; padding: 0.2rem 0.45rem; border-radius: 6px; background: #EFF6FF; color: var(--primary); }

/* ===== Licen?a / uso do plano ===== */
.lic-page { display: flex; flex-direction: column; gap: 1.25rem; }
.lic-hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.25rem 1.5rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.75);
  background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(239,246,255,0.92) 55%, rgba(236,253,245,0.88) 100%); color: #0F1B3D;
}
.lic-hero-ok { box-shadow: inset 0 -3px 0 #10D9A3; }
.lic-hero-info { box-shadow: inset 0 -3px 0 #0066FF; }
.lic-hero-warn, .lic-hero-danger { box-shadow: inset 0 -3px 0 #F59E0B; }
.lic-hero-danger { box-shadow: inset 0 -3px 0 #EF4444; }
.lic-hero-muted { box-shadow: inset 0 -3px 0 #94A3B8; }
.lic-hero-eyebrow { margin: 0 0 0.35rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #0D9488; }
.lic-hero-eyebrow i { color: #10D9A3; margin-right: 0.35rem; }
.lic-hero-title { margin: 0 0 0.35rem; font-size: 1.5rem; font-weight: 800; color: #0F1B3D; }
.lic-hero-sub { margin: 0; font-size: 0.875rem; color: #475569; max-width: 36rem; line-height: 1.45; }
.lic-hero-badge { text-align: right; }
.lic-hero-key { margin: 0.5rem 0 0; font-size: 0.75rem; color: #64748B; font-family: ui-monospace, monospace; }
.lic-hero-key span { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: #94A3B8; margin-bottom: 0.15rem; }

.lic-alert {
  display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.85rem 1rem;
  border-radius: 10px; font-size: 0.875rem; font-weight: 550; line-height: 1.45;
}
.lic-alert i { margin-top: 0.15rem; }
.lic-alert-warn { background: #FFFBEB; border: 1px solid #FCD34D; color: #92400E; }
.lic-alert-danger { background: #FEF2F2; border: 1px solid #FCA5A5; color: #991B1B; }

.lic-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 1024px) { .lic-grid { grid-template-columns: 1.15fr 0.85fr; } }

.lic-panel {
  background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 1.25rem 1.35rem;
}
.lic-panel-full { width: 100%; }
.lic-panel-head { margin-bottom: 1rem; }
.lic-panel-head h3 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 800; color: #0A1931; }
.lic-panel-head h3 i { color: #0066FF; margin-right: 0.4rem; }
.lic-panel-head p { margin: 0; font-size: 0.8rem; color: #64748B; }

.lic-usage-item { margin-bottom: 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px solid #F1F5F9; }
.lic-usage-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.lic-usage-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; margin-bottom: 0.45rem; }
.lic-usage-label { font-size: 0.8125rem; font-weight: 700; color: #0F172A; }
.lic-usage-label i { color: #0066FF; margin-right: 0.35rem; }
.lic-usage-nums { font-size: 0.8125rem; font-weight: 700; color: #334155; white-space: nowrap; }
.lic-usage-bar { height: 8px; background: #E2E8F0; border-radius: 99px; overflow: hidden; }
.lic-usage-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0066FF, #10D9A3); }
.lic-usage-warn .lic-usage-bar span { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.lic-usage-danger .lic-usage-bar span { background: linear-gradient(90deg, #EF4444, #F87171); }
.lic-usage-foot { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.35rem; font-size: 0.72rem; color: #64748B; }
.lic-usage-alert { color: #B45309; font-weight: 700; }
.lic-usage-meta { margin: 0.35rem 0 0; font-size: 0.78rem; color: #64748B; }
.lic-usage-meta strong { color: #0F172A; }

.lic-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.lic-timeline-item { display: flex; gap: 0.75rem; align-items: flex-start; }
.lic-timeline-dot {
  width: 2rem; height: 2rem; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0;
  background: #EFF6FF; color: #0066FF; font-size: 0.75rem;
}
.lic-timeline-label { margin: 0; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #64748B; }
.lic-timeline-value { margin: 0.15rem 0 0; font-size: 0.9375rem; font-weight: 750; color: #0A1931; }
.lic-timeline-sub { margin: 0.15rem 0 0; font-size: 0.75rem; color: #64748B; }
.lic-blocked-reason { margin: 1rem 0 0; padding: 0.75rem; border-radius: 8px; background: #FEF2F2; color: #991B1B; font-size: 0.8125rem; }

.lic-modules-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.65rem;
}
.lic-module-card {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.7rem 0.8rem;
  border: 1px solid #E2E8F0; border-radius: 10px; background: #F8FAFC;
}
.lic-module-icon {
  width: 2rem; height: 2rem; border-radius: 8px; display: grid; place-items: center;
  background: #EFF6FF; color: #0066FF; font-size: 0.8rem;
}
.lic-module-name { flex: 1; font-size: 0.8125rem; font-weight: 700; color: #0F172A; }
.lic-module-check { color: #10D9A3; font-size: 0.75rem; }
.lic-empty { margin: 0; font-size: 0.875rem; color: #64748B; }

.lic-cta {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.25rem 1.35rem; border-radius: 14px; border: 1px solid #BFDBFE;
  background: linear-gradient(135deg, #EFF6FF, #F0FDFA);
}
.lic-cta h3 { margin: 0 0 0.25rem; font-size: 1.05rem; font-weight: 800; color: #0A1931; }
.lic-cta p { margin: 0; font-size: 0.85rem; color: #475569; max-width: 36rem; }
.lic-cta-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ============================================================
   Responsive shell ? phone / tablet / desktop
   Breakpoints: 640 (sm) ? 768 (md) ? 1024 (lg) ? 1280 (xl)
   ============================================================ */

html {
  -webkit-text-size-adjust: 100%;
}

body.app-body,
body.mockup-theme {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Scroll lock only — avoid touch-action:none on body (blocks overlay taps on iOS). */
html.sidebar-open,
body.sidebar-open {
  overflow: hidden;
}

/* Conteudo bloqueado sob o overlay; toggle/header ainda clicaveis (fecha drawer). */
body.sidebar-open .app-content {
  pointer-events: none;
}

body.sidebar-open .app-sidebar,
body.sidebar-open .sidebar-overlay,
body.sidebar-open .sidebar-toggle,
body.sidebar-open #sidebar-toggle,
body.sidebar-open .global-header {
  pointer-events: auto;
}

body.sidebar-open .global-header-right,
body.sidebar-open .global-search-wrap,
body.sidebar-open .company-selector,
body.sidebar-open .branch-selector {
  pointer-events: none;
}

.app-sidebar {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.global-header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  padding-top: max(0.5rem, env(safe-area-inset-top));
}

.sidebar-toggle,
.sidebar-close {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.report-tabs-scroll,
.module-tab-bar {
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.report-tabs-scroll .module-tab-btn,
.module-tab-bar .module-tab-btn {
  scroll-snap-align: start;
}

/* Stacked table cards (<640px) for critical lists */
@media (max-width: 639px) {
  .table-wrap.table-stack {
    border: none;
    background: transparent;
    overflow: visible;
  }

  .table-wrap.table-stack table {
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
  }

  .table-wrap.table-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .table-wrap.table-stack tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #E8EDF5;
    border-radius: 12px;
    padding: 0.35rem 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  }

  .table-wrap.table-stack tbody tr:hover {
    background: #fff;
    transform: none;
  }

  .table-wrap.table-stack td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.875rem;
    border-bottom: 1px solid #F1F5F9;
    text-align: right;
    font-size: 0.8125rem;
    word-break: break-word;
  }

  .table-wrap.table-stack td:last-child {
    border-bottom: none;
  }

  .table-wrap.table-stack td[colspan] {
    display: block;
    text-align: center;
    justify-content: center;
  }

  .table-wrap.table-stack td[data-label]::before {
    content: attr(data-label);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #94A3B8;
    text-align: left;
    flex-shrink: 0;
    max-width: 42%;
  }

  .table-wrap.table-stack td .row-edit-btn,
  .table-wrap.table-stack td .btn-mockup-primary,
  .table-wrap.table-stack td .btn-mockup-outline {
    min-height: 44px;
    padding-inline: 0.85rem;
  }
}

@media (max-width: 1023px) {
  .app-sidebar {
    width: min(var(--sidebar-w), calc(100vw - 3rem));
    max-width: 320px;
  }

  .sidebar-overlay.open {
    display: block;
    backdrop-filter: blur(2px);
  }

  .global-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: auto;
    padding: 0.5rem 0.875rem;
  }

  .global-header-left {
    flex: 1;
    min-width: 0;
  }

  .company-selector {
    min-width: 0;
    max-width: 100%;
  }

  .company-selector-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 46vw;
  }

  .global-user-info { display: none; }

  .global-user {
    padding-left: 0;
    border-left: none;
  }

  .page-header-row {
    padding: 1rem 1rem 0.5rem;
    gap: 0.75rem;
  }

  .page-title-main { font-size: 1.25rem; }

  .mockup-theme .app-main {
    padding: 0 1rem calc(5.5rem + env(safe-area-inset-bottom));
  }

  .filter-bar,
  .mock-filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar form,
  .mock-filter-field,
  .filter-search,
  .mock-select {
    width: 100%;
    min-width: 0;
  }

  .mock-filter-clear { margin-left: 0; }

  .page-header-actions,
  .page-action-bar,
  .module-toolbar,
  .module-toolbar-actions {
    width: 100%;
  }

  .btn-mockup-primary,
  .btn-mockup-outline,
  .filter-chip,
  .page-btn,
  .page-num,
  .global-icon-btn {
    min-height: 44px;
  }

  .global-icon-btn {
    width: 44px;
    height: 44px;
  }

  .ramo-op-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .ramo-areas-grid { grid-template-columns: 1fr; }
  .lic-modules-grid { grid-template-columns: 1fr 1fr; }
  .lic-hero-badge { text-align: left; width: 100%; }
  .lic-usage-head { flex-wrap: wrap; }
  .vertical-op-grid { grid-template-columns: 1fr; }
  .vertical-hub-head { flex-direction: column; }

  /* Support-ops remote viewer */
  #support-ops-root .ra-phone {
    width: min(280px, 100%);
    transform-origin: top center;
  }

  #support-ops-root .ra-viewer-wrap {
    padding: 10px;
    overflow-x: auto;
  }

  #support-ops-root .ra-stream-img {
    min-height: 220px;
    max-height: 55vh;
  }

  #support-ops-root .ra-controls-float {
    position: static;
  }

  #remote-viewer {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 767px) {
  .branch-selector { display: none; }
  .global-search-wrap { display: none; }

  .login-page {
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    align-items: flex-start;
  }

  .login-card { padding: 1.25rem; }

  .page-date-meta { display: none; }

  .lic-modules-grid { grid-template-columns: 1fr; }
  .lic-cta { flex-direction: column; align-items: stretch; }
  .lic-cta-actions .btn-mockup-primary,
  .lic-cta-actions .btn-mockup-outline { width: 100%; justify-content: center; }

  .ramo-title { font-size: 1.35rem; }
  .ramo-features-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .ramo-features-tab { flex-shrink: 0; }

  .notif-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: min(85dvh, 640px);
    border-radius: 16px 16px 0 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .mockup-theme .app-main {
    padding: 0 1.25rem calc(2.5rem + env(safe-area-inset-bottom));
  }

  .page-header-row { padding: 1.1rem 1.25rem 0.65rem; }

  .kpi-cols-3,
  .kpi-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .mockup-theme .app-main {
    padding: 0 1.5rem 2.5rem;
  }
}

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

/* Forms full-width on narrow screens */
@media (max-width: 639px) {
  .integra-form input,
  .integra-form select,
  .integra-form textarea,
  .login-form input {
    font-size: 16px; /* evita zoom iOS */
  }

  .fld-grid { grid-template-columns: 1fr !important; }

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


/* ===== Relatorios administrativos (/app/reports) ===== */
.rpt-hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(239,246,255,0.94) 55%, rgba(236,253,245,0.9) 100%);
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.1rem;
  margin-bottom: 1rem;
  color: #0F1B3D;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.rpt-hero-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.rpt-hero-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0D9488;
}
.rpt-hero-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 800;
  color: #0F1B3D;
  letter-spacing: -0.02em;
}
.rpt-hero-sub {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  color: #475569;
  max-width: 42rem;
  line-height: 1.45;
}
.rpt-period-badge {
  background: rgba(16, 217, 163, 0.12);
  border: 1px solid rgba(16, 217, 163, 0.35);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  min-width: 10rem;
  text-align: right;
}
.rpt-period-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0F766E;
}
.rpt-period-value {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0F1B3D;
}
.rpt-filters { margin: 0; }
.rpt-presets {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.rpt-preset {
  flex: 0 0 auto;
  border: 1px solid #CBD5E1;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.rpt-preset:hover { background: #F8FAFC; border-color: #94A3B8; color: #0F172A; }
.rpt-preset:focus-visible {
  outline: 2px solid #1D4ED8;
  outline-offset: 2px;
}
.rpt-preset.is-active {
  background: #1D4ED8;
  border-color: #1E40AF;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
}
.rpt-filters-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: end;
}
@media (min-width: 720px) {
  .rpt-filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .rpt-filters-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.rpt-field {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
}
.rpt-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.96);
  color: #0F172A;
  font-size: 0.875rem;
}
.rpt-input:focus {
  outline: 2px solid rgba(16, 217, 163, 0.45);
  outline-offset: 1px;
}
.rpt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.rpt-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.rpt-filters-meta {
  margin: 0.75rem 0 0;
  font-size: 0.7rem;
  color: #64748B;
}
.rpt-filters-meta code {
  background: #F1F5F9;
  color: #0D9488;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.rpt-loading {
  margin: 0.75rem 0 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
}
.rpt-loading.hidden { display: none !important; }
.rpt-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 900px) {
  .rpt-skeleton-grid { grid-template-columns: repeat(4, 1fr); }
}
.rpt-skel {
  height: 88px;
  border-radius: 12px;
  background: linear-gradient(90deg, #E2E8F0 0%, #F1F5F9 50%, #E2E8F0 100%);
  background-size: 200% 100%;
  animation: rpt-shimmer 1.2s ease-in-out infinite;
}
.rpt-skel-wide { height: 140px; margin-bottom: 0.5rem; }
.rpt-loading-text {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748B;
}
@keyframes rpt-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.rpt-panel { display: flex; flex-direction: column; gap: 0.85rem; }
.rpt-kpi-wrap { margin-bottom: 0.15rem; }
.rpt-kpi-wrap .kpi-value {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  color: #0A1931;
}
.rpt-kpi-wrap .kpi-label {
  color: #475569;
  font-weight: 600;
}
.rpt-compare { padding: 1rem 1.1rem; }
.rpt-metric-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rpt-metric-value {
  margin: 0.25rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0A1931;
}
.rpt-delta--up { color: #059669 !important; }
.rpt-delta--down { color: #E11D48 !important; }
.rpt-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 960px) {
  .rpt-charts { grid-template-columns: 1.2fr 1fr; }
}
.rpt-section { margin: 0; }
.rpt-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.rpt-section-head--inline { margin: 0.35rem 0 0.5rem; }
.rpt-section-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0A1931;
}
.rpt-section-hint {
  font-size: 0.72rem;
  color: #64748B;
  font-weight: 600;
}
.rpt-bar-chart { display: flex; flex-direction: column; gap: 0.45rem; }
.rpt-bar-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 7.5rem) 1fr auto;
  gap: 0.55rem;
  align-items: center;
}
.rpt-bar-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rpt-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #E2E8F0;
  overflow: hidden;
}
.rpt-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0066FF, #10D9A3);
  min-width: 4px;
}
.rpt-bar-value {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0A1931;
  text-align: right;
  white-space: nowrap;
}
.rpt-empty {
  text-align: center;
  padding: 1.75rem 1rem;
  border: 1px dashed #CBD5E1;
  border-radius: 12px;
  background: #F8FAFC;
}
.rpt-empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.65rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EFF6FF;
  color: #2563EB;
  font-size: 1.1rem;
}
.rpt-empty-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0A1931;
}
.rpt-empty-text {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #475569;
}
.rpt-empty-hint {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: #94A3B8;
}
.report-tabs-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.report-tabs-scroll .module-tab-btn {
  flex-shrink: 0;
}
.module-tabs-wrap[data-reports-tabs] .module-tab-panels .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.report-cat-count { color: #64748B; }
@media (max-width: 640px) {
  .rpt-hero { padding: 1rem; border-radius: 14px; }
  .rpt-period-badge { text-align: left; width: 100%; }
  .rpt-bar-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .rpt-bar-value { text-align: left; }
  .rpt-actions { width: 100%; }
  .rpt-actions .rpt-btn { flex: 1 1 auto; justify-content: center; }
}


/* PDF export button + polish */
.rpt-btn-pdf {
  background: #1D4ED8 !important;
  border: 1px solid #1E40AF !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.28);
}
.rpt-btn-pdf:hover {
  background: #1E40AF !important;
  filter: none;
  transform: translateY(-1px);
}
.rpt-btn-pdf:focus-visible {
  outline: 2px solid #1D4ED8;
  outline-offset: 2px;
}
.rpt-btn-pdf i { color: inherit; }
.rpt-hero-sub { max-width: 46rem; }
.rpt-hero-lede {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  color: #475569;
  max-width: 40rem;
  line-height: 1.45;
}
.rpt-filters-card {
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem;
}
.rpt-filters-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.rpt-filters-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0F1B3D;
}
.rpt-actions { gap: 0.45rem; }
.rpt-export-pdf {
  background: #1D4ED8 !important;
  color: #fff !important;
  border-color: #1E40AF !important;
}
.rpt-export-pdf:hover { color: #fff !important; background: #1E40AF !important; }
.rpt-related {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
}
.rpt-related-title {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}
.rpt-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 640px) {
  .rpt-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .rpt-related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.rpt-related-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  background: rgba(255,255,255,0.72);
  text-decoration: none;
  color: #0F172A;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rpt-related-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.08);
}
.rpt-related-card i {
  margin-top: 0.15rem;
  color: #1D4ED8;
  width: 1.1rem;
  text-align: center;
}
.rpt-related-card strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 750;
  color: #0F1B3D;
}
.rpt-related-card small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #64748B;
  line-height: 1.35;
}
@media (max-width: 640px) {
  .rpt-btn-pdf { order: -1; width: 100%; justify-content: center; }
}
