@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {

  --bg-body: var(--gray-100);

  --bg-card: #ffffff;
  --text-main: var(--gray-800);

  --text-muted: var(--gray-500);

  --primary: #2563eb;

  --primary-hover: #1d4ed8;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --glass-blur: blur(12px);

  --sidebar-width: 260px;
  --header-height: 64px;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --indigo-200: #c7d2fe;
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --green-50: #ecfdf5;
  --green-100: #d1fae5;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-2xl: 12px;
  --radius-full: 50%;
}

html[data-theme="comfort"] {
  filter: brightness(0.85) sepia(0.1) contrast(0.95);
  background-color: #111;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-size: 0.875rem;
  /* High Density: 14px base */
  line-height: 1.4;
  overflow-x: hidden;
}

/* Custom Scrollbar Stylings (Premium UI) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.4);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

/* Scrollbar Sidebar */
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 1rem;
  /* High Density: 1.5rem -> 1rem */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.layout-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--gray-900);

  color: white;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;

}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;

  padding: 0;

}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: var(--gray-400);
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
  border-right: 3px solid var(--primary);
}

.nav-link i {
  font-size: 1.25rem;
}

/* Sidebar Dropdown (Submenu) */
.nav-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
}

.nav-dropdown-trigger {
  cursor: pointer;
  user-select: none;
  justify-content: space-between;
}

.nav-dropdown-trigger i.caret {
  font-size: 0.7rem;
  transition: transform 0.2s;
  margin-left: auto;
}

.nav-dropdown-trigger[aria-expanded="true"] i.caret {
  transform: rotate(180deg);
}

