@font-face {
  font-family: "ERS Intro";
  src: url("/assets/Intro-Bold-Alt.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

/* Central ERS — implementação do design system corporativo. */
.portal-frame {
  --ers-ink: #171717;
  --ers-charcoal: #333132;
  --ers-charcoal-2: #454141;
  --ers-orange: #f58345;
  --ers-orange-dark: #ce551e;
  --ers-orange-soft: #fff1e8;
  --ers-turquoise: #1cbbb4;
  --ers-turquoise-soft: #e4f7f6;
  --ers-paper: #f5f4f1;
  --ers-surface: #fff;
  --ers-line: #dedbd5;
  --ers-muted: #74706c;
  min-height: 100vh;
  background: linear-gradient(90deg, rgb(51 49 50 / 3%) 1px, transparent 1px) 0 0 / 120px 100%, var(--ers-paper);
  color: var(--ers-ink);
  font-family: Aptos, "Segoe UI", Arial, sans-serif;
}

:root[data-theme="dark"] .portal-frame {
  --ers-ink: #f4f2ee;
  --ers-charcoal: #191817;
  --ers-charcoal-2: #2b2929;
  --ers-paper: #201f1e;
  --ers-surface: #292726;
  --ers-line: #494642;
  --ers-muted: #b5afaa;
  background: #201f1e;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  min-height: 72px;
  padding: 0 clamp(22px, 3.1vw, 58px);
  border-bottom: 1px solid var(--ers-line);
  background: color-mix(in srgb, var(--ers-surface) 94%, transparent);
  backdrop-filter: blur(16px);
}

.portal-brand {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ers-ink);
  text-align: left;
}

.portal-brand-mark {
  display: grid;
  place-items: center;
  width: 49px;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--ers-line);
  border-radius: 4px;
  background: #fff;
}

