/* ============================================================
   DESIGN SYSTEM — NETI UNAPI
   Preset: shadcn Vega · Blue · Mist · DM Sans
   Framework: Bootstrap 5.3
   ============================================================ */

/* ─── CSS Custom Properties ─────────────────────────────── */
:root {
  /* ── Escala de azul institucional (NETI brand) ── */
  --neti-50:  #e3f0fb;
  --neti-100: #b8d5f4;
  --neti-200: #89b9ed;
  --neti-300: #5a9de6;
  --neti-400: #3487e0;
  --neti-500: #1a6bb5;
  --neti-600: #155a9a;
  --neti-700: #104880;
  --neti-800: #0c3666;
  --neti-900: #07244d;

  /* ── Paleta mist (cinza frio neutro) ── */
  --mist-50:  #f8fafc;
  --mist-100: #f1f5f9;
  --mist-200: #e2e8f0;
  --mist-300: #cbd5e1;
  --mist-400: #94a3b8;
  --mist-500: #64748b;
  --mist-600: #475569;
  --mist-700: #334155;
  --mist-800: #1e293b;
  --mist-900: #0f172a;

  /* ── Tokens semânticos (shadcn Vega) ── */
  --background:          #ffffff;
  --foreground:          var(--mist-900);
  --card:                #ffffff;
  --card-foreground:     var(--mist-900);
  --popover:             #ffffff;
  --popover-foreground:  var(--mist-900);
  --primary:             #1a6bb5;
  --primary-foreground:  #ffffff;
  --secondary:           var(--mist-100);
  --secondary-foreground: var(--mist-800);
  --muted:               var(--mist-100);
  --muted-foreground:    var(--mist-500);
  --accent:              var(--neti-50);
  --accent-foreground:   var(--neti-700);
  --destructive:         #ef4444;
  --destructive-foreground: #ffffff;
  --border:              var(--mist-200);
  --input:               var(--mist-200);
  --ring:                var(--neti-500);

  /* ── Atalhos semânticos (mapeados para uso interno) ── */
  --text-primary:   var(--mist-900);
  --text-secondary: var(--mist-600);
  --text-muted:     var(--mist-400);

  --bg-body:    var(--mist-50);
  --bg-card:    var(--background);
  --bg-subtle:  var(--mist-100);
  --bg-section: var(--neti-50);

  --border-default: var(--border);
  --border-subtle:  var(--mist-100);

  /* ── Status ── */
  --color-success: #22c55e;
  --color-error:   #ef4444;
  --color-info:    var(--neti-500);
  --color-warning: #f59e0b;
  --color-danger:  #ef4444;

  /* ── Vega radius (medium = 0.5rem base) ── */
  --radius-sm: 0.375rem;   /* 6px  */
  --radius:    0.5rem;     /* 8px  */
  --radius-md: 0.625rem;   /* 10px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl:1.25rem;    /* 20px */
  --radius-full: 9999px;
}

/* ─── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* Força herança de fonte em elementos de formulário (browsers não herdam por padrão) */
input, button, select, textarea, optgroup, option {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  margin: 0; padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--mist-300); border-radius: var(--radius-full); }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* ════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 256px;
  height: 100vh;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--neti-800) 0%, var(--neti-900) 100%);
  border-right: 1px solid var(--neti-900);
  overflow: hidden;
}

/* Brand */
.sidebar-brand {
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-brand img {
  height: 60px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.sidebar-brand h4 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 10px 0 2px;
  letter-spacing: 0.01em;
}
.sidebar-brand .brand-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.38);
  line-height: 1.45;
}

/* Nav scrollável */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

/* Subtítulos de seção */
.sidebar-subtitle {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(255,255,255,0.28);
  padding: 16px 18px 4px;
  display: block;
}

/* Link direto */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 1px 8px;
  padding: 8px 11px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.72);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255,255,255,0.09);
  color: #fff;
}
.sidebar-link i { width: 17px; text-align: center; font-size: 13px; }

