:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #182640;
  background: #f4f6fa;
  --navy: #101d36;
  --ink: #182640;
  --muted: #51617b;
  --border: #dce4ef;
  --soft: #f4f6fa;
  --card: #fff;
  --blue: #2857d2;
  --blue-hover: #1f45aa;
  --tenant-accent: #3b6deb;
  --focus: #4974ef;
  --radius: 14px;
  --shadow: 0 1px 2px #0e23420b, 0 10px 26px #192a4910;
  accent-color: var(--blue);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100dvh; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.025em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.35rem); font-weight: 740; }
h2 { font-size: 1.22rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 690; }
a { color: var(--blue); text-underline-offset: .16em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
main:focus { outline: none; }
svg { display: block; flex: 0 0 auto; width: 1.15rem; height: 1.15rem; }
noscript { display: block; padding: 1rem; }
[tabindex="-1"] { scroll-margin-top: 5rem; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 50;
  top: .5rem;
  left: .5rem;
  padding: .75rem 1rem;
  background: var(--card);
  border-radius: 8px;
}

.button, .icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 650;
  font-size: .9rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.button { padding: .58rem .85rem; }
.button.primary { background: var(--blue); color: #fff; box-shadow: 0 2px 6px #254dba24; }
.button.primary:hover:not(:disabled) { background: var(--blue-hover); }
.button.secondary { background: #fff; border-color: var(--border); color: #263754; }
.button.secondary:hover:not(:disabled) { background: #edf3ff; border-color: #adbfec; }
.button.text { background: transparent; color: var(--blue); border-color: transparent; padding-inline: 0; justify-content: flex-start; }
.button.text:hover { text-decoration: underline; }
.button.danger { background: #fff; color: #9d2332; border-color: #efcbd1; }
.button.danger:hover { background: #fff0f2; }
.icon-button {
  width: 42px;
  padding: .45rem;
  background: transparent;
  color: inherit;
  border-color: var(--border);
}
.icon-button:hover:not(:disabled) { background: #edf3ff; }

.brand-mark { display: flex; align-items: center; gap: .72rem; width: fit-content; }
.brand-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid #9aafff50;
  background: #3761de;
  color: #fff;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: 785;
  letter-spacing: -.07em;
  box-shadow: 0 4px 12px #0e1b5340;
}
.brand-name { display: grid; gap: 1px; line-height: 1.15; }
.brand-name strong { font-size: 1.05rem; letter-spacing: .08em; }
.brand-name small { font-size: .72rem; font-weight: 600; }

.boot {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
}
.login-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  background: #fff;
}
.login-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2.5rem;
  padding: clamp(1.3rem, 4vw, 3.25rem);
}
.login-content { width: min(100%, 390px); align-self: center; margin: auto 0; }
.login-content h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); margin-bottom: .55rem; }
.login-form { margin-top: 1.7rem; }
.login-form .button.primary { width: 100%; min-height: 49px; }
.login-form .form-actions { justify-content: stretch; }
.login-form .button.text { width: max-content; max-width: 100%; }
.login-footer { color: var(--muted); font-weight: 550; }
.login-right {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(2.2rem, 8vh, 5rem);
  padding: clamp(2rem, 5.5vw, 6.8rem);
  background: radial-gradient(ellipse at 76% 23%, #203c80, transparent 65%), var(--navy);
  color: #fff;
}
.login-right::before, .login-right::after {
  position: absolute;
  z-index: -1;
  display: block;
  width: clamp(25rem, 55vw, 45rem);
  aspect-ratio: 1;
  content: "";
  border: 1px solid #a8bcf127;
  border-radius: 50%;
  inset: -17rem auto auto 14%;
}
.login-right::after { inset: auto 15% -20rem auto; }
.login-story { width: min(100%, 470px); }
.login-story h2 { color: #fff; font-size: clamp(2rem, 4.3vw, 3.8rem); font-weight: 740; margin-bottom: 1rem; }
.login-story p { max-width: 32ch; color: #c8d8fb; font-size: clamp(1rem, 2vw, 1.15rem); }
.login-graphic { position: relative; width: min(100%, 330px); height: 185px; }
.graphic-main, .graphic-chip { display: grid; place-items: center; position: absolute; border: 1px solid #94aaf66a; }
.graphic-main {
  inset: 9px 24% 10px 16%;
  border-radius: 32px;
  transform: rotate(-9deg);
  background: linear-gradient(147deg, #536ee8, #2857d2);
  box-shadow: 0 16px 50px #070d285e;
}
.graphic-main svg { width: 50%; height: auto; opacity: .92; }
.graphic-chip {
  width: 72px;
  height: 72px;
  border-radius: 19px;
  background: #19356b;
  color: #cfdbff;
  box-shadow: 0 10px 28px #0b163e7a;
}
.graphic-chip svg { width: 31px; height: 31px; }
.graphic-chip.upper { top: -3px; right: 10%; transform: rotate(13deg); }
.graphic-chip.lower { bottom: -8px; left: 8%; transform: rotate(-14deg); }

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  min-height: 100dvh;
}
.shell.nav-compact { grid-template-columns: 76px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  height: 100dvh;
  overflow-y: auto;
  padding: 1.35rem .88rem .95rem;
  background: var(--navy);
  color: #edf3ff;
}
.sidebar > .brand-mark { margin: 0 .34rem 1.75rem; }
.sidebar .brand-name small { color: #b3c2de; }
.sidebar-nav { display: grid; align-content: start; gap: .2rem; }
.nav-label {
  margin: .1rem .72rem .25rem;
  font-size: .7rem;
  font-weight: 700;
  color: #aebedb;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.nav-label:not(:first-child) { margin-top: 1.3rem; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 43px;
  padding: .52rem .72rem;
  border-radius: 8px;
  color: #d1dcf1;
  font-size: .9rem;
  font-weight: 580;
  text-decoration: none;
}
.nav-link svg { color: #acbfe4; }
.nav-link:hover, .account-link:hover { background: #1b2e50; }
.nav-link[aria-current] { background: #243c6d; color: #fff; }
.nav-link[aria-current]::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 50%;
  border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--tenant-accent), #aabfff 45%);
}
.nav-link[aria-current] svg { color: #c4d5ff; }
.sidebar-account {
  display: flex;
  align-items: center;
  gap: .2rem;
  margin-top: auto;
  min-width: 0;
  padding-top: 1rem;
}
.account-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: .35rem;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.account-link[aria-current] { background: #243c6d; }
.account-details, .contact-copy { display: grid; min-width: 0; gap: .05rem; }
.account-details * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-details strong { font-size: .83rem; }
.account-details small { color: #bccbea; font-size: .69rem; }
.sidebar-account .icon-button { flex: 0 0 34px; width: 34px; min-height: 34px; border-color: #3c4f72; }
.sidebar-account .icon-button:hover { background: #243c6d; }
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  padding: 0 .25rem;
  border-radius: 9px;
  background: #2d4a79;
  color: #ecf3ff;
  font-size: .74rem;
  font-weight: 720;
}
.avatar.light { width: 39px; height: 39px; background: #ebf1fe; color: #2850b7; }
.nav-overlay { display: none; }

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
  min-height: 67px;
  padding: .7rem clamp(1rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.topbar-left { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.topbar-left .icon-button { width: 36px; min-width: 36px; min-height: 36px; padding: .4rem; }
.topbar-company { overflow: hidden; color: #293955; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .94rem; }
.tenant-select { max-width: min(16rem, 45%); }
.tenant-select select { min-height: 37px; font-size: .88rem; }

.main-content {
  display: grid;
  align-content: start;
  gap: 1.25rem;
  width: min(100%, 1480px);
  min-width: 0;
  margin: 0 auto;
  padding: clamp(1.15rem, 3vw, 2rem) clamp(1rem, 3vw, 2.25rem) 2.75rem;
}
.main-content > .button { justify-self: start; }
.page-heading, .panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 1rem;
  min-width: 0;
}
.page-intro { min-width: 0; }
.page-intro h1 { overflow-wrap: anywhere; }
.page-intro p { margin-top: .36rem; color: var(--muted); overflow-wrap: anywhere; }
.panel-heading { margin-bottom: .5rem; }
.panel-heading .panel-title { margin-right: auto; }
.stack, .form-stack { display: grid; gap: 1rem; min-width: 0; }
.stack.compact { gap: .48rem; }
.panel {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 2px #0e23420b;
}
.panel:has(> .empty) { align-content: stretch; }
.panel-title { overflow-wrap: anywhere; }
.panel > .button { justify-self: start; }
.muted-text, .field-hint { color: var(--muted); }
.field-hint { font-size: .82rem; }
.notice {
  display: block;
  padding: .7rem .85rem;
  background: #f0f3f8;
  color: #465771;
  border: 1px solid #e0e6f0;
  border-radius: 9px;
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.notice.error { background: #fff0f2; color: #932c3c; border-color: #f3cbd2; }
.notice.warning { background: #fff7e6; color: #714500; border-color: #f2d8ad; }
.notice.info { background: #eff4ff; color: #244c9d; border-color: #d4e1ff; }
.loading { padding: 1.3rem 1rem; color: var(--muted); }
.empty {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .5rem;
  min-width: 0;
  padding: clamp(1.4rem, 5vw, 3rem) .5rem;
  text-align: center;
}
.empty p { max-width: 42ch; color: var(--muted); font-size: .9rem; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  margin-bottom: .25rem;
  border: 1px solid #dce6f9;
  border-radius: 13px;
  background: #edf3ff;
  color: #3860c9;
}
.empty-icon svg { width: 23px; height: 23px; }

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .72rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #41516c;
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dashboard-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 224px;
  padding: clamp(1.45rem, 4.1vw, 2.55rem);
  border-radius: 18px;
  background: linear-gradient(118deg, #122242 10%, #203a70 72%, color-mix(in srgb, #263f78, var(--tenant-accent) 25%));
  color: #fff;
  box-shadow: 0 8px 20px #12244624;
}
.banner-content { position: relative; max-width: 73%; }
.banner-company { color: #d1e0ff; font-size: .86rem; font-weight: 650; overflow-wrap: anywhere; }
.dashboard-banner h2 { margin: .2rem 0 .48rem; font-size: clamp(1.6rem, 3.6vw, 2.5rem); }
.dashboard-banner p { max-width: 47ch; color: #d3e0fb; line-height: 1.45; }
.banner-button { margin-top: 1rem; background: #fff; color: #1f3e8f; }
.banner-button:hover { background: #e9f1ff; }
.banner-art {
  position: absolute;
  z-index: -1;
  right: clamp(1rem, 7vw, 5.5rem);
  display: grid;
  place-items: center;
  width: clamp(100px, 16vw, 175px);
  aspect-ratio: 1;
  border: 1px solid #a9c0ff56;
  border-radius: 34%;
  background: #9bb8ff18;
  color: #c5d6ff;
  transform: rotate(-11deg);
}
.banner-art::before, .banner-art::after {
  position: absolute;
  content: "";
  inset: -25%;
  border: 1px solid #b3cbff30;
  border-radius: 37%;
}
.banner-art::after { inset: -49%; opacity: .58; }
.banner-art svg { width: 47%; height: auto; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.metric {
  display: grid;
  justify-items: start;
  gap: .2rem;
  min-width: 0;
  padding: 1rem 1.1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px #0e23420b;
}
.metric-icon, .shortcut-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  border-radius: 9px;
  background: #edf3ff;
  color: #3057c5;
}
.metric-icon.teal { background: #e3f6f4; color: #08756a; }
.metric-icon.violet { background: #f0ebff; color: #6044b7; }
.metric-icon.amber { background: #fff3df; color: #89560b; }
.metric-value { margin-top: .3rem; font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 750; line-height: 1.08; letter-spacing: -.06em; overflow-wrap: anywhere; }
.metric-label { font-size: .88rem; color: #485875; font-weight: 590; }
.dashboard-bottom { display: grid; grid-template-columns: 1.13fr 1fr; gap: 1rem; }
.dashboard-total { color: var(--muted); font-size: .84rem; }
.channel-breakdown { display: grid; gap: .8rem; }
.channel-row { display: grid; grid-template-columns: minmax(85px, .7fr) minmax(55px, 1.7fr) minmax(25px, .3fr); align-items: center; gap: .7rem; }
.channel-row strong { text-align: right; }
.channel-progress { display: block; width: 100%; height: .68rem; appearance: none; border: 0; border-radius: 10px; overflow: hidden; background: #edf1f8; }
.channel-progress::-webkit-progress-bar { background: #edf1f8; }
.channel-progress::-webkit-progress-value { background: var(--blue); }
.channel-progress::-moz-progress-bar { background: var(--blue); }
.shortcut {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
  margin: 0;
  padding: .65rem;
  background: #f8faff;
  border: 1px solid #e5ebf6;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
}
.shortcut:hover { background: #edf3ff; }
.shortcut-text { display: grid; flex: 1 1 auto; min-width: 0; }
.shortcut-text small { color: var(--muted); }
.shortcut > svg { color: var(--blue); }

.field { display: grid; align-content: start; gap: .34rem; min-width: 0; }
.field-label { color: #24334e; font-size: .89rem; font-weight: 680; }
.field small { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.field input, .field select, .field textarea {
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  min-height: 43px;
  padding: .55rem .7rem;
  border-radius: 8px;
  border: 1px solid #c8d3e3;
  background: #fff;
  color: var(--ink);
  font-size: .94rem;
  line-height: 1.35;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input[type="color"] { padding: .27rem .4rem; }
.field [readonly] { background: #f4f7fc; }
.field [disabled] { background: #f1f3f8; color: var(--muted); }
.field input::placeholder, .field textarea::placeholder { color: #68758a; }
.checkbox { display: inline-flex; align-items: center; justify-self: start; gap: .5rem; min-height: 34px; font-size: .92rem; font-weight: 620; }
.checkbox input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; }
.form-actions, .row-actions, .badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; min-width: 0; }
.form-actions { justify-content: flex-end; }
form[aria-busy="true"] .button[type="submit"] { cursor: wait; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.filters { display: grid; grid-template-columns: minmax(150px, 2.4fr) minmax(100px, 1fr) minmax(100px, 1fr) auto; align-items: end; gap: .75rem; }
.filters.single { grid-template-columns: minmax(140px, 240px); }
.filters > .notice { grid-column: 1 / -1; }

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .19rem .52rem;
  border-radius: 7px;
  background: #eef2f7;
  color: #465771;
  font-size: .75rem;
  line-height: 1.35;
  font-weight: 690;
}
.pill.blue { background: #eaf0fe; color: #2a50ad; }
.pill.green { background: #e2f5ec; color: #1b694e; }
.pill.warning { background: #fff0d7; color: #7a4b0a; }
.pill.red { background: #ffebef; color: #9f2637; }

.table-wrap { min-width: 0; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.data-table th, .data-table td { padding: .85rem .7rem; border-bottom: 1px solid #e3e9f2; vertical-align: middle; overflow-wrap: anywhere; }
.data-table th { color: #44546f; background: #f5f7fb; font-size: .77rem; font-weight: 700; white-space: nowrap; }
.data-table th:first-child { border-top-left-radius: 8px; }
.data-table th:last-child { border-top-right-radius: 8px; }
.data-table td .button { min-height: 37px; font-size: .81rem; }
.data-table td:last-child .row-actions { gap: .35rem; }
.data-table tbody tr:hover { background: #f9fbfe; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.contact-link { display: flex; align-items: center; gap: .58rem; min-width: 0; color: #1f3051; text-decoration: none; }
a.contact-link:hover strong { text-decoration: underline; }
.contact-copy small {
  display: -webkit-box;
  max-width: 30ch;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: .78rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.record-text { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: .7rem;
  padding-top: .7rem;
  border-top: 1px solid var(--border);
}
.pagination .field select { width: fit-content; min-height: 38px; }
.pagination .muted-text { align-self: flex-end; padding-bottom: .5rem; font-size: .83rem; }
.pagination .button { min-height: 38px; font-size: .81rem; }

.conversation-body, .conversation-layout, .simulator-layout, .account-layout { display: grid; min-width: 0; gap: 1rem; align-items: start; }
.conversation-layout, .simulator-layout { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.account-layout { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.account-layout.forced { grid-template-columns: minmax(0, 480px); }
.conversation-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; min-width: 0; }
.conversation-heading .avatar { width: 47px; height: 47px; border-radius: 11px; font-size: .9rem; }
.conversation-heading .page-intro { min-width: 0; }
.conversation-heading .page-intro h1 { font-size: clamp(1.4rem, 4vw, 2rem); }
.message-history, .note-list, .menu-editor { display: grid; gap: .7rem; min-width: 0; margin: 0; padding: 0; list-style: none; }
.message-history { justify-items: start; }
.message-entry {
  width: min(94%, 630px);
  min-width: 0;
  padding: .72rem .8rem;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  background: #f4f7fb;
}
.message-entry.outgoing { justify-self: end; border-color: #d8e3fc; background: #eff4ff; }
.message-entry .notice { margin-top: .5rem; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .28rem .45rem; margin-bottom: .32rem; color: #425475; font-size: .76rem; overflow-wrap: anywhere; }
.message-meta time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.message-text, .message-preview, .note-entry p { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { padding-top: .9rem; border-top: 1px solid var(--border); }
.metadata { display: flex; flex-wrap: wrap; gap: .25rem .6rem; color: var(--muted); font-size: .85rem; }
.metadata strong, .metadata-title { color: var(--ink); font-size: .88rem; font-weight: 660; }
.note-entry { min-width: 0; padding: .65rem .7rem; border: 1px solid #e6ecf5; border-radius: 8px; background: #f8faff; overflow-wrap: anywhere; }
.note-entry strong { font-size: .83rem; }
.note-entry time { display: block; color: var(--muted); font-size: .74rem; }
.note-entry p { margin-top: .25rem; font-size: .88rem; }
.conversation-side .stack > .button { width: 100%; }
.history-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; font-size: .82rem; color: var(--muted); }

.tab-list { display: flex; flex-wrap: wrap; gap: .4rem; padding: .4rem; background: #eaf0f8; border: 1px solid var(--border); border-radius: 11px; width: fit-content; }
.tab { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: .45rem .75rem; border-radius: 7px; color: #40516f; font-size: .89rem; font-weight: 650; text-decoration: none; }
.tab:hover { background: #f7faff; }
.tab[aria-current] { background: #fff; color: var(--blue); box-shadow: 0 1px 3px #25396313; }
.preview-box { display: grid; gap: .5rem; padding: .8rem 1rem; border-left: 3px solid var(--tenant-accent); background: #f2f6ff; border-radius: 9px; }
.preview-box h3 { color: #334a76; font-size: .89rem; }
.message-preview { font-size: .92rem; }
.menu-entry { display: grid; gap: .75rem; min-width: 0; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.menu-entry-heading { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.menu-entry-heading strong { flex: 1 1 auto; }
.menu-entry-heading .icon-button { width: 36px; min-height: 36px; }
.position { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; background: #edf3ff; color: #3456a8; border-radius: 7px; font-size: .82rem; font-weight: 700; }

.integration-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; gap: .85rem; }
.integration-grid .panel-heading { justify-content: start; gap: .52rem; }
.integration-grid .panel-title { font-size: 1.12rem; }
.integration-grid .form-stack { padding-top: .8rem; border-top: 1px solid var(--border); }
.integration-status, .profile-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: .25rem .6rem; font-size: .88rem; }
.integration-status dt, .profile-details dt { font-weight: 650; }
.integration-status dd, .profile-details dd { color: var(--muted); overflow-wrap: anywhere; }
.simulator-layout .muted-text { overflow-wrap: anywhere; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: end; min-width: 0; }
.copy-field .button { min-height: 43px; }

.erp-form { gap: 1.2rem; }
.erp-inspect-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.erp-inspect-actions .button { flex: 0 0 auto; }
.erp-inspect-actions .field-hint { flex: 1 1 260px; max-width: 70ch; }
.erp-mapping-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1rem; align-items: start; min-width: 0; }
.erp-mapping-card { display: grid; align-content: start; gap: 1rem; min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 11px; background: #f8faff; }
.erp-mapping-card h3 { color: #29436f; }
.erp-mapping-card .form-grid { gap: .85rem; }
.erp-version { width: min(100%, 38rem); }
.erp-version input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; }
.erp-feedback ul { margin: .4rem 0 0; padding-left: 1.3rem; }
.erp-feedback li + li { margin-top: .28rem; }
.erp-form[aria-busy="true"] { cursor: progress; }
.erp-form[aria-busy="true"] .button { cursor: wait; }
.gatewaypay-form { gap: 1.2rem; }
.gatewaypay-test-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.gatewaypay-test-actions .button { flex: 0 0 auto; }
.gatewaypay-test-actions .field-hint { flex: 1 1 280px; max-width: 70ch; }
.gatewaypay-company { display: grid; gap: .65rem; min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 11px; background: #f8faff; }
.gatewaypay-company h3 { color: #29436f; }
.gatewaypay-company .notice { margin: 0; }
.gatewaypay-flow { padding: 1rem; border-radius: 10px; background: #f2f5fb; line-height: 1.8; font-weight: 600; }
.gatewaypay-feedback ul { margin: .4rem 0 0; padding-left: 1.3rem; }
.gatewaypay-feedback li + li { margin-top: .28rem; }
.gatewaypay-form[aria-busy="true"] { cursor: progress; }
.gatewaypay-form[aria-busy="true"] .button { cursor: wait; }

.modal {
  width: min(calc(100% - 2rem), 525px);
  max-width: none;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  margin: auto;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 22px 65px #12213b50;
}
.modal[open] { display: grid; gap: 1rem; }
.modal::backdrop { background: #13224088; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modal-heading .icon-button { flex: 0 0 auto; }
.modal-heading h2 { overflow-wrap: anywhere; }
.toast-area { position: fixed; z-index: 12; right: 1rem; bottom: 1rem; max-width: min(460px, calc(100% - 2rem)); pointer-events: none; }
.toast { padding: .78rem .95rem; border: 1px solid #c7e1d6; border-radius: 10px; background: #edf9f3; color: #18583d; font-size: .93rem; font-weight: 620; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.toast.error { border-color: #f3cbd2; background: #fff0f2; color: #932c3c; }
.toast.info { border-color: #d4e1ff; background: #eff4ff; color: #244c9d; }

@media (min-width: 781px) {
  .nav-compact .sidebar { padding-inline: .65rem; }
  .nav-compact .sidebar > .brand-mark { margin-inline: auto; }
  .nav-compact .sidebar .brand-name, .nav-compact .nav-link span, .nav-compact .nav-label, .nav-compact .account-details { display: none; }
  .nav-compact .nav-link { justify-content: center; padding-inline: .35rem; }
  .nav-compact .sidebar-account { display: grid; justify-items: center; }
}

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

@media (max-width: 780px) {
  .login-layout { grid-template-columns: minmax(0, 1fr); }
  .login-right { display: none; }
  .login-left { min-height: 100dvh; }
  .shell, .shell.nav-compact { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: min(270px, 84vw);
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .2s ease, visibility .2s;
  }
  .nav-open .sidebar { visibility: visible; transform: translateX(0); }
  .nav-open .nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 19;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #101d3670;
  }
  .nav-open .nav-overlay svg { display: none; }
  .nav-open .nav-overlay:hover:not(:disabled) { background: #101d3670; }
  .account-layout { grid-template-columns: 1fr; }
  .data-table, .data-table tbody, .data-table tr { display: block; min-width: 0; }
  .data-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .data-table tr { padding: .52rem 0; border-bottom: 1px solid var(--border); }
  .data-table tr:last-child { border-bottom: 0; }
  .data-table td {
    display: grid;
    grid-template-columns: minmax(92px, .55fr) minmax(0, 1fr);
    align-items: start;
    gap: .38rem;
    border: 0;
    padding: .34rem .25rem;
  }
  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 690;
  }
  .data-table td > a, .data-table td > .pill { justify-self: start; }
}

@media (max-width: 570px) {
  .dashboard-bottom { grid-template-columns: 1fr; }
  .dashboard-banner { min-height: 0; }
  .banner-content { max-width: 100%; }
  .banner-art { opacity: .22; right: .5rem; }
  .banner-button { margin-top: .75rem; }
  .metrics { gap: .6rem; }
  .metric { padding: .8rem; }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters > .field:first-child { grid-column: 1 / -1; }
  .filters > .button { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .message-entry { width: 100%; }
}

@media (max-width: 365px) {
  .metrics { grid-template-columns: 1fr; }
  .copy-field { grid-template-columns: 1fr; }
  .copy-field .button { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 .34rem 1.75rem; }
.sidebar .nav-close { display: none; }
@media (min-width: 781px) {
  .nav-compact .sidebar-heading { justify-content: center; margin-inline: 0; }
}
@media (max-width: 780px) {
  .sidebar .nav-close { display: inline-flex; border-color: #3c4f72; }
  .sidebar .nav-close:hover { background: #243c6d; }
}
