/* ProGate Customer Portal. Styles are deliberately scoped away from ERP staff screens. */
.customer-portal {
  --pg-ink: #10233d;
  --pg-muted: #51647c;
  --pg-line: #dbe5f0;
  --pg-faint: #f3f7fb;
  --pg-panel: #fff;
  --pg-link: #165b9f;
  --pg-action: #125495;
  --pg-action-hover: #0c427b;
  --pg-accent: #067363;
  --pg-mint: #e5f8f2;
  --pg-radius: 18px;
  --pg-shadow: 0 10px 30px rgb(16 35 61 / 6%);
  --pg-gutter: clamp(14px, 4vw, 40px);
  --pg-width: 1312px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f2f6fb;
  color: var(--pg-ink);
  font: 400 1rem/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.customer-portal .skip-link:focus {
  z-index: 1000;
  background: #fff;
  color: var(--pg-ink);
}

.customer-portal :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #207bd2;
  outline-offset: 3px;
}

.customer-portal .portal-topbar {
  background: #fff;
  color: var(--pg-ink);
  box-shadow: 0 1px 0 var(--pg-line), 0 6px 18px rgb(16 35 61 / 4%);
}

.customer-portal .portal-topbar-row {
  width: min(100%, var(--pg-width));
  margin-inline: auto;
  padding: 15px var(--pg-gutter);
  min-height: 74px;
}

.customer-portal .portal-brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  color: var(--pg-ink);
  letter-spacing: normal;
  line-height: 1.05;
}

.customer-portal .portal-brand strong,
.customer-portal .portal-brand small { display: block; }
.customer-portal .portal-brand strong { font-size: 1.42rem; letter-spacing: -.045em; font-weight: 800; }
.customer-portal .portal-brand small {
  margin-top: 6px;
  color: var(--pg-muted);
  font-size: .63rem;
  font-weight: 750;
  letter-spacing: .1em;
  opacity: 1;
}

.customer-portal .portal-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 43px;
  height: 43px;
  border-radius: 13px;
  background: linear-gradient(145deg, #183e69, #0f2645);
  color: #9ce8d3;
  box-shadow: 0 3px 9px rgb(16 35 61 / 18%);
}
.customer-portal .portal-brand-mark svg { width: 25px; height: 25px; }