.nav-dropdown-content {
  background: rgba(0, 0, 0, 0.25);
  margin: 0.15rem 0;
  border-left: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-dropdown-link {
  padding: 0.5rem 1.5rem 0.5rem 3.4rem;
  font-size: 0.8rem;
  color: var(--gray-400);
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.nav-dropdown-link:hover,
.nav-dropdown-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-mini .nav-dropdown-link {
  padding-left: 1.5rem;
}

.sidebar-mini .nav-dropdown-content {
  border-left: none;
  background: transparent;
  margin: 0.15rem 0 0.35rem;
}

.sidebar-mini .nav-dropdown-trigger {
  justify-content: center !important;
}

.sidebar-mini .nav-dropdown-trigger > div {
  gap: 0 !important;
}

.sidebar-mini .nav-dropdown-trigger .caret {
  display: none !important;
}

.sidebar-mini .nav-dropdown-link {
  justify-content: center;
  padding: 0.45rem 0;
  gap: 0;
}

.sidebar-mini .nav-dropdown-link span {
  display: none;
}

.sidebar-mini .nav-dropdown-link i {
  margin: 0;
  font-size: 1.1rem;
}

.nav-dropdown-trigger.active-parent {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.page-content {
  padding: 1.5rem;
  /* High Density: 2rem -> 1.5rem */
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  /* High Density: thinner buttons */
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  font-family: inherit;
  text-decoration: none;
  font-size: 0.85rem;
  height: 2.25rem;
  /* Fixed height for consistency */
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-soft-primary {
  background: var(--blue-50);
  color: var(--primary);
  border: 1px solid var(--blue-100);
}

.btn-soft-primary:hover {
  background: var(--blue-100);
}

.btn-soft-success {
  background: var(--green-50);
  color: #059669;
  border: 1px solid var(--green-100);
}

.btn-soft-success:hover {
  background: var(--green-100);
}

.btn-soft-warning {
  background: var(--orange-50);
  color: #c2410c;
  border: 1px solid var(--orange-100);
}

.btn-soft-warning:hover {
  background: var(--orange-100);
}

.btn-soft-danger {
  background: var(--red-50);
  color: #dc2626;
  border: 1px solid var(--red-100);
}

.btn-soft-danger:hover {
  background: var(--red-100);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 2px 8px;
  font-size: 0.75rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--text-muted);
}

.btn-outline:hover {
  background: var(--gray-50);
  color: var(--text-main);
  border-color: var(--gray-400);
}

.text-sm {
  font-size: 0.875rem;
}

.text-muted {
  color: var(--text-muted);
}

.flash-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flash-message {
  background: white;
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
}

.flash-success {
  border-left-color: var(--success);
}

.flash-error {
  border-left-color: var(--danger);
}

.confirm-modal-overlay {
  position: fixed !important;

  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999 !important;

  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
}

.confirm-modal-content {
  background: white;
  border-radius: var(--radius-2xl);
  padding: 2rem;
  max-width: 450px;
  width: 90%;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.erp-banner {
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
}

.erp-banner-warning {
  background-color: var(--orange-50);
  border-color: #fbbf24;
  border-left-width: 4px;
  color: #9a3412;
}

.erp-banner-warning i {
  color: var(--warning);
  font-size: 1.5rem;
}

.erp-banner-danger {
  background-color: var(--red-50);
  border-color: #f87171;
  border-left-width: 4px;
  color: #991b1b;
}

.erp-banner-danger i {
  color: var(--danger);
  font-size: 1.5rem;
}

.erp-banner-info {
  background-color: var(--blue-50);
  border-color: #60a5fa;
  border-left-width: 4px;
  color: #1e40af;
}

.erp-banner-info i {
  color: var(--primary);
  font-size: 1.5rem;
}

.erp-banner-success {
  background-color: var(--green-50);
  border-color: #34d399;
  border-left-width: 4px;
  color: #166534;
}

.erp-banner-success i {
  color: var(--success);
  font-size: 1.5rem;
}

.erp-banner-title {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
  display: block;
}

.erp-banner-content {
  display: flex;
  flex-direction: column;
}

.erp-banner-description {
  font-size: 0.8rem;
  line-height: 1.5;
}

.erp-banner-close {
  margin-left: auto;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0.2rem;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.erp-banner-close:hover {
  opacity: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Utilitários de Destaque de Linhas (Financeiro/Bloqueio) */
.finance-row-atraso {
  background: rgba(239, 68, 68, 0.05) !important;
}

.finance-row-atraso:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

.form-control {
  width: 100%;
  padding: 0.4rem 0.75rem;
  /* High Density: thinner inputs */
  background-color: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 0.875rem;
  /* Matches body */
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  height: 2.25rem;
  /* Fixed height matching buttons */
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
  color: var(--gray-400);
}

textarea.form-control {
  min-height: 80px;
  line-height: 1.5;
  resize: vertical;
}

.badge-danger {
  background: var(--red-50);
  color: #dc2626;
  border: 1px solid var(--red-100);
}

.badge-warning {
  background: var(--orange-50);
  color: #c2410c;
  border: 1px solid var(--orange-100);
}

.badge-info {
  background: var(--blue-50);
  color: #2563eb;
  border: 1px solid var(--blue-100);
}

.badge-success {
  background: var(--green-50);
  color: #16a34a;
  border: 1px solid #dcfce7;
}

.badge-escalonado {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ede9fe;
}

.badge-neutral {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.card-status-aberto {
  border-left: 3px solid var(--danger) !important;
}

.card-status-agendado {
  border-left: 3px solid var(--warning) !important;
}

.card-status-pendente {
  border-left: 3px solid var(--primary) !important;
}

.card-status-fechado {
  border-left: 3px solid var(--success) !important;
}

.card-status-escalonado {
  border-left: 3px solid #8b5cf6 !important;
}

.andamento-card {
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}

.andamento-body {
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: break-word;

  word-wrap: break-word;
  word-break: break-word;
}

.andamento-retratado {
  opacity: 0.6;
  background: var(--gray-50);
}

.andamento-retratado .andamento-body {
  text-decoration: line-through;
  color: var(--gray-400);
}

.timeline-dot-evento {
  background: var(--gray-400);
}

.timeline-dot-resposta {
  background: var(--primary);
}

.timeline-dot-nota {
  background: var(--warning);
}

.andamento-evento {
  background: var(--gray-100) !important;
  border: 1px dashed var(--gray-300) !important;
  box-shadow: none !important;
}

.ts-control {
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.3rem 0.6rem !important;
  /* High Density */
  font-family: inherit !important;
  font-size: 0.875rem !important;
  background-color: white !important;
  box-shadow: none !important;
  min-height: 2.25rem !important;
  /* Match inputs */
  transition:
    border-color 0.2s,
    box-shadow 0.2s !important;
}

.ts-wrapper.form-control {
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.ts-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.ts-dropdown {
  border: 1px solid var(--gray-200) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
  margin-top: 5px !important;
  padding: 5px !important;
}

.ts-dropdown .active {
  background-color: var(--blue-50) !important;
  color: var(--primary) !important;
}

.ts-dropdown .option {
  padding: 0.5rem 0.75rem !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.875rem !important;
}

.ts-control .item {
  font-weight: 500 !important;
}

.error-viewport {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.error-scene {
  position: relative;
  max-width: 800px;
  width: 100%;
  perspective: 1000px;
  z-index: 2;
}

.error-glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  padding: 4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.error-404-page .error-glass-card {
  background: rgba(79, 70, 229, 0.03);
  box-shadow:
    inset 0 0 80px rgba(79, 70, 229, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(79, 70, 229, 0.2);
}

.error-500-page .error-glass-card {
  background: rgba(239, 68, 68, 0.04);
  box-shadow:
    inset 0 0 80px rgba(239, 68, 68, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.error-403-page .error-glass-card {
  background: rgba(245, 158, 11, 0.04);
  box-shadow:
    inset 0 0 80px rgba(245, 158, 11, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.error-413-page .error-glass-card {
  background: rgba(139, 92, 246, 0.04);
  box-shadow:
    inset 0 0 80px rgba(139, 92, 246, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
}

.error-429-page .error-glass-card {
  background: rgba(20, 184, 166, 0.04);
  box-shadow:
    inset 0 0 80px rgba(20, 184, 166, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(20, 184, 166, 0.2);
}

.error-huge-text {
  font-size: 8rem;
  font-weight: 900;
  line-height: 0.8;
  margin: 0;
  letter-spacing: -5px;
  background: linear-gradient(180deg,
      var(--primary) 0%,
      rgba(79, 70, 229, 0.2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
  user-select: none;
}

.glitch-500 {
  background: linear-gradient(180deg,
      var(--danger) 0%,
      rgba(239, 68, 68, 0.2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: error-pulse 2s infinite ease-in-out;
}

.warning-403 {
  background: linear-gradient(180deg,
      var(--warning) 0%,
      rgba(245, 158, 11, 0.2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.heavy-413 {
  background: linear-gradient(180deg, #8b5cf6 0%, rgba(139, 92, 246, 0.2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.limit-429 {
  background: linear-gradient(180deg, #14b8a6 0%, rgba(20, 184, 166, 0.2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes error-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.02);
    opacity: 1;
  }
}

.error-main-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
}

.error-sub-text {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

.ph-spin {
  animation: ph-spin 2s linear infinite;
  display: inline-block;
}

@keyframes ph-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.erp-panel {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0 8px 8px 8px;

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;

  position: relative;
  z-index: 10;
}

.erp-tab-container {
  display: flex;
  padding-left: 2px;
  margin-bottom: -1px;

  position: relative;
  z-index: 5;
  overflow-x: auto;
  gap: 4px;

  scrollbar-width: none;

  -ms-overflow-style: none;

}

.erp-tab-container::-webkit-scrollbar {
  display: none;
}

/* 
========================================================================
   ACTION BUTTONS (Micro-Actions)
   Padrão para botões pequenos de ação em tabelas (22x22px)
========================================================================
*/
.btn-action-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: white;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none !important;
}

.btn-action-sm:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
  color: white;
}

.btn-action-sm:active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transform: scale(1);
}

.btn-action-sm i {
  font-size: 16px;
  display: flex !important;
}

/* Variantes de Cor (Gradients) */
.btn-action-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-action-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-action-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-action-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}



.erp-tab {
  padding: 0.5rem 1rem;
  /* High Density */
  background: var(--gray-100);

  border: 1px solid transparent;
  border-radius: var(--radius-lg) 8px 0 0;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  /* Smaller font */
  font-family: "Inter", sans-serif !important;

  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none !important;

  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  top: 1px;

}

.erp-tab:hover {
  background: var(--gray-200);
  color: var(--text-main);
  text-decoration: none !important;
}

.erp-tab.active {
  background: white;
  color: var(--primary);
  border-color: var(--gray-200);
  border-bottom-color: white;

  font-weight: 600;
  z-index: 20;
}

.erp-toolbar {
  padding: 0.5rem 0.75rem;
  /* High Density */
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);

  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;

  overflow-x: auto;

  font-family: "Inter", sans-serif;
}

/* 
  --- GLOBAL TOOLBAR UTILITIES ---
  Use estas classes para organizar botões e ações dentro das .erp-toolbar
  Evite recriar flexbox manualmente em cada módulo.
*/

.erp-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

/* Espaçador flexível (empurra itens para a direita) */
.erp-toolbar-spacer {
  margin-left: auto;
}

.erp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  /* High Density: thinner */

  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none !important;

  font-family: "Inter", sans-serif !important;

  line-height: 1.2;
}

.erp-btn-neutral {
  color: var(--text-main);
  background: white;
  border-color: var(--gray-300);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.erp-btn-neutral:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.erp-btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary-hover);
}

.erp-btn-primary:hover {
  background: var(--primary-hover);
}

.erp-btn[disabled],
.erp-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--gray-100);
  color: var(--gray-400);
  border-color: var(--gray-200);
  box-shadow: none;
}

.erp-separator {
  width: 1px;
  height: 24px;
  background: var(--gray-300);
  margin: 0 4px;
}

.erp-grid-container {
  flex: 1;
  overflow: auto;

  position: relative;
  background: white;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;

  white-space: nowrap;

}

.erp-table thead th {
  background: var(--gray-50);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 4px 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
  border-right: 1px solid var(--gray-100);

}

.erp-table tbody td {
  padding: 4px 10px;
  border-bottom: 1px solid var(--gray-100);

  border-bottom: 1px solid var(--gray-100);
  border-right: 1px solid var(--gray-50);
  color: var(--text-main);
  transition: none;

}

.erp-table tr.selected td {
  background-color: #e0f2fe !important;

  color: #0c4a6e;
  border-bottom-color: #bae6fd;
}

.erp-table tr:hover td {
  background-color: var(--gray-100);
}

.erp-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  gap: 1rem;
}

/* Utilitários de Botão */
.erp-btn-sm {
  padding: 2px 8px !important;
  font-size: 0.75rem !important;
  gap: 4px !important;
}

/* Utilitários de Gap */
.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}




.erp-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 8px 8px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.erp-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

/* --- Utilitários de Layout de Formulários e Configurações --- */
.erp-container-form {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.erp-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.erp-card-header {
  padding: 1rem 1.5rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.erp-card-header i {
  font-size: 1.25rem;
  color: var(--primary);
}

.erp-card-title {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

.erp-card-body {
  padding: 1.5rem;
}

/* Grids de Formulário */
.erp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.erp-form-grid-full {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .erp-form-grid {
    grid-template-columns: 1fr;
  }

  .erp-form-grid-full {
    grid-column: span 1;
  }
}

/* Grupos de Campos */
.erp-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.erp-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
}

.erp-field-help {
  font-size: 0.75rem;
  color: var(--gray-400);
  line-height: 1.4;
}

/* Upload de Logo Especial */
.erp-upload-zone {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
}

.erp-upload-zone:hover {
  border-color: var(--primary);
}

.erp-logo-preview {
  width: 100px;
  height: 100px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.erp-logo-preview img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.erp-logo-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--gray-300);
}

.erp-logo-preview-empty span {
  font-size: 0.625rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.erp-search-box {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.erp-search-box i {
  position: absolute;
  left: 10px;
  pointer-events: none;
  font-size: 1.1rem;
  color: var(--gray-400);
}

.erp-search-input {
  padding: 6px 12px 6px 36px !important;

  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
  width: 220px;
  background: white;
  font-family: "Inter", sans-serif;
}

.erp-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.erp-badge-count {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  font-weight: 600;
  white-space: nowrap;
  font-family: "Inter", sans-serif;
}

.erp-subtitle {
  font-size: 0.85rem;
  color: var(--gray-400);
  border-left: 1px solid var(--gray-300);
  padding-left: 10px;
  margin-left: 10px;
  font-weight: 400;
  display: inline-block;
}

.erp-grid-content {
  display: flex;
  flex-direction: column;

}

.modern-form .form-group {
  margin-bottom: 1.5rem;
}

.form-layout-premium {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;

  width: 100%;
}

.modern-form .form-label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  display: block;
  color: var(--text-main);
}

.modern-form .form-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  background: white;
  font-family: inherit;
  font-size: 0.9rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.modern-form .form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.erp-terminal {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  font-family: "Fira Code", monospace;
  font-size: 0.8rem;
  height: 600px;
  overflow-y: auto;
  border: 1px solid #1e293b;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.erp-terminal-line {
  margin-bottom: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid #1e293b;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.erp-terminal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Componentes de Layout Baseados em Linhas (Row-based) --- */
.erp-modern-container {
  padding: 1.5rem 4rem;
  max-width: 1400px;
  margin: 0;
}

.erp-config-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

.erp-config-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--gray-200);
  align-items: flex-start;
}

.erp-config-row:last-child {
  border-bottom: none;
}

.erp-config-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.erp-config-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
}

.erp-config-info p {
  font-size: 0.8rem;
  color: var(--gray-400);
  line-height: 1.5;
}

.erp-config-fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Componentes de Alternância (Toggle/Switch) */
.erp-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.erp-switch input {
  display: none;
}

.erp-switch-slider {
  width: 44px;
  height: 24px;
  background: var(--gray-200);
  border-radius: 12px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.erp-switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.erp-switch input:checked+.erp-switch-slider {
  background: var(--primary);
}

.erp-switch input:checked+.erp-switch-slider::before {
  transform: translateX(20px);
}

.erp-switch-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* Barra de Validação e Teste */
.erp-validation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
}

.erp-btn-validate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  color: var(--gray-700);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.erp-btn-validate:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.erp-btn-validate i {
  font-size: 1rem;
  color: var(--primary);
}

.erp-action-hint {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Campos e Grupos de Formulário */
.erp-config-fields .form-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.erp-config-fields .erp-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.erp-config-fields label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray-400);
  letter-spacing: 0.05em;
}

/* Área de Identidade Visual */
.erp-config-logo-area {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.erp-logo-display {
  width: 120px;
  height: 120px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.erp-logo-display img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

/* Componente de Alerta com Glassmorphism */
.erp-glass-alert {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(248, 250, 252, 0.8));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-2xl);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  margin-top: 1rem;
  max-width: 1000px;
}

.erp-glass-alert-icon {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.erp-glass-alert-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.erp-glass-alert-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-800);
}

.erp-glass-alert-text {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.6;
}

.erp-flat-container {
  max-width: 1000px;
  margin-left: 0;
  padding: 3rem 4rem;
}

.erp-flat-header {
  margin-bottom: 2rem;
  text-align: left;
}

.erp-flat-header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.erp-flat-header-top i {
  font-size: 1.5rem;
  color: var(--primary);
}

.erp-flat-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.erp-flat-header-desc {
  font-size: 0.9rem;
  color: var(--gray-500);
  max-width: 600px;
}

.erp-flat-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 4rem;
}

.erp-flat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.erp-flat-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.erp-flat-field label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
}

/* Inputs Premium dentro do modo Flat */
.erp-flat-field .form-control {
  background: transparent;
  border-width: 0 0 1px 0;
  border-radius: 0;
  padding: 0.5rem 0;
  height: auto;
  font-size: 1rem;
  font-weight: 500;
  border-color: var(--gray-200);
}

.erp-flat-field .form-control:focus {
  border-color: var(--primary);
  box-shadow: none;
}

/* Estilo de Upload Simplificado */
.erp-flat-upload {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--gray-50);
}

.erp-flat-preview {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-xl);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.erp-flat-preview img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

/* Grupo de Filtros Estilo Segmentado */
.erp-filter-group {
  display: inline-flex;
  background: var(--gray-100);
  padding: 0.2rem;
  border-radius: var(--radius-lg);
  gap: 0.2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--gray-200);
}

.erp-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-500);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.erp-filter-btn:hover {
  color: var(--gray-800);
  background: rgba(0, 0, 0, 0.03);
}

.erp-filter-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.erp-filter-btn.active.variant-danger {
  color: var(--danger);
}

.erp-filter-btn.active.variant-warning {
  color: var(--warning);
}

.erp-pill-filter.active {
  color: white;
}

.erp-pill-filter.inactive {
  background: #64748b;
  color: #e2e8f0;
}





:root {
  --sidebar-mini-width: 80px;
}

.sidebar-ready .sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar-ready .main-content {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar {
  position: fixed;

}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: -1;
}

.sidebar.sidebar-mini,
.sidebar-collapsed-init .sidebar {
  width: var(--sidebar-mini-width) !important;
}

.main-content {
  width: calc(100vw - var(--sidebar-width));
  max-width: calc(100vw - var(--sidebar-width));
}

.main-content.sidebar-collapsed,
.sidebar-collapsed-init .main-content {
  margin-left: var(--sidebar-mini-width) !important;
  width: calc(100vw - var(--sidebar-mini-width));
  max-width: calc(100vw - var(--sidebar-mini-width));
}

.sidebar.sidebar-mini .sidebar-nav {
  padding: 0.5rem 0;
}

.sidebar-collapsed-init .nav-label,
.sidebar-collapsed-init .admin-section-title,
.sidebar-collapsed-init .sidebar-footer div[x-show="sidebarOpen"] {
  display: none !important;
}

.sidebar.sidebar-mini .nav-link {
  justify-content: center;
  padding: 0.5rem 0;
  border-right: none;
}

.sidebar.sidebar-mini .nav-link:hover,
.sidebar.sidebar-mini .nav-link.active {
  border-left: 3px solid var(--primary) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.btn-toggle-sidebar {
  position: absolute;
  right: -12px;

  top: 20px;

  background: var(--gray-900);

  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  z-index: 100;
  transition: all 0.2s;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

.btn-toggle-sidebar:hover {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.sidebar.sidebar-mini .btn-toggle-sidebar {
  margin: 0;
}

.sidebar.sidebar-mini .nav-link i {
  font-size: 1.5rem !important;
  margin: 0 !important;
}

[x-cloak] {
  display: none !important;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem;

  transition: padding 0.3s ease;
  overflow: hidden;

}

.sidebar.sidebar-mini .sidebar-footer,
.sidebar-collapsed-init .sidebar-footer {
  padding: 0.5rem 0;
}

.footer-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-2xl);
  padding: 0.75rem;
  transition: all 0.3s ease;
}

.sidebar.sidebar-mini .footer-card,
.sidebar-collapsed-init .footer-card {
  background: transparent;
  border-color: transparent;
  padding: 0;
  justify-content: center;
}

.user-avatar-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  position: relative;
  transition: transform 0.2s;
}

.user-avatar-link:hover {
  transform: scale(1.05);
}

.user-avatar-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.user-name {
  font-weight: 600;
  color: white;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-decoration: none;
  transition: opacity 0.2s;
}

.user-name:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.user-role {
  font-size: 0.7rem;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  color: #ef4444;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background 0.2s;
  text-decoration: none;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-logout i {
  font-size: 1.25rem;
  display: block;
  line-height: 1;
}

.version-info {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.6rem;
  color: var(--gray-600);
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   HELPHUB ERP STANDARD FORMS
   ========================================================================== */

.erp-modern-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}


.erp-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.erp-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
}

.erp-section-title i {
  font-size: 16px;
  color: #94a3b8;
}

.erp-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 24px 0;
}

/* Grid System (Flexbox base) */
.erp-row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -10px;
  margin-right: -10px;
  margin-bottom: 16px;
}

[class^="erp-col-"] {
  padding-left: 10px;
  padding-right: 10px;
  box-sizing: border-box;
}

.erp-col-100 {
  flex: 0 0 100%;
  max-width: 100%;
}

.erp-col-75 {
  flex: 0 0 75%;
  max-width: 75%;
}

.erp-col-66 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

.erp-col-50 {
  flex: 0 0 50%;
  max-width: 50%;
}

.erp-col-45 {
  flex: 0 0 45%;
  max-width: 45%;
}

/* Custom */
.erp-col-33 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.erp-col-25 {
  flex: 0 0 25%;
  max-width: 25%;
}

.erp-col-23 {
  flex: 0 0 23%;
  max-width: 23%;
}

/* Custom */
.erp-col-20 {
  flex: 0 0 20%;
  max-width: 20%;
}

.erp-col-16 {
  flex: 0 0 16.666667%;
  max-width: 16.666667%;
}

.erp-col-15 {
  flex: 0 0 15%;
  max-width: 15%;
}

.erp-col-10 {
  flex: 0 0 10%;
  max-width: 10%;
}

/* Form Controls */
.erp-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #1e293b;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: #1e293b;
  background-color: #fff;
  border-color: #3b82f6;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control[readonly],
.form-control[disabled] {
  background-color: #f8fafc;
  opacity: 1;
  cursor: default;
  color: #64748b;
}

.erp-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.erp-checkbox-wrapper:hover {
  background-color: #f8fafc;
}

.erp-checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
}

/* Media Queries */
@media (max-width: 992px) {

  .erp-col-10,
  .erp-col-15,
  .erp-col-16,
  .erp-col-20,
  .erp-col-23,
  .erp-col-25 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 576px) {
  .erp-modern-container {
    padding: 10px;
  }

  .erp-card {
    padding: 15px;
  }

  [class^="erp-col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.erp-panel {
  padding: 0;
}

/* Espaçamento apenas para Conteúdo de Formulários */
.erp-grid-container>form {
  padding: 1.5rem;
}

/* Listagens (Grids) ficam flush/zeradas por padrão */
.erp-grid-container {
  padding: 0;
}

/* ==========================================================================
   FORM EXPERIENCE LAYER
   ========================================================================== */

.form-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: stretch;
}

.form-hero-main,
.form-hero-aside,
.form-card,
.form-sidecard {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  box-shadow: 0 18px 40px -32px rgba(15, 23, 42, 0.45);
}

.form-hero-main {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.form-hero-main::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0));
  transform: translate(-35%, -35%);
  pointer-events: none;
}

.form-hero-aside,
.form-sidecard {
  padding: 1.25rem;
}

.form-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.65rem;
}

