/* ═══════════════════════════════════════════════════════════════════════════════
   VALORE DESIGN SYSTEM — Portal NFSe
   Visual inspirado no Projeto RH, mantendo identidade azul do Emissão NFSe.
   ═══════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Paleta principal — azul NFSe */
  --primary: #0a1628;
  --primary-light: #112240;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-light: #dbeafe;

  /* Compatibilidade com classes antigas */
  --azul-escuro: var(--primary);
  --azul-medio: var(--accent);
  --azul-claro: var(--accent-light);
  --azul-hover: var(--accent-hover);
  --branco: #ffffff;
  --cinza-f8: #f4f6fb;
  --cinza-f2: #f8f9fd;
  --cinza-borda: #e4e8f2;
  --cinza-medio: #8896b0;
  --cinza-escuro: #4a5568;
  --texto: #0a1628;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --info: #1d4ed8;
  --info-bg: #dbeafe;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #f8f9fd;
  --border: #e4e8f2;
  --border-strong: #cdd3e8;
  --text: #0a1628;
  --text-2: #4a5568;
  --text-3: #8896b0;

  --sidebar-w: 244px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(26,31,54,.06), 0 1px 2px rgba(26,31,54,.04);
  --shadow: 0 4px 16px rgba(26,31,54,.08), 0 1px 4px rgba(26,31,54,.04);
  --shadow-lg: 0 8px 32px rgba(26,31,54,.12), 0 2px 8px rgba(26,31,54,.06);
  --font: 'Plus Jakarta Sans', 'DM Sans', Arial, sans-serif;
  --transition: .18s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: none; }
svg { flex-shrink: 0; }

/* ═══════════════════════════════════════
   LAYOUT / SIDEBAR
   ═══════════════════════════════════════ */
.vl-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, .54);
  z-index: 998;
  backdrop-filter: blur(2px);
}
.vl-overlay.show { display: block; }
.vl-layout { display: flex; min-height: 100vh; }

.vl-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--primary);
  background-image: radial-gradient(ellipse at 90% 0%, rgba(29,78,216,.22) 0%, transparent 48%),
                    linear-gradient(180deg, #112240 0%, #0a1628 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 999;
  transition: width var(--transition), transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.vl-sidebar__brand {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  min-height: 76px;
  display: flex;
  align-items: center;
}
.vl-brand-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.vl-sidebar__logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}
.vl-sidebar__product { min-width: 0; }
.vl-sidebar__product strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vl-sidebar__product span {
  display: block;
  color: rgba(255,255,255,.46);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vl-sidebar__toggle {
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.58);
  cursor: pointer;
  transition: all var(--transition);
}
.vl-sidebar__toggle:hover { color: #fff; background: rgba(255,255,255,.10); }
.vl-sidebar__toggle svg { transition: transform var(--transition); }

.vl-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.vl-sidebar__nav::-webkit-scrollbar { width: 4px; }
.vl-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }
.vl-sidebar__section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255,255,255,.30);
  padding: 14px 16px 5px;
  white-space: nowrap;
}
.vl-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: rgba(255,255,255,.68);
  font-size: 13.3px;
  font-weight: 500;
  line-height: 1.25;
  position: relative;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.vl-nav-item svg { width: 18px; height: 18px; color: currentColor; }