/* Accordion nível 1 */
.sidebar-menu .accordion-item {
  background: transparent;
  border: none;
}
.sidebar-menu > .accordion-item > .accordion-header > .accordion-button {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 1px 8px;
  padding: 8px 11px;
  width: calc(100% - 16px);
  border-radius: var(--radius-md);
  background: transparent;
  color: rgba(255,255,255,0.72);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  border: none;
  box-shadow: none !important;
}
.sidebar-menu > .accordion-item > .accordion-header > .accordion-button::after {
  filter: brightness(0) invert(1) opacity(0.4);
  margin-left: auto;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1), filter 0.2s;
}
.sidebar-menu > .accordion-item > .accordion-header > .accordion-button:not(.collapsed) {
  background: rgba(255,255,255,0.09);
  color: #fff;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.sidebar-menu > .accordion-item > .accordion-header > .accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(1) opacity(0.65);
}
.sidebar-menu > .accordion-item > .accordion-header > .accordion-button i { width: 17px; text-align: center; font-size: 13px; }

/* Transição de abertura/fechamento do submenu */
.sidebar-menu > .accordion-item > .accordion-collapse.collapsing {
  transition: height 0.28s cubic-bezier(.4,0,.2,1);
}

/* Body accordion nível 1 */
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body {
  padding: 3px 0 5px;
  background: rgba(0,0,0,0.18);
  margin: 0 8px 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  animation: sidebarSubmenuFade 0.22s ease;
}

@keyframes sidebarSubmenuFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Links nível 2 */
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body > a {
  display: flex;
  align-items: center;
  padding: 7px 11px 7px 30px;
  color: rgba(255,255,255,0.62);
  font-size: 15px;
  font-weight: 400;
  border-radius: var(--radius);
  margin: 1px 5px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body > a::before {
  content: '·';
  margin-right: 7px;
  color: rgba(255,255,255,0.28);
  font-size: 16px;
  line-height: 1;
}
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body > a:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

/* Select dentro de submenu da sidebar */
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body select,
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body .form-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  background-color: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  width: 100%;
  outline: none;
  cursor: pointer;
}
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body select:focus,
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body .form-select:focus {
  border-color: rgba(255,255,255,0.25);
  box-shadow: none;
}
.sidebar-menu > .accordion-item > .accordion-collapse > .accordion-body select option {
  background: var(--mist-800);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
}

/* Logout */
.sidebar-logout {
  margin: 8px 10px 14px;
  padding: 9px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.68);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sidebar-logout:hover {
  background: rgba(239,68,68,0.65);
  border-color: rgba(239,68,68,0.35);
  color: #fff;
}

/* ════════════════════════════════════════════════════════════
   CONTENT AREA
   ════════════════════════════════════════════════════════════ */
.neti-content {
  margin-left: 256px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.neti-main {
  flex: 1;
  padding: 28px 24px;
  max-width: 100vw;
  width: 100%;
  margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════ */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  height: 60px;
}

.topbar-project-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar-project-icon i { color: #fff; font-size: 14px; }

.topbar-project-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: .9px;
}

.topbar-project-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.topbar-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 11px;
  font-size: 11px;
  color: var(--secondary-foreground);
  font-weight: 500;
  white-space: nowrap;
}

.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.topbar-user-btn:hover { background: var(--secondary); border-color: var(--mist-300); }

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-user-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.topbar-dropdown-menu {
  min-width: 210px;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05) !important;
  padding: 5px !important;
}

.topbar-dd-item {
  padding: 7px 11px !important;
  border-radius: var(--radius) !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  transition: background 0.12s, color 0.12s;
}
.topbar-dd-item:hover { background: var(--secondary) !important; color: var(--text-primary) !important; }
.topbar-dd-danger { color: var(--destructive) !important; }
.topbar-dd-danger:hover { background: #fef2f2 !important; color: #b91c1c !important; }

/* ════════════════════════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* Label de formulário */
.neti-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

/* Breadcrumb */
.neti-breadcrumb {
  font-size: 15px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 6px;
}
.neti-breadcrumb > * + * { margin-left: 4px; }
.neti-breadcrumb > * + *::before {
  content: '/';
  margin-right: 4px;
  color: var(--border);
}
.neti-breadcrumb .sep { display: none; }
.neti-breadcrumb a { color: var(--primary); text-decoration: none; }
.neti-breadcrumb a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════ */
.neti-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
  padding: 24px;
  margin-bottom: 24px;
}