.form-hero-title {
  font-size: 1.55rem;
  line-height: 1.1;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.55rem;
}

.form-hero-copy,
.form-sidecard p,
.form-card-intro p {
  color: #475569;
  line-height: 1.55;
}

.form-metrics,
.form-chip-row,
.form-anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.form-metric {
  min-width: 140px;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(191, 219, 254, 0.9);
}

.form-metric-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.form-metric-label,
.form-hint,
.form-side-list li,
.form-progress-meta {
  font-size: 0.82rem;
  color: #64748b;
}

.form-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.78rem;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.8rem;
}

.form-anchor-nav {
  margin-top: 1rem;
}

.form-anchor-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 0.8rem;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.form-anchor-nav a:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.form-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.form-hero-wide,
.form-workspace-wide {
  grid-template-columns: 1fr;
}

.form-workspace-wide .form-main {
  max-width: none;
}

.form-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

.form-card {
  padding: 1.35rem;
}

.form-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-card-intro {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #1d4ed8;
}

.form-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.form-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  white-space: nowrap;
}

.form-inline-note {
  margin-top: -0.35rem;
  margin-bottom: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #475569;
}

.form-side-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.form-side-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.form-side-list li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.form-side-list i {
  color: var(--primary);
  font-size: 1rem;
  margin-top: 0.05rem;
}

.form-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 0.7rem 0 0.4rem;
}

.form-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width 0.25s ease;
}

.form-progress-meta strong {
  color: #0f172a;
}

.form-fieldset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.form-fieldset-grid .erp-checkbox-wrapper,
.form-fieldset-grid .form-control {
  height: 100%;
}

.field-required::after {
  content: " *";
  color: #dc2626;
}

.field-help {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.45;
}

.form-card .erp-divider:last-child {
  display: none;
}

@media (max-width: 1100px) {

  .form-hero,
  .form-workspace {
    grid-template-columns: 1fr;
  }

  .form-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {

  .form-hero-main,
  .form-hero-aside,
  .form-card,
  .form-sidecard {
    padding: 1rem;
    border-radius: 16px;
  }

  .form-hero-title {
    font-size: 1.3rem;
  }

  .form-card-header {
    flex-direction: column;
  }

  .form-fieldset-grid {
    grid-template-columns: 1fr;
  }
}
