/* ============================================================
   style.css — PHPay
   Design system baseado no projeto ajuste-data-bitrix
   Fonte: IBM Plex Mono | Fundo: #f0f2f8 | Azul: #0f2fb5
   ============================================================ */

/* ── Reset e base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  background: #f0f2f8;
  color: #1a2040;
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
}

a { color: #0f2fb5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────── */
.header {
  background: #ffffff;
  border-bottom: 3px solid #0f2fb5;
  padding: 12px 0;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(15,47,181,.08);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-brand { display: flex; align-items: center; gap: 14px; }
.header-logo  { height: 36px; width: auto; }
.header-divider { width: 1px; height: 28px; background: #d8e0f0; flex-shrink: 0; }
.header-title { font-size: 13px; font-weight: 700; color: #0f2fb5; letter-spacing: .5px; }
.header-sub   { font-size: 10px; color: #6070a0; letter-spacing: 1.2px; text-transform: uppercase; margin-top: 2px; }
.header-badge {
  background: #eef1fc; border: 1px solid #c0ccee; color: #0f2fb5;
  font-size: 9px; padding: 3px 8px; border-radius: 20px;
  letter-spacing: 1px; text-transform: uppercase;
}
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ── Layout principal ────────────────────────────────────── */
.app-body {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  gap: 24px;
  min-height: calc(100vh - 70px);
}
.app-body--wide {
  max-width: 100%;
  padding: 24px 32px;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar { width: 200px; flex-shrink: 0; }

.sidebar-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(21,64,203,.15);
  border: 1px solid #d0d9f5;
}

.sidebar-header {
  background: linear-gradient(135deg, #1540CB 0%, #0f2fb5 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 11px 16px;
}

.sidebar-body {
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: #2d3a5c;
  text-decoration: none;
  transition: background .13s, color .13s;
  border-left: 3px solid transparent;
}
.sidebar-item:hover {
  background: #eef2fd;
  color: #1540CB;
  text-decoration: none;
}
.sidebar-item:hover .sidebar-icon {
  background: rgba(21,64,203,.15);
  color: #1540CB;
}
.sidebar-item.active {
  background: linear-gradient(135deg, #1540CB 0%, #0f2fb5 100%);
  color: #fff;
  font-weight: 600;
  border-left-color: transparent;
  border-radius: 0;
}
.sidebar-item.active .sidebar-icon {
  background: rgba(255,255,255,.2);
  color: #fff;
}
.sidebar-item.active:hover {
  background: linear-gradient(135deg, #1847d4 0%, #1135c0 100%);
  color: #fff;
}
.sidebar-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(21,64,203,.08);
  border-radius: 7px;
  transition: background .13s;
}
.sidebar-icon svg { width: 15px; height: 15px; }

.ui-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  vertical-align: -2px;
  color: currentColor;
}
.ui-icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ui-icon-lg { width: 17px; height: 17px; }
.ui-icon-xl { width: 19px; height: 19px; }
.ui-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ui-label-tight {
  gap: 6px;
}
.btn .ui-icon,
.modal-title .ui-icon,
.crm-tab-title .ui-icon,
.resumo-title .ui-icon,
.exp-card-title .ui-icon,
.section-header .ui-icon,
.alert-icon .ui-icon,
.empty-icon .ui-icon {
  color: inherit;
}
.empty-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5a72d6;
  background: linear-gradient(135deg, rgba(21,64,203,.12), rgba(33,111,255,.05));
  border: 1px solid rgba(21,64,203,.16);
  border-radius: 14px;
  margin-bottom: 12px;
}
.empty-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.sidebar-divider {
  height: 1px;
  background: #e6ecf8;
  margin: 5px 12px;
}

/* ── Main content ────────────────────────────────────────── */
.main { flex: 1; min-width: 0; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: #ffffff;
  border: 1px solid #d8e0f0;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(15,47,181,.06);
}
.card-header {
  background: linear-gradient(135deg, #0f2fb5, #1a50e0);
  padding: 12px 20px;
  font-size: 11px;
  color: #ffffff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header-actions { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-body.no-padding { padding: 0; }

/* Card sem gradiente (mais suave) */
.card-header.light {
  background: #f4f6fc;
  color: #1a2040;
  border-bottom: 1px solid #d8e0f0;
  font-weight: 600;
}

/* ── Stats grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: #ffffff;
  border: 1px solid #d8e0f0;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(15,47,181,.06);
}
.stat-number { font-size: 28px; font-weight: 700; color: #0f2fb5; line-height: 1; }
.stat-label  { font-size: 10px; color: #6070a0; letter-spacing: 1px; text-transform: uppercase; margin-top: 8px; }

/* ── Tabelas ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  text-align: left; padding: 10px 12px;
  color: #6070a0; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  border-bottom: 1px solid #d8e0f0; white-space: nowrap; background: #f8faff;
}
tbody tr { border-bottom: 1px solid #e8edf8; transition: background .15s; }
tbody tr:hover { background: #f4f6fc; }
tbody td { padding: 10px 12px; color: #6070a0; vertical-align: middle; }
tbody td:first-child { color: #1a2040; }

/* ── Formulários ─────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

/* ── Filtros de data ─────────────────────────────────────── */
.filter-label { display:block; font-size:11px; font-weight:600; color:#6070a0; text-transform:uppercase; margin-bottom:5px; }
.filter-date-group { display:flex; flex-direction:column; }
.filter-date-range { display:flex; align-items:center; gap:6px; }
.filter-date-range input[type="date"] { flex:1; min-width:0; }
.filter-date-sep { font-size:13px; color:#9aaccb; flex-shrink:0; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-row.cols3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .form-row, .form-row.cols3 { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 11px; color: #6070a0;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 6px;
}
label .required { color: #dc2626; margin-left: 2px; }

/* ── Inputs (azul vazio → verde preenchido) ─────────────── */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="password"],
textarea {
  width: 100%;
  background: #E8F0FE;
  border: 2px solid #9aaccb;
  border-radius: 6px;
  color: #1a2040;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
input.filled,
input:not(:placeholder-shown):not(:focus),
textarea:not(:placeholder-shown) {
  background: #F0FDF4;
  border-color: #6ebc8a;
}
input:focus, textarea:focus, select:focus {
  border-color: #0f2fb5;
  box-shadow: 0 0 0 3px rgba(15,47,181,.10);
  background: #E8F0FE;
}
input::placeholder, textarea::placeholder { color: #9aaccb; }
textarea { resize: vertical; min-height: 80px; }

/* ── Selects ─────────────────────────────────────────────── */
select {
  width: 100%;
  background: #E8F0FE;
  border: 2px solid #9aaccb;
  border-radius: 6px;
  color: #1a2040;
  padding: 10px 36px 10px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236070a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
select.filled, select:not([value=""]):valid { background-color: #F0FDF4; border-color: #6ebc8a; }
select:disabled { opacity: .5; cursor: not-allowed; }

/* ── Checkboxes customizados ─────────────────────────────── */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.checkbox-item { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox-item input[type="checkbox"] {
  width: 16px; height: 16px;
  background: #E8F0FE; border: 2px solid #9aaccb; border-radius: 4px;
  appearance: none; -webkit-appearance: none;
  cursor: pointer; transition: background .15s, border-color .15s;
  position: relative; flex-shrink: 0;
}
.checkbox-item input[type="checkbox"]:checked {
  background: #0f2fb5; border-color: #0f2fb5;
}
.checkbox-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.checkbox-item label { text-transform: none; letter-spacing: 0; font-size: 12px; color: #1a2040; margin-bottom: 0; }

/* ── Toggle switch ───────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; width: 44px; height: 24px; cursor: pointer;
}
.toggle input { display: none; }
.toggle-track {
  position: absolute; inset: 0;
  background: #d8e0f0; border-radius: 20px;
  transition: background .2s;
}
.toggle input:checked + .toggle-track { background: #0f2fb5; }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: left .2s;
}
.toggle input:checked ~ .toggle-thumb { left: 23px; }
.toggle-label { font-size: 12px; color: #6070a0; }

/* ── Botões ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 7px; font-size: 12px; font-family: inherit;
  font-weight: 600; cursor: pointer; border: none;
  transition: opacity .2s, box-shadow .2s, background .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #0f2fb5, #1a50e0);
  color: #fff;
  box-shadow: 0 4px 16px rgba(15,47,181,.25);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(15,47,181,.35); opacity: .92; }

.btn-secondary {
  background: #f4f6fc; color: #6070a0;
  border: 1px solid #d8e0f0;
}
.btn-secondary:hover:not(:disabled) { background: #e8edf8; color: #1a2040; border-color: #b0c0d8; }

.btn-success {
  background: #16a34a; color: #fff;
  box-shadow: 0 4px 12px rgba(22,163,74,.2);
}
.btn-success:hover:not(:disabled) { opacity: .9; }

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245,158,11,.22);
}
.btn-warning:hover:not(:disabled) { opacity: .92; }

.btn-danger {
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fca5a5;
}
.btn-danger:hover:not(:disabled) { background: #fee2e2; }

.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-lg { padding: 13px 28px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-logout {
  background: transparent; border: 1px solid #fca5a5; color: #dc2626;
  border-radius: 6px; padding: 6px 12px; font-size: 11px;
  font-family: inherit; cursor: pointer; text-decoration: none; transition: background .2s;
}
.btn-logout:hover { background: #fef2f2; }

/* ── Sino de notificações ─────────────────────────────────── */
.notif-bell-wrap {
  position: relative;
}
.notif-bell-btn {
  background: transparent; border: none; cursor: pointer;
  padding: 6px 8px; border-radius: 8px; font-size: 20px; line-height: 1;
  position: relative; transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.notif-bell-btn:hover { background: #f0f3ff; }
.notif-bell-badge {
  position: absolute; top: 2px; right: 2px;
  background: #dc2626; color: #fff;
  font-size: 9px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1; border: 2px solid #fff;
}
.notif-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  width: 360px; background: #fff; border: 1px solid #dde3f5;
  border-radius: 10px; box-shadow: 0 8px 32px rgba(15,47,181,.13);
  z-index: 9999; overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #eef1fc;
  font-size: 12px; font-weight: 700; color: #0f2fb5;
}
.notif-dropdown-header button {
  background: transparent; border: none; font-size: 11px; color: #6070a0;
  cursor: pointer; padding: 3px 8px; border-radius: 5px;
  font-family: inherit;
}
.notif-dropdown-header button:hover { background: #f0f3ff; color: #0f2fb5; }
.notif-dropdown-empty {
  padding: 24px 16px; text-align: center; color: #9aa0c0; font-size: 12px;
}
.notif-item {
  padding: 10px 16px; border-bottom: 1px solid #f0f3ff;
  display: flex; gap: 10px; align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-msg { font-size: 12px; color: #222; line-height: 1.4; }
.notif-item-meta { font-size: 10px; color: #9aa0c0; margin-top: 3px; }
.notif-item-code { font-size: 10px; color: #9aa0c0; font-family: monospace; }
.notif-item-read { flex-shrink: 0; }
.notif-item-read button {
  background: transparent; border: 1px solid #d0d8f0; color: #6070a0;
  border-radius: 5px; padding: 2px 7px; font-size: 10px; cursor: pointer;
  font-family: inherit;
}
.notif-item-read button:hover { background: #f0f3ff; }

/* ── Badges de status ────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  white-space: nowrap;
}
.badge-rascunho   { background: #f4f6fc; color: #6070a0; border: 1px solid #d8e0f0; }
.badge-enviado    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-info       { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-primary    { background: #f0e9ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.badge-pago       { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-pago_parcial { background: #ecfeff; color: #0f766e; border: 1px solid #a5f3fc; }
.badge-vencido    { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.badge-cancelado  { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.badge-pendente   { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.badge-trial      { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-active     { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-overdue    { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.badge-blocked    { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.badge-cancelled  { background: #f4f6fc; color: #6070a0; border: 1px solid #d8e0f0; }
.badge-warning    { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

/* ── Documentos ──────────────────────────────────────────── */
.doc-file-item {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f4f6fc; border: 1px solid #d8e0f0; border-radius: 6px;
  padding: 3px 8px; font-size: 11px; color: #1e2a4a;
}

/* ── Alertas ─────────────────────────────────────────────── */
.alert {
  border-radius: 7px; padding: 12px 16px; font-size: 12px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.alert-error   { background: #fef2f2; border: 1px solid #fca5a550; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d050; color: #16a34a; }
.alert-warning { background: #fefce8; border: 1px solid #fde68a50; color: #a16207; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe50; color: #1d4ed8; }

/* ── Stepper ─────────────────────────────────────────────── */
.stepper { display: flex; align-items: flex-start; margin-bottom: 14px; max-width: 480px; }
/* Stepper compacto dentro do header */
.stepper-header { flex: 1; max-width: none; margin: 0 20px; align-items: center; }
.stepper-header .step-connector { max-width: none; min-width: 20px; flex: 1; margin-top: 12px; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: #eef1f8; border: 2px solid #c8d2e8; color: #8090b0;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all .3s; user-select: none;
}
.step-item.completed .step-dot { background: #eef2ff; border-color: #0f2fb5; color: #0f2fb5; cursor: pointer; }
.step-item.completed .step-dot:hover { background: #0f2fb5; color: #fff; }
.step-item.active .step-dot {
  background: linear-gradient(135deg, #0f2fb5, #1a50e0);
  border-color: #0f2fb5; color: #fff;
  box-shadow: 0 0 14px rgba(15,47,181,.30);
}
.step-label { font-size: 8px; color: #b0c0d8; letter-spacing: .6px; text-transform: uppercase; text-align: center; white-space: nowrap; }
.step-item.completed .step-label { color: #8090b0; }
.step-item.active .step-label    { color: #6070a0; }
.step-connector { flex: 1; height: 2px; background: #d8e0f0; margin: 12px 4px 0; transition: background .4s; min-width: 12px; max-width: 60px; }
.step-connector.done { background: linear-gradient(90deg, #0f2fb5, #93c5fd); }

/* ── Step panels ─────────────────────────────────────────── */
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ── Navegação de steps ──────────────────────────────────── */
.step-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding: 10px 14px;
  background: #f4f6fc;
  border-radius: 8px;
  border: 1px solid #d8e0f0;
}
.step-nav .btn-primary { min-width: 160px; }
.step-error {
  display: none; margin-top: 10px;
  background: #fef2f2; border: 1px solid #fca5a550;
  border-radius: 6px; padding: 9px 12px;
  font-size: 11px; color: #dc2626;
}

/* ── Tabela de depara (field mapping) ────────────────────── */
.mapping-table { width: 100%; border-collapse: collapse; }
.mapping-table th {
  font-size: 10px; color: #6070a0; letter-spacing: 1px; text-transform: uppercase;
  padding: 8px 12px; border-bottom: 1px solid #d8e0f0;
  background: #f8faff; text-align: left;
}
.mapping-table td { padding: 8px 12px; border-bottom: 1px solid #e8edf8; vertical-align: middle; }
.mapping-table td:first-child { font-size: 12px; font-weight: 600; color: #1a2040; }
.mapping-table .required-star { color: #dc2626; font-size: 14px; }
.mapping-table tr.row-mapped { background: #f0fdf4; }
.mapping-table tr.row-mapped td:first-child::after { content: ' ✓'; color: #16a34a; font-size: 11px; }
.mapping-table tr.row-automap { background: #eff6ff; }
.mapping-table tr.row-automap td:first-child::after { content: ' ~'; color: #2563eb; font-size: 11px; }
.mapping-table select { padding: 7px 32px 7px 10px; font-size: 12px; }
.mapping-table .spinner-cell { position: relative; }
.field-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #d8e0f0; border-top-color: #0f2fb5;
  border-radius: 50%; animation: spin .7s linear infinite;
  margin-left: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Resumo da fatura ────────────────────────────────────── */
.resumo-box {
  background: #fff; border: 1px solid #d8e0f0; border-radius: 10px;
  margin-bottom: 14px; overflow: hidden;
}
.resumo-title {
  background: linear-gradient(135deg, #0f2fb5, #1a50e0);
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; padding: 10px 18px; margin-bottom: 0;
}
.resumo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  padding: 12px 18px;
}
.resumo-item {
  text-align: center; padding: 8px 6px;
  border-right: 1px solid #e8edf8;
}
.resumo-item:last-child { border-right: none; }
.resumo-item label { display: block; font-size: 10px; color: #6070a0; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; font-weight: 600; }
.resumo-item .valor { font-size: 13px; color: #1a2040; font-weight: 700; }
.resumo-valor-destaque { font-size: 20px; font-weight: 800; color: #0f2fb5; }

/* ── Resumo cliente 2 colunas (step 4) ───────────────────── */
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.rc-col { padding: 10px 0; }
.rc-col-right { border-left: 1px solid #e8edf8; }
.rc-item {
  display: grid; grid-template-columns: 110px 1fr; align-items: baseline;
  gap: 6px; padding: 6px 16px; border-bottom: 1px solid #f4f6fc;
}
.rc-item:last-child { border-bottom: none; }
.rc-label { font-size: 10px; font-weight: 700; color: #6070a0; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.rc-valor { font-size: 12px; color: #1a2040; font-weight: 600; word-break: break-word; }

/* ── Campos step 3 compactos ─────────────────────────────── */
#cliente-fields-container .form-group { margin-bottom: 4px !important; }
#cliente-fields-container > div[style*="grid"] { gap: 4px 10px !important; }

/* ── Faturas expandíveis ─────────────────────────────────── */
.invoice-row { cursor: pointer; transition: background .15s; }
.invoice-row:hover { background: #f4f6fc !important; }
.btn-expand {
  background: linear-gradient(135deg, #0f2fb5, #1a50e0); border: none;
  border-radius: 6px; width: 24px; height: 24px; cursor: pointer;
  font-size: 16px; line-height: 1; color: #fff; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(15,47,181,.25); transition: opacity .15s;
}
.btn-expand:hover { opacity: .82; }
.invoice-detail { display: none; }
.invoice-detail.open { display: table-row; }
.invoice-detail td { padding: 0 !important; }
.invoice-detail-inner {
  background: #f0f4fd;
  border-top: 3px solid #1540CB;
  border-bottom: 1px solid #d8e2f4;
  box-shadow: 0 4px 18px rgba(21,64,203,.07);
}

/* Expand — layout interno */
.exp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.exp-card {
  padding: 18px 24px 14px;
  background: #f7f9fe;
  border-right: 1px solid #dce6f5;
}
.exp-card:last-child { border-right: none; }
.exp-card-title {
  font-size: 10px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: #1540CB;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1.5px solid #d0dcf0;
  display: flex; align-items: center; gap: 5px;
}
.exp-row {
  display: flex; align-items: baseline;
  padding: 5px 0; gap: 8px; font-size: 12px;
}
.exp-label {
  flex: 0 0 110px; color: #8090b0; font-size: 11px; font-weight: 600;
}
.exp-value { color: #1a2040; font-weight: 600; flex: 1; }
.exp-value a { color: #1540CB; }

/* Expand — parcelas */
.exp-parcelas {
  padding: 14px 24px;
  border-top: 1px solid #d8e2f4;
  background: #edf2fb;
}
.exp-parcelas-title {
  font-size: 10px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: #1540CB; margin-bottom: 10px;
  display: flex; align-items: center; gap: 5px;
}
.exp-parc-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.exp-parc-table th {
  padding: 5px 10px; font-size: 10px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: #8090b0; text-align: left;
  border-bottom: 1.5px solid #e0e8f4;
}
.exp-parc-table td { padding: 7px 10px; color: #1a2040; border-bottom: 1px solid #f0f4fc; }
.exp-parc-table tr:last-child td { border-bottom: none; }
.exp-parc-btns { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }

/* Expand — ações único payment */
.exp-links {
  padding: 12px 24px;
  border-top: 1px solid #d8e2f4;
  background: #edf2fb;
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
}

/* Expand — área de ações (enviar / cancelar) */
.exp-actions {
  padding: 12px 24px;
  border-top: 1px solid #d8e2f4;
  background: #edf2fb;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}

/* Expand — footer (ID Asaas) */
.exp-footer {
  padding: 8px 24px 12px;
  font-size: 10.5px; color: #8090b0;
  border-top: 1px solid #d8e2f4;
  background: #edf2fb;
}
.exp-footer code { font-size: 10px; color: #6070a0; }

/* ── Loading overlay ─────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(240,242,248,.85);
  display: none; align-items: center; justify-content: center; z-index: 999;
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 4px solid #d8e0f0; border-top-color: #0f2fb5;
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,30,60,.5);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 20px 24px;
  max-width: 600px; width: 100%; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15,47,181,.20);
  position: relative;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #e8edf8;
}
/* Header com stepper integrado */
.wizard-header { align-items: flex-start; padding-bottom: 14px; }
.wizard-header .modal-title { padding-top: 4px; white-space: nowrap; }
.wizard-header #modal-header-actions { padding-top: 2px; white-space: nowrap; }
.modal-title { font-size: 14px; font-weight: 700; color: #0f2fb5; }
.modal-close {
  background: none; border: none; font-size: 18px; color: #6070a0;
  cursor: pointer; padding: 4px; line-height: 1;
}
.modal-close:hover { color: #1a2040; }
.modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ── Abas (tabs) ─────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid #d8e0f0; margin-bottom: 24px; gap: 4px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 18px; border-radius: 7px 7px 0 0;
  font-size: 12px; font-family: inherit; font-weight: 600;
  color: #6070a0; background: transparent; border: 1px solid transparent;
  cursor: pointer; border-bottom: none; margin-bottom: -2px; transition: color .15s, background .15s;
}
.tab-btn:hover { color: #0f2fb5; background: #f0f4fc; }
.tab-btn.active {
  color: #0f2fb5; background: #fff;
  border-color: #d8e0f0; border-bottom-color: #fff;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Toast notifications ─────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px; z-index: 2000;
}
.toast {
  background: #1a2040; color: #fff; padding: 12px 18px; border-radius: 8px;
  font-size: 12px; min-width: 240px; max-width: 380px;
  box-shadow: 0 4px 20px rgba(15,47,181,.20);
  animation: slideIn .3s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { background: #16a34a; }
.toast.error   { background: #dc2626; }
.toast.warning { background: #a16207; }
@keyframes slideIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }

/* ── Seções colapsáveis ──────────────────────────────────── */
.section { background: #ffffff; border: 1px solid #d8e0f0; border-radius: 10px; margin-bottom: 18px; overflow: hidden; box-shadow: 0 1px 6px rgba(15,47,181,.06); }
.section-header {
  background: linear-gradient(135deg, #0f2fb5, #1a50e0);
  padding: 10px 18px; font-size: 11px; color: #fff;
  letter-spacing: 1.5px; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 8px rgba(15,47,181,.2);
}
.section-body { padding: 20px 18px; }
.section-body.collapsed { display: none; }
.btn-toggle { background: none; border: none; color: rgba(255,255,255,.75); cursor: pointer; font-size: 14px; font-family: inherit; }
.btn-toggle:hover { color: #fff; }

/* ── Tipo de pessoa (PF/PJ toggle) ──────────────────────── */
.pessoa-toggle { display: flex; gap: 0; border: 2px solid #9aaccb; border-radius: 7px; overflow: hidden; width: fit-content; }
.pessoa-btn {
  padding: 9px 22px; font-size: 12px; font-family: inherit; font-weight: 600;
  color: #6070a0; background: #E8F0FE; border: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.pessoa-btn.active { background: #0f2fb5; color: #fff; }
.pessoa-btn + .pessoa-btn { border-left: 2px solid #9aaccb; }

/* ── Cobrança tipo toggle ────────────────────────────────── */
.tipo-cobranca-toggle { display: flex !important; flex-direction: row !important; gap: 6px; margin-bottom: 0; }
.tipo-btn {
  flex: 1; padding: 7px 10px; border: 2px solid #d8e0f0; border-radius: 7px;
  background: #f8faff; cursor: pointer; transition: all .2s;
  display: flex !important; flex-direction: row !important; align-items: center !important; gap: 6px; min-height: 0;
}
.tipo-btn:hover { border-color: #9aaccb; background: #f0f4fc; }
.tipo-btn.active { border-color: #0f2fb5; background: #eef2ff; }
.tipo-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  line-height: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: #3554cf;
}
.tipo-btn-label { font-size: 11px; font-weight: 700; color: #1a2040; line-height: 1.2; }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ── Layout 2 colunas Step 1 ────────────────────────────── */
.step1-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; }
.step1-col .form-group { margin-bottom: 10px; }
.step1-col .form-group:last-child { margin-bottom: 0; }
.step1-col textarea { min-height: 56px; }
/* Checkboxes lado a lado (Forma de pagamento + Outras Opções) */
.step1-checks-row { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 0; border: 1px solid #e8edf8; border-radius: 8px; overflow: hidden; }
#step1-checks-row[style*="display: none"] { display: none !important; }
.step1-checks-row .form-group { margin-bottom: 0 !important; padding: 10px 10px 8px; background: #fafbff; }
.step1-checks-row .form-group:first-child { border-right: 1px solid #e8edf8; }
.step1-checks-row > .form-group > label { display: block; text-align: center; margin-bottom: 6px; font-size: 10px; color: #6070a0; text-transform: uppercase; letter-spacing: .8px; }

/* ── Valor monetário destaque ────────────────────────────── */
.money-input-wrap { position: relative; }
.money-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: #6070a0; pointer-events: none;
}
.money-input-wrap input { padding-left: 36px; }

/* ── Parcelamento select ─────────────────────────────────── */
.parcelas-preview { font-size: 11px; color: #6070a0; margin-top: 6px; }
.parcelas-preview strong { color: #0f2fb5; }

/* ── Preview de taxa ─────────────────────────────────────── */
.taxa-preview {
  font-size: 11px; color: #6070a0; margin-top: 4px;
  background: #f0fdf4; padding: 6px 10px; border-radius: 5px; display: none;
}
.taxa-preview.show { display: block; }
.taxa-preview strong { color: #16a34a; }

/* ── Sub-opção (repassar taxa do cartão) ─────────────────── */
.sub-opcao {
  margin-left: 24px; margin-top: 8px;
  padding: 10px 12px; background: #f4f6fc;
  border-left: 3px solid #9aaccb; border-radius: 0 6px 6px 0;
  display: none;
}
.sub-opcao.show { display: block; }

/* ── Dados do cliente (preview) ──────────────────────────── */
.cliente-field { margin-bottom: 12px; }
.cliente-field-label { font-size: 10px; color: #6070a0; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.cliente-field-value {
  font-size: 13px; color: #1a2040; padding: 8px 12px;
  background: #f8faff; border: 1px solid #e8edf8; border-radius: 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.cliente-field-value.missing { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.btn-edit-field { background: none; border: none; color: #0f2fb5; cursor: pointer; font-size: 11px; font-family: inherit; }
.btn-edit-field:hover { text-decoration: underline; }

/* ── Login Admin ─────────────────────────────────────────── */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.login-card {
  background: #ffffff; border: 1px solid #d8e0f0; border-radius: 12px;
  padding: 40px; width: 100%; max-width: 360px;
  box-shadow: 0 4px 24px rgba(15,47,181,.10);
}
.login-title { font-size: 16px; color: #0f2fb5; margin-bottom: 24px; text-align: center; }
.login-error { color: #dc2626; font-size: 12px; margin-top: 10px; text-align: center; }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb { font-size: 11px; color: #6070a0; margin-bottom: 20px; }
.breadcrumb a { color: #0f2fb5; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Empty state ─────────────────────────────────────────── */
.empty { text-align: center; padding: 40px 28px; color: #8090b0; font-size: 12px; }
.empty-title { font-size: 14px; font-weight: 600; color: #6070a0; margin-bottom: 6px; }

/* ── Passo a passo de configuração ────────────────────────── */
.guide-steps { counter-reset: guide-step; }
.guide-step {
  display: flex; gap: 14px; margin-bottom: 16px; align-items: flex-start;
}
.guide-step-num {
  counter-increment: guide-step;
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #0f2fb5, #1a50e0);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.guide-step-num::before { content: counter(guide-step); }
.guide-step-content { font-size: 12px; color: #6070a0; line-height: 1.7; padding-top: 4px; }
.guide-step-content strong { color: #1a2040; }
.guide-step-content code {
  background: #eef1fc; color: #0f2fb5; padding: 2px 6px; border-radius: 4px;
  font-family: inherit; font-size: 11px; word-break: break-all;
}

/* ── Responsivo para CRM Tab (iframe estreito) ─────────────── */
@media (max-width: 700px) {
  .app-body { flex-direction: column; padding: 16px; }
  .sidebar { width: 100%; }
  .sidebar-card { border-radius: 8px; }
  .sidebar-body { flex-direction: row; flex-wrap: wrap; padding: 4px; }
  .sidebar-item { padding: 7px 10px; font-size: 11.5px; border-left: none; border-bottom: 2px solid transparent; }
  .sidebar-item.active { border-left-color: transparent; border-bottom-color: #1540CB; }
  .sidebar-divider { display: none; }
  .header-inner { flex-wrap: wrap; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .mapping-table { font-size: 11px; }
  .mapping-table select { font-size: 11px; padding: 6px 28px 6px 8px; }
  .tipo-cobranca-toggle { flex-direction: column; }
  .modal { padding: 20px; }
  .tabs { overflow-x: auto; }
}

/* ── CRM Tab específico (iframe compacto) ─────────────────── */
.crm-tab-body {
  padding: 16px;
  max-width: 100%;
  border: 1.5px solid #c8d4f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(21,64,203,.07);
  background: #fff;
}
.crm-tab-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.crm-tab-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f2fb5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.crm-actions { display: flex; gap: 8px; align-items: center; }

/* ── Valor líquido estimado ──────────────────────────────── */
.liquido-card {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 12px;
}
.liquido-titulo { font-size: 10px; color: #16a34a; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.liquido-valor  { font-size: 20px; font-weight: 700; color: #16a34a; }
.liquido-detalhe { font-size: 11px; color: #6070a0; margin-top: 4px; }

/* ── Scroll suave para iframes ───────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Utility classes ─────────────────────────────────────── */
.text-muted    { color: #6070a0; }
.text-small    { font-size: 11px; }
.text-xsmall   { font-size: 10px; letter-spacing: .5px; }
.text-primary  { color: #0f2fb5; }
.text-success  { color: #16a34a; }
.text-danger   { color: #dc2626; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.fw-bold       { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.visible { display: block !important; }

/* ── Permissions ─────────────────────────────────────────────────────────── */
.perm-locked { opacity: 0.45; cursor: not-allowed !important; pointer-events: none; position: relative; }
.perm-locked::after {
  content: '';
  width: 10px;
  height: 10px;
  position: absolute;
  top: 5px;
  right: 5px;
  border: 1.4px solid currentColor;
  border-radius: 2px;
  opacity: .9;
}
.perm-locked::before {
  content: '';
  width: 8px;
  height: 5px;
  position: absolute;
  top: 1px;
  right: 6px;
  border: 1.4px solid currentColor;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  opacity: .9;
}

.perm-matrix { width: 100%; border-collapse: collapse; font-size: 12px; }
.perm-matrix th { background: #f0f4ff; color: #4060c0; padding: 8px 12px; text-align: left; font-weight: 700; }
.perm-matrix td { padding: 7px 12px; border-bottom: 1px solid #edf0f8; vertical-align: middle; }
.perm-matrix .perm-label { font-weight: 600; color: #1a2040; }
.perm-matrix .radio-group { display: flex; gap: 12px; align-items: center; }
.perm-matrix .radio-group label { display: flex; align-items: center; gap: 4px; cursor: pointer; font-size: 11px; color: #4060a0; }
.perm-matrix .radio-group input[type=radio] { cursor: pointer; }

.perm-profile-card { border: 1px solid #e0e8f8; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.perm-profile-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #f5f8ff; cursor: pointer; gap: 10px; }
.perm-profile-title { font-weight: 700; color: #1a2040; font-size: 13px; }
.perm-profile-subtitle { font-size: 11px; color: #7080a0; }
.perm-profile-body { padding: 12px 14px; display: none; }
.perm-profile-body.open { display: block; }
.perm-tipo-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: #e0e8ff; color: #3050b0; }
.perm-tipo-badge.all { background: #fef3c7; color: #92400e; }
.perm-tipo-badge.department { background: #dcfce7; color: #166534; }
.perm-tipo-badge.department_sub { background: #d1fae5; color: #065f46; }
.perm-tipo-badge.user { background: #ede9fe; color: #5b21b6; }