.neti-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.neti-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.neti-card-icon.orange { background: #fff7ed; color: #ea580c; }
.neti-card-icon.green  { background: #f0fdf4; color: #16a34a; }
.neti-card-icon.red    { background: #fef2f2; color: #dc2626; }

.neti-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.neti-card-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.stat-card-icon.blue   { background: var(--accent); color: var(--primary); }
.stat-card-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-card-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-card-icon.amber  { background: #fffbeb; color: #d97706; }

.stat-card-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-muted);
}
.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-card-sub { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   ACTION GRID
   ════════════════════════════════════════════════════════════ */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.action-btn-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.action-btn-card:hover {
  border-color: var(--primary);
  background: var(--accent);
  color: var(--accent-foreground);
}
.action-btn-card .action-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--secondary);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.action-btn-card:hover .action-icon {
  background: var(--primary);
  color: #fff;
}

.action-btn-card.danger { border-color: #fecaca; }
.action-btn-card.danger:hover { border-color: #ef4444; background: #fef2f2; color: #991b1b; }
.action-btn-card.danger .action-icon { background: #fef2f2; color: #dc2626; }
.action-btn-card.danger:hover .action-icon { background: #ef4444; color: #fff; }

.action-btn-card.orange { border-color: #fed7aa; }
.action-btn-card.orange:hover { border-color: #ea580c; background: #fff7ed; color: #9a3412; }
.action-btn-card.orange .action-icon { background: #fff7ed; color: #ea580c; }
.action-btn-card.orange:hover .action-icon { background: #ea580c; color: #fff; }

.action-btn-card.green { border-color: #bbf7d0; }
.action-btn-card.green:hover { border-color: #16a34a; background: #f0fdf4; color: #14532d; }
.action-btn-card.green .action-icon { background: #f0fdf4; color: #16a34a; }
.action-btn-card.green:hover .action-icon { background: #16a34a; color: #fff; }

.action-btn-card.purple { border-color: #e9d5ff; }
.action-btn-card.purple:hover { border-color: #7c3aed; background: #faf5ff; color: #5b21b6; }
.action-btn-card.purple .action-icon { background: #faf5ff; color: #7c3aed; }
.action-btn-card.purple:hover .action-icon { background: #7c3aed; color: #fff; }

/* ════════════════════════════════════════════════════════════
   BOTÕES
   ════════════════════════════════════════════════════════════ */
.btn-neti {
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn-neti:hover {
  background: var(--neti-600);
  color: #fff;
}
.btn-neti:active { opacity: .92; }
.btn-neti:disabled { opacity: .5; cursor: not-allowed; }

.btn-neti-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-neti-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--primary);
}

.btn-neti-ghost {
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: #00000010;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}
.btn-neti-ghost:hover {
  background: var(--secondary);
  color: var(--text-primary);
}

.btn-neti-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-neti-secondary:hover { background: var(--mist-200); color: var(--text-primary); }

.btn-neti-danger {
  background: var(--destructive);
  color: var(--destructive-foreground);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-neti-danger:hover { background: #dc2626; color: #fff; }

/* Estado "pendente" (isenção/cota aguardando análise) — âmbar */
.btn-neti-warning {
  background: #f59e0b;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-neti-warning:hover { background: #d97706; color: #fff; }

/* ════════════════════════════════════════════════════════════
   INPUTS E FORMS
   ════════════════════════════════════════════════════════════ */
.neti-form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.neti-input,
.neti-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--background);
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.neti-input:focus,
.neti-select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.neti-input::placeholder { color: var(--text-muted); }

/* Bootstrap form-control override */
.form-control,
.form-select {
  border-color: var(--input) !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  border-radius: var(--radius-md) !important;
  background: var(--background);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--ring) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}

.input-group-text {
  background: var(--muted);
  border-color: var(--input);
  color: var(--muted-foreground);
  font-family: 'DM Sans', sans-serif;
}

/* Checkbox/Radio */
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input[type="radio"]:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-label { font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text-primary); }

/* ════════════════════════════════════════════════════════════
   TABELAS
   ════════════════════════════════════════════════════════════ */
.neti-table {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.neti-table thead th {
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.neti-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background .1s;
}
.neti-table tbody tr:hover { background: var(--muted); }
.neti-table td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

/* Table wrapper */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ════════════════════════════════════════════════════════════
   BADGES / CHIPS
   ════════════════════════════════════════════════════════════ */
.neti-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.neti-badge.blue   { background: var(--accent); color: var(--neti-700); border: 1px solid var(--neti-200); }
.neti-badge.green  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.neti-badge.red    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.neti-badge.amber  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.neti-badge.gray   { background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); }
.neti-badge.orange { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }

/* ════════════════════════════════════════════════════════════
   ALERTAS
   ════════════════════════════════════════════════════════════ */
.neti-alert {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.neti-alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.neti-alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.neti-alert.info {
  background: var(--accent);
  border: 1px solid var(--neti-200);
  color: var(--neti-800);
}
.neti-alert.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* ════════════════════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════════════════════ */
.neti-tabs.nav-tabs {
  border-bottom: none !important;
  background: var(--muted);
  padding: 4px;
  border-radius: var(--radius-lg);
  gap: 3px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.neti-tabs .nav-link {
  border: none !important;
  border-radius: var(--radius) !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 13px;
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.neti-tabs .nav-link:hover { background: rgba(255,255,255,.6); color: var(--text-primary); }
.neti-tabs .nav-link.active {
  background: #fff !important;
  color: var(--text-primary) !important;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════════════════════ */
#neti-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.neti-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px 16px;
  border-radius: var(--radius-lg);
  min-width: 290px;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  transition: transform .32s cubic-bezier(.34,1.4,.64,1);
  font-family: 'DM Sans', sans-serif;
  pointer-events: auto;
}
.neti-toast.neti-toast-show { transform: translateX(0); }
.neti-toast-title   { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.neti-toast-msg     { font-size: 15px; color: var(--text-muted); margin-top: 1px; }
.neti-toast-icon    { font-size: 18px; flex-shrink: 0; }
.neti-toast-bar     { position: absolute; bottom: 0; left: 0; height: 2px; width: 100%; }

.neti-toast-error   .neti-toast-icon { color: #ef4444; }
.neti-toast-success .neti-toast-icon { color: #22c55e; }
.neti-toast-info    .neti-toast-icon { color: var(--primary); }
.neti-toast-error   .neti-toast-bar { background: linear-gradient(90deg, #fecaca, #ef4444); animation: neti-bar 4s linear forwards; }
.neti-toast-success .neti-toast-bar { background: linear-gradient(90deg, #bbf7d0, #22c55e); animation: neti-bar 4s linear forwards; }
.neti-toast-info    .neti-toast-bar { background: linear-gradient(90deg, var(--neti-200), var(--primary)); animation: neti-bar 4s linear forwards; }
@keyframes neti-bar { from { width: 100%; } to { width: 0; } }

/* ════════════════════════════════════════════════════════════
   SECTION LABEL / DIVIDER
   ════════════════════════════════════════════════════════════ */
.section-label-tipo {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-muted);
  margin-bottom: 10px;
  margin-top: 40px;
  display: block;
}
.neti-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVIDADE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.18); }
  .neti-content { margin-left: 0; }
  .app-topbar { padding: 0 16px; }
  .neti-main  { padding: 20px 16px; }
  #sidebarOverlay {
    opacity: 0;
    transition: opacity .3s ease;
  }
  #sidebarOverlay.show { opacity: 1; }
}

@media (max-width: 768px) {
  .action-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid  { grid-template-columns: 1fr 1fr; }
  .topbar-chip { display: none; }
}

@media (max-width: 480px) {
  .action-grid { grid-template-columns: 1fr; }
  .stats-grid  { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   UTILITÁRIOS
   ════════════════════════════════════════════════════════════ */
.text-neti   { color: var(--primary) !important; }
.bg-neti-50  { background: var(--accent) !important; }
.border-neti { border-color: var(--primary) !important; }

.zoom-container { font-size: 0.85rem; }

/* Remove setas (spinners) dos inputs numéricos — webkit e Firefox */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }
