/* =========================================================
   DESIGN SYSTEM BOLETOZAP — REFINADO CONFORME ESPECIFICAÇÕES
   ========================================================= */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --surface-tab: #f2f5f9;
  --input-bg: #ebf2fc;
  --border: #eef2f6;
  --txt: #1e293b;
  --txt2: #7a8b9e;
  --txt3: #8c959f;
  --accent: #f05a28;
  --grad: linear-gradient(90deg, #ffb326 0%, #ff6b2b 55%, #f05a28 100%);
  --grad-hover: linear-gradient(90deg, #ffa510 0%, #f55b1b 55%, #e04a18 100%);
  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --blue: #3b82f6;
  --blue-bg: #eff6ff;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme='dark'] {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --surface-tab: #1c2128;
  --input-bg: #22272e;
  --border: #30363d;
  --txt: #c9d1d9;
  --txt2: #8b949e;
  --txt3: #484f58;
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── TELA DE LOGIN ── */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}
.login-blob-1 {
  width: 500px;
  height: 500px;
  background: rgba(240, 90, 40, 0.08);
  top: -140px;
  left: -120px;
}
.login-blob-2 {
  width: 450px;
  height: 450px;
  background: rgba(255, 179, 38, 0.1);
  bottom: -120px;
  right: -100px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  position: relative;
  z-index: 2;
  transition: all 0.2s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.login-logo-icon {
  width: 42px;
  height: 42px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-logo-text {
  font-size: 28px;
  font-weight: 800;
  color: #f05a28;
  letter-spacing: -0.5px;
}
[data-theme='dark'] .login-logo-text {
  color: #ffffff;
}

.login-subtitle {
  font-size: 13px;
  color: var(--txt2);
  font-weight: 500;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface-tab);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  padding: 10px 14px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.auth-tab.active {
  background: var(--surface);
  color: #f05a28;
  box-shadow: var(--shadow-sm);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.form-input-icon .icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--txt2);
}

/* INPUTS COM ALINHAMENTO À ESQUERDA E PADDING COMPACTO */
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--txt);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  text-align: left;
  transition: all 0.2s ease;
}
.form-input-icon .form-input {
  padding-left: 44px;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 32px 10px 14px;
  text-align: left;
  font-size: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8b9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select.form-input option {
  text-align: left;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--txt);
}

.form-input.code-font {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
}
.form-input:focus {
  border-color: rgba(240, 90, 40, 0.4);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.1);
}
.form-help-text {
  font-size: 11px;
  color: var(--txt2);
  margin-top: 4px;
}

.login-btn {
  width: 100%;
  padding: 15px;
  background: var(--grad);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(240, 90, 40, 0.32);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.login-btn:hover {
  background: var(--grad-hover);
  transform: translateY(-1px);
}

.info-box {
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;

  &.warning {
    background: var(--amber-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--amber);
  }
}
.alert-msg {
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;

  &.error {
    background: var(--red-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
  }
  &.success {
    background: var(--green-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--green);
  }
}

/* ── TOP NAVBAR IDÊNTICA AO BOLETOZAP ── */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 36px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  color: #f05a28;
  letter-spacing: -0.5px;
}
[data-theme='dark'] .brand-title {
  color: #ffffff;
}

/* PÍLULA CENTRAL DE NAVEGAÇÃO DO BOLETOZAP */
.nav-menu.center-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f2f5f9;
  border-radius: 99px;
  padding: 4px;
  border: 1px solid #eef2f6;
}

[data-theme='dark'] .nav-menu.center-nav {
  background: #1c2128;
  border-color: #30363d;
}

.nav-item-btn {
  padding: 8px 18px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--txt2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-item-btn i, .nav-item-btn svg {
  width: 16px;
  height: 16px;
  color: var(--txt2);
  transition: color 0.2s ease;
}

.nav-item-btn:hover {
  color: var(--txt);
}
.nav-item-btn:hover i, .nav-item-btn:hover svg {
  color: var(--txt);
}

.nav-item-btn.active {
  background: #ffffff;
  color: #f05a28;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  font-weight: 700;
}
.nav-item-btn.active i, .nav-item-btn.active svg {
  color: #f05a28;
}

[data-theme='dark'] .nav-item-btn.active {
  background: #21262d;
  color: #f05a28;
}

/* USUÁRIO & AÇÕES DIREITA */
.nav-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  text-align: right;
  line-height: 1.2;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
}
.user-role {
  font-size: 11px;
  font-weight: 500;
  color: var(--txt2);
  margin-top: 2px;
}