.vl-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.vl-nav-item.active { background: rgba(29,78,216,.25); color: #fff; }
.vl-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.vl-sidebar__footer {
  padding: 14px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.vl-user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}
.vl-user-block__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(29,78,216,.16);
}
.vl-user-block__info { min-width: 0; }
.vl-user-block__name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vl-user-block__role {
  color: rgba(255,255,255,.42);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vl-btn-sair {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.60);
  border-radius: 8px;
  transition: all var(--transition);
  font-size: 12px;
}
.vl-btn-sair:hover { background: rgba(220,38,38,.14) !important; color: #fca5a5; }

.vl-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  transition: margin-left var(--transition);
}
@media (min-width: 901px) {
  .vl-sidebar {
    width: var(--sidebar-w-collapsed);
    box-shadow: 6px 0 18px rgba(10,22,40,.08);
  }
  .vl-sidebar:hover,
  .vl-sidebar:focus-within {
    width: var(--sidebar-w);
    box-shadow: var(--shadow-lg);
  }
  .vl-main { margin-left: var(--sidebar-w-collapsed); }
  .vl-sidebar__product,
  .vl-sidebar__section,
  .vl-user-block__info,
  .vl-btn-sair span {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
  }
  .vl-sidebar:hover .vl-sidebar__product,
  .vl-sidebar:focus-within .vl-sidebar__product,
  .vl-sidebar:hover .vl-sidebar__section,
  .vl-sidebar:focus-within .vl-sidebar__section,
  .vl-sidebar:hover .vl-user-block__info,
  .vl-sidebar:focus-within .vl-user-block__info,
  .vl-sidebar:hover .vl-btn-sair span,
  .vl-sidebar:focus-within .vl-btn-sair span {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .vl-brand-card { justify-content: center; }
  .vl-sidebar:hover .vl-brand-card,
  .vl-sidebar:focus-within .vl-brand-card { justify-content: flex-start; }
  .vl-sidebar__logo { width: 34px; height: 34px; }
  .vl-sidebar:hover .vl-sidebar__logo,
  .vl-sidebar:focus-within .vl-sidebar__logo { width: 42px; height: 42px; }
  .vl-nav-item {
    justify-content: center;
    gap: 0;
    padding: 11px 0;
    font-size: 0;
  }
  .vl-sidebar:hover .vl-nav-item,
  .vl-sidebar:focus-within .vl-nav-item {
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13.3px;
  }
  .vl-nav-item svg { width: 18px; height: 18px; }
  .vl-user-block { justify-content: center; }
  .vl-sidebar:hover .vl-user-block,
  .vl-sidebar:focus-within .vl-user-block { justify-content: flex-start; }
  .vl-btn-sair { justify-content: center; }
  .vl-sidebar:hover .vl-btn-sair,
  .vl-sidebar:focus-within .vl-btn-sair { justify-content: flex-start; }
}

/* ═══════════════════════════════════════
   TOPBAR / PAGE
   ═══════════════════════════════════════ */
.vl-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 0 rgba(26,31,54,.02);
}
.vl-topbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 9px;
  transition: all var(--transition);
}
.vl-topbar__hamburger:hover { background: var(--surface2); border-color: var(--border-strong); }
.vl-topbar__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-2);
}
.vl-topbar__breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-3);
  font-size: 13px;
  min-width: 0;
}
.vl-topbar__breadcrumb a { color: var(--text-3); }
.vl-topbar__breadcrumb a:hover { color: var(--accent); }
.vl-topbar__breadcrumb .sep { color: var(--border-strong); }
.vl-topbar__breadcrumb .current { color: var(--primary); font-weight: 600; }
.vl-topbar__breadcrumb a,
.vl-topbar__breadcrumb .sep { display: none; }
.vl-topbar__actions { display: flex; align-items: center; gap: 8px; }
.vl-messages { padding: 18px 32px 0; }
.vl-page { flex: 1; padding: 28px 32px 36px; }

.vl-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.vl-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
}
.vl-page-title::before {
  content: 'NF';
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--accent-light);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.vl-page-subtitle {
  color: var(--text-2);
  font-size: 13.3px;
  margin-top: 5px;
}

/* ═══════════════════════════════════════
   CARDS / SECTIONS / STATS
   ═══════════════════════════════════════ */
.vl-card,
.vl-section,
.vl-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.vl-card {
  padding: 22px;
}
.vl-card__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.vl-card__body { font-size: 13.5px; color: var(--text-2); }
.vl-section { margin-bottom: 20px; }
.vl-section__header {
  padding: 17px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, var(--surface2) 100%);
}
.vl-section__header svg { color: var(--accent); }
.vl-section__body { padding: 22px; }

