/* Mesa operacional do Portfólio Industrial IQL.
   Mesma identidade das folhas A4. Sem carcaça de ERP. */

:root {
  --iql-red: #b42318;
  --iql-ink: #7f1d1d;
  --iql-soft: #f4f4f5;
  --iql-line: #e4e4e7;
  --iql-text: #18181b;
  --iql-muted: #3f3f46;
  --color-border: #e4e4e7;
  --color-border-light: #f4f4f5;
  --color-text: #18181b;
  --color-text-muted: #3f3f46;
  --radius: 0;
  --focus-ring: 0 0 0 2px #fff, 0 0 0 4px #b42318;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #e5e7eb;
  color: var(--iql-text);
  font: 15px/1.35 "Segoe UI", system-ui, sans-serif;
}

body.mesa-screen {
  display: flex;
  justify-content: center;
  padding: 0 16px 24px;
}

.mesa-sheet {
  width: min(1280px, 100%);
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 24px);
  overflow: hidden;
  border-radius: 0;
}

.mesa-hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  min-height: 118px;
  border-bottom: 1px solid #111;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #f7f7f8;
}

.mesa-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("assets/iql-industria-marca.png") 100% 82% / 110% auto no-repeat;
  opacity: 0.7;
  pointer-events: none;
}

.mesa-hero--iql,
.mesa-hero--pesquisa {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  line-height: 0;
  font-size: 0;
  background: transparent;
  border-bottom: 0;
  overflow: hidden;
  border-radius: 0;
}

.mesa-hero--iql::before,
.mesa-hero--pesquisa::before {
  display: none;
}

.mesa-hero--iql img,
.mesa-hero--pesquisa__art {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  /* Recorte layout das faixas claras do PNG (25px topo · 63px base em 1024×352) — sem alterar o asset */
  margin-top: -2.441%;
  margin-bottom: -6.152%;
}

.mesa-hero__main {
  background: transparent;
  color: var(--iql-ink);
  padding: 16px 28px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.mesa-brand {
  line-height: 0;
}

.mesa-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 220px;
  background: transparent;
}

.mesa-sub {
  display: none;
}

.mesa-hero__main h1 {
  margin: 10px 0 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--iql-red);
}

.mesa-hero__side {
  background: var(--iql-ink);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  z-index: 1;
}

.mesa-hero__side::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 270%;
  background: url("assets/iql-industria-marca.png") 100% 82% / 110% auto no-repeat;
  opacity: 0.34;
  mix-blend-mode: soft-light;
  filter: brightness(1.85) contrast(1.04);
  pointer-events: none;
}

.mesa-hero__side p {
  margin: 0;
  position: relative;
  z-index: 1;
}

.mesa-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--iql-ink);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mesa-nav button,
.mesa-nav a {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 22px;
  cursor: pointer;
}

.mesa-nav button:hover,
.mesa-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mesa-nav button.is-active,
.mesa-nav a.is-active {
  background: var(--iql-red);
}

.mesa-nav__admin {
  margin-left: auto;
}

.mesa-voltar {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 18px;
  cursor: pointer;
  white-space: nowrap;
}

.mesa-voltar:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mesa-voltar[hidden] {
  display: none !important;
}

.mesa-avancar {
  margin-left: 0;
}

.com030-nav-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--iql-ink, #7f1d1d);
  padding: 0 8px;
}

.com030-nav-fallback .mesa-voltar {
  padding: 10px 14px;
}

.mesa-work {
  flex: 1;
  background: #fafafa;
  padding: 16px 22px 24px;
  min-width: 0;
}

.mesa-work > .com030-ctx-bar {
  margin-bottom: 12px;
}

.mesa-screen .block-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--iql-line);
  border-radius: 0;
}

.mesa-screen .block-panel.is-active { display: block; }

.mesa-screen .block-panel__header {
  margin: 0;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--iql-line);
  color: var(--iql-ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mesa-screen .block-panel__body {
  padding: 16px;
}

.mesa-docs {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--iql-red);
  text-decoration: none;
}

.mesa-docs:hover { text-decoration: underline; }