.user-v-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}

.icon-btn-bz {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--txt2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn-bz i, .icon-btn-bz svg {
  width: 18px;
  height: 18px;
  transition: color 0.2s ease;
}

.icon-btn-bz:hover {
  border-color: #f05a28;
  color: #f05a28;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(240, 90, 40, 0.12);
}
.icon-btn-bz:hover i, .icon-btn-bz:hover svg {
  color: #f05a28;
}

/* ── CONTEÚDO PRINCIPAL ── */
.main-content {
  flex: 1;
  padding: 24px 36px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.dashboard-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.dash-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-title-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.dash-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--txt);
  letter-spacing: -0.5px;
}
.updated-time-badge {
  background: var(--surface-tab);
  color: var(--txt2);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
}

.subnav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-compact {
  padding: 6px 14px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}
.btn-compact .icon, .btn-compact svg {
  width: 14px;
  height: 14px;
}

.btn-orange {
  background: #f05a28;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(240, 90, 40, 0.2);
}
.btn-orange:hover {
  background: #e04a18;
  transform: translateY(-1px);
}

.btn-primary-compact {
  background: var(--grad);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(240, 90, 40, 0.2);
}
.btn-primary-compact:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--txt);
}
.btn-secondary:hover {
  background: var(--surface-tab);
}

/* ── PAINEL DE BUSCA REDUZIDA PELA METADE COM FILTROS À DIREITA ── */
.filter-panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.filter-bar-combined {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box-half {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon-half {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--txt2);
}
.search-input-half {
  width: 100%;
  height: 42px;
  padding: 10px 14px 10px 38px;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--txt);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}
.search-input-half:focus {
  border-color: rgba(240, 90, 40, 0.4);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.1);
}

.filters-row-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.btn-clear-filters {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-tab);
  color: var(--txt2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-clear-filters:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}
.btn-clear-filters svg,
.btn-clear-filters i {
  width: 17px;
  height: 17px;
}

.multiselect-dropdown-container {
  position: relative;
  z-index: 50;
}

.multiselect-trigger-btn {
  padding: 8px 16px;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--txt);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}
.multiselect-trigger-btn:hover {
  border-color: var(--accent);
}
.dropdown-chevron {
  width: 14px;
  height: 14px;
  color: var(--txt2);
}

.dropdown-menu-custom {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-item-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
  transition: background 0.15s ease;
}
.dropdown-item-checkbox:hover {
  background: var(--surface-tab);
}
.dropdown-item-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* ── ANIMAÇÃO DE SPIN PARA ICONES DURANTE REFRESH EM SEGUNDO PLANO ── */
.spin {
  animation: spin-rotate 1s linear infinite !important;
}
@keyframes spin-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── METADADOS DISCRETOS E MINIMALISTAS ── */
.meta-tags-bottom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.meta-tag-discrete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt2);
  background: var(--surface-tab);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 6px;
}
.meta-tag-discrete svg, .meta-tag-discrete i {
  width: 13px;
  height: 13px;
  color: var(--txt3);
}

/* ── CARDS KPIS HOJE & NESTA SEMANA ── */
.kpi-grid-boletozap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .kpi-grid-boletozap { grid-template-columns: 1fr; }
  .nav-menu.center-nav { position: static; transform: none; margin: 10px 0; }
  .search-box-half { flex: 1 1 100%; width: 100%; max-width: 100%; min-width: 100%; }
  .filters-row-inline { width: 100%; justify-content: flex-start; }
}

.kpi-card-bz {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

/* ── DASHBOARD KPIS CARDS ── */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .dash-kpi-grid { grid-template-columns: 1fr; }
}

