:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #16213b;
  background: #f4f6fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #101d38;
  --blue: #213e80;
  --blue-deep: #182f67;
  --muted: #526078;
  --line: #dce3ed;
  --wash: #eef3fa;
  --surface: #fff;
  --red: #a71c26;
  --radius: 17px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, button[aria-disabled="true"] { cursor: wait; opacity: .64; }
button, input, select, textarea, summary {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible { outline: 3px solid #5279ce; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1:focus { outline: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.85rem); line-height: 1.07; letter-spacing: -.055em; }
h2 { font-size: 1.2rem; line-height: 1.28; letter-spacing: -.02em; }

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--navy);
  line-height: 1.2;
  font-size: .73rem;
  font-weight: 650;
}
.brand img { display: block; width: 80px; height: auto; border-radius: 6px; }
.brand > span { border-left: 1px solid var(--line); padding-left: 12px; }

.auth-layout {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--surface);
}
.auth-identity {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 90px;
  padding: clamp(28px, 5vw, 76px);
  isolation: isolate;
  overflow: hidden;
  position: relative;
  color: #fff;
  background: radial-gradient(ellipse at 76% 82%, #263d79, var(--navy) 67%);
}
.auth-brand {
  color: #fff;
  font-size: .83rem;
  gap: 15px;
}
.auth-brand img { width: 105px; }
.auth-brand > span { border-color: #647393; padding-left: 15px; }
.auth-intro { padding-bottom: 10vh; max-width: 520px; }
.auth-intro h2 {
  font-size: clamp(2.3rem, 5.6vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -.065em;
  text-wrap: balance;
}
.optical-graphic {
  pointer-events: none;
  position: absolute;
  z-index: -1;
  right: -22%;
  bottom: -34%;
  transform: rotate(-26deg);
  width: 105%;
  aspect-ratio: 1/1;
  opacity: .64;
  background: radial-gradient(ellipse at 50% 54%, #87a5f633, transparent 54%);
  border-radius: 50%;
}
.optical-graphic i {
  display: block;
  position: absolute;
  inset: 12% 4%;
  border: 1px solid #9db7fa75;
  border-radius: 50%;
}
.optical-graphic i:nth-child(2) { inset: 16% 6%; }
.optical-graphic i:nth-child(3) { inset: 20% 8%; border-color: #9db7fa9c; }
.auth-main {
  display: grid;
  place-items: center;
  align-content: center;
  padding: 48px clamp(25px, 5vw, 86px);
}
.auth-content { width: min(100%, 425px); }
.auth-description {
  margin: 14px 0 30px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
.auth-content form, #invite-form { display: grid; }
.auth-content form > label, #invite-form > label { margin: 16px 0 7px; }
.auth-content form > label:first-child, #invite-form > label:first-child { margin-top: 0; }
.auth-content form > .button-primary, #invite-form > .button-primary { margin-top: 22px; }
.auth-switch { color: var(--muted); margin-top: 24px; font-size: .89rem; line-height: 1.65; }
.text-button {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.verification-code { letter-spacing: .18em; font-variant-numeric: tabular-nums; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  line-height: 1.25;
  font-size: .89rem;
  font-weight: 700;
  color: var(--navy);
}
.button svg { flex: 0 0 auto; width: 17px; height: 17px; }
.button-primary {
  background: var(--blue);
  color: #fff;
  min-height: 47px;
}
.button-primary:not(:disabled):hover { background: var(--blue-deep); }
.button-neutral { background: #fff; border-color: #d0d9e7; }
.button-neutral:not(:disabled):hover { background: var(--wash); }
.button-wide { width: 100%; }
.button-small { min-height: 37px; padding: 7px 12px; }

.initial-status {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  min-height: 90vh;
  padding: 25px;
  text-align: center;
}
.initial-status p { color: var(--muted); }
.portal-header { border-bottom: 1px solid var(--line); background: #fff; }
.portal-header-inner {
  max-width: 1510px;
  margin: 0 auto;
  padding: 10px clamp(18px, 3vw, 38px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.account { display: flex; align-items: center; gap: 17px; min-width: 0; }
.account-name { display: grid; gap: 3px; text-align: right; min-width: 0; }
.account-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .91rem;
}
.account-name span { color: var(--muted); font-size: .79rem; }
.logout { flex: 0 0 auto; }
.portal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  max-width: 1510px;
  gap: clamp(22px, 4vw, 68px);
  padding: clamp(22px, 4vw, 53px) clamp(18px, 3vw, 38px) 65px;
  margin: 0 auto;
}
.sidebar {
  display: grid;
  gap: 6px;
  position: sticky;
  top: 18px;
}
.sidebar button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 47px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: .92rem;
  font-weight: 650;
}
.sidebar svg { flex-shrink: 0; width: 18px; height: 18px; }
.sidebar button:hover { color: var(--blue); background: #ebeff7; }
.sidebar button[aria-current] { color: #183777; background: #e4ebfa; border-color: #d5dff3; }
.portal-content { min-width: 0; max-width: 1100px; }
.section-title { margin-bottom: 24px; }
.section-title-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; }
.section-title p { color: var(--muted); margin-top: 9px; line-height: 1.5; }
.date-label::first-letter { text-transform: uppercase; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.form-panel, .invite-panel { padding: clamp(16px, 2.5vw, 28px); }
.form-panel + .form-panel { margin-top: 14px; }
.form-panel h2 { margin-bottom: 15px; }
.section-description {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
  margin: -5px 0 16px;
}
.field { min-width: 0; }
.form-columns, .eye-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.eye {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbfd;
  padding: 10px 12px 13px;
}
.eye legend { padding: 0 5px; font-size: .88rem; font-weight: 750; color: var(--blue-deep); }
.eye-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 9px; }
label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 700; color: #26354e; }
label span { color: var(--muted); font-size: .78rem; font-weight: 500; }
input, select, textarea {
  display: block;
  width: 100%;
  min-height: 45px;
  padding: 9px 11px;
  color: var(--navy);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
}
input::placeholder, textarea::placeholder { color: #63728a; opacity: 1; }
select { padding-right: 8px; }
textarea { resize: vertical; }
input[aria-invalid], select[aria-invalid], textarea[aria-invalid] { border-color: var(--red); }
.input-hint, .input-error { font-size: .79rem; line-height: 1.4; margin-top: 5px; }
.input-hint { color: var(--muted); }
.input-error { color: var(--red); }
.eye input { font-variant-numeric: tabular-nums; }
.form-footer { display: grid; justify-items: end; margin-top: 16px; gap: 10px; }
.form-footer .message { justify-self: stretch; }
.message {
  width: 100%;
  border: 1px solid #edc5c7;
  padding: 11px 13px;
  border-radius: 8px;
  font-size: .88rem;
  line-height: 1.5;
}
.message-error { color: var(--red); background: #fff4f4; }
form > .message, #portal-error { margin-top: 16px; }
.section-title + .message { margin: -8px 0 14px; }
.message-success { color: #155841; border-color: #cae4d5; background: #eff9f3; margin-bottom: 14px; }
.product-refresh { display: inline-block; margin-top: 7px; font-size: .79rem; }
.product-summary { margin-top: 10px; border-radius: 8px; padding: 9px 10px; background: var(--wash); }
.product-summary > p { color: var(--blue-deep); font-size: .79rem; font-weight: 750; }
.product-ranges { margin: 7px 0 0; display: flex; flex-wrap: wrap; gap: 7px 14px; }
.product-ranges > div { min-width: 0; }
.product-ranges dt { color: var(--muted); font-size: .74rem; }
.product-ranges dd { margin: 3px 0 0; font-weight: 650; font-size: .8rem; font-variant-numeric: tabular-nums; }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); align-items: start; gap: 13px; }
.catalog-layout > .form-panel + .form-panel { margin-top: 0; }
#product-form > .field + .field { margin-top: 12px; }
.range-editor {
  border: 1px solid var(--line);
  border-radius: 11px;
  margin: 16px 0 0;
  min-width: 0;
  padding: 9px 12px 12px;
}
.range-editor legend { font-weight: 750; font-size: .88rem; padding: 0 4px; }
.range-editor .input-hint { margin: 0 0 9px; }
.range-editor-row {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 7px;
  padding: 11px 0;
}
.range-editor-row + .range-editor-row { border-top: 1px solid var(--line); }
.range-editor-row:last-child { padding-bottom: 0; }
.range-editor-label { padding-top: 21px; font-size: .82rem; line-height: 1.36; font-weight: 750; }
.range-editor-label > small { color: var(--muted); font-size: .74rem; display: block; font-weight: 500; }
.range-editor-row label { font-size: .76rem; }
.catalog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.catalog-list-heading, .catalog-product-heading { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.catalog-list-heading { margin-bottom: 14px; }
.catalog-list-heading h2 { margin: 0; }
.catalog-product + .catalog-product { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.catalog-product h3 { font-size: .98rem; overflow-wrap: anywhere; margin: 0; }
.catalog-notice { color: var(--muted); font-size: .89rem; line-height: 1.5; }
#catalog-list > .message { margin-bottom: 10px; }
.request-product { color: var(--muted); font-size: .9rem; margin: 0 0 11px; }
.request-product strong { color: var(--navy); margin-right: 4px; }

.success-panel { padding: clamp(24px, 4vw, 55px); display: grid; justify-items: start; gap: 15px; }
.success-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  color: #155841;
  background: #def2e8;
}
.success-panel h2 { font-size: 1.45rem; }
.success-panel p { color: var(--muted); line-height: 1.55; }
.success-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.request-list { overflow: hidden; }
.list-notice {
  min-height: 165px;
  display: grid;
  justify-items: center;
  place-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.list-notice svg { color: var(--blue); }
.request + .request { border-top: 1px solid var(--line); }
.request summary {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}
.request summary::-webkit-details-marker { display: none; }
.request summary:hover, .request[open] summary { background: #f4f7fb; }
.request summary:focus-visible { outline-offset: -3px; }
.request summary svg { margin-left: auto; flex: 0 0 auto; color: var(--blue); width: 15px; height: 15px; }
.request[open] summary svg { transform: rotate(90deg); }
.request-identity, .request-customer { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.request-identity { display: grid; gap: 4px; }
.request-identity span, .request-customer, .request time { color: var(--muted); font-size: .85rem; }
.request time { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.request-detail { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.request-detail table { width: 100%; max-width: 630px; border-collapse: collapse; text-align: left; }
.request-detail caption { text-align: left; font-weight: 750; margin-bottom: 10px; }
.request-detail td, .request-detail th { padding: 7px 9px 7px 0; border-bottom: 1px solid var(--line); font-size: .83rem; }
.request-detail td { font-variant-numeric: tabular-nums; }
.request-detail tbody th { font-weight: 500; }
.request-notes { display: grid; gap: 5px; margin-top: 16px; color: var(--muted); overflow-wrap: anywhere; }
.request-notes span { white-space: pre-wrap; }
.request-notes strong { color: var(--navy); }

.invite-panel { max-width: 590px; }
.invite-panel > h2 { margin-bottom: 17px; }
#invite-form > .button-primary { justify-self: start; }
#invitation-result { border-top: 1px solid var(--line); margin-top: 25px; padding-top: 18px; }
#invitation-result > p { margin-top: 8px; line-height: 1.45; }
#invitation-result .setup-key { margin-top: 12px; }
.setup-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--wash);
}
.setup-key .muted { display: block; margin-bottom: 4px; font-size: .77rem; color: var(--muted); }
.setup-key code { overflow-wrap: anywhere; user-select: all; }

@media (max-width: 1050px) {
  .portal-layout { gap: 24px; grid-template-columns: 186px minmax(0, 1fr); }
  .catalog-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .auth-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-identity { padding: 20px 23px 25px; gap: 21px; }
  .auth-brand img { width: 74px; }
  .auth-intro { padding-bottom: 0; }
  .auth-intro h2 { font-size: clamp(1.48rem, 4.7vw, 2.25rem); letter-spacing: -.04em; text-wrap: initial; }
  .optical-graphic { width: 375px; right: -170px; bottom: -220px; }
  .auth-main { justify-items: center; align-content: start; padding: 32px 22px 37px; }
  .portal-layout { grid-template-columns: 1fr; padding-top: 12px; gap: 24px; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); position: static; }
  .sidebar-admin { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar button { justify-content: center; gap: 8px; min-height: 43px; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.9rem; }
  .account { gap: 8px; }
  .account-name strong { font-size: .77rem; }
  .account-name span { font-size: .7rem; }
  .logout { padding: 8px; min-height: 40px; min-width: 40px; }
  .logout > span { display: none; }
  .brand { gap: 6px; }
  .brand img { width: 65px; }
  .brand > span { padding-left: 6px; font-size: .69rem; }
  .form-columns, .eye-grid { grid-template-columns: 1fr; }
  .section-title h1 { text-wrap: balance; }
  .request summary { flex-wrap: wrap; justify-content: space-between; gap: 7px 10px; padding: 13px; }
  .request-identity { flex-basis: calc(100% - 100px); }
  .request-customer { flex-basis: 100%; order: 1; }
  .request summary svg { margin-left: 0; }
  .sidebar-admin button { flex-direction: column; gap: 5px; min-height: 62px; line-height: 1.21; justify-content: flex-start; text-align: center; padding-inline: 4px; font-size: .76rem; }
}