.mesa-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: var(--iql-ink);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.mesa-foot--iql .mesa-foot__marca {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}

.mesa-foot--iql .mesa-foot__iql {
  display: block;
  height: 20px;
  width: auto;
  filter: invert(1);
}

.mesa-foot--iql .mesa-foot__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e11d48;
  flex: 0 0 auto;
}

.mesa-foot--iql .mesa-foot__tag {
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.mesa-foot--iql .mesa-foot__direita {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.mesa-foot--iql .mesa-foot__liore {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  background: transparent;
}

.mesa-foot--iql .mesa-foot__div {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
}

.mesa-foot--iql .mesa-foot__versao {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
  white-space: nowrap;
  padding: 0 8px 0 0;
  cursor: default;
}

.mesa-foot--iql .mesa-foot__sair {
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 1;
  padding: 0;
  text-transform: uppercase;
}

.mesa-foot--iql .mesa-foot__sair:hover {
  opacity: 0.85;
}

.mesa-foot--iql .mesa-foot__liore-mark {
  display: block;
  height: 20px;
  width: auto;
}

.mesa-foot--iql .mesa-foot__liore-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.mesa-foot--iql .mesa-foot__liore-sep {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d38b03;
  flex: 0 0 auto;
}

.mesa-foot a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.72;
}

.mesa-foot a:hover { opacity: 1; }

.mesa-admin { display: none !important; }
body.is-admin .mesa-admin { display: inline !important; opacity: 0.72; }
body.is-admin .mesa-admin:hover { opacity: 1; }

.mesa-foot a.mesa-admin-open,
.mesa-foot button.mesa-admin-open {
  opacity: 0.4;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 600;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  font-family: inherit;
}
.mesa-foot a.mesa-admin-open:hover,
.mesa-foot button.mesa-admin-open:hover { opacity: 0.9; }

.admin-auth {
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--iql-line);
  padding: 18px;
}

.admin-auth__step {
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--iql-ink);
}

.admin-auth__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.admin-auth [hidden] {
  display: none !important;
}

.admin-auth__field input {
  font: inherit;
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid var(--iql-line);
  pointer-events: auto;
}

#admin-totp {
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  caret-color: var(--iql-text, #18181b);
  background: #fff;
  color: var(--iql-text, #18181b);
}

.admin-auth__qr {
  margin: 0 0 14px;
  font-size: 13px;
}

.admin-auth__qr-img {
  margin-top: 10px;
  display: inline-block;
  padding: 8px;
  border: 1px solid var(--iql-line);
  background: #fff;
}

.admin-auth__qr-img svg,
.admin-auth__qr-img img { display: block; width: 180px; height: 180px; background: #fff; }

.admin-auth__recovery {
  margin: 0 0 14px;
  font-size: 13px;
}

.admin-auth__recovery ul {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.04em;
}

.admin-auth__reset-open { margin: 14px 0 0; }

.admin-auth__link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--iql-muted);
  cursor: pointer;
  text-decoration: underline;
}

.admin-auth--reset { margin-top: 16px; }

.cad-msg {
  min-height: 1.2em;
  font-size: 13px;
  color: var(--iql-red);
}

.anexo-uso {
  margin: 8px 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--iql-ink);
}

.anexo-uso.is-off { color: var(--iql-red); }

.anexo-admin-only { display: none; }
body.is-admin .anexo-admin-only { display: block; }

.cad-lib {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 14px;
}

.cad-lib button.is-on {
  background: var(--iql-red);
  color: #fff;
}

.btn {
  border: 1px solid var(--iql-red);
  background: #fff;
  color: var(--iql-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
}

.btn--cta {
  background: var(--iql-red);
  color: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden { display: none !important; }

@media (max-width: 1024px) {
  body.mesa-screen {
    padding: 0 12px 16px;
  }

  .mesa-sheet {
    min-height: calc(100vh - 16px);
  }
}

@media (max-width: 720px) {
  .mesa-hero { grid-template-columns: 1fr; }
  .mesa-hero { min-height: 0; }
}