.dash-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.kpi-badge-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}
.kpi-badge-tag.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.kpi-badge-tag.amber { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.kpi-badge-tag.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.kpi-badge-tag.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.kpi-main-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--txt);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.kpi-main-val.amber { color: #f59e0b; }
.kpi-main-val.green { color: #10b981; }
.kpi-main-val.blue { color: #3b82f6; }

.kpi-sub-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dash-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .dash-charts-grid { grid-template-columns: 1fr; }
}

.dash-table-summary {
  width: 100%;
  border-collapse: collapse;
}
.dash-table-summary th {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
}
.dash-table-summary td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--txt);
  border-bottom: 1px solid var(--border);
}
.dash-table-summary tr:last-child td {
  border-bottom: none;
}
.dash-table-summary tr:hover td {
  background: rgba(240, 90, 40, 0.02);
}

/* ── GRÁFICOS VISUAIS DE PERCENTUAL (LIBERADO VS BLOQUEADO) ── */
.status-bar-row {
  margin-bottom: 16px;
}
.status-bar-row:last-child {
  margin-bottom: 0;
}
.status-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.status-bar-title {
  font-weight: 700;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-bar-stats {
  font-weight: 800;
  color: var(--txt);
}

.status-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--surface-tab);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.status-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease-out;

  &.green { background: var(--green); }
  &.amber { background: var(--amber); }
  &.blue { background: var(--blue); }
}

/* ── SELETOR VISUAL INTERATIVO DE ÍCONES (`.icon-picker-grid`) ── */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 210px;
  overflow-y: auto;
  padding: 8px;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.icon-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.icon-picker-item {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--txt2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-picker-item i, .icon-picker-item svg {
  width: 20px;
  height: 20px;
}

.icon-picker-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

.icon-picker-item.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(240, 90, 40, 0.3);
  transform: scale(1.08);
}

/* BOTÃO DE FECHAR MODAL COM DESIGN DO APP */
.modal-header .icon-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--txt);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-header .icon-btn:hover {
  background: rgba(240, 90, 40, 0.1);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

/* ── TABELA & CARDS DE INVOICES ── */
.table-card-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  box-sizing: border-box;
}

#invoicesListContainer {
  width: 100%;
  box-sizing: border-box;
}

.invoice-record-card {
  border-bottom: 1px solid var(--border);
  padding: 24px 28px;
  transition: background 0.18s ease;
  width: 100%;
  box-sizing: border-box;
}
.invoice-record-card:last-child {
  border-bottom: none;
}
.invoice-record-card:hover {
  background: #fafbfc;
}
[data-theme='dark'] .invoice-record-card:hover {
  background: #1c2128;
}

.record-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 16px;
}

.record-main-info {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  flex: 1;
}

.record-code-tag {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.record-code {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}
.record-master-code {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt2);
}

.record-details-group {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}
.detail-col {
  display: flex;
  flex-direction: column;
}
.detail-col-fornecedor {
  max-width: 480px;
}
.detail-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
}
.supplier-name-full {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

/* ── BARRA DE PAGINAÇÃO MODERNA DA ABA HISTÓRICO ── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt2);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-limit-custom {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--txt);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}
.select-limit-custom:focus, .select-limit-custom:hover {
  border-color: var(--accent);
}

.btn-pagination {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--txt);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.btn-pagination:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(240, 90, 40, 0.25);
}
.btn-pagination:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-pagination i, .btn-pagination svg {
  width: 14px;
  height: 14px;
}

.page-current-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 90, 40, 0.08);
  color: var(--accent);
  border: 1px solid rgba(240, 90, 40, 0.2);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 800;
}

.record-action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill-aligned {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}
.status-pill-aligned i, .status-pill-aligned svg {
  width: 18px;
  height: 18px;
}

/* LINHA DO TEMPO RESPONSIVA E DE ALTO IMPACTO VISUAL */
.inline-timeline-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px 18px 24px;
  margin-top: 14px;
  overflow: hidden;
}

.timeline-stepper-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  gap: 12px;
  padding: 6px 10px 4px 10px;
}

/* TRACK DE FUNDO DA LINHA DE CONEXÃO */
.timeline-stepper-row::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 36px;
  right: 36px;
  height: 5px;
  background: var(--border);
  z-index: 1;
  border-radius: 99px;
}