.portal-brand-mark img { width: 43px; height: 29px; object-fit: contain; }
.portal-brand strong, .portal-brand small, .portal-user-copy strong, .portal-user-copy small { display: block; }
.portal-brand strong { color: var(--ers-ink); font-size: 14px; letter-spacing: -.015em; }
.portal-brand small { margin-top: 1px; color: var(--ers-muted); font-size: 10px; letter-spacing: .04em; }
.portal-topbar-title { color: var(--ers-charcoal-2); font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
:root[data-theme="dark"] .portal-topbar-title { color: #d4cfca; }

.portal-user { display: flex; align-items: center; justify-self: end; gap: 10px; }
.portal-user-copy { min-width: 0; line-height: 1.2; text-align: left; }
.portal-user-copy strong { max-width: 180px; overflow: hidden; color: var(--ers-ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.portal-user-copy small { margin-top: 2px; color: var(--ers-muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.portal-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; background: var(--ers-charcoal); color: #fff; font-size: 12px; font-weight: 800; }
.portal-user-divider { width: 1px; height: 24px; margin: 0 3px; background: var(--ers-line); }
.portal-action { min-height: 34px; border: 1px solid var(--ers-line); border-radius: 4px; padding: 0 12px; background: transparent; color: var(--ers-muted); font-size: 11px; font-weight: 700; transition: border-color 160ms ease, color 160ms ease, background 160ms ease; }
.portal-action:hover { border-color: var(--ers-charcoal-2); color: var(--ers-ink); }
.portal-logout:hover { border-color: var(--ers-orange); background: var(--ers-orange-soft); color: var(--ers-orange-dark); }

.portal-content { width: 100%; margin: 0; padding: clamp(26px, 3.2vw, 52px) clamp(22px, 3.1vw, 58px) 72px; }
.portal-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; min-height: 288px; overflow: hidden; border-radius: 6px; background: var(--ers-charcoal); color: #fff; }
.portal-hero::before { position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: var(--ers-orange); content: ""; }
.portal-hero::after { position: absolute; top: -170px; right: 12%; width: 420px; height: 420px; border: 1px solid rgb(255 255 255 / 7%); border-radius: 50%; content: ""; }
.portal-hero-copy { position: relative; z-index: 2; align-self: end; padding: clamp(38px, 5vw, 72px); }
.portal-hero h1 { max-width: 900px; margin: 5px 0 14px; color: #fff; font-family: "ERS Intro", Aptos, "Segoe UI", sans-serif; font-size: clamp(44px, 5vw, 76px); font-weight: 700; letter-spacing: -.035em; line-height: .98; }
.portal-hero p:not(.portal-kicker) { max-width: 620px; margin: 0; color: #c5c0bd; font-size: 15px; }
.portal-kicker { margin: 0 0 8px; color: var(--ers-orange-dark); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.portal-hero .portal-kicker { color: var(--ers-orange); }
.portal-hero-side { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; min-width: clamp(260px, 25vw, 410px); padding: 46px 48px 42px; border-left: 1px solid rgb(255 255 255 / 10%); }
.portal-ai-entry { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 12px; width: min(350px, 100%); min-height: 62px; margin-top: 26px; border: 1px solid #fff; border-radius: 7px; padding: 10px 13px; background: #fff; color: #173e37; text-align: left; box-shadow: 0 15px 34px rgb(0 0 0 / 18%); transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.portal-ai-entry:hover { background: #f2fbf9; box-shadow: 0 18px 40px rgb(0 0 0 / 24%); transform: translateY(-2px); }
.portal-ai-entry:focus-visible { outline: 3px solid rgb(28 187 180 / 45%); outline-offset: 3px; }
.portal-ai-entry-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; background: #e4f7f6; color: #157f7a; }
.portal-ai-entry > span:nth-child(2) { display: grid; gap: 1px; }
.portal-ai-entry small { color: #74706c; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.portal-ai-entry strong { color: #173e37; font-size: 13px; font-weight: 800; }
.portal-ai-entry svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.portal-ai-entry .portal-ai-entry-icon svg { width: 18px; height: 18px; }
.portal-brand-motion { position: relative; width: 116px; height: 56px; }
.portal-brand-motion i { position: absolute; top: 11px; width: 36px; height: 36px; border: 2px solid var(--ers-orange); transform: rotate(45deg); animation: portal-mark-float 6s ease-in-out infinite; }
.portal-brand-motion i:nth-child(1) { left: 8px; }
.portal-brand-motion i:nth-child(2) { left: 36px; animation-delay: -2s; }
.portal-brand-motion i:nth-child(3) { left: 64px; animation-delay: -4s; }
@keyframes portal-mark-float { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(-6px) rotate(45deg); } }
.portal-access-summary { display: flex; align-items: baseline; gap: 13px; color: #fff; }
.portal-access-summary strong { font-family: "ERS Intro", Aptos, sans-serif; font-size: 35px; line-height: 1; }
.portal-access-summary span { max-width: 95px; color: #b9b3af; font-size: 10px; line-height: 1.35; text-transform: uppercase; }

.portal-section { margin-top: 42px; }
.portal-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--ers-line); }
.portal-section-head h2 { margin: 0; color: var(--ers-ink); font-family: "ERS Intro", Aptos, "Segoe UI", sans-serif; font-size: 27px; letter-spacing: -.025em; }
.portal-section-actions { display: flex; align-items: center; gap: 14px; }
.portal-section-actions > span { color: var(--ers-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.portal-view-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--ers-line); border-radius: 5px; background: var(--ers-surface); }
.portal-view-switch button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; border: 0; border-radius: 3px; padding: 0 10px; background: transparent; color: var(--ers-muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.portal-view-switch button[aria-pressed="true"] { background: var(--ers-charcoal); color: #fff; }
.portal-view-switch svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.portal-system-groups { display: grid; gap: 30px; }
.portal-category-block { min-width: 0; }
.portal-category-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 10px; }
.portal-category-head h3 { margin: 0; color: var(--ers-charcoal-2); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.portal-category-head span { color: var(--ers-muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.portal-system-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.portal-system-card { position: relative; min-height: 258px; display: flex; flex-direction: column; overflow: hidden; padding: 23px 22px 20px; border: 1px solid var(--ers-line); border-radius: 5px; background: var(--ers-surface); color: var(--ers-ink); text-decoration: none; box-shadow: 0 2px 0 rgb(23 23 23 / 2%); animation: portal-card-enter 420ms both; animation-delay: calc(var(--portal-card-order, 0) * 35ms); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.portal-system-card::before { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--ers-orange); transform: scaleX(0); transform-origin: left; transition: transform 220ms ease; content: ""; }
.portal-system-card:hover { z-index: 1; border-color: #c9c4bd; box-shadow: 0 14px 34px rgb(51 49 50 / 9%); transform: translateY(-3px); }
.portal-system-card:hover::before { transform: scaleX(1); }
@keyframes portal-card-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.portal-system-number { position: absolute; top: 20px; right: 21px; color: #aaa49e; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.portal-system-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 25px; border: 1px solid #baeae8; border-radius: 4px; background: var(--ers-turquoise-soft); color: #157f7a; }
.portal-system-icon svg, .portal-admin-icon svg, .portal-empty-icon svg, .portal-system-open svg, .portal-admin-callout .button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.portal-system-category { margin-bottom: 5px; color: var(--ers-muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.portal-system-name { color: var(--ers-ink); font-family: "ERS Intro", Aptos, "Segoe UI", sans-serif; font-size: 20px; letter-spacing: -.018em; }
.portal-system-card > p { margin: 8px 0 18px; color: var(--ers-muted); font-size: 12px; line-height: 1.55; }
.portal-system-open { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--ers-line); color: var(--ers-charcoal-2); font-size: 11px; font-weight: 750; }
:root[data-theme="dark"] .portal-system-open { color: #e6e0db; }
.portal-system-open svg { width: 16px; height: 16px; color: var(--ers-orange-dark); transition: transform 180ms ease; }
.portal-system-card:hover .portal-system-open svg { transform: translateX(4px); }
.portal-system-status { align-self: flex-start; margin: -7px 0 13px; padding: 4px 7px; border: 1px solid #dfbe83; border-radius: 3px; background: #fff8ea; color: #8b5c12; font-size: 8px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.portal-system-card-featured { min-height: 210px; border-color: color-mix(in srgb, var(--ers-orange) 45%, var(--ers-line)); background: linear-gradient(115deg, var(--ers-surface) 0 72%, var(--ers-orange-soft)); }
.portal-system-card-featured .portal-system-icon { border-color: #ead7b9; background: #f5ecdf; color: #9a6f34; }

.portal-system-groups.is-list { gap: 24px; }
.portal-system-groups.is-list .portal-system-grid { grid-template-columns: 1fr; gap: 7px; }
.portal-system-groups.is-list .portal-system-card { display: grid; grid-template-columns: 44px minmax(170px, .7fr) minmax(240px, 1.3fr) auto; align-items: center; gap: 18px; min-height: 76px; padding: 14px 17px; }
.portal-system-groups.is-list .portal-system-icon { grid-column: 1; grid-row: 1 / 3; width: 40px; height: 40px; margin: 0; }
.portal-system-groups.is-list .portal-system-category { grid-column: 2; grid-row: 1; align-self: end; margin: 0; }
.portal-system-groups.is-list .portal-system-name { grid-column: 2; grid-row: 2; align-self: start; font-size: 17px; }
.portal-system-groups.is-list .portal-system-card > p { grid-column: 3; grid-row: 1 / 3; margin: 0; }
.portal-system-groups.is-list .portal-system-status { grid-column: 4; grid-row: 1; justify-self: end; margin: 0; }
.portal-system-groups.is-list .portal-system-open { grid-column: 4; grid-row: 1 / 3; min-width: 132px; margin: 0; padding: 0 0 0 18px; border-top: 0; border-left: 1px solid var(--ers-line); }
.portal-system-groups.is-list .portal-system-card:has(.portal-system-status) .portal-system-open { grid-row: 2; }
.portal-system-groups.is-list .portal-system-number { display: none; }
.portal-system-groups.is-list .portal-system-card-featured { min-height: 82px; }

/* Assistente ERS: uma única linha para escrever, sem painel ou conteúdo auxiliar. */
.portal-ai-quick {
  position: fixed;
  right: clamp(18px, 2.2vw, 30px);
  bottom: clamp(18px, 2.2vw, 28px);
  z-index: 35;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  width: min(340px, calc(100vw - 36px));
  min-height: 54px;
  border: 1px solid rgb(23 62 55 / 10%);
  border-radius: 14px;
  padding: 7px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 14px 38px rgb(34 70 66 / 13%);
  backdrop-filter: blur(18px) saturate(1.15);
  animation: portal-ai-arrive 520ms cubic-bezier(.22, 1, .36, 1) both;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.portal-ai-quick:focus-within { border-color: rgb(28 187 180 / 44%); background: #fff; box-shadow: 0 18px 46px rgb(34 70 66 / 17%), 0 0 0 4px rgb(28 187 180 / 7%); }
.portal-ai-quick-logo { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border-radius: 9px; background: #f8faf9; }
.portal-ai-quick-logo img { width: 32px; height: 24px; object-fit: contain; }
.portal-ai-quick input,
.portal-ai-quick input:hover,
.portal-ai-quick input:focus {
  width: 100%;
  min-width: 0;
  min-height: 0 !important;
  height: 38px;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  padding: 0 4px !important;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  box-shadow: none !important;
  color: #173e37;
  font-size: 11px;
}
.portal-ai-quick input::placeholder { color: #899691; }
.portal-ai-quick button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 9px; padding: 0; background: #173e37; color: #fff; font-size: 17px; font-weight: 850; cursor: pointer; transition: background 160ms ease, transform 160ms ease; }
.portal-ai-quick button:hover { background: #157f7a; transform: translateY(-1px); }
@keyframes portal-ai-arrive { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.portal-admin-callout { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; margin-top: 30px; padding: 24px 26px; border-left: 5px solid var(--ers-orange); border-radius: 5px; background: var(--ers-charcoal); color: #fff; }
.portal-admin-callout h2 { margin: 1px 0 4px; color: #fff; font-family: "ERS Intro", Aptos, sans-serif; font-size: 21px; }
.portal-admin-callout > div > p:last-child { margin: 0; color: #bbb5b1; font-size: 12px; }
.portal-admin-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 4px; color: var(--ers-turquoise); }
.portal-admin-callout .button { display: flex; align-items: center; gap: 14px; border-radius: 4px; background: var(--ers-orange-dark); }
.portal-admin-callout .button svg { width: 16px; height: 16px; }
.portal-empty { margin-top: 32px; padding: 52px; border: 1px dashed var(--ers-line); border-radius: 5px; background: var(--ers-surface); text-align: center; }
.portal-empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 4px; background: var(--ers-orange-soft); color: var(--ers-orange-dark); }
.portal-central-page { padding-top: 24px; }
.portal-central-page .page-head { margin-top: 0; }
.system-access-fieldset { grid-column: 1 / -1; margin: 3px 0 8px; padding: 14px 16px 16px; border: 1px solid var(--ers-line); border-top: 3px solid var(--ers-turquoise); border-radius: 5px; background: var(--ers-paper); }
.system-access-fieldset legend { padding: 0 8px; color: var(--ers-ink); font-size: 12px; font-weight: 800; }
.system-access-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 11px; }
.system-access-toolbar > span { color: var(--ers-muted); font-size: 11px; font-weight: 700; }
.system-access-toolbar > div { display: flex; gap: 5px; }
.system-access-toolbar button { min-height: 29px; padding: 0 9px; border: 1px solid var(--ers-line); border-radius: 3px; background: var(--ers-surface); color: var(--ers-charcoal-2); font-size: 10px; font-weight: 750; cursor: pointer; }
.system-access-toolbar button:hover { border-color: var(--ers-orange); color: var(--ers-orange-dark); }
.system-access-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.system-access-option { display: flex !important; flex-direction: row !important; align-items: center; gap: 9px; min-height: 50px; padding: 8px 10px; border: 1px solid var(--ers-line); border-radius: 4px; background: var(--ers-surface); cursor: pointer; }
.system-access-option:has(input:checked) { border-color: color-mix(in srgb, var(--ers-turquoise) 58%, var(--ers-line)); background: color-mix(in srgb, var(--ers-turquoise) 7%, var(--ers-surface)); }
.system-access-option input { width: auto !important; margin: 0; accent-color: var(--ers-turquoise); }
.system-access-option > span { display: grid; gap: 2px; min-width: 0; }
.system-access-option strong { overflow: hidden; color: var(--ers-ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.system-access-option small { color: var(--ers-muted); font-size: 9px; font-weight: 600; }
.system-access-fieldset > small { display: block; margin-top: 9px; color: var(--ers-muted); font-size: 10px; }
.user-system-access { grid-column: 1 / -1; }
.user-cftv-access { grid-column: 1 / -1; }
.cftv-access-fieldset { grid-column: 1 / -1; margin: 3px 0 8px; padding: 14px 16px 16px; border: 1px solid var(--ers-line); border-top: 3px solid #2563eb; border-radius: 5px; background: var(--ers-paper); }
.cftv-access-fieldset legend { padding: 0 8px; color: var(--ers-ink); font-size: 12px; font-weight: 800; }
.cftv-access-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.cftv-access-toolbar > span { display: grid; gap: 2px; }
.cftv-access-toolbar b { color: var(--ers-ink); font-size: 11px; }
.cftv-access-toolbar small, .cftv-access-fieldset > small { color: var(--ers-muted); font-size: 10px; }
.cftv-access-toolbar button { min-height: 29px; padding: 0 10px; border: 1px solid var(--ers-line); border-radius: 3px; background: var(--ers-surface); color: var(--ers-charcoal-2); font-size: 10px; font-weight: 750; cursor: pointer; }
.cftv-access-units { display: grid; gap: 7px; }
.cftv-access-unit, .cftv-access-sector { border: 1px solid var(--ers-line); border-radius: 4px; background: var(--ers-surface); }
.cftv-access-unit > summary, .cftv-access-sector > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 11px; cursor: pointer; list-style: none; }
.cftv-access-unit > summary::-webkit-details-marker, .cftv-access-sector > summary::-webkit-details-marker { display: none; }
.cftv-access-unit summary label, .cftv-access-sector summary label, .cftv-access-cameras label { display: flex !important; flex-direction: row !important; align-items: center; gap: 9px; min-width: 0; cursor: pointer; }
.cftv-access-unit input, .cftv-access-sector input, .cftv-access-cameras input { width: auto !important; margin: 0; accent-color: #2563eb; }
.cftv-access-unit summary label > span, .cftv-access-sector summary label > span { display: grid; gap: 1px; }
.cftv-access-unit summary strong, .cftv-access-sector summary strong { color: var(--ers-ink); font-size: 11px; }
.cftv-access-unit summary small, .cftv-access-sector summary small { color: var(--ers-muted); font-size: 9px; }
.cftv-access-chevron, .cftv-access-sector > summary > span { transition: transform 160ms ease; }
.cftv-access-unit[open] > summary .cftv-access-chevron, .cftv-access-sector[open] > summary > span { transform: rotate(180deg); }
.cftv-access-sectors { display: grid; gap: 6px; padding: 0 9px 9px 32px; }
.cftv-access-sector { background: var(--ers-paper); }
.cftv-access-cameras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 0 9px 9px 32px; }
.cftv-access-cameras label { min-height: 34px; padding: 5px 7px; border: 1px solid var(--ers-line); border-radius: 3px; color: var(--ers-charcoal-2); font-size: 10px; }
.cftv-access-cameras label:has(input:checked) { border-color: #60a5fa; background: color-mix(in srgb, #3b82f6 8%, var(--ers-surface)); }
.cftv-access-sectors > p { margin: 4px 0; color: var(--ers-muted); font-size: 10px; }
.cftv-access-fieldset > small { display: block; margin-top: 9px; }
.cftv-access-fieldset.is-system-disabled:not(:has([data-cftv-scope]:disabled)) .cftv-access-units { opacity: .48; }

/* Login da Central: mesma linguagem visual, sem afetar os sistemas internos. */
.login-entry { --canvas: #f5f4f1; --surface: #fff; --surface-subtle: #faf9f7; --input-bg: #fff; --ink: #171717; --ink-strong: #171717; --muted: #74706c; --muted-strong: #454141; --line: #dedbd5; --line-strong: #c9c5bf; --primary: #ce551e; --primary-strong: #ad4315; --primary-soft: #fff1e8; --brand: #f58345; grid-template-columns: minmax(520px, 1.12fr) minmax(430px, .88fr); background: var(--canvas); font-family: Aptos, "Segoe UI", Arial, sans-serif; }
.login-entry .login-context { padding: clamp(38px, 4vw, 66px); background: #333132; }
.login-entry .login-context::after { width: 5px; height: 110px; background: #f58345; }
.login-entry .login-context-logo { width: 58px; height: 42px; border-radius: 4px; }
.login-entry .login-context-logo img { width: 51px; }
.login-entry .login-context-copy h1 { max-width: 650px; font-family: "ERS Intro", Aptos, "Segoe UI", sans-serif; font-size: clamp(46px, 5vw, 76px); letter-spacing: -.035em; line-height: .98; }
.login-entry .login-context-kicker { color: #f58345; }
.login-entry .login-motion { width: 116px; }
.login-entry .login-motion span { width: 36px; height: 36px; border-color: #f58345; }
.login-entry .login-motion span:nth-child(1) { left: 8px; }
.login-entry .login-motion span:nth-child(2) { left: 36px; }
.login-entry .login-motion span:nth-child(3) { left: 64px; }
.login-entry .login-form-area { padding: clamp(30px, 5vw, 78px); background: #f5f4f1; }
.login-entry .login-access { width: min(460px, 100%); padding: clamp(30px, 3.5vw, 44px); border: 1px solid #dedbd5; border-top: 4px solid #f58345; border-radius: 5px; box-shadow: 0 18px 52px rgb(51 49 50 / 10%); }
.login-entry .login-title h1 { font-family: "ERS Intro", Aptos, "Segoe UI", sans-serif; font-size: clamp(34px, 3vw, 43px); letter-spacing: -.025em; }
.login-entry .login-title .eyebrow { color: #ce551e; }
.login-entry .login-form input, .login-entry .login-submit { border-radius: 4px; }
.login-entry .login-local-access summary { color: #74706c; }

@media (max-width: 1260px) { .portal-system-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .portal-topbar { grid-template-columns: 1fr auto; }
  .portal-topbar-title { display: none; }
  .portal-hero-side { min-width: 230px; padding-inline: 32px; }
  .portal-system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-admin-callout { grid-template-columns: auto 1fr; }
  .portal-admin-callout .button { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
}

@media (max-width: 760px) {
  .login-entry { grid-template-columns: 1fr; }
  .login-entry .login-context { min-height: 184px; padding: 22px; }
  .login-entry .login-context-copy h1 { max-width: 390px; font-size: 31px; }
  .login-entry .login-form-area { min-height: calc(100vh - 184px); padding: 28px 18px 40px; }
  .login-entry .login-access { padding: 28px 23px; }
  .portal-topbar { min-height: 64px; padding: 0 15px; }
  .portal-brand > span:last-child, .portal-user-copy, .portal-user-divider, .portal-action:not(.portal-logout) { display: none; }
  .portal-user { gap: 7px; }
  .portal-logout { min-height: 32px; padding-inline: 10px; }
  .portal-content { padding: 18px 14px 48px; }
  .portal-hero { grid-template-columns: 1fr; min-height: 300px; }
  .portal-hero-copy { align-self: end; padding: 38px 30px; }
  .portal-hero h1 { max-width: 100%; font-size: clamp(37px, 10.8vw, 47px); overflow-wrap: anywhere; }
  .portal-hero-side { position: absolute; inset: 25px 24px auto auto; min-width: 0; padding: 0; border: 0; }
  .portal-ai-entry { grid-template-columns: 34px 1fr 16px; min-height: 56px; margin-top: 22px; padding: 8px 10px; }
  .portal-ai-entry-icon { width: 34px; height: 34px; }
  .portal-access-summary { display: none; }
  .portal-brand-motion { transform: scale(.75); transform-origin: top right; }
  .portal-section { margin-top: 32px; }
  .portal-section-head { align-items: flex-start; }
  .portal-section-actions > span, .portal-view-switch button span { display: none; }
  .portal-view-switch button { padding-inline: 9px; }
  .portal-system-grid, .system-access-grid { grid-template-columns: 1fr; }
  .portal-system-card { min-height: 232px; }
  .portal-system-groups.is-list .portal-system-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; min-height: 78px; padding: 12px; }
  .portal-system-groups.is-list .portal-system-icon { grid-column: 1; }
  .portal-system-groups.is-list .portal-system-category, .portal-system-groups.is-list .portal-system-name { grid-column: 2; }
  .portal-system-groups.is-list .portal-system-card > p, .portal-system-groups.is-list .portal-system-status { display: none; }
  .portal-system-groups.is-list .portal-system-open { grid-column: 3; grid-row: 1 / 3; min-width: 0; padding-left: 12px; font-size: 0; }
  .portal-system-groups.is-list .portal-system-open svg { width: 20px; height: 20px; }
  .portal-admin-callout { grid-template-columns: 1fr; padding: 24px; }
  .portal-ai-quick { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) { .portal-brand-motion i, .portal-system-card, .portal-ai-quick { animation: none; } }
