@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/tabler-icons.min.css');

:root { --font-display: 'Bebas Neue', sans-serif; --font-body: 'Montserrat', sans-serif; }
.titulo-secao { font-family: var(--font-display); letter-spacing: 0.04em; }
*, *::before, *::after { font-family: inherit; }

.erp-global-header {
  background: #1d4ed8;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.erp-global-header__inner {
  width: 100%;
  height: 30px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
  position: relative;
}

.erp-global-header__brand {
  text-decoration: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.erp-global-header__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.erp-global-header__link {
  text-decoration: none;
  color: rgba(255,255,255,0.65);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  height: 30px;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
  position: relative;
}
.erp-global-header__link:hover {
  color: #ffffff;
}

.erp-global-header__link.is-active {
  color: #ffffff;
  font-weight: 700;
}

.erp-global-header__link.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #f47920;
}

.modulo-badge {
  display:flex;align-items:center;gap:4px;
  padding-left:0;margin-left:2px;
}

.modulo-badge__icon { font-size:22px;line-height:1;flex-shrink:0;margin-right:-2px; }

.modulo-badge__nome {
  color:#fff;font-size:14px;font-weight:700;line-height:1.1;
}

.modulo-badge__sub {
  color:rgba(255,255,255,.5);font-size:10px;letter-spacing:.3px;margin-top:1px;
}



.erp-global-header__apis {
  display: flex;
  align-items: center;
  gap: 4px;
}

.erp-global-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}



.erp-global-header__icon-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.15s, background 0.15s;
}

.erp-global-header__icon-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

/* ── Toast global ── */
.erp-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: #003399;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-body);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  max-width: 360px;
}
.erp-toast.erp-toast--visible { opacity: 1; pointer-events: auto; }

/* ── Modal Sobre (global) ── */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:500;align-items:center;justify-content:center;padding:1rem;}
.modal-overlay.open{display:flex;}
#modal-historico-editor{display:none;}
#modal-historico-editor.open{display:flex;}
.modal{background:#fff;border-radius:12px;width:100%;max-width:560px;max-height:90vh;overflow-y:auto;box-shadow:0 4px 12px rgba(0,0,0,.1);}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:1.25rem 1.5rem;border-bottom:1px solid #e2e8f0;}
.modal-title{font-size:17px;font-weight:600;color:#0f172a;}
.modal-close{background:none;border:none;font-size:20px;cursor:pointer;color:#64748b;line-height:1;}
.modal-body{padding:1.5rem;}
.modal-foot{padding:1rem 1.5rem;border-top:1px solid #e2e8f0;display:flex;justify-content:flex-end;gap:8px;}
.modal-sobre-overlay{z-index:520;}
.modal.modal-sobre{max-width:820px;background:#fff;border:1px solid #e2e8f0;}
.sobre-mtabs{display:flex;gap:0;border-bottom:1px solid #e2e8f0;padding:0 1.5rem;background:#f1f5f9;}
.sobre-mtab{font-family:inherit;font-size:13px;font-weight:600;padding:12px 18px;border:none;background:transparent;color:#64748b;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;}
.sobre-mtab:hover{color:#0f172a;}
.sobre-mtab.active{color:#003399;border-bottom-color:#f47920;background:#fff;}
.modal-sobre-body{padding-top:1rem;max-height:min(72vh,720px);overflow-y:auto;}
.sobre-panel{display:none;padding:0 1.5rem 1.5rem;}
.sobre-panel.active{display:block;}
.sobre-meta-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 16px;margin-bottom:1.25rem;padding:1rem;background:#f1f5f9;border-radius:8px;border:1px solid #e2e8f0;}
.sobre-meta-field{flex:1;min-width:140px;margin:0;}
.sobre-meta-field .form-label{font-size:11px;}
.sobre-meta-save{align-self:flex-end;height:36px;}
.sobre-doc-block{margin-bottom:1.25rem;}
.sobre-h{font-size:14px;font-weight:700;color:#0f172a;margin-bottom:.5rem;}
.sobre-hint{font-size:11px;font-weight:500;color:#94a3b8;}
.sobre-p{font-size:13px;color:#64748b;line-height:1.55;margin-bottom:.75rem;}
.sobre-p code{font-size:12px;background:#f1f5f9;padding:1px 6px;border-radius:4px;border:1px solid #e2e8f0;color:#0f172a;}
.sobre-note{font-size:12px;}
.sobre-ol,.sobre-ul{margin:.25rem 0 .75rem 1.25rem;color:#64748b;font-size:13px;line-height:1.55;}
.sobre-ol li,.sobre-ul li{margin-bottom:.35rem;}
.sobre-table-wrap{overflow-x:auto;border:1px solid #e2e8f0;border-radius:8px;margin:.5rem 0;}
.sobre-table{width:100%;border-collapse:collapse;font-size:12px;background:#fff;}
.sobre-table th,.sobre-table td{padding:8px 10px;text-align:left;border-bottom:1px solid #e2e8f0;vertical-align:top;}
.sobre-table th{background:#f1f5f9;color:#0f172a;font-weight:600;}
.sobre-table tr:last-child td{border-bottom:none;}
.sobre-table code{font-size:11px;}
.sobre-prompt-ta{width:100%;font-family:ui-monospace,Consolas,monospace;font-size:12px;line-height:1.5;padding:12px;border:1px solid #e2e8f0;border-radius:8px;background:#fafafa;color:#0f172a;resize:vertical;min-height:240px;margin-top:.75rem;}
.sobre-ia-actions{margin-top:12px;}
.sobre-historico-block{border-bottom:none;}
.form-row{display:flex;flex-direction:column;gap:4px;}
.form-label{font-size:12px;font-weight:600;display:block;margin-bottom:4px;color:#374151;}
.form-input{padding:6px 10px;border:1px solid #e2e8f0;border-radius:6px;font-size:13px;width:100%;}
.btn{padding:8px 16px;border-radius:8px;border:1px solid #e2e8f0;background:#f8fafc;cursor:pointer;font-size:13px;font-weight:600;color:#374151;}
.btn:hover{background:#f1f5f9;}
.btn-green{background:#15803d;color:#fff;border-color:#15803d;}
.btn-green:hover{background:#166534;}
.btn-dark{background:#1e293b;color:#fff;border-color:#1e293b;}
.btn-dark:hover{background:#0f172a;}

/* --- Badge proxy offline no header -------------------- */
.erp-proxy-badge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -2px;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  animation: erp-proxy-pulse 0.9s ease-in-out infinite;
}
.erp-global-header__link .erp-proxy-badge,
.erp-global-header__link.is-active .erp-proxy-badge,
.erp-global-header__link:hover .erp-proxy-badge {
  color: #e71010 !important;
}
@keyframes erp-proxy-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}