.customer-portal .portal-account-actions { gap: 10px; justify-content: flex-end; }
.customer-portal .portal-account-actions form { min-width: 0; }
.customer-portal .portal-account-actions label { margin-block: 0; color: var(--pg-muted); font-weight: 650; }
.customer-portal .portal-account-actions select {
  min-width: 0;
  max-width: 245px;
  padding: 8px 10px;
  border-color: var(--pg-line);
  background: #fff;
  color: var(--pg-ink);
  border-radius: 9px;
}
.customer-portal .portal-organization-name {
  max-width: 300px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--pg-faint);
  color: var(--pg-muted);
  font-size: .8rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.customer-portal .portal-account-actions button {
  min-height: 42px;
  padding: 7px 14px;
  border-color: var(--pg-line);
  border-radius: 9px;
  background: #fff;
  color: var(--pg-ink);
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.customer-portal .portal-account-actions button:hover { background: var(--pg-faint); }

.customer-portal .portal-nav-strip { border-top: 1px solid #edf2f8; }
.customer-portal .topbar .portal-primary-nav {
  width: min(100%, var(--pg-width));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 4px 6px;
  padding: 7px var(--pg-gutter);
  border: 0;
  background: transparent;
  overflow: visible;
}
.customer-portal .topbar .portal-primary-nav > a {
  width: auto;
  min-width: 0;
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--pg-muted);
  font-size: .85rem;
  font-weight: 675;
  text-align: center;
  white-space: normal;
}
.customer-portal .topbar .portal-primary-nav > a:hover { background: var(--pg-faint); color: var(--pg-ink); }
.customer-portal .topbar .portal-primary-nav > a:focus-visible { outline: 3px solid #207bd2; outline-offset: 2px; }
.customer-portal .topbar .portal-primary-nav > a.is-active {
  border-color: #c5eadf;
  background: var(--pg-mint);
  color: #075e50;
  font-weight: 780;
}

.customer-portal .portal-app-main {
  width: min(100%, var(--pg-width));
  max-width: none;
  min-width: 0;
  flex: 1;
  padding: clamp(22px, 4vw, 44px) var(--pg-gutter) 48px;
}
.customer-portal .portal-app-main > * + * { margin-block-start: 21px; }
.customer-portal .portal-app-main :where(h1, h2, h3) {
  color: var(--pg-ink);
  line-height: 1.17;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.customer-portal h1 { margin: 0 0 .65rem; font-size: clamp(1.86rem, 4.2vw, 3.1rem); letter-spacing: -.045em; }
.customer-portal h2 { margin: 0 0 .5rem; font-size: clamp(1.15rem, 2.15vw, 1.47rem); letter-spacing: -.025em; }
.customer-portal h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.customer-portal p { margin: 0 0 .8em; overflow-wrap: anywhere; }
.customer-portal :where(strong, small, code, dd, a) { overflow-wrap: anywhere; }
.customer-portal .page-head { margin: 0 0 18px; }
.customer-portal .page-head p,
.customer-portal .muted,
.customer-portal .record small,
.customer-portal .portal-lead { color: var(--pg-muted); }
.customer-portal .panel,
.customer-portal .stat {
  min-width: 0;
  padding: clamp(16px, 2.6vw, 26px);
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: var(--pg-panel);
  box-shadow: var(--pg-shadow);
}
.customer-portal .panel-head { gap: 14px; flex-wrap: wrap; }
.customer-portal .panel-head p { margin: 0; color: var(--pg-muted); }
.customer-portal .actions { gap: 8px; flex-wrap: wrap; }
.customer-portal .button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--pg-line);
  border-radius: 9px;
  background: #fff;
  color: var(--pg-ink);
  font-weight: 730;
  text-align: center;
}
.customer-portal .button:hover { background: var(--pg-faint); transform: none; box-shadow: none; }
.customer-portal .button.primary { border-color: var(--pg-action); background: var(--pg-action); color: #fff; }
.customer-portal .button.primary:hover { border-color: var(--pg-action-hover); background: var(--pg-action-hover); }
.customer-portal .button.danger { border-color: #a93243; background: #a93243; color: #fff; }
.customer-portal .button.success { border-color: var(--pg-accent); background: var(--pg-accent); color: #fff; }
.customer-portal .portal-app-main a:not(.button):not(.stat):not(.portal-device-card) {
  color: var(--pg-link);
  text-underline-offset: 3px;
}
.customer-portal :where(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  min-height: 44px;
  border-color: #c6d4e4;
  border-radius: 9px;
}
.customer-portal .table-wrap { max-width: 100%; border: 1px solid var(--pg-line); border-radius: 12px; overflow-x: auto; }
.customer-portal th { background: var(--pg-faint); color: var(--pg-muted); }
.customer-portal .record { gap: 12px; padding-block: 14px; border-color: var(--pg-line); }
.customer-portal .record:last-child { border-bottom: 0; }
.customer-portal .flash { border-radius: 12px; }

.customer-portal .portal-footer {
  width: min(100%, var(--pg-width));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 12px;
  padding: 17px var(--pg-gutter) 22px;
  border-top: 1px solid var(--pg-line);
  color: var(--pg-muted);
  font-size: .82rem;
}

.customer-portal .portal-kicker {
  display: block;
  margin: 0 0 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .115em;
  color: var(--pg-accent);
  text-transform: uppercase;
}
.customer-portal .portal-lead { max-width: 62ch; font-size: 1rem; }
.customer-portal .portal-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
}
.customer-portal .portal-page-heading > * { min-width: 0; }
.customer-portal .portal-page-heading p:last-child { margin: 0; }
.customer-portal .portal-page-heading > div > .button:first-child { margin-bottom: 11px; }
.customer-portal .portal-page-actions,
.customer-portal .portal-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.customer-portal .portal-pagination { margin-block-start: 20px; color: var(--pg-muted); }
.customer-portal .portal-hero {
  padding: clamp(22px, 4.5vw, 49px);
  border: 1px solid #1b3d66;
  border-radius: 22px;
  background: radial-gradient(ellipse at 95% 12%, rgb(28 119 132 / 38%), transparent 58%),
              linear-gradient(130deg, #10243f, #153b66);
  box-shadow: 0 13px 27px rgb(16 35 61 / 17%);
  color: #e8f1fb;
}
.customer-portal .portal-hero :where(h1, h2, h3) { color: #fff; }
.customer-portal .portal-hero :where(p, .portal-lead, .muted) { color: #d4e5f4; }
.customer-portal .portal-hero .portal-kicker { color: #aff4de; }
.customer-portal .portal-hero .button.primary {
  background: #b9f4e2;
  border-color: #b9f4e2;
  color: #0c302b;
}
.customer-portal .portal-hero .button.primary:hover { background: #e3fff5; }
.customer-portal .portal-hero .button:not(.primary) { color: #fff; background: #173959; border-color: #6d8ba9; }
.customer-portal .portal-hero .button:not(.primary):hover { background: #1c4c6e; }
.customer-portal .portal-app-main .portal-hero a:not(.button) { color: #b9f4e2; }

.customer-portal .portal-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.customer-portal .portal-device-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--pg-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--pg-shadow);
}
.customer-portal .portal-device-card:hover { border-color: #a8c5e0; }
.customer-portal .portal-device-heading,
.customer-portal .portal-record-head,
.customer-portal .portal-section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.customer-portal .portal-device-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--pg-mint);
  color: var(--pg-accent);
}
.customer-portal .portal-device-mark svg { width: 21px; height: 21px; }
.customer-portal .portal-device-meta { color: var(--pg-muted); font-size: .88rem; overflow-wrap: anywhere; }
.customer-portal .portal-device-meta :where(dt, dd) { margin: 0; }
.customer-portal dl.portal-device-meta { display: grid; gap: 6px; margin: 12px 0 0; }
.customer-portal dl.portal-device-meta > div { display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 5px 10px; }
.customer-portal dl.portal-device-meta dt { font-size: .8rem; font-weight: 680; }
.customer-portal dl.portal-device-meta dd { color: var(--pg-ink); }
.customer-portal .portal-hero .portal-device-meta { color: #c3d9ed; }
.customer-portal .portal-facts-grid,
.customer-portal .portal-record-copy {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  margin: 12px 0 16px;
}
.customer-portal .portal-record-copy { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.customer-portal .portal-facts-grid > div,
.customer-portal .portal-record-copy > div {
  min-width: 0;
  padding: 13px;
  border: 1px solid #e2ebf4;
  border-radius: 12px;
  background: #f7fafc;
}
.customer-portal .portal-facts-grid dt,
.customer-portal .portal-record-copy dt { color: var(--pg-muted); font-size: .83rem; font-weight: 670; }
.customer-portal .portal-facts-grid dd,
.customer-portal .portal-record-copy dd { margin: 5px 0 0; color: var(--pg-ink); font-weight: 640; }
.customer-portal .portal-record-copy dd { font-weight: 500; }
.customer-portal .portal-record-list { list-style: none; padding: 0; margin: 0; }
.customer-portal .portal-empty {
  padding: 16px;
  border: 1px dashed #c7d7e8;
  border-radius: 12px;
  background: #f8fbfe;
  color: var(--pg-muted);
}

.customer-portal .portal-auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  max-width: 1060px;
  margin: clamp(0px, 3vh, 25px) auto 0;
  border: 1px solid var(--pg-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 48px rgb(16 35 61 / 12%);
  overflow: hidden;
}
.customer-portal .portal-auth-intro {
  min-width: 0;
  padding: clamp(22px, 5vw, 54px);
  background: radial-gradient(ellipse at 98% 0%, rgb(20 135 126 / 45%), transparent 63%),
              linear-gradient(143deg, #122640, #143d60);
  color: #e7f1fb;
}
.customer-portal .portal-auth-intro :where(h1, h2, h3, .portal-auth-tagline) { color: #fff; }
.customer-portal .portal-auth-intro .portal-kicker { color: #aff4de; }
.customer-portal .portal-auth-intro .portal-lead { color: #d4e5f4; }
.customer-portal .portal-auth-tagline {
  margin: 0 0 14px;
  max-width: 18ch;
  font-size: clamp(1.55rem, 3.8vw, 2.8rem);
  letter-spacing: -.04em;
  font-weight: 790;
  line-height: 1.12;
  text-wrap: balance;
}
.customer-portal .portal-auth-features { display: grid; gap: 9px; list-style: none; margin: 24px 0 0; padding: 0; }
.customer-portal .portal-auth-feature {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgb(220 240 255 / 23%);
  border-radius: 9px;
  background: rgb(224 245 255 / 8%);
  font-size: .9rem;
}
.customer-portal .portal-auth-feature svg { width: 19px; height: 19px; flex: 0 0 19px; color: #b9f4e2; }
.customer-portal .portal-auth-feature strong,
.customer-portal .portal-auth-feature span { display: block; }
.customer-portal .portal-auth-feature span { margin-top: 2px; color: #d4e5f4; font-size: .83em; }
.customer-portal .portal-auth-card.panel { border: 0; border-radius: 0; box-shadow: none; padding: clamp(22px, 5vw, 52px); }
.customer-portal .portal-auth-card h1 { font-size: clamp(1.68rem, 3.5vw, 2.48rem); }
.customer-portal .portal-auth-form { display: grid; gap: 12px; margin-top: 18px; }
.customer-portal .portal-auth-form label { margin: 0; font-size: .9rem; }
.customer-portal .portal-auth-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 17px; font-size: .9rem; }
.customer-portal .portal-auth-divider { border: 0; border-top: 1px solid var(--pg-line); margin: 14px 0; }
.customer-portal .portal-auth-code {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--pg-line);
  border-radius: 8px;
  background: var(--pg-faint);
  color: var(--pg-ink);
  overflow-wrap: anywhere;
}
.customer-portal .portal-auth-code-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr));
  gap: 6px;
  padding: 0;
  margin: 12px 0;
  list-style: none;
}

@media (max-width: 760px) {
  .customer-portal .portal-topbar-row { flex-direction: row; align-items: center; gap: 10px; }
  .customer-portal .portal-account-actions { width: auto; align-items: flex-end; }
  .customer-portal .portal-account-actions form { max-width: min(100%, 230px); }
  .customer-portal .portal-account-actions form:has(select) { flex-direction: column; align-items: flex-start; gap: 2px; }
  .customer-portal .portal-account-actions select { max-width: min(100%, 170px); }
  .customer-portal .portal-organization-name { display: none; }
  .customer-portal .topbar .portal-primary-nav > a { padding-inline: 8px; font-size: .78rem; }
  .customer-portal .portal-auth-layout { grid-template-columns: minmax(0, 1fr); }
  .customer-portal .portal-auth-layout .portal-auth-card { order: -1; }
  .customer-portal .portal-auth-intro { padding: 23px; }
  .customer-portal .portal-auth-features { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
  .customer-portal .portal-auth-feature { padding: 5px 8px; font-size: .8rem; }
  .customer-portal .portal-app-main { padding-bottom: 31px; }
  .customer-portal .workspace-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .customer-portal .portal-brand { gap: 8px; }
  .customer-portal .portal-brand-mark { flex-basis: 35px; height: 35px; }
  .customer-portal .portal-brand-mark svg { width: 20px; height: 20px; }
  .customer-portal .portal-brand small { font-size: .57rem; letter-spacing: .045em; }
  .customer-portal .portal-topbar-row { flex-wrap: wrap; }
  .customer-portal .topbar .portal-primary-nav > a { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .customer-portal *, .customer-portal *::before, .customer-portal *::after { transition: none !important; }
}