.vl-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.vl-stat {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.vl-stat:hover { box-shadow: var(--shadow); border-color: #bfdbfe; transform: translateY(-1px); }
.vl-stat::before {
  content: '';
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1.5px solid #bfdbfe;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.vl-stat:not(.vl-stat--warning):not(.vl-stat--danger):not(.vl-stat--success):not(.vl-stat--info)::before { content: '✓'; }
.vl-stat--warning::before { content: '!'; background: #fffbeb; color: #b45309; border-color: #fde68a; }
.vl-stat--danger::before { content: '×'; background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.vl-stat--success::before { content: '✓'; background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.vl-stat--info::before { content: 'i'; background: #eff6ff; color: var(--accent); border-color: #bfdbfe; }
.vl-stat__label {
  font-size: 12.3px;
  color: var(--text-2);
  font-weight: 600;
  margin-top: 5px;
}
.vl-stat__value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  letter-spacing: -.03em;
}
.vl-stat--warning .vl-stat__value { color: #b45309; }
.vl-stat--danger .vl-stat__value { color: #b91c1c; }
.vl-stat--success .vl-stat__value { color: #15803d; }
.vl-stat--info .vl-stat__value { color: var(--accent); }

.vl-company-grid,
.vl-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.vl-company-card,
.vl-quick-card {
  display: block;
  padding: 17px;
  border-radius: var(--radius-lg);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all var(--transition);
}
.vl-company-card:hover,
.vl-quick-card:hover { box-shadow: var(--shadow); border-color: #bfdbfe; transform: translateY(-1px); }
.vl-company-card__name { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.vl-company-card__cnpj { font-size: 12px; color: var(--text-3); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin-bottom: 12px; }
.vl-company-card__meta { display: flex; flex-wrap: wrap; gap: 7px; }
.vl-quick-card__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid #bfdbfe;
}
.vl-quick-card__title { font-size: 13.5px; font-weight: 700; color: var(--primary); }
.vl-quick-card__text { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* ═══════════════════════════════════════
   FORMS / BUTTONS
   ═══════════════════════════════════════ */
.vl-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.vl-form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.vl-form-group { margin-bottom: 18px; }
.vl-form-label,
.vl-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.vl-form-label span { color: var(--danger); }
.vl-form-hint,
.vl-help-text { color: var(--text-3); font-size: 12px; margin-top: 6px; }
.vl-input,
.vl-select,
.vl-textarea,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.vl-textarea,
textarea { min-height: 110px; resize: vertical; }
.vl-input:focus,
.vl-select:focus,
.vl-textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,.10);
}
.vl-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.vl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform .10s, box-shadow var(--transition);
  white-space: nowrap;
}
.vl-btn:active { transform: scale(.985); }
.vl-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.vl-btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.vl-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.vl-btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.vl-btn--secondary:hover { background: var(--bg); border-color: var(--border-strong); color: var(--text); }
.vl-btn--ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.vl-btn--ghost:hover { background: var(--surface2); color: var(--text); }
.vl-btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.vl-btn--danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.vl-btn--success { background: var(--success); color: #fff; border-color: var(--success); }
.vl-btn--success:hover { background: #15803d; color: #fff; }
.vl-btn--sm { min-height: 34px; padding: 7px 12px; font-size: 12.5px; }
.vl-btn--lg { min-height: 46px; padding: 12px 20px; font-size: 14px; }
.vl-btn--block { width: 100%; }

/* ═══════════════════════════════════════
   TABLES / FILTERS / PAGINATION
   ═══════════════════════════════════════ */
.vl-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.vl-search { position: relative; flex: 1; min-width: 220px; }
.vl-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.vl-search input { padding-left: 42px; }
.vl-table-wrap { margin-bottom: 22px; overflow-x: auto; }
.vl-table { width: 100%; border-collapse: collapse; }
.vl-table thead th {
  text-align: left;
  font-size: 10.8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  padding: 11px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.vl-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  vertical-align: top;
}
.vl-table tbody tr:hover td { background: var(--bg); }
.vl-table tbody tr:last-child td { border-bottom: none; }
.vl-table__empty { text-align: center; color: var(--text-3); padding: 34px !important; }
.vl-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
}
.vl-pagination__pages { display: flex; gap: 6px; flex-wrap: wrap; }
.vl-pagination__btn {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.vl-pagination__btn:hover,
.vl-pagination__btn--active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ═══════════════════════════════════════
   BADGES / ALERTS / DETAILS / TABS
   ═══════════════════════════════════════ */
.vl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
  white-space: nowrap;
}
.vl-badge--default { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.vl-badge--success { background: var(--success-bg); color: #15803d; }
.vl-badge--danger { background: var(--danger-bg); color: #b91c1c; }
.vl-badge--warning { background: var(--warning-bg); color: #b45309; }
.vl-badge--info,
.vl-badge--blue { background: var(--info-bg); color: var(--accent); }
.vl-badge--mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.8px; }

.vl-alert {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.vl-alert--success { background: var(--success-bg); color: #15803d; border-color: #bbf7d0; }
.vl-alert--danger,
.vl-alert--error { background: var(--danger-bg); color: #b91c1c; border-color: #fecaca; }
.vl-alert--warning { background: var(--warning-bg); color: #b45309; border-color: #fde68a; }
.vl-alert--info { background: var(--info-bg); color: var(--accent); border-color: #bfdbfe; }

.vl-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.vl-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: all var(--transition);
}
.vl-tab:hover { background: var(--surface2); color: var(--accent); }
.vl-tab.active { background: var(--accent); color: #fff; }

.vl-import-help {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  margin-bottom: 20px;
}
.vl-import-help strong { display: block; color: var(--primary); font-size: 14px; margin-bottom: 4px; }
.vl-import-help p { color: var(--text-2); font-size: 13px; margin: 0; }
.vl-import-help__example {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed #93c5fd;
  color: var(--text-2);
  font-size: 12.5px;
}

.vl-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vl-detail-item,
.vl-field {
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: var(--radius);
}
.vl-detail-item__label,
.vl-field__label {
  font-size: 10.8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.vl-detail-item__value,
.vl-field__value { font-size: 13.5px; color: var(--text); word-break: break-word; }

/* ═══════════════════════════════════════
   LOGIN / RECUPERAÇÃO DE SENHA
   ═══════════════════════════════════════ */
.vl-login-body {
  min-height: 100vh;
  background: var(--surface);
  color: var(--text);
}
.vl-login-page { display: flex; min-height: 100vh; }
.vl-login-left {
  flex: 1;
  background: var(--primary);
  background-image: radial-gradient(ellipse at 82% 18%, rgba(29,78,216,.38) 0%, transparent 56%),
                    radial-gradient(ellipse at 12% 84%, rgba(59,130,246,.24) 0%, transparent 50%),
                    linear-gradient(180deg, #112240 0%, #0a1628 100%);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.vl-login-left::before,
.vl-login-left::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(147,197,253,.18);
  pointer-events: none;
}
.vl-login-left::before { right: -70px; bottom: -90px; width: 330px; height: 330px; }
.vl-login-left::after { right: 28px; bottom: -18px; width: 210px; height: 210px; }
.vl-login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.vl-login-brand img {
  width: 280px;
  height: auto;
  object-fit: contain;
  display: block;
}
.vl-login-brand__text strong { display: block; color: #fff; font-size: 18px; font-weight: 700; }
.vl-login-brand__text span { display: block; color: rgba(255,255,255,.52); font-size: 12px; }
.vl-login-headline {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  font-weight: 300;
  letter-spacing: -.04em;
  margin-top: auto;
  max-width: 650px;
}
.vl-login-headline span { color: #93c5fd; font-weight: 700; }
.vl-login-features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.vl-login-feature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.13);
  color: rgba(255,255,255,.82);
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 12px;
}
.vl-login-feature::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #93c5fd;
}
.vl-login-right {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--surface);
}
.vl-login-container { width: 100%; max-width: 382px; }
.vl-login-logo { display: none; }
.vl-login-card {
  width: 100%;
  background: var(--surface);
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.vl-login-card__title {
  color: var(--primary);
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -.02em;
}
.vl-login-card__sub { color: var(--text-2); font-size: 14px; margin-bottom: 32px; }
.vl-login-forgot { margin-top: 18px; text-align: center; }
.vl-login-forgot a { color: var(--accent); font-size: 13px; font-weight: 600; }
.vl-login-forgot a:hover { color: var(--accent-hover); }
.vl-login-footer { margin-top: 28px; text-align: center; color: var(--text-3); font-size: 12px; }
.vl-login-card__icon { display: flex; justify-content: center; margin-bottom: 18px; }
.vl-login-card__icon--success svg { color: var(--success); }

/* ═══════════════════════════════════════
   RESPONSIVO
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .vl-login-left { padding: 40px; }
  .vl-login-right { width: 440px; padding: 40px; }
}
@media (max-width: 900px) {
  .vl-sidebar {
    width: var(--sidebar-w);
    transform: translateX(calc(-1 * var(--sidebar-w)));
    box-shadow: none;
  }
  .vl-sidebar__product,
  .vl-sidebar__section,
  .vl-user-block__info,
  .vl-btn-sair span {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .vl-brand-card { justify-content: flex-start; }
  .vl-nav-item {
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13.3px;
  }
  .vl-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .vl-main { margin-left: 0; }
  .vl-topbar { padding: 0 16px; }
  .vl-topbar__hamburger { display: flex; }
  .vl-sidebar__toggle { display: none; }
  .vl-page { padding: 18px 16px 28px; }
  .vl-messages { padding: 14px 16px 0; }
  .vl-form-grid,
  .vl-form-grid-3,
  .vl-detail-grid,
  .vl-import-help { grid-template-columns: 1fr; }
  .vl-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vl-login-page { display: block; }
  .vl-login-left { min-height: 320px; padding: 32px 24px; }
  .vl-login-right { width: 100%; padding: 34px 24px; }
}
@media (max-width: 560px) {
  .vl-page-title { font-size: 18px; }
  .vl-page-title::before { width: 34px; height: 34px; }
  .vl-stats-grid { grid-template-columns: 1fr; }
  .vl-company-grid,
  .vl-quick-grid { grid-template-columns: 1fr; }
  .vl-section__body,
  .vl-card { padding: 18px; }
  .vl-filters,
  .vl-pagination { flex-direction: column; align-items: stretch; }
  .vl-login-left { min-height: 280px; }
  .vl-login-headline { font-size: 30px; }
}

/* Ajuste final dos cards de indicadores: ícone à esquerda, valor e rótulo empilhados. */
.vl-stat {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 4px;
}
.vl-stat::before { grid-column: 1; grid-row: 1 / span 2; }
.vl-stat__value { grid-column: 2; grid-row: 1; }
.vl-stat__label { grid-column: 2; grid-row: 2; margin-top: 0; }

/* Autocomplete de municípios usado nas solicitações e emissão.
   Visual alinhado ao campo de Código de Serviço, porém mantendo a digitação/filtro. */
.municipio-field { position: relative; }
.vl-autocomplete-wrap { position: relative; }
.vl-autocomplete-input {
  min-height: 42px;
  padding-right: 42px;
  cursor: text;
  background-color: var(--surface);
}
.vl-autocomplete-wrap::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.8px solid var(--text-2);
  border-bottom: 1.8px solid var(--text-2);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  opacity: .75;
}
.municipio-options {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}
.municipio-options.is-open { display: block; }
.municipio-option {
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid #eef2f7;
  background: var(--surface);
}
.municipio-option:hover { background: var(--accent-light); color: var(--primary); }
.municipio-option:last-child { border-bottom: 0; }

/* Histórico do tomador na solicitação de NFS-e */
.tomador-historico {
  grid-column: 1 / -1;
  margin-top: -6px;
  display: none;
}
.tomador-historico.is-open { display: block; }
.tomador-historico__emails {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tomador-email-chip {
  border: 1px solid var(--azul-medio);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12.5px;
  color: var(--azul-escuro);
  cursor: pointer;
}
.tomador-email-chip:hover { background: var(--azul-claro); }
.tomador-historico__actions { margin-top: 10px; }