/* PREENCHIMENTO DA LINHA DE CONEXÃO EM LARANJA OU AZUL */
.timeline-progress-fill {
  position: absolute;
  top: 17px;
  left: 36px;
  height: 5px;
  background: var(--accent);
  z-index: 1;
  border-radius: 99px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.timeline-progress-fill.completed-blue {
  background: #3b82f6 !important;
}

.timeline-progress-fill.in-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: progress-shimmer 1.8s infinite;
}
@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
  padding: 0 4px;
}

/* CÍRCULO DA ETAPA - 100% SÓLIDO SEM TRANSPARÊNCIA */
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--txt3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  transition: all 0.22s ease;
  box-shadow: var(--shadow-sm);
}
.step-circle i, .step-circle svg {
  width: 16px;
  height: 16px;
}

/* ETAPA PENDENTE: Fundo sólido surface para esconder a linha atrás */
.step-item.pending .step-circle {
  background: var(--surface);
  border-color: var(--border);
  color: var(--txt3);
}

/* ETAPA CONCLUÍDA: Preenchimento laranja sólido vibrante com ícone branco puro */
.step-item.completed .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(240, 90, 40, 0.3);
}

/* ETAPA ATIVA: Preenchimento laranja sólido com anel pulsante e destaque */
.step-item.active .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(240, 90, 40, 0.25);
  transform: scale(1.1);
}

/* ETAPA QUANDO TRAJETÓRIA CONCLUÍDA (100%): Preenchimento azul sólido elegante em todos os ícones */
.step-item.completed-blue-step .step-circle {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3) !important;
}

.step-item.completed-blue-step .step-title {
  color: #3b82f6 !important;
  font-weight: 800 !important;
}

/* TÍTULOS E SUBTÍTULOS COM EXCELENTE LEITURA */
.step-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--txt);
  line-height: 1.35;
}

.step-item.active .step-title {
  color: var(--accent);
  font-weight: 800;
}

.step-item.is-final .step-title {
  color: #3b82f6;
  font-weight: 800;
}

.step-subtitle {
  font-size: 11px;
  color: var(--txt2);
  margin-top: 3px;
  font-weight: 500;
}

.timeline-audit-log {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--txt2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.audit-badge {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
}

/* BOTÃO VER ITENS ABAIXO DA LINHA DO TEMPO */
.below-timeline-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* SUBTABELA EXPANSÍVEL INLINE PARA ITENS COM ALINHAMENTO PIXEL-PERFECT (TABLE-LAYOUT: FIXED) */
.record-items-expandable {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  animation: expand-down 0.2s ease-out;
}
@keyframes expand-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.items-subtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.items-subtable th {
  background: var(--surface2);
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.items-subtable td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  word-wrap: break-word;
}
.items-subtable tr:last-child td {
  border-bottom: none;
}

/* ABA DE CONFIGURAÇÕES CENTRALIZADA (780PX) */
.config-centered-container {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.config-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.config-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(240, 90, 40, 0.12);
  color: #f05a28;
  display: flex;
  align-items: center;
  justify-content: center;
}
.config-header-icon i, .config-header-icon svg {
  width: 22px;
  height: 22px;
}
.config-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--txt);
}
.config-subtitle {
  font-size: 13px;
  color: var(--txt2);
}

.config-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.config-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.config-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--txt);
}

.config-table-style {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.config-table-style th {
  background: var(--surface2);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.config-table-style td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.config-table-style tr:last-child td {
  border-bottom: none;
}
.config-table-style tr:hover {
  background: var(--surface2);
}

/* BOTÕES DE AÇÃO REFINADOS PARA TABELA DE CONFIGURAÇÕES */
.btn-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--txt2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-action-icon i, .btn-action-icon svg {
  width: 15px;
  height: 15px;
  transition: color 0.2s ease;
}

.btn-action-icon.edit:hover {
  border-color: #f05a28;
  color: #f05a28;
  background: rgba(240, 90, 40, 0.08);
}

.btn-action-icon.delete:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* Modais */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-slide 0.22s ease-out;
}
@keyframes modal-slide {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--txt);
}
.modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--surface2);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toast-in 0.3s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.hidden { display: none !important; }
