:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #173042;
  background: #edf2f3;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: #edf2f3;
}

button,
input { font: inherit; }

.portal-frame {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.18fr);
  min-height: 100vh;
}

.portal-identity {
  position: relative;
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  overflow: hidden;
  padding: clamp(32px, 6vw, 80px);
  background: #0b465c;
  color: #f7fbfc;
}

.portal-identity::before,
.portal-identity::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 10px;
  background: #e8b04b;
  content: "";
}

.portal-identity::before { top: 72px; }
.portal-identity::after { bottom: 72px; }

.portal-logo-plate {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: #fff;
}

.portal-logo {
  display: block;
  width: 214px;
  max-width: 100%;
  height: auto;
}

.portal-identity-bottom {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 150px);
  gap: 24px;
  align-items: end;
}

.portal-identity-copy { min-width: 0; }

.portal-kicker {
  margin: 0 0 12px;
  color: #526672;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portal-identity .portal-kicker { color: #e8b04b; }

.portal-identity-title {
  margin: 0;
  color: #f7fbfc;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.18;
}

.portal-mascot {
  display: block;
  width: 100%;
  height: auto;
  align-self: end;
  object-fit: contain;
}

.portal-login {
  align-self: center;
  width: min(100%, 540px);
  padding: clamp(32px, 7vw, 96px);
}

.portal-login h1,
.portal-login h2 { color: #153a4c; }

.portal-login h1 {
  max-width: 400px;
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
}

.portal-login h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.portal-description,
.portal-session p,
.portal-unauthorized p {
  max-width: 410px;
  color: #526672;
  line-height: 1.55;
}

.portal-loading,
.portal-status {
  min-height: 24px;
  margin: 28px 0 0;
  color: #245d70;
  font-weight: 700;
}

.portal-loading[hidden],
.portal-session[hidden],
.portal-unauthorized[hidden],
[data-login-actions][hidden] { display: none; }

.microsoft-login-button {
  width: min(100%, 380px);
  min-height: 50px;
  margin-top: 28px;
  padding: 12px 20px;
  border: 1px solid #0b465c;
  border-radius: 6px;
  background: #0b465c;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.microsoft-login-button:hover { background: #153a4c; }
.microsoft-login-button:disabled { cursor: wait; opacity: 0.7; }
.microsoft-login-button:focus-visible { outline: 3px solid #e8b04b; outline-offset: 3px; }
.switch-account-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #0b465c;
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
}
.switch-account-button:hover { color: #153a4c; }
.switch-account-button:focus-visible { outline: 3px solid #e8b04b; outline-offset: 3px; }
.portal-status[data-state="error"] { color: #a31f1f; }
.portal-session,
.portal-unauthorized { margin-top: 28px; }
.portal-unauthorized strong { overflow-wrap: anywhere; }

noscript {
  display: block;
  padding: 24px;
  color: #a31f1f;
  text-align: center;
}

.admin-shell {
  --module-accent: #0b5f82;
  --module-ink: #0a4058;
  --module-soft: #e9f5f8;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  background: #edf2f3;
  transition: grid-template-columns 180ms ease;
}

.admin-shell.is-sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.admin-shell[data-active-module="dashboard"] { --module-accent: #0b5f82; --module-ink: #0a4058; --module-soft: #e9f5f8; }
.admin-shell[data-active-module="suprimentos"] { --module-accent: #087f78; --module-ink: #07564f; --module-soft: #e7f7f3; }
.admin-shell[data-active-module="demandas"] { --module-accent: #b66a00; --module-ink: #774600; --module-soft: #fff3dc; }
.admin-shell[data-active-module="comercial"] { --module-accent: #167452; --module-ink: #104f39; --module-soft: #e8f7ef; }
.admin-shell[data-active-module="financeiro"] { --module-accent: #4655a2; --module-ink: #303b75; --module-soft: #eef0fb; }
.admin-shell[data-active-module="rh-obras"] { --module-accent: #ad4e32; --module-ink: #743421; --module-soft: #fff0eb; }
.admin-shell[data-active-module="patrimonio-locacoes"] { --module-accent: #526f7a; --module-ink: #354b54; --module-soft: #edf3f5; }
.admin-shell[data-active-module="auditoria-compliance"] { --module-accent: #983e57; --module-ink: #672a3b; --module-soft: #faedf1; }
.admin-shell[data-active-module="relatorios"] { --module-accent: #176b9a; --module-ink: #104967; --module-soft: #eaf4fa; }
.admin-shell[data-active-module="usuarios-acessos"] { --module-accent: #685b3d; --module-ink: #473e2a; --module-soft: #f5f1e8; }

.admin-sidebar {
  display: flex;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  border-right: 3px solid var(--module-accent);
  background: #fff;
  transition: border-color 160ms ease;
}

.admin-brand {
  position: relative;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #dce7eb;
}

.admin-brand-assets { display: grid; min-width: 0; place-items: center start; }
.admin-brand-logo { display: block; width: 166px; max-width: calc(100% - 40px); height: auto; }
.admin-brand-logo-compact { display: none; width: 146px; max-width: none; height: 50px; object-fit: contain; object-position: left center; }
.admin-sidebar-collapse,
.admin-drawer-close,
.admin-menu-button {
  border: 0;
  background: transparent;
  color: #0b465c;
  cursor: pointer;
  line-height: 1;
}
.admin-drawer-close,
.admin-menu-button { display: none; font-size: 26px; }
.admin-sidebar-collapse {
  display: inline-grid;
  position: absolute;
  z-index: 3;
  right: -15px;
  bottom: -15px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #b9ccd3;
  border-radius: 50%;
  background: #fff;
  color: var(--module-ink);
  box-shadow: 0 4px 12px rgba(23, 48, 66, 0.14);
}
.admin-sidebar-collapse span::before { content: "‹"; font-size: 24px; }
.admin-shell.is-sidebar-collapsed .admin-sidebar-collapse span::before { content: "›"; }
.admin-sidebar-collapse:hover { border-color: var(--module-accent); background: var(--module-soft); }
.admin-sidebar-collapse:focus-visible,
.admin-menu-button:focus-visible,
.admin-drawer-close:focus-visible { outline: 3px solid #e8b04b; outline-offset: 2px; }

.admin-navigation { display: grid; gap: 4px; overflow-y: auto; padding: 14px 10px; }
.admin-nav-link {
  --nav-accent: #0b5f82;
  position: relative;
  display: grid;
  min-height: 44px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: #173042;
  font-weight: 700;
  text-decoration: none;
}
.admin-nav-link[data-shell-route="suprimentos"] { --nav-accent: #087f78; }
.admin-nav-link[data-shell-route="demandas"] { --nav-accent: #b66a00; }
.admin-nav-link[data-shell-route="comercial"] { --nav-accent: #167452; }
.admin-nav-link[data-shell-route="financeiro"] { --nav-accent: #4655a2; }
.admin-nav-link[data-shell-route="rh-obras"] { --nav-accent: #ad4e32; }
.admin-nav-link[data-shell-route="patrimonio-locacoes"] { --nav-accent: #526f7a; }
.admin-nav-link[data-shell-route="auditoria-compliance"] { --nav-accent: #983e57; }
.admin-nav-link[data-shell-route="relatorios"] { --nav-accent: #176b9a; }
.admin-nav-link[data-shell-route="usuarios-acessos"] { --nav-accent: #685b3d; }
.admin-nav-link:hover { border-color: #c7d8de; border-left-color: var(--nav-accent); background: #f2f7f8; }
.admin-nav-link.is-active { border-color: var(--nav-accent); background: var(--nav-accent); color: #fff; }
.admin-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--nav-accent) 12%, white);
  color: var(--nav-accent);
  font-size: 17px;
}
.admin-nav-link.is-active .admin-nav-icon { background: rgba(255, 255, 255, 0.16); color: #fff; }
.admin-sidebar-user {
  display: grid;
  min-height: 84px;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid #dce7eb;
  background: var(--module-soft);
}
.admin-sidebar-mascot { display: block; width: 36px; height: 54px; object-fit: contain; object-position: center bottom; }
.admin-sidebar-user-copy { display: grid; min-width: 0; gap: 4px; }
.admin-sidebar-user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-sidebar-user-copy span { overflow-wrap: anywhere; color: #526672; font-size: 13px; }
.admin-drawer-backdrop { display: none; }

.admin-workspace { min-width: 0; }
.admin-topbar {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(20px, 3vw, 44px);
  border-bottom: 3px solid var(--module-accent);
  background: #fff;
  transition: border-color 160ms ease;
}
.admin-connection { display: inline-flex; align-items: center; gap: 8px; color: #166b42; font-size: 14px; font-weight: 700; }
.admin-connection::before { width: 9px; height: 9px; border-radius: 50%; background: #1e8b54; content: ""; }
.admin-connection.is-offline { color: #a85a00; }
.admin-connection.is-offline::before { background: #d58a00; }
.admin-topbar-actions { display: flex; min-width: 0; align-items: center; gap: 16px; }
.admin-account-name { max-width: 280px; overflow: hidden; color: #526672; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.admin-logout-button { padding: 9px 14px; border: 1px solid #0b465c; border-radius: 6px; background: #fff; color: #0b465c; cursor: pointer; font-weight: 700; }
.admin-logout-button:hover { background: #edf8fa; }
.admin-content { min-height: calc(100vh - 68px); padding: clamp(24px, 3vw, 44px); }

@media (min-width: 761px) {
  .admin-shell.is-sidebar-collapsed .admin-brand { justify-content: center; padding: 18px 10px; }
  .admin-shell.is-sidebar-collapsed .admin-brand-logo { display: none; }
  .admin-shell.is-sidebar-collapsed .admin-brand-assets { width: 28px; height: 50px; overflow: hidden; }
  .admin-shell.is-sidebar-collapsed .admin-brand-logo-compact { display: block; }
  .admin-shell.is-sidebar-collapsed .admin-navigation { overflow: visible; padding-inline: 10px; }
  .admin-shell.is-sidebar-collapsed .admin-nav-link { grid-template-columns: 1fr; place-items: center; padding-inline: 8px; }
  .admin-shell.is-sidebar-collapsed .admin-nav-label,
  .admin-shell.is-sidebar-collapsed .admin-sidebar-user-copy { display: none; }
  .admin-shell.is-sidebar-collapsed .admin-sidebar-user { grid-template-columns: 1fr; justify-items: center; padding-inline: 10px; }
  .admin-shell.is-sidebar-collapsed .admin-nav-link::after {
    position: absolute;
    z-index: 30;
    top: 50%;
    left: calc(100% + 10px);
    width: max-content;
    max-width: 230px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #173042;
    color: #fff;
    content: attr(data-tooltip);
    font-size: 13px;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    transform: translate(4px, -50%);
    transition: opacity 120ms ease, transform 120ms ease;
  }
  .admin-shell.is-sidebar-collapsed .admin-nav-link:hover::after,
  .admin-shell.is-sidebar-collapsed .admin-nav-link:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
}

.dashboard-page,
.module-page { width: min(100%, 1920px); margin: 0 auto; }
.dashboard-heading,
.module-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-eyebrow { margin: 0 0 7px; color: #245d70; font-size: 13px; font-weight: 700; text-transform: uppercase; }
.dashboard-heading h1,
.module-heading h1 { margin: 0; color: #153a4c; font-size: 32px; line-height: 1.1; }
.dashboard-state { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: #d9f7df; color: #166b42; font-size: 13px; font-weight: 700; }
.dashboard-state.is-offline { background: #fff0d2; color: #a85a00; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 30px; }
.dashboard-metric { display: grid; gap: 8px; min-height: 112px; padding: 18px; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }
.dashboard-metric span { color: #526672; font-size: 14px; font-weight: 700; }
.dashboard-metric strong { color: #153a4c; font-size: 30px; line-height: 1; }
.dashboard-metric-attention { border-color: #e8b04b; background: #fffaf0; }
.dashboard-powerapps-summary { display: grid; gap: 10px; padding: 10px; background: #f3f4f6; }
.dashboard-metric-row { display: grid; gap: 10px; align-items: stretch; }
.dashboard-metric-row-middle { grid-template-columns: 31fr 69fr; }
.dashboard-metric-row-bottom { grid-template-columns: 62fr 38fr; }
.dashboard-metric-group { min-width: 0; padding: 8px; border: 3px solid var(--dashboard-group-color); border-radius: 8px; background: var(--dashboard-group-color); }
.dashboard-metric-group > h2 { margin: 0 0 7px; color: #fff; font-size: 15px; font-weight: 900; text-align: center; text-transform: uppercase; }
.dashboard-metric-group > div { display: grid; grid-template-columns: repeat(var(--dashboard-card-count, 1), minmax(0, 1fr)); gap: 6px; height: calc(100% - 25px); }
.dashboard-metric-group[data-metric-group="financeiro-compras"] { --dashboard-card-count: 4; }
.dashboard-metric-group[data-metric-group="financeiro-compras"] { --dashboard-group-color: #001060; }
.dashboard-metric-group[data-metric-group="documentos"] { --dashboard-group-color: #88a0d1; }
.dashboard-metric-group[data-metric-group="tarefas"] { --dashboard-group-color: #638b2c; }
.dashboard-metric-group[data-metric-group="obras-rh"] { --dashboard-group-color: #cb6666; }
.dashboard-metric-group[data-metric-group="comercial"] { --dashboard-group-color: #ac3e0b; }
.dashboard-metric-group[data-metric-group="tarefas"],
.dashboard-metric-group[data-metric-group="comercial"] { --dashboard-card-count: 2; }
.dashboard-metric-group[data-metric-group="obras-rh"] { --dashboard-card-count: 3; }
.dashboard-metric-group .dashboard-metric { min-height: 88px; align-content: center; justify-items: center; gap: 4px; padding: 8px 6px; border: 2px solid color-mix(in srgb, var(--dashboard-group-color) 42%, white); border-radius: 7px; text-align: center; }
.dashboard-metric-group .dashboard-metric.has-value { border-color: var(--dashboard-group-color); background: color-mix(in srgb, var(--dashboard-group-color) 10%, white); }
.dashboard-metric-group .dashboard-metric span { min-height: 26px; color: #475569; font-size: 10px; font-weight: 800; line-height: 13px; text-transform: uppercase; }
.dashboard-metric-group .dashboard-metric strong { color: color-mix(in srgb, var(--dashboard-group-color) 78%, #111); font-size: 27px; font-weight: 900; line-height: 31px; white-space: nowrap; }
.dashboard-metric-group .dashboard-metric small { color: #7c5100; font-size: 10px; font-weight: 700; }
.dashboard-metric-group[data-metric-group="obras-rh"] > div { grid-template-columns: 28fr 44fr 28fr; }
.dashboard-metric-group[data-metric-group="obras-rh"] [data-metric-id="valores-pendentes"] strong { font-size: 18px; }
.dashboard-section { margin-top: 30px; }
.dashboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dashboard-section h2 { margin: 0; color: #153a4c; font-size: 20px; }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dashboard-shortcut { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #c7d6dc; border-radius: 6px; background: #fff; color: #173042; font-weight: 700; text-decoration: none; }
.dashboard-shortcut:hover { border-color: #0b465c; background: #edf8fa; }
.dashboard-shortcut span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
.dashboard-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dashboard-list li { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid #c7d6dc; }
.dashboard-list li:last-child { border-bottom: 0; }
.dashboard-list span,
.dashboard-empty { margin: 0; color: #526672; line-height: 1.45; }
.dashboard-warning { margin: 28px 0 0; padding: 14px; border: 1px solid #e8b04b; border-radius: 6px; background: #fff6dd; color: #7c5100; font-weight: 700; }
.dashboard-loading { margin: 0; color: #245d70; font-weight: 700; }
.dashboard-chart { min-width: 0; padding: 16px; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }
.dashboard-chart svg { display: block; min-height: 120px; overflow: visible; }
.dashboard-chart g[role="button"] { cursor: pointer; }
.dashboard-chart g[role="button"] rect { transition: opacity 140ms ease; }
.dashboard-chart g[role="button"]:hover rect { opacity: .78; }
.dashboard-chart g[role="button"]:focus-visible { outline: none; }
.dashboard-chart g[role="button"]:focus-visible rect { stroke: #e8b04b; stroke-width: 4px; }
.dashboard-audit label { display: grid; gap: 5px; color: #173042; font-size: 13px; font-weight: 700; }
.dashboard-audit input[type="date"] { min-height: 40px; padding: 8px 10px; border: 1px solid #aec2ca; border-radius: 6px; background: #fff; color: #173042; }
.dashboard-audit .dashboard-columns > section { min-width: 0; padding: 16px; border-top: 3px solid var(--module-accent); background: var(--module-soft); }

.powerapps-home-page { width: min(100%, 1920px); margin: 0 auto; }
.powerapps-home-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 1366 / 768;
  overflow: hidden;
  border: 1px solid #9fb4bc;
  background: #d7d7d7 url("/portal/assets/powerapps-home/powerapps-home-background.jpg") center / 100% 100% no-repeat;
  box-shadow: 0 9px 24px rgba(16, 55, 70, 0.16);
}
.powerapps-home-brand {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 18.594436%;
  height: 11.197917%;
  background: #fff;
}
.powerapps-home-brand img { display: block; width: 95.275591%; height: 86.046512%; object-fit: contain; }
.powerapps-home-tile,
.powerapps-home-quick-action {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
  text-decoration: none;
}
.powerapps-home-tile { width: 41.142020%; height: 17.578125%; }
.powerapps-home-tile[data-home-tile="suprimentos"] { top: 17.317708%; left: 8.418741%; background: rgb(0, 13, 75); }
.powerapps-home-tile[data-home-tile="demandas"] { top: 17.317708%; left: 51.317716%; background: rgb(99, 139, 44); }
.powerapps-home-tile[data-home-tile="financeiro"] { top: 38.281250%; left: 8.491947%; background: rgb(77, 77, 77); }
.powerapps-home-tile[data-home-tile="comercial"] { top: 38.151042%; left: 51.317716%; background: rgb(172, 62, 11); }
.powerapps-home-tile[data-home-tile="rh-obras"] { top: 58.593750%; left: 8.418741%; background: rgb(203, 102, 102); }
.powerapps-home-tile[data-home-tile="patrimonio-locacoes"] { top: 58.593750%; left: 51.317716%; background: rgb(251, 188, 159); }
.powerapps-home-tile[data-home-tile="auditoria-compliance"] { top: 79.557292%; left: 8.418741%; background: rgb(136, 160, 209); }
.powerapps-home-tile { display: flex; align-items: center; justify-content: center; padding: 0; }
.powerapps-home-tile img {
  position: absolute;
  object-fit: contain;
}
.powerapps-home-tile[data-home-tile="suprimentos"] img { top: 1.481481%; left: 0; width: 24.911032%; height: 97.777778%; }
.powerapps-home-tile[data-home-tile="demandas"] img { top: 2.962963%; left: 2.491103%; width: 19.395018%; height: 97.777778%; }
.powerapps-home-tile[data-home-tile="financeiro"] img { top: 0; left: 1.067616%; width: 21.174377%; height: 100%; }
.powerapps-home-tile[data-home-tile="comercial"] img { top: 0; left: 3.380783%; width: 19.395018%; height: 102.222222%; }
.powerapps-home-tile[data-home-tile="rh-obras"] img { top: -2.222222%; left: .533808%; width: 20.106762%; height: 108.148148%; }
.powerapps-home-tile[data-home-tile="patrimonio-locacoes"] img { top: 2.222222%; left: 2.135231%; width: 23.309609%; height: 97.777778%; }
.powerapps-home-tile[data-home-tile="auditoria-compliance"] img { top: -3.703704%; left: .355872%; width: 21.174377%; height: 106.666667%; }
.powerapps-home-tile span {
  position: relative;
  z-index: 1;
  max-width: 74%;
  font-size: clamp(11px, 1.18vw, 22px);
  font-weight: 700;
  line-height: 1.14;
  text-align: center;
}
.powerapps-home-quick-action { width: 5.783309%; height: 9.895833%; padding: 0; cursor: pointer; }
.powerapps-home-quick-action[data-home-quick-action="resumo-geral"] { top: 4.296875%; left: 93.484627%; background: rgb(242, 242, 208); }
.powerapps-home-quick-action[data-home-quick-action="patologias"] { top: 53.385417%; left: 93.484627%; background: rgb(172, 62, 11); }
.powerapps-home-quick-action[data-home-quick-action="cotacoes"] { top: 57.942708%; left: 0; background: rgb(0, 16, 96); }
.powerapps-home-quick-action[data-home-quick-action="contratos"] { top: 4.036458%; left: 34.114202%; background: rgb(203, 102, 102); }
.powerapps-home-quick-action[data-home-quick-action="imoveis"] { top: 41.666667%; left: 93.484627%; background: rgb(172, 62, 11); }
.powerapps-home-quick-action[data-home-quick-action="presenca-semanal"] { top: 3.906250%; left: 53.806735%; height: 9.635417%; background: rgb(203, 102, 102); }
.powerapps-home-quick-action[data-home-quick-action="pagamentos-presenca"] { top: 3.906250%; left: 40.629575%; background: rgb(203, 102, 102); }
.powerapps-home-quick-action[data-home-quick-action="auditoria-pedidos"] { top: 69.661458%; left: 0; height: 10.156250%; background: rgb(149, 149, 149); }
.powerapps-home-quick-action[data-home-quick-action="pedidos"] { top: 45.572917%; left: 0; background: rgb(0, 18, 107); }
.powerapps-home-quick-action[data-home-quick-action="lancamentos"] { top: 12.239583%; left: 0; background: rgb(0, 13, 75); }
.powerapps-home-quick-action[data-home-quick-action="despesas-recorrentes"] { top: 34.375%; left: 0; background: rgb(0, 13, 75); }
.powerapps-home-quick-action[data-home-quick-action="apontamentos-funcionarios"] { top: 3.906250%; left: 47.218155%; background: rgb(203, 102, 102); }
.powerapps-home-quick-action[data-home-quick-action="diario-obras"] { top: 4.036458%; left: 73.206442%; background: rgb(203, 102, 102); }
.powerapps-home-quick-action[data-home-quick-action="provisoes"] { top: 23.307292%; left: 0; background: rgb(0, 16, 96); }
.powerapps-home-quick-action[data-home-quick-action="previsoes-locacao"] { top: 64.713542%; left: 93.484627%; background: rgb(251, 188, 159); }
.powerapps-home-quick-action[data-home-quick-action="tarefas"] { top: 4.036458%; left: 79.795022%; height: 10.026042%; background: rgb(99, 139, 44); }
.powerapps-home-quick-action[data-home-quick-action="apontamentos-comerciais"] { top: 29.947917%; left: 93.484627%; background: rgb(172, 62, 11); }
.powerapps-home-quick-action[data-home-quick-action="homologacao-locacao"] { top: 76.171875%; left: 93.484627%; background: rgb(251, 188, 159); }
.powerapps-home-quick-action[data-home-quick-action="alugueis"] { top: 87.760417%; left: 93.484627%; background: rgb(251, 188, 159); }
.powerapps-home-quick-action[data-home-quick-action="receitas"] { top: 18.229167%; left: 93.484627%; background: rgb(172, 62, 11); }
.powerapps-home-quick-action[data-home-quick-action="documentos"] { top: 81.380208%; left: 0; background: rgb(136, 160, 209); }
.powerapps-home-quick-action[data-home-quick-action="presencas"] { top: 4.036458%; left: 60.029283%; height: 9.635417%; background: rgb(203, 102, 102); }
.powerapps-home-quick-action[data-home-quick-action="etapas"] { top: 4.036458%; left: 66.617862%; background: rgb(203, 102, 102); }
.powerapps-home-quick-action[data-home-quick-action="relatorio-tarefas"] { top: 4.036458%; left: 86.383602%; background: rgb(99, 139, 44); }
.powerapps-home-quick-action img { display: block; width: 100%; height: 100%; object-fit: contain; }
.powerapps-home-tile:hover,
.powerapps-home-quick-action:hover { filter: brightness(1.08); }
.powerapps-home-tile:focus-visible,
.powerapps-home-quick-action:focus-visible,
.powerapps-home-mobile-menu a:focus-visible,
.powerapps-home-mobile-tools a:focus-visible,
.powerapps-home-mobile-tools button:focus-visible { z-index: 5; outline: 4px solid #fff; outline-offset: -5px; box-shadow: 0 0 0 3px #0b465c; }
.powerapps-home-mobile-menu,
.powerapps-home-mobile-tools { display: none; }
.powerapps-home-report-layer[hidden] { display: none; }
.powerapps-home-report-layer { position: fixed; z-index: 150; inset: 0; display: grid; place-items: center; padding: 3vh 3vw; }
.powerapps-home-report-backdrop { position: absolute; inset: 0; border: 0; border-radius: 0; background: rgba(8, 28, 37, 0.62); }
.powerapps-home-report {
  position: relative;
  display: grid;
  width: min(1320px, 100%);
  max-height: 94vh;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #8ea7b1;
  background: #edf2f3;
  box-shadow: 0 18px 54px rgba(4, 25, 34, 0.34);
}
.powerapps-home-report > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 18px; border-bottom: 1px solid #c7d6dc; background: #fff; }
.powerapps-home-report h2 { margin: 0; color: #153a4c; font-size: 22px; }
.powerapps-home-report-actions { display: flex; align-items: center; gap: 8px; }
.powerapps-home-report-actions [hidden] { display: none; }
.powerapps-home-report-content { min-height: 240px; overflow: auto; padding: 22px; }
.module-entity-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.module-entity-card { display: grid; min-width: 0; gap: 14px; padding: 16px; border: 1px solid #c7d6dc; border-top: 4px solid var(--module-accent); border-radius: 6px; background: #fff; }
.module-entity-card h2 { margin: 0; color: #173042; font-size: 18px; line-height: 1.25; }
.module-entity-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.module-entity-command { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 12px; border: 1px solid #0b465c; border-radius: 5px; font-weight: 700; text-decoration: none; }
.module-entity-gallery { background: #0b465c; color: #fff; }
.module-entity-gallery:hover { background: #153a4c; }
.module-entity-create { border-color: var(--module-accent); background: var(--module-soft); color: #173042; }
.module-entity-create:hover { background: #fff; }
.module-entity-command:focus-visible { outline: 3px solid #e8b04b; outline-offset: 2px; }
.module-page .module-entity-command.is-disabled,
.module-page .module-entity-command.is-disabled:hover {
  border-color: #aeb7bb;
  background: #d5dadd;
  color: #657278;
  cursor: not-allowed;
  opacity: .82;
  pointer-events: none;
  filter: saturate(.2);
}

.supplies-module-page { --supplies-red: #bd1010; --supplies-red-soft: #f4d5d5; --supplies-blue: #31599b; --supplies-blue-soft: #e7edf9; }
.supplies-module-heading { margin-bottom: 22px; }
.module-page-intro { margin: 9px 0 0; color: #526672; }
.supplies-workspace { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 10px; align-items: stretch; }
.supplies-column { min-width: 0; padding: 18px; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }
.supplies-operations { border-top: 6px solid var(--supplies-red); background: #fff8f8; }
.supplies-catalog { border-top: 6px solid var(--supplies-blue); background: #f7f9fd; }
.supplies-column-heading { margin-bottom: 16px; }
.supplies-column-kicker { color: var(--module-accent); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.supplies-column h2 { margin: 5px 0 6px; color: #173042; font-size: 20px; }
.supplies-column-heading p { margin: 0; color: #526672; font-size: 13px; line-height: 1.45; }
.supplies-action-list, .supplies-paired-grid, .supplies-secondary-grid { display: grid; gap: 8px; }
.supplies-paired-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.supplies-secondary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.supplies-action-row { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #d6e0e5; border-radius: 6px; background: #fff; }
.supplies-action-row h3 { min-height: 34px; margin: 0; color: #173042; font-size: 13px; line-height: 1.25; }
.supplies-action-row .module-entity-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.supplies-action-single { margin-top: 8px; }
.supplies-action-single .module-entity-actions { grid-template-columns: 1fr; }
.supplies-operations .module-entity-create { border-color: var(--supplies-red); background: var(--supplies-red); color: #fff; }
.supplies-operations .module-entity-create:hover { background: #930b0b; }
.supplies-operations .module-entity-gallery { border-color: #d79494; background: var(--supplies-red-soft); color: #722020; }
.supplies-operations .module-entity-gallery:hover { background: #fff; }
.supplies-catalog .module-entity-create { border-color: var(--supplies-blue); background: var(--supplies-blue); color: #fff; }
.supplies-catalog .module-entity-create:hover { background: #27467d; }
.supplies-catalog .module-entity-gallery { border-color: #aab8d5; background: var(--supplies-blue-soft); color: #28477f; }
.supplies-catalog .module-entity-gallery:hover { background: #fff; }
.demands-module-page { --demands-green: #79ad32; --demands-green-dark: #4e7e1d; --demands-green-soft: #e2f0c8; }
.demands-module-heading { margin-bottom: 22px; }
.demands-workspace { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr); gap: 10px; }
.demands-column { min-width: 0; padding: 18px; border: 1px solid #c2d8a4; border-radius: 8px; background: #f7fbef; }
.demands-tasks { border-top: 6px solid var(--demands-green-dark); }
.demands-communication { border-top: 6px solid var(--demands-green); background: #fbfdf6; }
.demands-column-heading { margin-bottom: 16px; }
.demands-column-kicker { color: var(--demands-green-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.demands-column h2 { margin: 5px 0 6px; color: #35551a; font-size: 20px; }
.demands-column-heading p { margin: 0; color: #526672; font-size: 13px; line-height: 1.45; }
.demands-action-list { display: grid; gap: 8px; }
.demands-action-row { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #c7dca9; border-radius: 6px; background: #fff; }
.demands-action-row h3 { min-height: 34px; margin: 0; color: #35551a; font-size: 13px; line-height: 1.25; }
.demands-action-row .module-entity-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demands-module-page .module-entity-create { border-color: var(--demands-green-dark); background: var(--demands-green-dark); color: #fff; }
.demands-module-page .module-entity-create:hover { background: #3d6516; }
.demands-module-page .module-entity-gallery { border-color: #b7d58a; background: var(--demands-green-soft); color: #456c20; }
.demands-module-page .module-entity-gallery:hover { background: #fff; }
.commercial-module-page { --commercial-blue: #31599b; --commercial-blue-dark: #172a70; --commercial-blue-soft: #e4e9f7; --commercial-orange: #b3420d; --commercial-orange-soft: #f3d2d2; }
.commercial-module-heading { margin-bottom: 22px; }
.commercial-workspace { display: grid; grid-template-columns: minmax(300px, .84fr) minmax(0, 1.16fr); gap: 10px; }
.commercial-column { min-width: 0; padding: 18px; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }
.commercial-catalog { border-top: 6px solid var(--commercial-blue-dark); background: #f5f7fd; }
.commercial-operations { border-top: 6px solid var(--commercial-orange); background: #fff8f6; }
.commercial-column-heading { margin-bottom: 16px; }
.commercial-column-kicker { color: var(--commercial-blue-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.commercial-operations .commercial-column-kicker { color: var(--commercial-orange); }
.commercial-column h2 { margin: 5px 0 6px; color: #173042; font-size: 20px; }
.commercial-column-heading p { margin: 0; color: #526672; font-size: 13px; line-height: 1.45; }
.commercial-action-list { display: grid; gap: 8px; }
.commercial-action-row { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #c5d0e7; border-radius: 6px; background: #fff; }
.commercial-action-row h3 { min-height: 34px; margin: 0; color: #233d7c; font-size: 13px; line-height: 1.25; }
.commercial-operations .commercial-action-row { border-color: #e0b1b1; }
.commercial-operations .commercial-action-row h3 { color: #8e360e; }
.commercial-action-row .module-entity-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.commercial-homologation { margin-top: 10px; }
.commercial-catalog .module-entity-create { border-color: var(--commercial-blue-dark); background: var(--commercial-blue); color: #fff; }
.commercial-catalog .module-entity-create:hover { background: #223f83; }
.commercial-catalog .module-entity-gallery { border-color: #a9b7d7; background: var(--commercial-blue-soft); color: #29447f; }
.commercial-catalog .module-entity-gallery:hover { background: #fff; }
.commercial-operations .module-entity-create { border-color: var(--commercial-orange); background: var(--commercial-orange); color: #fff; }
.commercial-operations .module-entity-create:hover { background: #8d3409; }
.commercial-operations .module-entity-gallery { border-color: #d99999; background: var(--commercial-orange-soft); color: #803737; }
.commercial-operations .module-entity-gallery:hover { background: #fff; }
.hr-module-page { --hr-red: #a90808; --hr-red-soft: #efd0d0; --hr-coral: #d99a9a; }
.hr-module-heading { margin-bottom: 22px; }
.hr-workspace { display: grid; grid-template-columns: minmax(300px, .84fr) minmax(0, 1.16fr); gap: 10px; }
.hr-column { min-width: 0; padding: 18px; border: 1px solid #dfb1b1; border-radius: 8px; background: #fffafa; }
.hr-people { border-top: 6px solid var(--hr-red); }
.hr-operations { border-top: 6px solid #c46d6d; background: #fff7f7; }
.hr-column-heading { margin-bottom: 16px; }
.hr-column-kicker { color: var(--hr-red); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hr-column h2 { margin: 5px 0 6px; color: #6e2020; font-size: 20px; }
.hr-column-heading p { margin: 0; color: #526672; font-size: 13px; line-height: 1.45; }
.hr-action-list { display: grid; gap: 8px; }
.hr-action-row { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #e0baba; border-radius: 6px; background: #fff; }
.hr-action-row h3 { min-height: 34px; margin: 0; color: #762525; font-size: 13px; line-height: 1.25; }
.hr-action-row .module-entity-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hr-module-page .module-entity-create { border-color: var(--hr-red); background: var(--hr-red); color: #fff; }
.hr-module-page .module-entity-create:hover { background: #810606; }
.hr-module-page .module-entity-gallery { border-color: var(--hr-coral); background: var(--hr-red-soft); color: #783333; }
.hr-module-page .module-entity-gallery:hover { background: #fff; }
.hr-contracts { margin-top: 16px; padding-top: 16px; border-top: 2px solid #e7baba; }
.hr-contracts h2 { margin-top: 0; font-size: 17px; }
.property-module-page { --property-blue: #31599b; --property-blue-soft: #e5ebf8; --property-red: #a90808; --property-red-soft: #efd0d0; }
.property-module-heading { margin-bottom: 22px; }
.property-workspace { display: grid; grid-template-columns: minmax(300px, .84fr) minmax(0, 1.16fr); gap: 10px; }
.property-column { min-width: 0; padding: 18px; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }
.property-operations { border-top: 6px solid var(--property-red); background: #fff8f8; }
.property-catalog { border-top: 6px solid var(--property-blue); background: #f6f8fd; }
.property-column-heading { margin-bottom: 16px; }
.property-column-kicker { color: var(--property-red); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.property-catalog .property-column-kicker { color: var(--property-blue); }
.property-column h2 { margin: 5px 0 6px; color: #173042; font-size: 20px; }
.property-column-heading p { margin: 0; color: #526672; font-size: 13px; line-height: 1.45; }
.property-action-list { display: grid; gap: 8px; }
.property-action-row { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #dfb2b2; border-radius: 6px; background: #fff; }
.property-catalog .property-action-row { border-color: #c4d0e8; }
.property-action-row h3 { min-height: 34px; margin: 0; color: #7a2525; font-size: 13px; line-height: 1.25; }
.property-catalog .property-action-row h3 { color: #29477f; }
.property-action-row .module-entity-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.property-operations .module-entity-create { border-color: var(--property-red); background: var(--property-red); color: #fff; }
.property-operations .module-entity-create:hover { background: #810606; }
.property-operations .module-entity-gallery { border-color: #d99999; background: var(--property-red-soft); color: #783333; }
.property-operations .module-entity-gallery:hover { background: #fff; }
.property-catalog .module-entity-create { border-color: var(--property-blue); background: var(--property-blue); color: #fff; }
.property-catalog .module-entity-create:hover { background: #223f83; }
.property-catalog .module-entity-gallery { border-color: #aab9d8; background: var(--property-blue-soft); color: #29477f; }
.property-catalog .module-entity-gallery:hover { background: #fff; }
.audit-module-page { --audit-blue: #31599b; --audit-blue-dark: #172a70; --audit-blue-soft: #e4e9f7; --audit-red: #a90808; --audit-red-soft: #efd0d0; }
.audit-module-heading { margin-bottom: 22px; }
.audit-workspace { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr); gap: 10px; }
.audit-column { min-width: 0; padding: 18px; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }
.audit-catalog { border-top: 6px solid var(--audit-blue-dark); background: #f5f7fd; }
.audit-operations { border-top: 6px solid var(--audit-red); background: #fff8f8; }
.audit-column-heading { margin-bottom: 16px; }
.audit-column-kicker { color: var(--audit-blue-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.audit-operations .audit-column-kicker { color: var(--audit-red); }
.audit-column h2 { margin: 5px 0 6px; color: #173042; font-size: 20px; }
.audit-column-heading p { margin: 0; color: #526672; font-size: 13px; line-height: 1.45; }
.audit-action-list { display: grid; gap: 8px; }
.audit-action-row { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #c5d0e7; border-radius: 6px; background: #fff; }
.audit-operations .audit-action-row { border-color: #dfb2b2; }
.audit-action-row h3 { min-height: 34px; margin: 0; color: #29477f; font-size: 13px; line-height: 1.25; }
.audit-operations .audit-action-row h3 { color: #7a2525; }
.audit-action-row .module-entity-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.audit-catalog .module-entity-create { border-color: var(--audit-blue-dark); background: var(--audit-blue); color: #fff; }
.audit-catalog .module-entity-gallery { border-color: #aab9d8; background: var(--audit-blue-soft); color: #29477f; }
.audit-operations .module-entity-create { border-color: var(--audit-red); background: var(--audit-red); color: #fff; }
.audit-operations .module-entity-gallery { border-color: #d99999; background: var(--audit-red-soft); color: #783333; }

.entity-page { width: 100%; margin: 0 auto; }
.entity-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.entity-heading h1 { margin: 0; color: #153a4c; font-size: 32px; line-height: 1.1; }
.entity-meta { margin: 8px 0 0; color: #526672; }
.entity-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #aec2ca;
  border-radius: 8px;
  background: #eaf1f3;
}
.entity-view-command {
  width: 100%;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #0b465c;
  cursor: pointer;
  font-weight: 700;
}
.entity-view-command:hover { border-color: #aec2ca; background: #fff; }
.entity-view-command[aria-pressed="true"] { border-color: #0b465c; background: #0b465c; color: #fff; box-shadow: 0 2px 7px rgba(11, 70, 92, .2); }
[data-entity-create].entity-view-command[aria-pressed="true"] { border-color: var(--module-accent); background: var(--module-accent); }
.entity-view-command:focus-visible { outline: 3px solid #e8b04b; outline-offset: 2px; }
.entity-page .entity-view-command.is-disabled,
.entity-page .entity-view-command.is-disabled:hover {
  border-color: #aeb7bb;
  background: #d5dadd;
  color: #657278;
  cursor: not-allowed;
  opacity: .82;
  pointer-events: none;
  filter: saturate(.2);
}

/* Assistente administrativo persistente */
.operations-assistant-host { position: relative; z-index: 120; }
.operations-assistant-launcher {
  display: flex;
  position: fixed;
  z-index: 121;
  right: 24px;
  bottom: 24px;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 7px;
  border: 1px solid #0b5f82;
  border-radius: 27px;
  background: #0b465c;
  box-shadow: 0 10px 28px rgba(23, 48, 66, 0.24);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.operations-assistant-launcher:hover { background: #0b5f82; }
.operations-assistant-launcher:focus-visible,
.assistant-header button:focus-visible,
.assistant-module-menu button:focus-visible,
.assistant-composer input:focus-visible,
.assistant-composer button:focus-visible { outline: 3px solid #e8b04b; outline-offset: 2px; }
.operations-assistant-panel {
  display: grid;
  position: fixed;
  z-index: 122;
  right: 24px;
  bottom: 88px;
  width: min(430px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 112px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #abc2cc;
  border-radius: 8px;
  background: #eef3f4;
  box-shadow: 0 18px 50px rgba(23, 48, 66, 0.28);
}
.operations-assistant-panel[hidden] { display: none; }
.assistant-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 9px 12px;
  background: #0b465c;
  color: #fff;
}
.assistant-header > span:not(.assistant-avatar) { display: grid; gap: 2px; }
.assistant-header strong { font-size: 16px; }
.assistant-header small { color: #d9edf2; font-size: 12px; }
.assistant-header button {
  min-width: 38px;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.assistant-header [data-assistant-close] { font-size: 22px; }
.assistant-avatar {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  color: #0b465c;
  font-size: 13px;
  font-weight: 800;
}
.assistant-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.assistant-avatar.is-energetico img { object-fit: contain; object-position: center bottom; }
.assistant-avatar.is-launcher { width: 42px; height: 42px; flex-basis: 42px; }
.assistant-transcript {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 16px 14px 20px;
  background: #eef3f4;
}
.assistant-message { display: flex; gap: 8px; align-items: flex-end; }
.assistant-message.is-user { flex-direction: row-reverse; }
.assistant-bubble {
  width: fit-content;
  max-width: calc(100% - 52px);
  padding: 9px 12px;
  border: 1px solid #ccdce2;
  border-radius: 8px 8px 8px 2px;
  background: #fff;
  color: #173042;
}
.assistant-message.is-user .assistant-bubble {
  border-color: #97c9bf;
  border-radius: 8px 8px 2px 8px;
  background: #dff3ed;
}
.assistant-bubble strong { display: block; margin-bottom: 3px; color: #0b5f82; font-size: 12px; }
.assistant-message.is-user .assistant-bubble strong { color: #087f78; text-align: right; }
.assistant-bubble p { margin: 0; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-bubble p strong { display: inline; margin: 0; color: inherit; font-size: inherit; }
.assistant-message.is-media .assistant-bubble { width: calc(100% - 52px); }
.assistant-media { display: grid; gap: 8px; margin: 6px 0 0; }
.assistant-media figcaption { color: #0a4058; font-size: 13px; font-weight: 800; }
.assistant-media-content { display: grid; gap: 8px; color: #526672; font-size: 13px; }
.assistant-media-preview {
  display: block;
  width: 100%;
  max-height: 420px;
  border: 1px solid #bfd1d8;
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}
.assistant-media-preview.is-pdf { height: 420px; }
.assistant-media-download { color: #0b5f82; font-weight: 700; }
.assistant-choice-card {
  margin-left: 46px;
  padding: 12px;
  border: 1px solid #bfd1d8;
  border-left: 4px solid #0b5f82;
  border-radius: 6px;
  background: #fff;
}
.assistant-choice-card p { margin: 0 0 9px; color: #0a4058; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.assistant-choice-card .assistant-quick-menu { margin-bottom: 14px; }
.assistant-quick-menu button:first-child { border-color: #087f78; background: #e7f7f3; color: #07564f; }
.assistant-module-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.assistant-module-menu button {
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid #b8ccd4;
  border-radius: 5px;
  background: #f7fafb;
  color: #173042;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}
.assistant-module-menu button:hover { border-color: #0b5f82; background: #e9f5f8; }
.assistant-composer {
  display: grid;
  grid-template-columns: 38px auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #cbdbe1;
  background: #fff;
}
.assistant-attachment-actions { display: flex; gap: 5px; }
.assistant-composer .assistant-attachment-actions button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-color: #9eb8c4;
  background: #edf6f8;
  color: #0b465c;
  font-size: 19px;
}
.assistant-pending-attachments {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.assistant-pending-attachments[hidden] { display: none; }
.assistant-pending-attachments > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 9px;
  border: 1px solid #8eabb7;
  border-radius: 6px;
  background: #f3f8fa;
  color: #173042;
  font-size: 12px;
  font-weight: 700;
}
.assistant-pending-attachments > span > span { overflow-wrap: anywhere; }
.assistant-composer .assistant-pending-attachments button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #526672;
}
.assistant-composer input {
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #aac0ca;
  border-radius: 6px;
  color: #173042;
}
.assistant-composer button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #0b465c;
  border-radius: 6px;
  background: #0b465c;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.assistant-composer.is-busy { opacity: 0.7; }
.assistant-composer.is-busy input,
.assistant-composer.is-busy button { cursor: wait; }

@media (max-width: 760px) {
  .operations-assistant-launcher { right: 14px; bottom: 14px; }
  .operations-assistant-launcher > span:last-child { display: none; }
  .operations-assistant-panel { inset: 8px; width: auto; height: auto; }
  .assistant-module-menu { grid-template-columns: 1fr; }
  .assistant-composer { grid-template-columns: auto minmax(0, 1fr) auto; }
  .assistant-composer > .assistant-avatar { display: none; }
  .assistant-pending-attachments { grid-column: 1 / -1; }
}

.pwa-install-action {
  position: fixed;
  z-index: 120;
  right: 18px;
  top: 18px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #0b465c;
  border-radius: 6px;
  background: #0b465c;
  box-shadow: 0 8px 22px rgba(11, 70, 92, .22);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}
.pwa-install-action[hidden],
.pwa-ios-help[hidden] { display: none; }
.pwa-ios-help {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 32, 44, .68);
}
.pwa-ios-help-card {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(8, 32, 44, .3);
  color: #173042;
}
.pwa-ios-help-card h2 { margin: 0 0 10px; color: #0b465c; }
.pwa-ios-help-card p { margin: 0 0 16px; line-height: 1.5; }
.pwa-ios-help-card button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #0b465c;
  border-radius: 6px;
  background: #0b465c;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}
.entity-actions,
.dynamic-form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button-primary,
.button-secondary,
.button-danger,
.entity-pagination button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 14px; border-radius: 6px; cursor: pointer; font-weight: 700; text-decoration: none; }
.button-primary { border: 1px solid #0b465c; background: #0b465c; color: #fff; }
.button-primary:hover { background: #153a4c; }
.button-secondary,
.entity-pagination button { border: 1px solid #aec2ca; background: #fff; color: #0b465c; }
.button-secondary:hover,
.entity-pagination button:not(:disabled):hover { border-color: #0b465c; background: #edf8fa; }
.button-danger { border: 1px solid #a31f1f; background: #a31f1f; color: #fff; }
.button-danger:hover { background: #7d1616; }
.button-primary:focus-visible,
.button-secondary:focus-visible,
.button-danger:focus-visible,
.entity-pagination button:focus-visible,
.entity-sort:focus-visible,
.entity-sort-direction:focus-visible { outline: 3px solid #e8b04b; outline-offset: 2px; }
.entity-pagination button:disabled { cursor: not-allowed; opacity: .5; }
.entity-toast { min-height: 24px; margin: 0 0 16px; color: #166b42; font-weight: 700; }
.entity-toast.is-error,
.entity-error { color: #a31f1f; font-weight: 700; }
.entity-note { color: #245d70; font-weight: 700; }
.entity-diagnostic-code { margin: 8px 0 16px; color: #526672; font-family: Consolas, monospace; font-size: 12px; }
.entity-split-workspace {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.6fr);
  gap: 20px;
  align-items: start;
}
.entity-form-panel,
.entity-gallery-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid #c7d6dc;
  border-radius: 8px;
  background: #fff;
}
.entity-form-panel { border-top: 4px solid var(--module-accent); }
.entity-gallery-panel { border-top: 4px solid #1776a8; }
.entity-gallery-panel:only-child { grid-column: 1 / -1; }
.entity-form-panel:only-child { grid-column: 1 / -1; }
.entity-toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(180px, 280px); gap: 14px; align-items: end; margin-bottom: 16px; padding: 16px 0; border-top: 1px solid #c7d6dc; border-bottom: 1px solid #c7d6dc; }
.entity-toolbar label,
.dynamic-field { display: grid; gap: 6px; color: #173042; font-size: 14px; font-weight: 700; }
.entity-toolbar input,
.entity-toolbar select,
.dynamic-field input,
.dynamic-field select,
.dynamic-field textarea { width: 100%; min-width: 0; padding: 10px; border: 1px solid #aec2ca; border-radius: 6px; background: #fff; color: #173042; }
.dynamic-field textarea { min-height: 112px; resize: vertical; }
.dynamic-field small { color: #526672; font-weight: 400; }
.entity-toolbar label > small { color: #526672; font-size: 12px; font-weight: 500; }
.entity-filter-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.entity-filter-range legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: #173042;
  font-size: 14px;
  font-weight: 700;
}
.entity-filter-toggle {
  grid-template-columns: 20px minmax(0, 1fr) !important;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #aec2ca;
  border-radius: 6px;
  background: #f6fafb;
}
.entity-filter-toggle input { width: 18px; height: 18px; margin: 0; }
.searchable-select,
[data-searchable-root],
.dynamic-field[data-combobox-field] [data-combobox-root],
.dynamic-relationship-searchable { position: relative; display: block; min-width: 0; }
/* O valor nativo permanece no formulario apenas para validacao e envio; a interface e sempre o ComboBox pesquisavel. */
.dynamic-field[data-combobox-field] > select { display: none !important; }
.entity-toolbar select[data-gallery-filter-searchable][aria-hidden="true"] { display: none !important; }
[data-gallery-filter-searchable-root] { display: block; min-width: 0; }
.searchable-select-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.searchable-select-selected:empty { display: none; }
.searchable-select-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 5px 4px 8px; border: 1px solid #9fb8c3; border-radius: 4px; background: #edf5f7; color: #173042; font-size: 0.82rem; font-weight: 700; }
.searchable-select-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchable-select-chip-remove { display: inline-grid; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: #7f1717; font: 700 1.15rem/1 inherit; place-items: center; cursor: pointer; }
.searchable-select-chip-remove:focus-visible { outline: 2px solid #1776a8; outline-offset: 1px; }
.searchable-select-input { width: 100%; min-height: 42px; padding: 10px 38px 10px 12px; border: 1px solid #8eabb7; border-radius: 6px; background: #fff; color: #173042; font: inherit; }
.searchable-select-input:focus { border-color: #1776a8; outline: 3px solid rgba(23, 118, 168, 0.16); }
.searchable-select::after { position: absolute; top: 50%; right: 14px; width: 8px; height: 8px; border-right: 2px solid #526672; border-bottom: 2px solid #526672; content: ""; pointer-events: none; transform: translateY(-65%) rotate(45deg); }
.searchable-select-options {
  position: absolute;
  z-index: 20;
  inset: calc(100% + 4px) 0 auto;
  display: grid;
  max-height: 240px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid #8eabb7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 54, 73, 0.12);
  list-style: none;
}
.searchable-select-options[hidden] { display: none; }
.searchable-select-options [role="option"] { padding: 10px; border-radius: 4px; color: #173042; cursor: pointer; font-weight: 600; }
.searchable-select-options [role="option"]:hover,
.searchable-select-options [role="option"][aria-selected="true"] { background: #e8f4f8; outline: 2px solid transparent; }
.dynamic-selected-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dynamic-selected-items[hidden] { display: none; }
.dynamic-selected-items li { display: inline-flex; min-width: 0; align-items: center; gap: 6px; padding: 5px 6px 5px 9px; border: 1px solid #8eabb7; border-radius: 6px; background: #f3f8fa; color: #173042; font-size: 12px; font-weight: 700; }
.dynamic-selected-items li span { overflow-wrap: anywhere; }
.dynamic-selected-item-remove { display: inline-grid; width: 22px; height: 22px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #526672; cursor: pointer; font: inherit; line-height: 1; }
.dynamic-selected-item-remove:hover,
.dynamic-selected-item-remove:focus-visible { background: #dcebf0; color: #173042; outline: 2px solid #1776a8; outline-offset: 1px; }
.dynamic-relationship { align-content: start; }
.dynamic-relationship-status { min-height: 18px; margin: 0; color: #526672; font-size: 12px; font-weight: 600; }
.dynamic-relationship-options { display: grid; max-height: 240px; margin: 0; padding: 4px; overflow-y: auto; border: 1px solid #8eabb7; border-radius: 6px; background: #fff; box-shadow: 0 10px 24px rgba(15, 54, 73, 0.12); list-style: none; }
.dynamic-relationship-options[hidden] { display: none; }
.dynamic-relationship-options [role="option"] { display: grid; gap: 2px; padding: 10px; border-radius: 4px; color: #173042; cursor: pointer; }
.dynamic-relationship-options [role="option"]:hover,
.dynamic-relationship-options [role="option"][aria-selected="true"] { background: #e8f4f8; outline: 2px solid transparent; }
.dynamic-relationship-options [role="option"] strong,
.dynamic-relationship-options [role="option"] small { overflow-wrap: anywhere; }
.entity-table-wrap { overflow-x: auto; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }
.entity-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.entity-table th { position: relative; padding: 12px; border-bottom: 1px solid #c7d6dc; color: #526672; font-size: 13px; text-align: left; white-space: nowrap; }
.entity-table td { max-width: 260px; padding: 12px; border-bottom: 1px solid #e3ebee; overflow: hidden; text-overflow: ellipsis; vertical-align: top; white-space: nowrap; }
.entity-table tbody tr:last-child td { border-bottom: 0; }
.entity-table tbody tr:hover { background: #f7fbfc; }
.entity-table tbody tr.is-selected { background: #e7f4f8; box-shadow: inset 4px 0 0 var(--module-accent); }
.entity-table tbody tr.is-selected:hover { background: #deeff5; }
.entity-sort { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-weight: 700; }
.entity-sort:disabled { cursor: not-allowed; opacity: .6; }
.entity-sort-picker { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 6px; align-items: end; }
.entity-sort-picker > label { position: relative; display: block; min-width: 0; }
.entity-sort-picker select { width: 100%; padding-left: 38px; }
.entity-sort-picker-icon { position: absolute; z-index: 1; left: 12px; top: 50%; transform: translateY(-50%); color: var(--module-accent); font-size: 20px; line-height: 1; pointer-events: none; }
.entity-sort-direction { width: 42px; min-width: 42px; height: 42px; border: 1px solid #9cb8c7; border-radius: 6px; background: #fff; color: #0b526c; cursor: pointer; font-size: 21px; font-weight: 800; line-height: 1; }
.entity-sort-direction:hover:not(:disabled) { background: #e5f2f5; border-color: var(--module-accent); }
.entity-sort-direction:disabled { cursor: not-allowed; opacity: .48; }
.entity-row-action { text-align: right; }
.entity-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.entity-row-actions .button-primary,
.entity-row-actions .button-secondary,
.entity-row-actions .button-danger { min-height: 34px; padding: 6px 10px; white-space: nowrap; }
.entity-signature-action { border-color: #8b6400; color: #745300; }
.entity-signature-action:hover { background: #fff7dc; }

/* Galerias seguem a leitura horizontal do Power Apps: um registro por faixa,
   com os campos compactos e visíveis, em vez de uma tabela larga. */
.entity-gallery-panel .entity-table-wrap {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (min-width: 1440px) {
  .entity-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .entity-toolbar > label:first-child { grid-column: span 2; }
  .entity-filter-range { grid-column: span 2; }
}
.entity-gallery-panel .entity-table {
  display: block;
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.entity-gallery-panel .entity-table thead { display: none; }
.entity-gallery-panel .entity-table tbody { display: grid; gap: 8px; }
.entity-gallery-panel .entity-table tbody tr {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #c7d6dc;
  border-left: 4px solid #1776a8;
  border-radius: 6px;
  background: #fff;
}
.entity-gallery-panel .entity-table tbody tr:hover { background: #f7fbfc; }
.entity-gallery-panel .entity-table tbody tr.is-selected {
  border-left-color: var(--module-accent);
  background: #e7f4f8;
  box-shadow: none;
}
.entity-gallery-panel .entity-table td {
  display: grid;
  flex: 1 1 150px;
  min-width: 0;
  max-width: none;
  min-height: 54px;
  align-content: center;
  gap: 3px;
  padding: 7px 9px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid #e3ebee;
  color: #173042;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}
.entity-gallery-panel .entity-table td::before {
  color: #657983;
  content: attr(data-label);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
}
.entity-gallery-panel .entity-table td.entity-row-action {
  flex: 0 1 auto;
  margin-left: auto;
  min-width: max-content;
  padding: 7px;
  border-right: 0;
  background: #f7fbfc;
  text-align: right;
}
.entity-gallery-panel .entity-table td.entity-row-action::before { display: none; }
.entity-gallery-panel .entity-table .entity-row-actions { flex-wrap: wrap; }
.gallery-metric-clusters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.gallery-metric-cluster {
  display: grid;
  min-width: 0;
  min-height: 82px;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #c7d6dc;
  border-top: 4px solid var(--module-accent);
  border-radius: 6px;
  background: #f8fcfd;
}
.gallery-metric-cluster span { color: #526672; font-size: 11px; font-weight: 800; line-height: 1.2; }
.gallery-metric-cluster strong { color: #173042; font-size: 24px; line-height: 1; }
.gallery-metric-cluster.is-attachments { border-top-color: #176b9a; background: #eef7fb; }
.gallery-metric-cluster.is-pending { border-top-color: #c88712; background: #fff8e8; }
.gallery-metric-cluster.is-created { border-top-color: #5b7eb7; background: #f1f5ff; }
.gallery-metric-cluster.is-updated { border-top-color: #357d5f; background: #eef9f2; }
.lancamentos-gallery { display: grid; gap: 0; overflow: hidden; border: 1px solid #9eb4bf; background: #fff; }
.g1-operational-bar {
  display: grid;
  grid-template-columns: minmax(460px, 1.25fr) minmax(520px, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid #9fb6c2;
  background: #fff;
}
.g1-operational-actions { display: grid; grid-template-columns: repeat(5, minmax(88px, 1fr)); gap: 6px; }
.g1-action {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid #9fb6c2;
  border-radius: 4px;
  background: #eef3f6;
  color: #123a4d;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.g1-action span { display: grid; min-width: 28px; height: 28px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-weight: 800; }
.g1-action strong { font-size: 12px; line-height: 1.1; }
.g1-action.is-primary { border-color: #168a7e; background: #e5f5f2; color: #075d56; }
.g1-action:hover { background: #dce8ed; }
.g1-metrics {
  display: grid;
  width: 100%;
  max-width: 414px;
  grid-template-columns: minmax(0, 235px) minmax(0, 175px);
  gap: 0;
  justify-self: end;
  border: 1px solid #000;
  background: #fff;
}
.g1-value-metrics,
.g1-status-metrics { display: grid; grid-template-rows: repeat(5, minmax(19px, 1fr)); gap: 0; padding: 2px 5px; }
.g1-value-metrics { border-right: 3px solid #000; }
.g1-value-metric,
.g1-status-metric {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: #fff;
  color: #000;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}
.g1-value-metric span,
.g1-status-metric span { flex: 0 0 auto; color: inherit; font-size: inherit; font-weight: inherit; }
.g1-value-metric strong,
.g1-status-metric strong { min-width: 0; color: inherit; font-size: inherit; font-weight: inherit; overflow-wrap: anywhere; }
.g1-value-metric.is-commitment { color: #7fb239; }
.g1-value-metric.is-settled { color: #959595; }
.g1-value-metric.is-pending { color: #005e92; }
.g1-value-metric.is-all-total { color: #a80000; }
.g1-status-metric.is-committed { color: #dd4f0e; }
.g1-status-metric.is-settlement { color: #6d31a2; }
.g1-status-metric.is-delivery { color: #2771c2; }
.g1-status-metric.is-paid { color: #638b2c; }
.g1-field-visit-dialog { width: min(92vw, 720px); padding: 0; border: 1px solid #9fb6c2; border-radius: 6px; color: #173042; }
.g1-field-visit-dialog::backdrop { background: rgba(12, 39, 52, .62); }
.g1-field-visit-dialog form { display: grid; gap: 18px; padding: 22px; }
.g1-field-visit-dialog header,
.g1-field-visit-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.g1-field-visit-dialog h2 { margin: 3px 0 0; }
.g1-field-visit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.g1-field-visit-grid label { display: grid; gap: 6px; font-weight: 800; }
.g1-field-visit-grid input,
.g1-field-visit-grid select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #aec2ca; border-radius: 4px; background: #fff; }
.g1-settlement-dialog { width: min(94vw, 940px); }
.g1-settlement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.g1-settlement-grid label,
.g1-settlement-items-header label { display: grid; gap: 6px; font-weight: 800; }
.g1-settlement-grid input,
.g1-settlement-grid select,
.g1-settlement-items-header input { width: 100%; min-height: 40px; padding: 7px 9px; border: 1px solid #aec2ca; border-radius: 4px; background: #fff; }
.g1-settlement-grid select { min-height: 116px; }
.g1-settlement-items-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.g1-settlement-items-header > div { display: flex; gap: 7px; }
.g1-settlement-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; max-height: 230px; overflow: auto; padding: 10px; border: 1px solid #c7d5db; background: #f7fafb; }
.g1-settlement-items label { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 8px; border: 1px solid #d8e2e6; background: #fff; }
.g1-settlement-summary { min-height: 52px; padding: 12px; border-left: 4px solid #970000; background: #fddccf; font-weight: 800; }
.entity-toolbar.g1-filter-grid { grid-template-columns: minmax(210px, 1.4fr) repeat(5, minmax(130px, 1fr)); gap: 7px; padding: 8px; }
.entity-toolbar.g1-filter-grid > label,
.entity-toolbar.g1-filter-grid > fieldset,
.entity-toolbar.g1-filter-grid > .entity-sort-picker { margin: 0; }
.entity-toolbar.g1-filter-grid input,
.entity-toolbar.g1-filter-grid select { min-height: 36px; }
.notas-pendentes-gallery { display: grid; gap: 14px; }
.notas-pendentes-gallery .entity-table-wrap { border-top: 4px solid #a90808; }
.notas-pendentes-gallery tbody tr:hover { background: #fff8f0; }
.entity-gallery-attachment {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #173f7a;
  border-radius: 4px;
  background: #eef5ff;
  color: #123b77;
  cursor: pointer;
}
.entity-gallery-attachment[hidden] { display: none !important; }
.entity-gallery-attachment:hover { background: #dcecff; }
.entity-gallery-attachment img { width: 100%; height: 100%; object-fit: cover; }
.entity-gallery-file-icon { font-size: 11px; font-weight: 900; letter-spacing: 0; }
.entity-gallery-attachment-count { position: absolute; right: 2px; bottom: 1px; min-width: 14px; padding: 1px 3px; border-radius: 8px; background: #a90808; color: #fff; font-size: 10px; font-weight: 800; line-height: 1.1; }
.attachment-viewer {
  display: grid;
  width: min(94vw, 1440px);
  height: min(92vh, 920px);
  max-width: none;
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
  border: 1px solid #8fa8b4;
  border-radius: 6px;
  background: #fff;
  color: #102d3c;
  box-shadow: 0 22px 60px rgba(4, 22, 31, .34);
}
.attachment-viewer::backdrop { background: rgba(4, 22, 31, .72); }
.attachment-viewer-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  border-bottom: 1px solid #c8d7de;
  background: #fff;
}
.attachment-viewer-heading > div { min-width: 0; }
.attachment-viewer-heading .page-eyebrow { margin: 0 0 3px; color: #a31f1f; }
.attachment-viewer-heading h3 { margin: 0; overflow: hidden; color: #173042; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #dce5e9;
}
.attachment-preview-content {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-items: center;
  overflow: auto;
  background: #edf2f4;
}
.attachment-preview-content iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.attachment-preview-content img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.attachment-nav-button {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  width: 54px;
  min-width: 54px;
  height: 54px;
  place-items: center;
  padding: 0;
  border: 3px solid #a90808;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #a90808;
  box-shadow: 0 5px 16px rgba(16, 45, 60, .22);
  font-size: 30px;
  line-height: 1;
  transform: translateY(-50%);
}
.attachment-nav-button.is-previous { left: 14px; }
.attachment-nav-button.is-next { right: 14px; }
.attachment-nav-button:hover:not(:disabled) { background: #fff3f3; }
.attachment-nav-button:disabled { visibility: hidden; }
.attachment-viewer-footer {
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid #c8d7de;
  background: #fff;
}
.attachment-viewer-footer > span:first-child { flex: 0 0 auto; color: #526672; font-weight: 800; }
.attachment-viewer-upload { display: flex; min-width: 0; align-items: center; gap: 8px; margin-left: auto; }
.attachment-viewer-upload label { display: flex; min-width: 0; align-items: center; gap: 8px; font-weight: 800; }
.attachment-viewer-upload input[type="file"] { width: min(32vw, 330px); }
.attachment-viewer-upload [data-attachment-preview-upload-status] { max-width: 260px; color: #526672; font-size: 12px; }
.signature-dialog {
  width: min(94vw, 1080px);
  max-width: none;
  padding: 0;
  border: 1px solid #8fa8b4;
  border-radius: 6px;
  background: #fff;
  color: #102d3c;
  box-shadow: 0 22px 60px rgba(4, 22, 31, .34);
}
.signature-dialog::backdrop { background: rgba(4, 22, 31, .72); }
.signature-dialog-heading,
.signature-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.signature-dialog-heading { border-bottom: 1px solid #c8d7de; }
.signature-dialog-heading h2,
.signature-dialog-content h3 { margin: 0; }
.signature-dialog-content { display: grid; gap: 16px; padding: 16px; }
.signature-existing { display: grid; gap: 8px; }
.signature-existing img { display: block; width: 100%; max-height: 180px; object-fit: contain; border: 1px solid #c8d7de; background: #fff; }
.signature-empty { margin: 0; color: #526672; }
.signature-pad { display: grid; gap: 8px; }
.signature-pad canvas { display: block; width: 100%; height: auto; max-height: 38vh; border: 2px solid #7f9daa; border-radius: 4px; background: #fff; cursor: crosshair; touch-action: none; }
.signature-status { min-height: 22px; margin: 0; color: #a31f1f; font-weight: 700; }
.signature-dialog-actions { justify-content: flex-end; border-top: 1px solid #c8d7de; }

@media (max-width: 760px) {
  .attachment-viewer { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .attachment-viewer-heading { padding: 8px 10px; }
  .attachment-viewer-heading h3 { font-size: 14px; }
  .attachment-nav-button { width: 44px; min-width: 44px; height: 44px; font-size: 24px; }
  .attachment-nav-button.is-previous { left: 8px; }
  .attachment-nav-button.is-next { right: 8px; }
  .attachment-viewer-footer { align-items: stretch; flex-wrap: wrap; }
  .attachment-viewer-upload { width: 100%; align-items: stretch; flex-wrap: wrap; margin-left: 0; }
  .attachment-viewer-upload label { width: 100%; align-items: stretch; flex-direction: column; }
  .attachment-viewer-upload input[type="file"] { width: 100%; }
  .signature-dialog { width: 100vw; max-height: 100dvh; border: 0; border-radius: 0; }
  .signature-dialog-heading { align-items: flex-start; }
  .signature-dialog-content { padding: 12px; }
}
.entity-page.is-g1 { width: 100%; max-width: none; }
.g1-list-row {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: stretch;
  border: 0;
  border-bottom: 1px solid #a9c0cc;
  background: #fff;
  color: #102d3c;
}
.g1-list-row:nth-child(even) { background: #d5e8f4; }
.g1-list-row:last-child { border-bottom: 0; }
.g1-list-row.is-pending { box-shadow: inset 5px 0 #d39a14; }
.g1-list-row.is-done { box-shadow: inset 5px 0 #16805a; }
.g1-row-file {
  display: flex;
  flex: 0 0 112px;
  min-height: 176px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 10px 8px;
  border-right: 1px solid #a9c0cc;
  text-align: center;
}
.g1-row-attachment {
  width: 64px;
  height: 70px;
  border: 3px solid #113d82;
  border-radius: 0;
  background: #fff;
  color: #113d82;
}
.g1-row-attachment::after {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 15px;
  height: 15px;
  border-bottom: 3px solid #113d82;
  border-left: 3px solid #113d82;
  background: #d5e8f4;
  content: "";
}
.g1-row-attachment .entity-gallery-file-icon { font-size: 19px; }
.g1-row-attachment img { width: 100%; height: 100%; object-fit: cover; }
.g1-row-id { font-size: 17px; }
.g1-row-file > span { color: #c00; font-size: 12px; font-weight: 800; line-height: 1.3; }
.g1-row-main {
  display: flex;
  flex: 1 1 650px;
  min-width: 0;
  align-content: flex-start;
  flex-wrap: wrap;
  padding: 8px 12px;
}
.g1-row-title {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 5px;
  font-size: 15px;
}
.g1-row-title strong:last-child { margin-left: auto; text-align: right; }
.g1-row-flow { display: flex; width: 100%; min-width: 0; flex-wrap: wrap; gap: 5px 22px; }
.g1-row-financial,
.g1-row-history { display: flex; flex: 1 1 285px; min-width: 230px; align-content: flex-start; flex-wrap: wrap; gap: 1px 12px; }
.g1-row-financial p,
.g1-row-history p,
.g1-row-side p { min-width: min(100%, 170px); margin: 0; font-size: 13px; line-height: 1.4; }
.g1-row-financial p:first-child,
.g1-row-history p:first-child { flex-basis: 100%; }
.g1-row-financial span,
.g1-row-history span,
.g1-row-side span,
.g1-row-description span { font-weight: 800; }
.g1-row-financial .is-total { flex-basis: 100%; color: #d00; font-size: 14px; }
.g1-row-history .is-created,
.g1-row-history .is-modified { color: #970000; }
.g1-row-history .is-unchanged { flex-basis: 100%; color: #638b2c; }
.g1-approval {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  margin-top: 4px;
  padding: 3px 8px;
  border: 1px solid #aebdc4;
  background: #fff;
  color: #a90808;
  font-size: 14px;
}
.g1-approval.is-approved { color: #087c19; }
.g1-row-description { width: 100%; margin: 4px 0 0; color: #a43b16; font-size: 13px; line-height: 1.4; }
.g1-row-side {
  display: flex;
  flex: 1 1 290px;
  max-width: 390px;
  align-content: flex-start;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  text-align: right;
}
.g1-row-status { margin-bottom: 3px; color: #087c19; font-size: 15px; }
.g1-list-row.is-pending .g1-row-status { color: #9a6200; }
.g1-row-side .is-rms { color: #970000; }
.g1-row-side .is-purchase-date { color: #fa9b70; }
.g1-row-side .is-settlement-date { color: #27437d; }
.g1-row-side .is-payment-date { color: #36b04b; }
.g1-row-actions { display: flex; margin-top: auto; padding-top: 7px; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.g1-row-actions .button-primary,
.g1-row-actions .button-secondary { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.entity-page.is-screen10 { width: 100%; min-width: 0; max-width: none; overflow-x: hidden; }
.pedidos-gallery { overflow: hidden; border: 1px solid #a9c0cc; background: #fff; }
.pedidos-list-row {
  display: flex;
  min-width: 0;
  align-items: stretch;
  border-bottom: 1px solid #a9c0cc;
  background: #fff;
  color: #102d3c;
  box-shadow: inset 5px 0 #78909c;
}
.pedidos-list-row:nth-child(even) { background: #d5e8f4; }
.pedidos-list-row:last-child { border-bottom: 0; }
.pedidos-list-row.is-pending { box-shadow: inset 5px 0 #d39a14; }
.pedidos-list-row.is-approved { box-shadow: inset 5px 0 #16805a; }

.familias-list {
  border: 1px solid #abc3d0;
  background: #fff;
}

.familias-list-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) minmax(210px, auto);
  align-items: stretch;
  min-height: 96px;
  border-bottom: 1px solid #abc3d0;
  background: #fff;
  box-shadow: inset 5px 0 #b97816;
}

.familias-list-row:nth-child(even) { background: #eaf4f8; }
.familias-list-row:last-child { border-bottom: 0; }
.familias-list-row.is-active { box-shadow: inset 5px 0 #16805a; }
.familias-list-row.is-blocked { box-shadow: inset 5px 0 #b4232b; }

.familias-row-id,
.familias-row-content,
.familias-row-side {
  min-width: 0;
  padding: 12px;
}

.familias-row-id {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-right: 1px solid #c4d5de;
}

.familias-row-id span,
.familias-row-audit,
.familias-row-status { font-size: 12px; font-weight: 700; }
.familias-row-id strong { font-size: 18px; }

.familias-row-content {
  display: grid;
  align-content: center;
  gap: 10px;
}

.familias-row-primary {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr);
  gap: 10px 24px;
  font-size: 14px;
}

.familias-row-primary span,
.familias-row-audit span { min-width: 0; overflow-wrap: anywhere; }

.familias-row-audit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  color: #aa1f24;
}

.familias-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.familias-row-status { color: #087c19; }
.familias-list-row.is-blocked .familias-row-status { color: #b4232b; }

@media (max-width: 760px) {
  .familias-list-row { grid-template-columns: 62px minmax(0, 1fr); }
  .familias-row-primary { grid-template-columns: 1fr; }
  .familias-row-side {
    grid-column: 2;
    align-items: flex-start;
    padding-top: 0;
  }
}
.pedido-row-file { flex-basis: 112px; min-height: 158px; }
.pedido-row-main {
  display: flex;
  flex: 1 1 650px;
  min-width: 0;
  align-content: flex-start;
  flex-wrap: wrap;
  padding: 9px 12px;
}
.pedido-row-title {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 6px;
  font-size: 15px;
  line-height: 1.35;
}
.pedido-row-title strong,
.pedido-row-financial strong,
.pedido-row-history strong,
.pedido-row-side strong { max-width: 100%; overflow-wrap: anywhere; }
.pedido-audit-status { color: #087c19; text-align: right; }
.pedidos-list-row.is-pending .pedido-audit-status { color: #9a6200; }
.pedido-row-content { display: flex; width: 100%; min-width: 0; flex-wrap: wrap; gap: 5px 24px; }
.pedido-row-financial,
.pedido-row-history { display: flex; flex: 1 1 300px; min-width: 250px; align-content: flex-start; flex-wrap: wrap; gap: 2px 14px; }
.pedido-row-financial p,
.pedido-row-history p,
.pedido-row-side p { min-width: min(100%, 190px); margin: 0; font-size: 14px; line-height: 1.45; }
.pedido-row-financial span,
.pedido-row-history span,
.pedido-row-side span { font-weight: 800; }
.pedido-row-financial p:first-child,
.pedido-row-history .is-created,
.pedido-row-history .is-modified,
.pedido-row-history .is-unchanged,
.pedido-row-history .is-observation,
.pedido-row-history .is-fiscal-observation { flex-basis: 100%; }
.pedido-row-financial .is-total { color: #d00; font-size: 15px; }
.pedido-row-history .is-created,
.pedido-row-history .is-modified { color: #970000; }
.pedido-row-history .is-unchanged { color: #638b2c; }
.pedido-row-history .is-observation { color: #9a3c18; white-space: pre-line; }
.pedido-row-history .is-fiscal-observation { color: #5b397d; white-space: pre-line; }
.pedido-row-side {
  display: flex;
  flex: 0 1 285px;
  min-width: 230px;
  align-content: flex-start;
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  text-align: right;
}
.pedido-row-status { color: #9a6200; font-size: 15px; }
.pedidos-list-row.is-approved .pedido-row-status { color: #087c19; }
.pedido-row-side .is-audit-date { color: #27437d; }
.pedido-row-actions { display: flex; margin-top: auto; padding-top: 8px; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.pedido-row-actions .button-primary,
.pedido-row-actions .button-secondary { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.lancamentos-card {
  display: grid;
  gap: 8px;
  overflow: hidden;
  border: 1px solid #b9ccd3;
  border-left: 6px solid #7d98a5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(17, 55, 70, 0.06);
}
.lancamentos-gallery .lancamentos-card:nth-child(even) { background: #d1e3f1; }
.lancamentos-gallery .lancamentos-card:nth-child(odd) { background: #fff; }
.lancamentos-card.is-pending { border-left-color: #d39a14; background: #fffaf0; }
.lancamentos-card.is-done { border-left-color: #16805a; background: #f1fbf5; }
.lancamentos-card-head {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #dce7eb;
  background: #f7fbfc;
}
.lancamentos-card-head h2 { margin: 3px 0 0; color: #153a4c; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.lancamentos-id { color: #526672; font-size: 12px; font-weight: 700; }
.lancamentos-head-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.lancamentos-head-actions .button-secondary,
.lancamentos-head-actions .button-primary { min-height: 34px; padding: 6px 10px; }
.lancamentos-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid #b9ccd3;
  border-radius: 999px;
  background: #fff;
  color: #173042;
  font-size: 12px;
  font-weight: 800;
}
.lancamentos-card.is-pending .lancamentos-status { border-color: #e6bd5b; background: #fff3cf; color: #7b5200; }
.lancamentos-card.is-done .lancamentos-status { border-color: #9ed8b8; background: #e3f7ec; color: #14663d; }
.tarefas-card { border-top: 4px solid #5d8f2d; }
.tarefas-card.is-pending { border-top-color: #d59b16; }
.tarefas-card.is-critical { border-top-color: #b42318; }
.tarefas-card.is-critical .lancamentos-status { border-color: #e0a39d; background: #fff0ee; color: #9b1c13; }
.tarefas-card .lancamentos-primary-grid .lancamentos-field { background: #f0f8e9; }
.lancamentos-primary-grid,
.lancamentos-detail-grid {
  display: grid;
  gap: 1px;
  margin: 0 12px;
  border: 1px solid #c7d6dc;
  background: #c7d6dc;
}
.lancamentos-primary-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.lancamentos-detail-grid { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); margin-bottom: 12px; }
.lancamentos-field {
  display: grid;
  min-width: 0;
  min-height: 54px;
  align-content: center;
  gap: 5px;
  padding: 8px 9px;
  background: #fff;
}
.lancamentos-primary-grid .lancamentos-field { background: #edf8fa; }
.lancamentos-field.is-wide { grid-column: span 2; }
.lancamentos-field span { color: #526672; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.lancamentos-field strong { color: #173042; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.lancamentos-field.is-strong strong { color: #0b465c; font-size: 16px; }
.entity-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; color: #526672; font-weight: 700; }
.entity-loading,
.entity-empty { margin: 0; padding: 24px 0; color: #526672; line-height: 1.5; }
.dynamic-form { width: min(100%, 1000px); margin: 0 auto; }
.dynamic-form-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dynamic-form-heading h2 { margin: 0; color: #153a4c; font-size: 26px; }
.dynamic-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dynamic-check { display: flex; min-height: 42px; align-items: center; gap: 10px; padding: 10px; border: 1px solid #c7d6dc; border-radius: 6px; background: #fff; font-weight: 700; }
.dynamic-check input { width: 18px; height: 18px; }
.dynamic-form-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid #c7d6dc; }
.dynamic-form-errors { margin: 0 0 16px; color: #a31f1f; font-weight: 700; }
.dynamic-form-conflict { margin: 0 0 18px; padding: 16px; border: 1px solid #d59b16; background: #fff7d7; color: #503600; }
.dynamic-form-conflict strong { display: block; margin-bottom: 4px; color: #7a4b00; }
.dynamic-form-conflict p { margin: 0 0 12px; }
.dynamic-form-conflict dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0 0 14px; }
.dynamic-form-conflict dl div { min-width: 0; padding-top: 8px; border-top: 1px solid #e7c96e; }
.dynamic-form-conflict dt { font-size: 12px; font-weight: 700; color: #715a22; }
.dynamic-form-conflict dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.multi-entry-queue { display: grid; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid #c7d6dc; }
.multi-entry-queue [data-multi-entry-rows] { display: grid; gap: 10px; }
.multi-entry-row {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #b9ccd3;
  border-left: 4px solid #b9ccd3;
  border-radius: 6px;
  background: #f8fbfc;
}
.multi-entry-row header, .multi-entry-row footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.multi-entry-row header strong { color: #153a4c; font-size: 14px; }
.multi-entry-row header span { color: #526672; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.multi-entry-row footer { padding-top: 9px; border-top: 1px solid #d6e1e5; }
.multi-entry-row p { margin: 0; color: #526672; }
.multi-entry-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 14px; margin: 0; }
.multi-entry-fields div { min-width: 0; }
.multi-entry-fields dt { color: #667b85; font-size: 10px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }
.multi-entry-fields dd { margin: 3px 0 0; overflow-wrap: anywhere; color: #173042; font-size: 13px; font-weight: 700; }
.multi-entry-row.is-submitting { border-color: #1776a8; background: #eef8fc; }
.multi-entry-row.is-success { border-color: #16805a; background: #edf9f3; }
.multi-entry-row.is-error { border-color: #c7382d; background: #fff1ef; }
.item-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid #c7d6dc; border-left: 1px solid #c7d6dc; background: #fff; }
.item-field { display: grid; min-height: 92px; gap: 8px; padding: 16px; border-right: 1px solid #c7d6dc; border-bottom: 1px solid #c7d6dc; }
.item-field span { color: #526672; font-size: 13px; font-weight: 700; }
.item-field strong { overflow-wrap: anywhere; color: #173042; }
.item-activity { margin-top: 26px; padding-top: 20px; border-top: 1px solid #c7d6dc; }
.item-activity h2 { margin: 0; color: #153a4c; font-size: 20px; }
.item-activity p:last-child { color: #526672; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.access-tool { width: 100%; max-width: none; min-height: 100vh; padding: 32px; background: #edf2f3; color: #173042; }
.access-container { width: min(100%, 1440px); min-width: 0; margin: 0 auto; }
.access-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.access-heading h1,
.access-restricted-panel h1,
.access-panel-heading h2,
.access-editor h2,
.access-empty h2 { margin: 0; }
.access-eyebrow { margin: 0 0 8px; color: #245d70; font-weight: 700; text-transform: uppercase; }
.access-eyebrow.is-error { color: #a31f1f; }
.access-description { max-width: 660px; margin: 8px 0 0; }
.access-message { min-height: 24px; color: #166b42; }
.access-message.is-error { color: #a31f1f; }
.access-security { margin: 0 0 20px; padding: 16px; border: 1px solid #e8b04b; border-radius: 8px; background: #fff6dd; }
.access-security p { margin: 8px 0 0; }
.access-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(460px, 1.2fr); gap: 20px; align-items: start; }
.access-users-panel,
.access-editor { min-width: 0; padding: 20px; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }
.access-editor { overflow: auto; }
.access-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.access-panel-heading h2 { font-size: 20px; }
.access-panel-actions,
.access-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.access-editor-actions { gap: 12px; margin-top: 20px; }
.access-search-label { display: block; margin-top: 16px; font-weight: 700; }
.access-search,
.access-editor input:not([type="checkbox"]) { width: 100%; min-width: 0; margin-top: 6px; padding: 10px; border: 1px solid #aec2ca; border-radius: 6px; background: #fff; color: #173042; }
.access-table-wrap { overflow: auto; margin-top: 16px; }
.access-permissions-wrap { overflow: auto; margin-top: 22px; }
.access-table { width: 100%; border-collapse: collapse; }
.access-table th { padding: 8px; text-align: left; }
.access-table th:not(:first-child),
.access-permission-cell { text-align: center; }
.access-table td { padding: 10px 8px; border-top: 1px solid #e3ebee; }
.access-user-button { padding: 0; border: 0; background: transparent; color: #0b465c; cursor: pointer; font-weight: 700; text-align: left; }
.access-user-button small { font-weight: 400; }
.access-status-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-weight: 700; }
.access-status-badge.is-active { background: #d9f7df; color: #166b42; }
.access-status-badge.is-inactive { background: #ffe0df; color: #a31f1f; }
.access-empty { padding: 40px 24px; border: 1px dashed #9cb4be; border-radius: 8px; background: #f9fcfd; }
.access-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.access-editor-grid label { font-weight: 700; }
.access-current-status { margin: 10px 0; }
.access-current-status .access-status-badge { padding: 5px 9px; }
.access-module-name { font-weight: 700; }
.access-change-meta { margin: 18px 0 0; }
.access-status-control { padding: 11px 16px; border: 0; border-radius: 6px; color: #fff; cursor: pointer; font-weight: 700; }
.access-status-control.is-revoke { background: #b42318; }
.access-status-control.is-activate { background: #166b42; }
.access-status-hint { align-self: center; }
.access-restricted-panel { max-width: 760px; margin: 0 auto; padding: 28px; border: 1px solid #c7d6dc; border-radius: 8px; background: #fff; }

@media (max-width: 1080px) {
  .access-tool { min-width: 0; min-height: 0; padding: 0; }
  .access-grid { grid-template-columns: 1fr; }
  .entity-split-workspace { grid-template-columns: 1fr; }
  .supplies-workspace { grid-template-columns: 1fr; }
  .supplies-secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demands-workspace { grid-template-columns: 1fr; }
  .commercial-workspace { grid-template-columns: 1fr; }
  .hr-workspace { grid-template-columns: 1fr; }
  .property-workspace { grid-template-columns: 1fr; }
  .audit-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .dashboard-shortcuts,
  .module-entity-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .access-permissions-wrap { overflow: visible; }
  .access-permissions-wrap .access-table,
  .access-permissions-wrap tbody { display: block; width: 100%; }
  .access-permissions-wrap thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .access-permissions-wrap tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; padding: 13px 0; border-top: 1px solid #dce7eb; }
  .access-permissions-wrap tbody tr:first-child { border-top: 0; }
  .access-permissions-wrap td { padding: 3px 0; border: 0; }
  .access-permissions-wrap .access-module-name { grid-column: 1 / -1; }
  .access-permission-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
  .access-permission-cell::before { content: attr(data-label); font-size: 13px; font-weight: 700; }
}

@media (max-width: 760px) {
  .g1-operational-bar { grid-template-columns: 1fr; }
  .g1-operational-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g1-metrics { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); justify-self: stretch; }
  .g1-value-metric,
  .g1-status-metric { font-size: 10px; }
  .g1-field-visit-grid { grid-template-columns: 1fr; }
  .g1-settlement-grid,
  .g1-settlement-items,
  .g1-settlement-items-header { grid-template-columns: 1fr; }
  .entity-toolbar.g1-filter-grid { grid-template-columns: 1fr; }
  .portal-frame { grid-template-columns: 1fr; }
  .portal-identity {
    min-height: 246px;
    gap: 28px;
    padding: 32px 28px;
  }
  .portal-identity::before { top: auto; bottom: 16px; }
  .portal-identity::after { display: none; }
  .portal-identity-bottom { grid-template-columns: minmax(0, 1fr) minmax(88px, 108px); gap: 14px; }
  .portal-identity-title { max-width: none; font-size: 24px; }
  .portal-login { width: 100%; padding: 40px 28px 56px; }
  .portal-login h1 { font-size: 32px; }
  .supplies-paired-grid, .supplies-secondary-grid { grid-template-columns: 1fr; }
  .demands-workspace { grid-template-columns: 1fr; }

  .admin-shell,
  .admin-shell.is-sidebar-collapsed { display: block; }
  .admin-sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); height: 100vh; transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 10px 0 26px rgba(16, 55, 70, 0.16); }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-sidebar-collapse { display: none; }
  .admin-brand { padding: 20px; }
  .admin-brand-logo { display: block; }
  .admin-brand-logo-compact { display: none; }
  .admin-drawer-backdrop {
    position: fixed;
    z-index: 19;
    inset: 0;
    border: 0;
    background: rgba(10, 34, 45, 0.46);
  }
  .admin-shell.is-drawer-open .admin-drawer-backdrop { display: block; }
  .admin-drawer-close,
  .admin-menu-button { display: inline-grid; width: 38px; height: 38px; place-items: center; }
  .admin-topbar { min-height: 62px; padding: 10px 18px; }
  .admin-account-name { display: none; }
  .admin-content { min-height: calc(100vh - 62px); padding: 24px 18px 42px; }
  .powerapps-home-canvas { aspect-ratio: 1366 / 405; background-position: top center; }
  .powerapps-home-canvas .powerapps-home-tile,
  .powerapps-home-canvas .powerapps-home-quick-action { display: none; }
  .powerapps-home-brand { width: 32%; height: 28%; }
  .powerapps-home-brand img { width: 100%; height: 100%; }
  .powerapps-home-mobile-menu,
  .powerapps-home-mobile-tools { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
  .powerapps-home-mobile-menu a,
  .powerapps-home-mobile-tools a,
  .powerapps-home-mobile-tools button {
    display: grid;
    min-height: 64px;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding: 6px 14px;
    border: 1px solid #b8cbd2;
    border-radius: 5px;
    background: #fff;
    color: #173042;
    cursor: pointer;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    width: 100%;
  }
  .powerapps-home-mobile-menu img,
  .powerapps-home-mobile-tools img { display: block; width: 52px; height: 52px; object-fit: contain; }
  .powerapps-home-mobile-menu span,
  .powerapps-home-mobile-tools span { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
  .powerapps-home-mobile-tools::before { margin-top: 14px; color: #153a4c; content: "Atalhos"; font-size: 19px; font-weight: 700; }
  .powerapps-home-report-layer { padding: 10px; }
  .powerapps-home-report { max-height: calc(100vh - 20px); }
  .powerapps-home-report > header { align-items: stretch; flex-direction: column; gap: 9px; }
  .powerapps-home-report-actions { width: 100%; }
  .powerapps-home-report-actions .button-secondary { flex: 1 1 0; }
  .powerapps-home-report-content { padding: 16px; }
  .dashboard-metric-row-middle,
  .dashboard-metric-row-bottom { grid-template-columns: 1fr; }
  .dashboard-metric-group[data-metric-group] > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-metric-group[data-metric-group="documentos"] > div,
  .dashboard-metric-group[data-metric-group="obras-rh"] > div { grid-template-columns: 1fr; }
  .dashboard-heading,
  .module-heading { align-items: start; flex-direction: column; margin-bottom: 22px; }
  .dashboard-heading h1,
  .module-heading h1 { font-size: 28px; }
  .dashboard-metrics,
  .dashboard-columns,
  .dashboard-shortcuts,
  .module-entity-list { grid-template-columns: 1fr; }
  .dashboard-metric { min-height: 92px; }
  .entity-heading,
  .dynamic-form-heading { flex-direction: column; }
  .entity-heading h1 { font-size: 28px; }
  .entity-view-switch { width: 100%; }
  .entity-view-command { width: 100%; }
  .entity-toolbar,
  .dynamic-form-grid,
  .item-fields { grid-template-columns: 1fr; }
  .entity-filter-range { grid-template-columns: 1fr; }
  .entity-form-panel,
  .entity-gallery-panel { padding: 16px; }
  .g1-row-file { flex-basis: 86px; min-height: 138px; }
  .g1-row-attachment { width: 54px; height: 60px; }
  .g1-row-main { flex-basis: calc(100% - 86px); padding-right: 8px; }
  .g1-row-side { flex-basis: 100%; max-width: none; align-items: flex-start; padding-left: 98px; text-align: left; }
  .pedidos-list-row { flex-wrap: wrap; }
  .pedido-row-file { flex-basis: 86px; min-height: 138px; }
  .pedido-row-main { width: 100%; max-width: 100%; flex: 1 1 100%; padding-right: 8px; overflow: hidden; }
  .pedido-row-title { flex-direction: column; gap: 3px; }
  .pedido-audit-status { text-align: left; }
  .pedido-row-financial,
  .pedido-row-history { min-width: 100%; }
  .pedido-row-side { flex-basis: 100%; min-width: 0; align-items: flex-start; padding-left: 98px; text-align: left; }
  .pedido-row-actions { margin-top: 6px; justify-content: flex-start; }
  .g1-row-actions { margin-top: 6px; justify-content: flex-start; }
  .lancamentos-card-head { flex-direction: column; }
  .lancamentos-head-actions { width: 100%; justify-content: flex-start; }
  .lancamentos-head-actions .entity-row-actions { flex-wrap: wrap; width: 100%; justify-content: flex-start; }
  .lancamentos-primary-grid,
  .lancamentos-detail-grid { grid-template-columns: 1fr; margin-inline: 12px; }
  .lancamentos-field.is-wide { grid-column: auto; }
  .multi-entry-row footer { align-items: flex-start; flex-direction: column; }
  .entity-pagination { flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .entity-pagination > span { line-height: 1.4; }
  .entity-pagination > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .entity-pagination > div > span { display: grid; grid-column: 1 / -1; min-height: 38px; place-items: center; order: -1; }
  .entity-table { min-width: 620px; }
  .access-tool { padding: 24px 18px 42px; }
  .access-grid,
  .access-editor-grid { grid-template-columns: 1fr; }
}

/* Operational reports */
.reports-page {
  display: grid;
  gap: 20px;
}

.reports-heading,
.reports-actions,
.reports-controls,
.report-metrics {
  display: flex;
  align-items: end;
  gap: 12px;
}

.reports-heading {
  align-items: flex-start;
  justify-content: space-between;
}

.reports-heading h1 {
  margin: 0;
}

.reports-heading p:not(.page-eyebrow) {
  margin: 6px 0 0;
  color: #52677f;
}

.reports-controls {
  flex-wrap: wrap;
  padding: 18px;
  border: 1px solid #cddce9;
  border-radius: 8px;
  background: #fff;
}

.reports-controls label {
  display: grid;
  flex: 1 1 150px;
  gap: 6px;
  min-width: 0;
  color: #092f53;
  font-weight: 700;
}

.reports-controls .report-source-field {
  flex-basis: 250px;
}

.reports-controls input,
.reports-controls select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #b9cddd;
  border-radius: 6px;
  background: #fff;
  color: #102f4d;
  font: inherit;
}

.reports-controls :disabled {
  color: #6d7c89;
  background: #eef3f6;
  cursor: not-allowed;
}

.reports-clear {
  min-height: 44px;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.report-metrics article {
  display: grid;
  gap: 8px;
  min-height: 90px;
  padding: 16px;
  border-left: 4px solid #146a96;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 48, 78, 0.08);
}

.report-metrics article.is-pending {
  border-left-color: #d28b00;
  background: #fff9e8;
}

.report-metrics article.is-finalized {
  border-left-color: #16814a;
  background: #eefbf3;
}

.report-metrics span {
  color: #5b6f83;
  font-size: 0.86rem;
  font-weight: 700;
}

.report-metrics strong {
  color: #062e54;
  font-size: 1.8rem;
}

.report-table-wrap {
  overflow-x: auto;
  border: 1px solid #cddce9;
  border-radius: 8px;
  background: #fff;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th,
.report-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #dbe5ed;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.report-table th {
  background: #0b4f79;
  color: #fff;
  font-size: 0.85rem;
}

.report-table tbody tr:hover {
  background: #f1f8fc;
}

.report-empty,
.reports-empty,
.reports-loading,
.reports-warning {
  padding: 22px;
  border: 1px dashed #a9bfd0;
  border-radius: 8px;
  color: #52677f;
  text-align: center;
}

.reports-warning {
  border-color: #e0aa3e;
  background: #fff9e8;
  color: #704e09;
}

.reports-progress {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid #9bc5d5;
  border-radius: 8px;
  background: #eef8fb;
  color: #153a4c;
  font-weight: 700;
}

.reports-progress progress {
  width: 100%;
  height: 12px;
  accent-color: #0b6d8b;
}

.reports-partial {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #e0aa3e;
  border-left: 5px solid #b96b00;
  border-radius: 6px;
  background: #fff7df;
  color: #704e09;
  font-weight: 700;
  line-height: 1.45;
}

.report-print-dataset {
  display: none;
}

/* Analytics */
.analytics-hub {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #cddce9;
  border-radius: 8px;
  background: #f7fafc;
}

.analytics-hub .reports-heading { margin: 0; }
.analytics-hub h2,
.analytics-diagnostics h2,
.analytics-table h2,
.analytics-chart h3 { margin: 0; color: #153a4c; }
.analytics-hub h2,
.analytics-diagnostics h2,
.analytics-table h2 { font-size: 1.15rem; }

.analytics-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.analytics-hub-card {
  --panel-accent: #176b9a;
  display: flex;
  min-width: 0;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #c7d6dc;
  border-left: 4px solid var(--panel-accent);
  border-radius: 6px;
  background: #fff;
  color: #173042;
  text-decoration: none;
}

.analytics-hub-card:nth-child(6n + 1) { --panel-accent: #167452; }
.analytics-hub-card:nth-child(6n + 2) { --panel-accent: #4655a2; }
.analytics-hub-card:nth-child(6n + 3) { --panel-accent: #ad4e32; }
.analytics-hub-card:nth-child(6n + 4) { --panel-accent: #b66a00; }
.analytics-hub-card:nth-child(6n + 5) { --panel-accent: #526f7a; }
.analytics-hub-card:nth-child(6n + 6) { --panel-accent: #983e57; }
.analytics-hub-card:hover { border-color: var(--panel-accent); background: #f7fbfc; }
.analytics-hub-card:focus-visible { outline: 3px solid #e8b04b; outline-offset: 2px; }
.analytics-hub-card > span:first-child { display: grid; min-width: 0; gap: 6px; }
.analytics-hub-card strong { overflow-wrap: anywhere; }
.analytics-hub-card small { color: #5b6f83; font-weight: 700; }
.analytics-hub-card > span:last-child { color: var(--panel-accent); font-size: 1.5rem; }

.analytics-diagnostics {
  display: grid;
  gap: 12px;
}

.analytics-diagnostics ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-diagnostic {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #c7d6dc;
  border-left: 4px solid #16814a;
  border-radius: 6px;
  background: #f3fbf6;
}

.analytics-diagnostic.is-partial { border-left-color: #b96b00; background: #fff7df; }
.analytics-diagnostic.is-forbidden,
.analytics-diagnostic.is-error { border-left-color: #a42c2c; background: #fff0f0; }
.analytics-diagnostic.is-missing,
.analytics-diagnostic.is-unknown,
.analytics-diagnostic.is-invalid { border-left-color: #526f7a; background: #f1f5f6; }
.analytics-diagnostic span,
.analytics-diagnostic small { overflow-wrap: anywhere; color: #52677f; }

.analytics-kpis {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}

.analytics-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-chart {
  --chart-accent: #176b9a;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.analytics-chart:nth-child(3n + 2) { --chart-accent: #167452; }
.analytics-chart:nth-child(3n + 3) { --chart-accent: #b66a00; }
.analytics-chart h3 { font-size: 1rem; }
.analytics-chart svg { width: 100%; height: auto; }
.analytics-chart svg text { fill: #314b61; font-family: Arial, Helvetica, sans-serif; font-size: 13px; }
.analytics-chart svg line { stroke: #a9bfd0; stroke-width: 1px; }
.analytics-chart svg rect { fill: var(--chart-accent); }
.analytics-chart svg path { stroke: var(--chart-accent); stroke-width: 4px; }
.analytics-chart svg circle { fill: #fff; stroke: var(--chart-accent); stroke-width: 4px; }
.analytics-chart g[role="button"]:focus-visible circle { stroke: #e8b04b; stroke-width: 6px; }

.analytics-table { display: grid; gap: 14px; }

@media (max-width: 900px) {
  .report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-charts { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .reports-heading {
    display: grid;
  }

  .reports-actions,
  .reports-actions button,
  .reports-controls label,
  .reports-clear {
    width: 100%;
  }

  .report-metrics {
    grid-template-columns: 1fr;
  }

  .analytics-hub-grid,
  .analytics-diagnostics ul,
  .analytics-kpis {
    grid-template-columns: 1fr;
  }
}

@media print {
  .admin-sidebar,
  .admin-topbar,
  .reports-actions,
  .reports-controls {
    display: none !important;
  }

  .admin-workspace,
  .admin-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  .report-table-wrap {
    overflow: visible;
    border: 0;
  }

  .report-table th,
  .report-table td {
    white-space: normal;
  }

  .report-screen-table {
    display: none;
  }

  .entity-pagination {
    display: none;
  }

  .report-print-dataset {
    display: block;
  }
}

/* Unified corporate ticket view */
.ticket-view-page {
  display: grid;
  gap: 18px;
  width: min(100%, 1120px);
  margin: 0 auto;
  letter-spacing: 0;
}

.ticket-view-heading,
.ticket-conversation-heading,
.ticket-header-actions,
.ticket-message-meta,
.ticket-message-actions,
.ticket-attachment,
.ticket-attachment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticket-view-heading,
.ticket-conversation-heading {
  justify-content: space-between;
}

.ticket-view-heading h1,
.ticket-conversation-heading h2 {
  margin: 0;
  color: #062e54;
}

.ticket-view-heading h1 { margin-top: 7px; font-size: 32px; }
.ticket-back { display: inline-flex; margin-bottom: 16px; }
.ticket-header-actions { align-self: flex-end; flex-wrap: wrap; }

.ticket-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid #c9d9e3;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.ticket-summary div {
  min-width: 0;
  padding: 15px 16px;
  border-left: 1px solid #dce7ed;
}

.ticket-summary div:first-child { border-left: 0; }
.ticket-summary dt { color: #5a6f7f; font-size: 13px; font-weight: 700; }
.ticket-summary dd { margin: 6px 0 0; color: #102f4d; font-weight: 700; overflow-wrap: anywhere; }
.ticket-status { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e5f7ec; color: #12683e; }

.ticket-conversation {
  border: 1px solid #c9d9e3;
  border-radius: 8px;
  background: #edf5f1;
  overflow: hidden;
}

.ticket-conversation-heading {
  padding: 16px 18px;
  border-bottom: 1px solid #cfddd7;
  background: #0b5362;
  color: #fff;
}

.ticket-conversation-heading .page-eyebrow,
.ticket-conversation-heading h2 { color: #fff; }
.ticket-conversation-heading span { font-size: 13px; font-weight: 700; }

.ticket-message-list {
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 20px;
}

.ticket-message {
  width: min(78%, 720px);
  padding: 13px 14px;
  border: 1px solid;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(18, 59, 70, 0.08);
}

.ticket-message.is-customer {
  justify-self: start;
  border-color: #a9dab8;
  background: #dff4e5;
}

.ticket-message.is-company {
  justify-self: end;
  border-color: #c9d9e3;
  background: #fff;
}

.ticket-message-meta { justify-content: space-between; align-items: flex-start; color: #195f53; font-size: 12px; }
.ticket-message-meta span { color: #5c6f78; text-align: right; }
.ticket-message-body { margin: 10px 0 0; color: #173042; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-message-actions { justify-content: flex-end; margin-top: 10px; border-top: 1px solid rgba(103, 135, 143, 0.22); padding-top: 8px; }
.button-link { padding: 3px; border: 0; background: transparent; color: #0b5f82; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.button-link.is-danger { color: #a31f1f; }

.ticket-attachments { display: grid; gap: 8px; margin-top: 12px; }
.ticket-attachment { justify-content: space-between; padding: 9px 10px; border: 1px solid #c8d8df; border-radius: 6px; background: rgba(255, 255, 255, 0.78); }
.ticket-attachment > span:first-child { display: grid; min-width: 0; }
.ticket-attachment strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-attachment small { color: #61747d; }
.ticket-attachment-actions { flex: 0 0 auto; }
.ticket-attachment-actions button { min-height: 34px; padding: 6px 9px; }
.ticket-attachment-error { margin: 10px 0 0; color: #a31f1f; font-size: 13px; }
.ticket-empty { margin: auto; padding: 36px 16px; color: #52677f; text-align: center; }

@media (max-width: 900px) {
  .ticket-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket-summary div:nth-child(3) { border-left: 0; border-top: 1px solid #dce7ed; }
  .ticket-summary div:nth-child(4) { border-top: 1px solid #dce7ed; }
}

@media (max-width: 640px) {
  .ticket-view-heading { align-items: stretch; flex-direction: column; }
  .ticket-header-actions { align-self: stretch; }
  .ticket-header-actions > * { flex: 1 1 auto; }
  .ticket-summary { grid-template-columns: 1fr; }
  .ticket-summary div { border-top: 1px solid #dce7ed; border-left: 0; }
  .ticket-summary div:first-child { border-top: 0; }
  .ticket-message-list { padding: 13px; }
  .ticket-message { width: 92%; }
  .ticket-message-meta,
  .ticket-attachment { align-items: stretch; flex-direction: column; }
  .ticket-message-meta span { text-align: left; }
  .ticket-attachment-actions button { flex: 1 1 auto; }
}
