:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #202327;
  --muted: #727881;
  --line: #e5e7eb;
  --soft: #f1f4f7;
  --primary: #24272c;
  --primary-dark: #111318;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c24135;
  --green: #16835b;
  --shadow: 0 8px 20px rgba(23, 26, 31, 0.06);
  --page-gutter: 18px;
  --page-top: 14px;
  --page-bottom: 30px;
  --shell-max: 1180px;
  --front-shell-max: 1240px;
  --admin-max: 1440px;
  --admin-menu-width: 204px;
  --layout-gap: 10px;
  --panel-pad: 12px;
  --panel-pad-lg: 14px;
  --card-pad: 8px;
  --control-height: 32px;
  --control-height-sm: 24px;
  --table-pad-y: 7px;
  --table-pad-x: 9px;
  --table-min: 860px;
  --wide-table-min: 1180px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1218;
  --panel: #171b23;
  --ink: #f4f6fb;
  --muted: #9aa3b2;
  --line: #2a303b;
  --soft: #202634;
  --primary: #f5f7fb;
  --primary-dark: #ffffff;
  --blue: #77a7ff;
  --amber: #f0b45b;
  --red: #f1796e;
  --green: #5ad49d;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
.button,
.pill,
.brand,
.topnav,
.menu-title,
.menu-item,
.eyebrow,
.theme-toggle button,
.mini-tabs button,
.product-submenu button,
.page-jump span,
.pager > span,
th {
  white-space: nowrap;
  word-break: keep-all;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 clamp(14px, 3vw, 32px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  scrollbar-width: thin;
}

.brand,
.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  letter-spacing: 0;
}

.topnav a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 248, 252, 0.96)),
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.11), transparent 32%),
    var(--bg);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-card {
  width: min(400px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.login-brand h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(194, 65, 53, 0.22);
  border-radius: 8px;
  background: rgba(194, 65, 53, 0.08);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.theme-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.theme-toggle button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.theme-toggle button.active {
  color: var(--ink);
  background: var(--soft);
}

.shell,
.admin-shell {
  width: min(var(--shell-max), calc(100% - var(--page-gutter)));
  margin: var(--page-top) auto var(--page-bottom);
}

.admin-layout {
  display: grid;
  grid-template-columns: var(--admin-menu-width) minmax(0, 1fr);
  gap: var(--layout-gap);
  width: min(var(--admin-max), calc(100% - var(--page-gutter)));
  margin: var(--page-top) auto var(--page-bottom);
  align-items: start;
}

.admin-menu {
  position: sticky;
  top: 66px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.menu-title {
  padding: 2px 6px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.menu-item {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.menu-item span {
  font-weight: 850;
}

.menu-item small {
  color: var(--muted);
  font-size: 12px;
}

.menu-item.active {
  border-color: #d8dce2;
  background: #f4f5f7;
  color: var(--primary);
}

.admin-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-view {
  display: none;
  gap: 12px;
}

.admin-view.active {
  display: grid;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.front-page {
  --front-ink: var(--ink);
  --front-muted: var(--muted);
  --front-line: var(--line);
  --front-surface: var(--panel);
  --front-soft: var(--soft);
  --front-primary: var(--primary);
  --front-primary-dark: var(--primary-dark);
  --front-teal: var(--green);
  --front-gold: var(--amber);
  --front-shadow: var(--shadow);
  background: var(--bg);
}

.front-page .shell {
  width: min(var(--front-shell-max), calc(100% - var(--page-gutter)));
}

.front-page:not(.front-has-session) .shell {
  display: grid;
  align-content: start;
  justify-items: center;
  width: min(720px, calc(100% - var(--page-gutter)));
  margin: 0 auto;
  min-height: calc(100vh - 62px);
  padding: clamp(52px, 11vh, 86px) 0 42px;
}

.front-page .workspace {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.front-page:not(.front-has-session) .workspace {
  grid-template-columns: 1fr;
  justify-items: center;
  width: 100%;
}

.front-page .status-pane {
  position: static;
}

.front-page .redeem-pane {
  position: relative;
  display: grid;
  gap: 18px;
  overflow: hidden;
}

.front-page:not(.front-has-session) .redeem-pane {
  grid-template-columns: 1fr;
  align-items: stretch;
  width: 100%;
  max-width: 680px;
  min-height: 0;
  padding: 26px;
  gap: 20px;
  border-color: var(--line);
  background: var(--front-surface);
  box-shadow: var(--front-shadow);
}

.front-page:not(.front-has-session) .redeem-pane::before {
  content: none;
}

.front-page.front-has-session .redeem-pane {
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 0.55fr) minmax(360px, 1fr);
  align-items: start;
  gap: 18px;
  padding: 22px;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--front-shadow);
}

.redeem-copy {
  display: grid;
  gap: 13px;
  min-width: 0;
}

.front-page:not(.front-has-session) .redeem-copy {
  justify-items: start;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.front-title-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}

.front-brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.front-brand-line span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 131, 91, 0.1);
}

.front-product-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--soft);
  font-size: 13px;
  font-weight: 850;
}

.redeem-copy h1 {
  margin: 0;
  max-width: 620px;
  color: var(--front-ink);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.18;
  letter-spacing: 0;
  font-weight: 850;
}

.redeem-copy p {
  margin: 0;
  color: var(--front-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.redeem-copy #statePill {
  justify-self: start;
  width: fit-content;
  margin-top: 4px;
}

.front-page:not(.front-has-session) #statePill {
  display: none;
}

.front-page.front-has-session .front-brand-line {
  font-size: 14px;
}

.front-page.front-has-session .redeem-copy h1 {
  font-size: 26px;
}

.front-page.front-has-session .redeem-copy p {
  font-size: 14px;
}

.front-page .redeem-form {
  min-width: 0;
}

.redeem-input-wrap {
  display: grid;
  gap: 12px;
  align-items: end;
}

.front-page:not(.front-has-session) .redeem-input-wrap {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.front-page:not(.front-has-session) .redeem-input-wrap .field span {
  display: block;
  margin-bottom: 8px;
  color: #34404a;
  font-size: 13px;
  font-weight: 850;
}

.front-page.front-has-session .redeem-input-wrap {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  box-shadow: none;
}

.front-page #cdkInput {
  min-height: 70px;
  height: auto;
  resize: vertical;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.front-page:not(.front-has-session) #cdkInput {
  min-height: 76px;
  height: 76px;
  resize: none;
  border: 1px solid var(--front-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: var(--front-ink);
  font-size: 16px;
  text-align: left;
}

.front-page:not(.front-has-session) #cdkInput:focus {
  border-color: rgba(37, 99, 235, 0.68);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.front-page:not(.front-has-session) #redeemBtn {
  width: 100%;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(17, 19, 24, 0.12);
  font-size: 15px;
}

.front-page:not(.front-has-session) #redeemBtn:hover {
  background: var(--primary-dark);
}

.front-page.front-has-session #cdkInput {
  min-height: 56px;
  height: 56px;
  resize: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 18px;
}

.front-page.front-has-session #redeemBtn {
  min-height: 56px;
  padding: 0 28px;
  border-radius: 8px;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(17, 19, 24, 0.12);
}

.front-page .action-row .button {
  min-width: 128px;
}

.front-page:not(.front-has-session) .secondary-actions {
  justify-content: space-between;
  margin-top: -2px;
  padding-top: 0;
}

.front-page:not(.front-has-session) .secondary-actions .button {
  min-width: 0;
  min-height: 38px;
  padding: 0 14px;
  border-color: rgba(223, 229, 236, 0.92);
  background: #fff;
  color: var(--muted);
  box-shadow: none;
  font-size: 13px;
}

.front-page:not(.front-has-session) .secondary-actions .button:hover {
  border-color: #cbd5e1;
  color: var(--ink);
  background: var(--soft);
}

.redeem-pane,
.status-pane,
.records-section,
.admin-panel,
.table-panel,
.admin-auth {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.redeem-pane,
.status-pane,
.records-section,
.admin-panel,
.table-panel {
  padding: var(--panel-pad);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 10px;
}

.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.form-grid,
.admin-panel {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  color: #34404a;
  font-weight: 750;
}

.field span {
  font-size: 13px;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.inline-field {
  display: inline-grid;
  grid-template-columns: auto 88px;
  gap: 6px;
  align-items: center;
  color: #34404a;
  font-size: 13px;
  font-weight: 800;
}

.inline-field input {
  height: 34px;
  padding: 0 9px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(17, 19, 24, 0.02);
}

input,
select {
  height: var(--control-height);
  padding: 0 11px;
}

textarea {
  min-height: 86px;
  resize: vertical;
  padding: 10px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.68);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
  color: var(--muted);
  background: #f1f5f6;
  cursor: not-allowed;
}

.mode-hint {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  color: #334155;
  background: #f7f9fc;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.action-row,
.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.button.primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(17, 19, 24, 0.12);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: #d6dbe2;
  color: var(--ink);
  background: #fff;
}

.button.light {
  border-color: var(--line);
  color: var(--muted);
  background: #fff;
}

.button.warn {
  color: #fff;
  background: var(--amber);
}

.status-pane .button.warn {
  width: 100%;
}

.button.tiny {
  min-height: var(--control-height-sm);
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
}

.button.danger {
  color: #fff;
  background: var(--red);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.icon-button:hover {
  background: #f4f5f7;
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.pill.neutral {
  color: var(--muted);
  background: #edf1f3;
}

.pill.ok {
  color: var(--green);
  background: #eaf7f0;
}

.pill.info {
  color: var(--blue);
  background: #eef4ff;
}

.pill.warning {
  color: var(--amber);
  background: #fff4e3;
}

.pill.danger {
  color: var(--red);
  background: #fff0f0;
}

.pill.error {
  color: var(--red);
  background: #fff0f0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.front-page .info-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.info-grid div,
.metric {
  min-height: 62px;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.info-grid span,
.metric span,
.code-panel span,
.number-box span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.info-grid small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.info-grid strong,
.metric strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  font-size: 15px;
}

.number-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.number-box.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.number-box strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  font-size: 22px;
}

.front-page .number-box strong {
  font-size: 22px;
}

.number-box p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.code-panel {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f7faff;
  transition: border-color 180ms ease, background 180ms ease;
}

.code-panel strong {
  display: block;
  color: var(--blue);
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.front-page .code-panel strong {
  font-size: 34px;
}

.code-main {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.code-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: thin;
}

.code-panel small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.front-notice {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid #bdd7ff;
  border-radius: 8px;
  color: #1d4f9a;
  background: #eef6ff;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.front-notice.ok {
  border-color: #b7e0c7;
  color: #14723c;
  background: #eefaf3;
}

.front-notice.changed {
  position: relative;
  border-color: #45c48a;
  color: #075f3d;
  background: linear-gradient(90deg, #e9fff5 0%, #f6fffb 100%);
  box-shadow: 0 8px 20px rgba(20, 143, 92, 0.12);
  font-weight: 850;
}

.front-notice.changed::before {
  content: "";
  width: 4px;
  align-self: stretch;
  min-height: 18px;
  margin-right: 8px;
  border-radius: 999px;
  background: #10a66b;
  flex: 0 0 auto;
}

.front-notice.error {
  border-color: #f2b8b5;
  color: #b3261e;
  background: #fff2f1;
}

.front-notice.hidden {
  display: none;
}

.change-request {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.change-request.hidden {
  display: none;
}

.change-request .section-head {
  margin-bottom: 0;
}

.change-request-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.change-request h2 {
  font-size: 16px;
}

.change-request input[type="file"] {
  height: 34px;
  padding: 0 8px 0 0;
  overflow: hidden;
  line-height: 32px;
}

.change-request input[type="file"]::file-selector-button {
  margin-right: 10px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-width: 0 1px 0 0;
  border-radius: 0;
  color: var(--ink);
  background: #f8fafc;
  font-weight: 800;
  cursor: pointer;
}

.front-page.front-has-session .info-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.front-page.front-has-session .info-grid div {
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.front-page.front-has-session .info-grid div:last-child {
  border-right: 0;
}

.front-page.front-has-session .info-grid strong {
  color: var(--front-ink);
  font-size: 16px;
}

.front-page.front-has-session .status-pane {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.front-page.front-has-session .status-pane > .section-head {
  display: none;
}

.front-page.front-has-session .front-notice,
.front-page.front-has-session #switchHint,
.front-page.front-has-session .change-request {
  grid-column: 1 / -1;
}

.front-page.front-has-session .number-box,
.front-page.front-has-session .code-panel {
  min-height: 150px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.front-page.front-has-session .number-box {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
}

.front-page.front-has-session .number-box span,
.front-page.front-has-session .code-panel > span {
  color: var(--front-muted);
  font-size: 13px;
  font-weight: 850;
}

.front-page.front-has-session .number-box strong {
  margin-top: 10px;
  color: var(--front-ink);
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.16;
}

.front-page.front-has-session .number-box p {
  max-width: 620px;
  font-size: 13px;
}

.front-page.front-has-session .number-box .button {
  justify-self: start;
  margin-top: 8px;
  min-height: var(--control-height);
  border-color: var(--line);
  color: var(--ink);
}

.front-page.front-has-session .code-panel {
  display: grid;
  align-content: start;
}

.front-page.front-has-session .code-main {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.front-page.front-has-session .code-panel strong {
  color: var(--blue);
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.02;
}

.front-page.front-has-session .code-actions {
  justify-content: start;
}

.front-page.front-has-session .code-panel small {
  order: -1;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.front-page.front-has-session #switchHint {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-weight: 750;
}

.front-page.front-has-session .change-request {
  position: relative;
  grid-template-columns: minmax(176px, 0.58fr) minmax(250px, 0.9fr) minmax(320px, 1.1fr) minmax(112px, auto);
  gap: 8px 10px;
  align-items: end;
  margin-top: 0;
  padding: 10px 11px;
  overflow: hidden;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(24, 31, 42, 0.06);
}

.front-page.front-has-session .change-request::before {
  content: none;
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--front-teal), var(--front-primary));
}

.front-page.front-has-session .change-request .section-head {
  align-self: stretch;
  margin: 0;
  padding-right: 6px;
}

.front-page.front-has-session .change-request .eyebrow {
  color: var(--muted);
}

.front-page.front-has-session .change-request h2 {
  margin-top: 1px;
  font-size: 15px;
  line-height: 1.15;
}

.front-page.front-has-session .change-request .field {
  gap: 4px;
  min-width: 0;
}

.front-page.front-has-session .change-request .field span {
  color: var(--front-muted);
  font-size: 12px;
}

.front-page.front-has-session .change-request input[type="file"],
.front-page.front-has-session .change-request textarea {
  height: 34px;
  min-height: 34px;
  border-color: var(--line);
  background: #fff;
  font-size: 13px;
}

.front-page.front-has-session .change-request textarea {
  padding: 7px 10px;
  line-height: 1.35;
  resize: none;
}

.front-page.front-has-session .change-request .button.warn {
  width: auto;
  min-width: 108px;
  min-height: 34px;
  padding: 0 14px;
  align-self: end;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--front-primary), var(--front-primary-dark));
}

.front-page.front-has-session .change-request .small {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 26px;
  margin-top: 0;
  padding: 5px 9px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 8px;
  color: #475569;
  background: #f8fafc;
  line-height: 1.3;
}

.front-page.front-has-session #changeRequestStatus.change-status-approved {
  border-color: #39b980;
  color: #086142;
  background: linear-gradient(90deg, #e9fff5 0%, #f7fffb 100%);
  box-shadow: inset 4px 0 0 #10a66b, 0 6px 16px rgba(16, 166, 107, 0.1);
  font-weight: 850;
}

.screenshot-preview {
  display: block;
  width: 100%;
  max-height: min(68vh, 760px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
}

.incident-history-table {
  min-width: 1080px;
  table-layout: fixed;
}

.incident-history-table th:nth-child(1) {
  width: 42px;
}

.incident-history-table th:nth-child(2) {
  width: 150px;
}

.incident-history-table th:nth-child(3) {
  width: 210px;
}

.incident-history-table th:nth-child(4) {
  width: 210px;
}

.incident-history-table th:nth-child(5) {
  width: 220px;
}

.incident-history-table th:nth-child(6) {
  width: 170px;
}

.incident-history-table th:nth-child(7) {
  width: 150px;
}

.incident-history-table th:nth-child(2),
.incident-history-table td:nth-child(2),
.incident-history-table th:nth-child(5),
.incident-history-table td:nth-child(5),
.incident-history-table th:nth-child(6),
.incident-history-table td:nth-child(6),
.incident-history-table th:nth-child(7),
.incident-history-table td:nth-child(7) {
  text-align: center;
}

.incident-history-table td {
  vertical-align: middle;
}

.incident-history-table .cell-stack {
  gap: 3px;
}

.incident-history-table .cell-stack strong,
.incident-history-table .cell-stack small {
  display: block;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-history-table .cell-stack strong {
  font-size: 13px;
  line-height: 1.25;
}

.incident-history-table .cell-stack small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.incident-history-table .incident-event-cell .pill {
  width: fit-content;
  margin-right: 4px;
}

.incident-history-table .incident-result-cell strong {
  color: var(--green);
}

.incident-history-table .incident-time-cell strong {
  font-size: 12px;
  font-weight: 850;
}

.incident-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.incident-detail-grid div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.incident-detail-grid .wide {
  grid-column: 1 / -1;
}

.incident-detail-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.incident-detail-grid strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
}

.small {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.6;
}

.records-section {
  margin-top: 18px;
}

.batch-section {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.batch-list {
  display: grid;
  gap: 10px;
}

.batch-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(130px, 0.45fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.batch-card.active {
  border-color: rgba(37, 99, 235, 0.48);
  background: #f6f9ff;
}

.batch-card.error {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: rgba(194, 65, 53, 0.24);
  background: rgba(194, 65, 53, 0.06);
}

.batch-main,
.batch-code {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.batch-main strong,
.batch-code strong {
  overflow-wrap: anywhere;
}

.batch-main small,
.batch-code span,
.batch-code small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.batch-main p {
  margin: 0;
  overflow-wrap: anywhere;
}

.batch-code strong {
  color: var(--blue);
  font-size: 24px;
}

.batch-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: thin;
}

.records {
  display: grid;
  gap: 10px;
}

.session-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.session-chip {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.session-chip:hover {
  transform: translateY(-1px);
}

.session-chip.active {
  border-color: rgba(37, 99, 235, 0.48);
  background: #f6f9ff;
}

.session-chip span,
.session-chip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.session-chip strong {
  overflow-wrap: anywhere;
}

.record,
.empty-record {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.record {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(86px, 110px) minmax(140px, 170px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.front-page .record {
  grid-template-columns: minmax(150px, 180px) minmax(86px, 110px) minmax(140px, 170px) minmax(0, 1fr) auto;
}

.record time {
  color: var(--muted);
  font-size: 13px;
}

.record strong {
  color: var(--blue);
  font-size: 20px;
}

.record p {
  margin-bottom: 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.record small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-record {
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  box-shadow: var(--shadow);
  font-weight: 800;
  animation: toastIn 180ms ease both;
}

.toast.error {
  background: var(--red);
}

.toast.warning {
  background: #b7791f;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(24, 32, 38, 0.42);
}

.modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(650px, 100%);
  max-height: min(94vh, 760px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(24, 32, 38, 0.24);
  overflow: hidden;
}

.modal-card.narrow {
  width: min(540px, 100%);
}

.modal-card.import-card {
  width: min(760px, 100%);
}

.modal-card.wide {
  width: min(1120px, 100%);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 18px;
}

.modal-body {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px;
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.rule-box {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rule-preview {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px dashed #b9c8cc;
  border-radius: 6px;
  background: #fff;
}

.rule-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rule-preview strong {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-size: 15px;
  letter-spacing: 0;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.field-hint.danger {
  color: var(--red);
  font-weight: 800;
}

.import-scope {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.import-scope-head {
  display: grid;
  gap: 2px;
}

.import-scope-head strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.detail-body {
  gap: 10px;
  background: #f8f9fb;
}

.detail-hero {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.detail-hero div,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-hero div {
  min-height: 62px;
  padding: 10px;
}

.detail-hero span,
.detail-kv span,
.detail-item span,
.detail-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-hero strong,
.detail-kv strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 10px;
  align-items: start;
}

.detail-section {
  padding: 12px;
}

.detail-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-kv div {
  min-height: 54px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.detail-form {
  display: grid;
  gap: 10px;
}

.inline-actions {
  padding: 0;
  border: 0;
  background: transparent;
}

.bind-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.bind-row p {
  grid-column: 1 / -1;
}

.mini-table {
  min-width: 760px;
}

.mini-table th {
  text-align: center;
}

.detail-session-table th:nth-child(1),
.detail-session-table td:nth-child(1),
.detail-session-table th:nth-child(3),
.detail-session-table td:nth-child(3),
.detail-session-table th:nth-child(4),
.detail-session-table td:nth-child(4),
.detail-session-table th:nth-child(5),
.detail-session-table td:nth-child(5),
.detail-message-table th:nth-child(1),
.detail-message-table td:nth-child(1),
.detail-message-table th:nth-child(3),
.detail-message-table td:nth-child(3),
.detail-message-table th:nth-child(5),
.detail-message-table td:nth-child(5) {
  text-align: center;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-item {
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) minmax(120px, 0.25fr) minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.detail-item strong,
.detail-item p {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-item p {
  color: var(--muted);
  line-height: 1.45;
}

.api-link-row {
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 680px);
  gap: 6px;
  vertical-align: middle;
}

.api-link-text {
  display: inline-block;
  max-width: min(58vw, 560px);
  padding: 1px 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  scrollbar-width: thin;
}

.api-link-empty {
  color: var(--muted);
}

.api-copy-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.api-copy-button:hover {
  border-color: #cbd5e1;
  background: #f6f8fb;
  color: var(--ink);
}

.sms-log-item {
  grid-template-columns: minmax(150px, 0.24fr) minmax(110px, 0.16fr) minmax(260px, 1fr) 150px;
  row-gap: 14px;
}

.sms-log-parsed,
.sms-log-raw {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sms-log-parsed > span,
.sms-log-raw > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.sms-log-raw pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #384252;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.58;
}

.sms-log-code {
  display: grid;
  grid-template-columns: minmax(90px, 0.18fr) minmax(0, 1fr) 180px;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 8px;
  background: #f7f9fc;
}

.sms-log-code strong {
  color: var(--blue);
  font-size: 18px;
}

.sms-log-code p,
.sms-log-code small {
  margin: 0;
  overflow-wrap: anywhere;
}

.change-record-cell {
  display: grid;
  gap: 4px;
  min-width: 170px;
}

.change-record-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.change-record-cell strong,
.change-record-cell span {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.empty-record.compact {
  min-height: 0;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
}

.admin-shell {
  display: grid;
  gap: 12px;
}

.admin-auth {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.metric strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
}

.metric-button {
  display: block;
  width: 100%;
  min-height: 62px;
  cursor: pointer;
  text-align: left;
}

.metric-button:hover {
  border-color: #d8dce2;
  background: #f4f6f8;
}

.compact-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.compact-metrics .metric strong {
  font-size: 18px;
}

.dashboard-business-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.dashboard-health-panel,
.dashboard-rank-panel {
  display: grid;
  gap: 10px;
}

.dashboard-rank-panel {
  grid-template-rows: auto minmax(0, 1fr);
  height: clamp(260px, 34vh, 360px);
  overflow: hidden;
}

.dashboard-rank-panel .section-head {
  margin-bottom: 0;
}

.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
}

.dashboard-card {
  min-height: 72px;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.dashboard-card span,
.dashboard-rank-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-card,
.dashboard-rank-item strong,
.dashboard-rank-item small {
  cursor: help;
}

.dashboard-card.ok {
  border-color: rgba(22, 131, 91, 0.22);
  background: #f3fbf7;
}

.dashboard-card.info {
  border-color: rgba(37, 99, 235, 0.18);
  background: #f5f8ff;
}

.dashboard-card.warning {
  border-color: rgba(183, 121, 31, 0.24);
  background: #fff9ef;
}

.dashboard-card.danger {
  border-color: rgba(194, 65, 53, 0.24);
  background: #fff6f6;
}

.dashboard-rank-list {
  min-height: 0;
  max-height: 100%;
  display: grid;
  align-content: start;
  gap: 9px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.dashboard-rank-list::-webkit-scrollbar {
  width: 6px;
}

.dashboard-rank-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(113, 124, 139, 0.28);
}

.dashboard-rank-list:hover::-webkit-scrollbar-thumb {
  background: rgba(113, 124, 139, 0.46);
}

.dashboard-rank-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  line-height: 1.35;
}

.dashboard-rank-item strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-rank-side {
  display: grid;
  gap: 5px;
  justify-items: end;
  text-align: right;
}

.business-stats-panel {
  display: grid;
  gap: 14px;
}

.business-stats-controls .inline-field {
  grid-template-columns: auto minmax(132px, 172px);
}

.business-stats-table {
  min-width: 1080px;
  table-layout: fixed;
}

.business-stats-table th,
.business-stats-table td {
  padding: 14px 12px;
}

.business-stats-table th:nth-child(1) {
  width: 15%;
}

.business-stats-table th:nth-child(2) {
  width: 16%;
}

.business-stats-table th:nth-child(3),
.business-stats-table th:nth-child(4) {
  width: 14%;
}

.business-stats-table th:nth-child(5),
.business-stats-table th:nth-child(6),
.business-stats-table th:nth-child(7) {
  width: 12%;
}

.business-stats-table th:nth-child(n + 2),
.business-stats-table td:nth-child(n + 2) {
  text-align: center;
}

.lease-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lease-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.lease-card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.lease-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.lease-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.lease-stat {
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.lease-stat span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lease-stat strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
}

.segment-analytics-panel {
  display: grid;
  gap: 12px;
  padding: var(--panel-pad);
}

.segment-analytics-panel > .section-head.compact {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.segment-analytics-panel > .section-head.compact h2 {
  margin-top: 2px;
  font-size: 18px;
  line-height: 1.2;
}

.segment-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: thin;
}

.segment-analytics-panel .segment-controls {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(126px, 0.65fr);
  gap: 8px;
  align-items: end;
  justify-content: stretch;
  width: 100%;
}

.segment-controls select {
  min-width: 130px;
}

.segment-analytics-panel .segment-controls select {
  min-width: 0;
}

.segment-controls .inline-field {
  grid-template-columns: auto minmax(104px, 142px);
}

.segment-analytics-panel .segment-controls .inline-field {
  grid-template-columns: auto minmax(92px, 1fr);
  min-width: 0;
}

.segment-analytics-panel .segment-controls .inline-field span {
  white-space: nowrap;
}

.segment-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.segment-analytics-panel .segment-summary {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.supplier-quality-panel {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.supplier-catalog-panel {
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.master-data-panel {
  margin-top: 12px;
}

.master-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.master-data-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  display: grid;
  align-content: start;
  gap: 8px;
}

.master-data-card h3 {
  margin: 0;
  font-size: 15px;
}

.inline-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 120px) auto;
  gap: 8px;
  margin-bottom: 0;
}

.master-data-card:nth-child(2) .inline-create-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-wrap {
  max-height: 300px;
  overflow: auto;
}

.compact-table {
  min-width: 420px;
}

.compact-table th,
.compact-table td {
  padding: 8px 9px;
}

.bulk-bar.master-bulk-bar {
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 7px;
  margin-bottom: 0;
}

.bulk-bar.master-bulk-bar .bulk-actions {
  gap: 6px;
}

.bulk-bar.master-bulk-bar .button {
  min-height: 26px;
  padding: 5px 9px;
}

.master-data-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.master-country-table th:nth-child(1),
.master-country-table td:nth-child(1),
.master-carrier-table th:nth-child(1),
.master-carrier-table td:nth-child(1) {
  width: 34px;
}

.master-country-table th:nth-child(2),
.master-country-table td:nth-child(2) {
  width: auto;
}

.master-country-table th:nth-child(3),
.master-country-table td:nth-child(3) {
  width: 82px;
  text-align: center;
}

.master-country-table th:nth-child(4),
.master-country-table td:nth-child(4),
.master-carrier-table th:nth-child(3),
.master-carrier-table td:nth-child(3) {
  width: 86px;
  text-align: center;
}

.master-carrier-table th:nth-child(2),
.master-carrier-table td:nth-child(2) {
  width: auto;
}

.master-data-table th,
.master-data-table td {
  height: 48px;
  vertical-align: middle;
}

.master-data-table .select-col {
  text-align: center;
}

.master-name-cell {
  min-width: 0;
}

.master-name-cell strong,
.master-name-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-name-cell strong {
  font-size: 13px;
}

.master-name-cell small {
  margin-top: 2px;
  color: var(--muted);
}

.master-action-cell {
  justify-content: flex-end;
  white-space: nowrap;
}

.master-action-cell .button {
  min-width: 42px;
  padding-inline: 8px;
}

.supplier-controls {
  grid-template-columns:
    minmax(180px, 1.2fr)
    minmax(150px, 0.95fr)
    repeat(4, minmax(118px, 0.75fr))
    minmax(150px, 0.9fr)
    auto;
  align-items: center;
}

.supplier-controls #supplierSegmentSearch {
  min-width: 150px;
}

.supplier-controls #supplierQualityResetBtn {
  min-width: 104px;
  white-space: nowrap;
}

.number-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.number-summary-item {
  min-height: 56px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.number-summary-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.number-summary-item strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.segment-summary-item {
  min-height: 56px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.segment-analytics-panel .segment-summary-item {
  min-height: 60px;
  padding: 9px 10px;
  background: #f9fbfd;
}

.segment-summary-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.segment-summary-item strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.supplier-health-card,
.status-rule-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.supplier-health-card.ok {
  border-color: rgba(22, 131, 91, 0.24);
  background: #f3fbf7;
}

.supplier-health-card.warning {
  border-color: rgba(183, 121, 31, 0.28);
  background: #fff8ec;
}

.supplier-health-card.danger {
  border-color: rgba(194, 65, 53, 0.28);
  background: #fff5f4;
}

.supplier-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.supplier-health-head strong,
.status-rule-card h3 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-health-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 7px;
}

.supplier-health-metrics span {
  min-width: 0;
  padding: 4px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-health-card small,
.supplier-health-card em,
.status-rule-card p,
.status-rule-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.supplier-health-card small,
.supplier-health-card em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-health-card em {
  margin-top: 4px;
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

.status-rules-panel,
.audit-log-panel {
  display: grid;
  gap: 10px;
}

.status-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.status-rule-card {
  display: grid;
  gap: 9px;
}

.status-rule-list {
  display: grid;
  gap: 6px;
}

.status-rule-list div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 6px 0;
  border-top: 1px solid rgba(229, 231, 235, 0.7);
}

.status-rule-list div:first-child {
  border-top: 0;
}

.status-rule-list strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-rule-card p {
  margin: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(229, 231, 235, 0.7);
}

.audit-controls {
  grid-template-columns: minmax(240px, 1fr) minmax(130px, 170px) minmax(120px, 150px);
}

.audit-table {
  min-width: 940px;
}

.audit-table th:nth-child(1) {
  width: 180px;
}

.audit-table th:nth-child(2) {
  width: 190px;
}

.audit-table th:nth-child(3) {
  width: 160px;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1),
.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
  text-align: center;
}

.audit-detail {
  max-width: 560px;
  color: #3f4650;
  line-height: 1.45;
  white-space: normal;
}

.segment-analytics-panel .segment-summary-item strong {
  overflow-wrap: normal;
  word-break: keep-all;
  font-size: 18px;
  line-height: 1.16;
}

.review-modal-card .modal-body {
  display: grid;
  gap: 14px;
}

.review-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.review-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.review-option-row .inline-field {
  grid-template-columns: auto 86px;
}

.review-message-table {
  min-width: 760px;
}

.review-message-table th,
.review-message-table td {
  padding: 12px;
}

.review-message-table th:nth-child(1),
.review-message-table td:nth-child(1),
.review-message-table th:nth-child(2),
.review-message-table td:nth-child(2),
.review-message-table th:nth-child(4),
.review-message-table td:nth-child(4) {
  text-align: center;
}

.segment-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.segment-lists > section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.segment-lists h3 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.3;
}

.segment-list {
  max-height: 220px;
  min-height: 60px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.segment-list::-webkit-scrollbar {
  width: 6px;
}

.segment-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(113, 124, 139, 0.28);
}

.segment-list:hover::-webkit-scrollbar-thumb {
  background: rgba(113, 124, 139, 0.46);
}

.segment-card {
  display: grid;
  grid-template-columns: minmax(88px, 0.2fr) 72px minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segment-card.ok {
  border-color: rgba(22, 131, 91, 0.3);
  background: #f1fbf6;
}

.segment-card.warning {
  border-color: rgba(183, 121, 31, 0.3);
  background: #fff9ef;
}

.segment-card.danger {
  border-color: rgba(194, 65, 53, 0.3);
  background: #fff6f6;
}

.segment-card strong {
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
}

.segment-card span {
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.segment-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segment-card .row-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.segment-analytics-panel .table-wrap {
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.segment-table {
  min-width: 1220px;
  table-layout: fixed;
}

.segment-table th:nth-child(1) {
  width: 15%;
}

.segment-table th:nth-child(2) {
  width: 16%;
}

.segment-table th:nth-child(3) {
  width: 12%;
}

.segment-table th:nth-child(4) {
  width: 20%;
}

.segment-table th:nth-child(5) {
  width: 12%;
}

.segment-table th:nth-child(6) {
  width: 12%;
}

.segment-table th:nth-child(7) {
  width: 13%;
}

.segment-table th:nth-child(8) {
  width: 112px;
}

.segment-analytics-panel .segment-table th,
.segment-analytics-panel .segment-table td {
  padding: 11px 12px;
}

.segment-analytics-panel .segment-table td {
  vertical-align: middle;
}

.admin-view[data-view-panel="dashboard"] .segment-table th:nth-child(n + 3),
.admin-view[data-view-panel="dashboard"] .segment-table td:nth-child(n + 3),
.admin-view[data-view-panel="products"] .segment-table th:nth-child(2),
.admin-view[data-view-panel="products"] .segment-table td:nth-child(2),
.admin-view[data-view-panel="products"] .segment-table th:nth-child(n + 5),
.admin-view[data-view-panel="products"] .segment-table td:nth-child(n + 5) {
  text-align: center;
}

.segment-table small {
  max-width: 100%;
  overflow-wrap: normal;
  word-break: keep-all;
}

.segment-main-cell strong,
.segment-scope-cell strong {
  font-size: 16px;
  font-weight: 850;
  white-space: nowrap;
}

.segment-main-cell small,
.segment-scope-cell small,
.segment-rate-cell small,
.segment-message-cell small,
.segment-judgement-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.segment-rate-stack {
  display: grid;
  gap: 6px;
  align-content: center;
}

.segment-rate-stack .pill {
  justify-self: start;
  min-width: 54px;
}

.segment-count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segment-count-grid span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.segment-count-grid b {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
}

.segment-count-grid small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.segment-message-cell strong {
  font-size: 16px;
  font-weight: 850;
  white-space: nowrap;
}

.segment-time-cell {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
}

.segment-judgement-cell strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  white-space: nowrap;
}

.segment-action-cell {
  width: 112px;
}

.segment-action-stack {
  display: grid;
  gap: 8px;
}

.segment-action-stack .button {
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
}

.segment-action-stack .button:disabled {
  cursor: not-allowed;
}

.ops-list {
  display: grid;
  gap: 8px;
}

.panel-tools {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.panel-tools > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mini-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.mini-tabs button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.mini-tabs button.active {
  color: var(--ink);
  background: #f3f4f6;
  box-shadow: 0 1px 3px rgba(17, 19, 24, 0.08);
}

.mini-tabs strong {
  margin-left: 4px;
}

.product-submenu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 760px);
  max-width: 100%;
  margin: -2px 0 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.product-submenu button {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supplier-coverage-controls {
  grid-template-columns: minmax(220px, 320px);
  margin-bottom: 0;
}

.supplier-country-panel {
  padding: calc(var(--panel-pad) - 2px) var(--panel-pad);
  display: grid;
  align-content: start;
  gap: 10px;
}

.supplier-country-panel .section-head.compact {
  margin-bottom: 0;
}

.supplier-country-panel .segment-summary {
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.supplier-country-panel > .table-wrap {
  padding-top: 8px;
  border-top: 1px solid #edf1f5;
}

.supplier-country-panel .segment-summary-item {
  min-height: 50px;
  padding: 7px 9px;
}

.supplier-country-panel .segment-summary-item span {
  margin-bottom: 3px;
  font-size: 11px;
}

.supplier-country-panel .segment-summary-item strong {
  font-size: 17px;
}

.supplier-country-table {
  min-width: 1240px;
  table-layout: fixed;
}

.supplier-country-table th,
.supplier-country-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.supplier-country-table th:nth-child(1) {
  width: 92px;
}

.supplier-country-table th:nth-child(2) {
  width: 86px;
}

.supplier-country-table th:nth-child(3) {
  width: 58px;
}

.supplier-country-table th:nth-child(4) {
  width: 76px;
}

.supplier-country-table th:nth-child(5) {
  width: 146px;
}

.supplier-country-table th:nth-child(6),
.supplier-country-table th:nth-child(7) {
  width: 88px;
}

.supplier-country-table th:nth-child(8) {
  width: 72px;
}

.supplier-country-table th:nth-child(9) {
  width: auto;
}

.supplier-country-table th:nth-child(10) {
  width: 92px;
}

.supplier-country-table th:nth-child(11) {
  width: 96px;
}

.supplier-country-table th:nth-child(3),
.supplier-country-table td:nth-child(3),
.supplier-country-table th:nth-child(6),
.supplier-country-table td:nth-child(6),
.supplier-country-table th:nth-child(7),
.supplier-country-table td:nth-child(7),
.supplier-country-table th:nth-child(8),
.supplier-country-table td:nth-child(8),
.supplier-country-table th:nth-child(10),
.supplier-country-table td:nth-child(10),
.supplier-country-table th:nth-child(11),
.supplier-country-table td:nth-child(11) {
  text-align: center;
}

.supplier-country-table .compact-main-cell strong,
.supplier-country-table .compact-metric-cell strong,
.supplier-country-table .compact-number-cell {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.supplier-country-table .compact-main-cell small,
.supplier-country-table .compact-metric-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.supplier-country-table .compact-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #1f2937;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-country-table .compact-rate-cell .pill {
  min-width: 42px;
  min-height: 24px;
  padding: 0 8px;
}

.supplier-country-table .compact-time-cell {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.product-overview-controls {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 10px;
}

.product-overview-controls #productSearch {
  grid-column: span 2;
}

.product-overview-controls .button {
  min-height: var(--control-height);
  justify-self: stretch;
}

.pager {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pager-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.number-bottom-pager {
  margin-top: 8px;
}

.page-numbers {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.page-gap {
  padding: 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.page-jump {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.page-jump input {
  width: 64px;
  min-height: 28px;
  padding: 4px 7px;
  text-align: center;
}

.op-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.op-item.compact {
  grid-template-columns: 64px minmax(0, 1fr) minmax(96px, 0.55fr) auto;
  min-height: 52px;
  padding: 9px 11px;
  gap: 10px;
  border-radius: 8px;
}

.op-item.compact strong {
  align-self: center;
}

.op-item.compact span,
.op-item.compact p {
  align-self: center;
}

.op-item.compact p {
  font-size: 13px;
}

.compact-empty {
  padding: 10px 12px;
}

.op-item.critical {
  border-color: rgba(183, 55, 55, 0.34);
  background: #fff6f6;
}

.op-item.warning {
  border-color: rgba(164, 93, 18, 0.34);
  background: #fff9ef;
}

.op-item strong {
  color: var(--red);
}

.op-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.admin-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.admin-grid .admin-panel:nth-child(3) {
  grid-column: 1 / -1;
}

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

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ops-toolbar {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(360px, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.cdk-toolbar {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
}

.toolbar-controls {
  display: grid;
  gap: 8px;
  justify-self: stretch;
}

.cdk-controls {
  grid-template-columns: minmax(180px, 260px) minmax(130px, 180px) minmax(320px, 1fr);
}

.cdk-toolbar .filter-tabs {
  width: 100%;
}

.cdk-toolbar .filter-tabs .metric {
  min-height: var(--control-height);
  padding: 0 10px;
}

.cdk-toolbar .toolbar-controls select,
.cdk-toolbar .toolbar-controls input {
  min-height: var(--control-height);
}

.number-toolbar {
  grid-template-columns: 1fr;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.number-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}

.number-controls > input,
.number-controls > select,
.number-controls > .button {
  flex: 0 0 128px;
  height: var(--control-height);
  min-height: var(--control-height);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

.number-controls > select {
  padding-right: 28px;
}

.number-search-control {
  flex-basis: 300px;
}

.number-controls #numberProductFilter {
  flex-basis: 170px;
}

.number-controls #numberTypeFilter,
.number-controls #numberStatusFilter,
.number-controls #numberValidityFilter {
  flex-basis: 116px;
}

.number-controls #numberSegmentFilter {
  flex-basis: 138px;
}

.number-controls #numberProviderFilter {
  flex-basis: 136px;
}

.number-controls #numberPriorityFilter,
.number-controls #numberReceiveFilter {
  flex-basis: 132px;
}

.number-reset-control {
  flex-basis: 96px;
  justify-self: stretch;
}

.table-bottom-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}

.table-bottom-controls > select {
  width: auto;
  min-width: 132px;
  height: 32px;
  padding: 0 8px;
}

.table-bottom-controls .pager {
  flex: 1;
  min-width: min(100%, 360px);
  justify-content: flex-end;
}

.table-bottom-controls .pager > span {
  white-space: nowrap;
}

.table-bottom-pager {
  margin-top: 0;
}

.detail-pager {
  justify-content: flex-end;
  font-size: 12px;
}

.detail-pager .pager-actions {
  gap: 4px;
}

.detail-pager .button.tiny {
  min-height: 28px;
  padding: 0 8px;
}

.detail-pager .page-jump input {
  width: 58px;
  min-height: 28px;
}

.record-controls {
  grid-template-columns: minmax(300px, 1fr);
}

.records-view {
  gap: 12px;
}

.records-panel {
  display: grid;
  gap: 8px;
}

.records-panel > .section-head.compact {
  margin-bottom: 0;
}

.records-panel > .section-head.compact h2 {
  font-size: 18px;
  line-height: 1.25;
}

.record-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(280px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.record-toolbar .filter-tabs {
  width: auto;
  min-width: 0;
  justify-content: flex-start;
  border-radius: 9px;
  padding: 2px;
}

.record-toolbar .filter-tabs .metric {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
}

.record-toolbar .filter-tabs .metric span,
.record-toolbar .filter-tabs .metric strong {
  font-size: 12px;
}

.record-toolbar .toolbar-controls {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.record-toolbar .toolbar-controls input {
  width: min(100%, 360px);
  height: var(--control-height);
  text-align: left;
}

#sessionResultSummary,
#messageResultSummary {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.record-bulk-bar {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(90px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  margin-bottom: 0;
}

.record-bulk-bar #sessionBulkCount {
  justify-self: center;
}

.record-bulk-bar .row-actions {
  justify-self: end;
}

.records-table {
  min-width: 1120px;
  table-layout: fixed;
}

.records-table th,
.records-table td {
  padding: 8px 10px;
  line-height: 1.35;
  vertical-align: middle;
}

.records-table th,
.records-table td:nth-child(1),
.records-table td:nth-child(5),
.records-table td:nth-child(6),
.records-table td:nth-child(7),
.records-table td:nth-child(8),
.records-table td:nth-child(9) {
  text-align: center;
}

.session-record-table th:nth-child(1) {
  width: 42px;
}

.session-record-table th:nth-child(2) {
  width: 16%;
}

.session-record-table th:nth-child(3) {
  width: 15%;
}

.session-record-table th:nth-child(4) {
  width: 14%;
}

.session-record-table th:nth-child(5) {
  width: 14%;
}

.session-record-table th:nth-child(6) {
  width: 9%;
}

.session-record-table th:nth-child(7) {
  width: 12%;
}

.session-record-table th:nth-child(8) {
  width: 14%;
}

.session-record-table th:nth-child(9) {
  width: 8%;
}

.message-record-table th:nth-child(1) {
  width: 8%;
}

.message-record-table th:nth-child(2) {
  width: 14%;
}

.message-record-table th:nth-child(3) {
  width: 13%;
}

.message-record-table th:nth-child(4) {
  width: 13%;
}

.message-record-table th:nth-child(5) {
  width: 12%;
}

.message-record-table th:nth-child(6) {
  width: 9%;
}

.message-record-table th:nth-child(7) {
  width: 18%;
}

.message-record-table th:nth-child(8) {
  width: 7%;
}

.message-record-table th:nth-child(9) {
  width: 12%;
}

.session-record-table td:nth-child(2),
.session-record-table td:nth-child(3),
.session-record-table td:nth-child(4),
.message-record-table td:nth-child(2),
.message-record-table td:nth-child(3),
.message-record-table td:nth-child(4),
.message-record-table td:nth-child(7) {
  text-align: left;
}

.records-table .row-actions {
  justify-content: center;
}

.message-record-table th:nth-child(10),
.message-record-table td:nth-child(10) {
  text-align: center;
}

.records-table td[colspan] {
  height: 42px;
  text-align: center;
  color: var(--muted);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(17, 19, 24, 0.01);
}

.filter-tabs .metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  min-width: max-content;
  min-height: 48px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.filter-tabs .metric span,
.filter-tabs .metric strong {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: 15px;
  line-height: 1;
}

.filter-tabs .metric strong {
  font-weight: 850;
}

.filter-tabs .metric-button:hover,
.filter-tabs .metric-button.active {
  color: var(--ink);
  background: #f3f4f6;
}

.filter-tabs .metric-button.active {
  box-shadow: 0 1px 3px rgba(17, 19, 24, 0.08);
}

.bulk-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  overflow-x: auto;
  scrollbar-width: thin;
}

.cdk-bulk-bar {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(90px, 1fr) auto;
  align-items: center;
}

.cdk-bulk-bar #cdkBulkCount {
  justify-self: center;
}

.cdk-bulk-bar .row-actions {
  justify-self: end;
}

.check-row {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.check-row input,
.select-col input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

#cdkBulkCount {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.select-col {
  width: 42px;
  text-align: center;
}

#cdkResultCodes {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.inline-copy {
  margin-top: 6px;
}

.cdk-code-cell {
  min-width: 190px;
}

.cdk-code-inline {
  display: grid;
  grid-template-columns: minmax(132px, 1fr) 24px;
  align-items: center;
  column-gap: 8px;
  max-width: 220px;
}

.cdk-code-inline strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cdk-code-inline small {
  grid-column: 1 / -1;
  white-space: normal;
}

.cdk-copy-button {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  vertical-align: middle;
}

.cdk-copy-button:hover {
  border-color: #cbd5e1;
  background: #f6f8fb;
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 140px 190px;
  gap: 8px;
  margin-bottom: 10px;
}

.history-controls {
  grid-template-columns: minmax(260px, 1fr) 160px 150px 140px 110px;
}

table {
  width: 100%;
  min-width: var(--table-min);
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: var(--table-pad-y) var(--table-pad-x);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #5f6670;
  background: #fafafa;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.resizable-table th.resizable-column {
  position: relative;
  user-select: none;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 2;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 3px;
  bottom: 8px;
  width: 1px;
  background: transparent;
}

.resizable-table th.resizable-column:hover .column-resizer::after,
.column-resizer:hover::after {
  background: #9ca3af;
}

td {
  overflow-wrap: normal;
  word-break: keep-all;
  color: #404650;
  font-weight: 500;
}

.data-table tbody tr:hover td {
  background: #fbfcfd;
}

td strong,
td small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

td small {
  margin-top: 2px;
  color: #8a9099;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.cell-stack {
  min-width: 130px;
}

.cell-status {
  color: #3f4650;
}

.cell-status.ok {
  color: #246b4e;
}

.cell-status.danger {
  color: var(--red);
}

.cell-status.muted {
  color: #4b5563;
}

.data-table.wide {
  min-width: var(--wide-table-min);
}

.table-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.table-panel > .section-head,
.table-panel > .section-head.compact {
  margin-bottom: 0;
}

.table-panel > .number-summary,
.table-panel > .segment-summary,
.table-panel > .toolbar-controls,
.table-panel > .filter-bar,
.table-panel > .bulk-bar,
.table-panel > .table-wrap,
.table-panel > .table-bottom-controls {
  margin-top: 0;
  margin-bottom: 0;
}

.table-panel > .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-panel > .table-wrap .data-table {
  min-width: var(--wide-table-min);
}

.data-table th,
.data-table td {
  vertical-align: middle;
}

.data-table th {
  height: 34px;
  text-align: center;
}

.data-table td {
  height: 42px;
}

.data-table .select-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.data-table .select-col input {
  display: block;
  margin: 0 auto;
}

.data-table .row-actions {
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.table-panel > .bulk-bar {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(76px, 1fr) auto;
  align-items: center;
}

.table-panel > .bulk-bar > [id$="BulkCount"] {
  justify-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.table-panel > .bulk-bar > .row-actions,
.table-panel > .bulk-bar > .bulk-actions {
  justify-self: end;
  justify-content: flex-end;
  overflow: visible;
}

.table-panel > .table-wrap .cdk-table,
.cdk-table {
  min-width: 1220px;
  table-layout: fixed;
}

.cdk-table th,
.cdk-table td {
  padding: 7px 9px;
}

.cdk-table th:nth-child(1) {
  width: 42px;
}

.cdk-table th:nth-child(2) {
  width: 210px;
  padding-right: 41px;
}

.cdk-table th:nth-child(3) {
  width: 190px;
}

.cdk-table th:nth-child(4) {
  width: 52px;
}

.cdk-table th:nth-child(5) {
  width: 88px;
}

.cdk-table th:nth-child(6) {
  width: 88px;
}

.cdk-table th:nth-child(7) {
  width: 136px;
}

.cdk-table th:nth-child(8) {
  width: 150px;
}

.cdk-table th:nth-child(9) {
  width: 60px;
}

.cdk-table th:nth-child(10) {
  width: 190px;
}

.cdk-table td:nth-child(4),
.cdk-table td:nth-child(7),
.cdk-table td:nth-child(9) {
  white-space: nowrap;
}

.cdk-table th:nth-child(4),
.cdk-table th:nth-child(5),
.cdk-table th:nth-child(6),
.cdk-table th:nth-child(7),
.cdk-table th:nth-child(8),
.cdk-table th:nth-child(9),
.cdk-table th:nth-child(10),
.cdk-table td:nth-child(4),
.cdk-table td:nth-child(5),
.cdk-table td:nth-child(6),
.cdk-table td:nth-child(7),
.cdk-table td:nth-child(8),
.cdk-table td:nth-child(9),
.cdk-table td:nth-child(10) {
  text-align: center;
}

.cdk-table td:nth-child(10).row-actions {
  gap: 3px;
  align-content: center;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-wrap: nowrap;
  overflow: visible;
  white-space: nowrap;
}

.cdk-table td:nth-child(10).row-actions .button {
  min-height: 24px;
  padding: 0 7px;
  font-size: 12px;
}

.table-bottom-controls {
  min-height: 40px;
  align-items: center;
}

.table-bottom-controls .pager,
.pager-actions,
.page-numbers,
.page-jump {
  align-items: center;
}

.pager-actions .button.tiny,
.page-numbers .button.tiny {
  min-width: 30px;
}

.recycle-table {
  min-width: 1080px;
  table-layout: fixed;
}

.recycle-table th,
.recycle-table td {
  padding: 8px 10px;
}

.recycle-table th:nth-child(1) {
  width: 42px;
}

.recycle-table th:nth-child(2) {
  width: 86px;
}

.recycle-table th:nth-child(3) {
  width: 25%;
}

.recycle-table th:nth-child(4) {
  width: 25%;
}

.recycle-table th:nth-child(5) {
  width: 160px;
}

.recycle-table th:nth-child(6) {
  width: 17%;
}

.recycle-table th:nth-child(7) {
  width: 96px;
}

.recycle-table th:nth-child(2),
.recycle-table td:nth-child(2),
.recycle-table th:nth-child(5),
.recycle-table td:nth-child(5),
.recycle-table th:nth-child(7),
.recycle-table td:nth-child(7) {
  text-align: center;
}

.recycle-table td:nth-child(5),
.recycle-table td:nth-child(6) {
  white-space: nowrap;
}

.recycle-table td:nth-child(6) span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-panel > .table-wrap .number-table,
.number-table {
  min-width: 1168px;
  table-layout: fixed;
}

.number-table th,
.number-table td {
  height: 36px;
  padding: 6px 8px;
  vertical-align: middle;
}

.number-table th:nth-child(1) {
  width: 42px;
}

.number-table th:nth-child(2) {
  width: 220px;
}

.number-table th:nth-child(3) {
  width: 190px;
}

.number-table th:nth-child(4) {
  width: 106px;
}

.number-table th:nth-child(5) {
  width: 160px;
}

.number-table th:nth-child(6) {
  width: 104px;
}

.number-table th:nth-child(7) {
  width: 166px;
}

.number-table th:nth-child(8) {
  width: 86px;
}

.number-table th:nth-child(9) {
  width: 168px;
}

.number-table th:nth-child(10) {
  width: 108px;
}

.number-table .cell-stack {
  min-width: 0;
}

.number-table .cell-stack strong,
.number-table .cell-stack small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.number-table .cell-stack strong {
  white-space: nowrap;
}

.number-table .cell-stack small {
  display: -webkit-box;
  max-width: 100%;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: normal;
}

.number-table .number-time-cell strong,
.number-table .number-time-cell small {
  display: block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  -webkit-line-clamp: initial;
}

.number-identity-cell {
  min-width: 0;
}

.number-identity-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.number-identity-line {
  display: block;
  align-items: center;
  justify-content: start;
  min-width: 0;
}

.number-identity-line strong,
.number-identity-line small {
  min-width: 0;
  max-width: 204px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.number-identity-line strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.number-identity-line small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.number-note-cell,
.number-type-status-cell,
.number-action-cell,
.number-api-cell {
  min-width: 0;
}

.number-type-status-cell {
  white-space: nowrap;
  text-align: center;
}

.number-type-status-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  overflow: visible;
  white-space: nowrap;
}

.number-type-status-inline .pill {
  min-height: 20px;
  padding: 0 6px;
  font-size: 10px;
}

.number-note-cell {
  text-align: left;
  width: 86px;
}

.number-table th:nth-child(4),
.number-table td:nth-child(4),
.number-table th:nth-child(5),
.number-table td:nth-child(5),
.number-table th:nth-child(6),
.number-table td:nth-child(6),
.number-table th:nth-child(7),
.number-table td:nth-child(7),
.number-table th:nth-child(9),
.number-table td:nth-child(9),
.number-table th:nth-child(10),
.number-table td:nth-child(10) {
  text-align: center;
}

.number-note-inline,
.number-action-inline,
.number-api-inline {
  display: grid;
  align-items: center;
  max-width: 100%;
}

.number-note-inline {
  display: inline-flex;
  justify-content: flex-start;
  gap: 4px;
  width: 66px;
  min-height: 20px;
}

.number-note-inline span {
  min-width: 0;
  max-width: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.number-note-inline .table-icon-button {
  width: 18px;
  height: 18px;
  border-color: transparent;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 140ms ease, background 140ms ease;
}

.number-note-cell:hover .number-note-inline .table-icon-button,
.number-note-inline:focus-within .table-icon-button {
  opacity: 1;
  visibility: visible;
}

.number-note-inline .table-icon-button:hover {
  border-color: #d7dee8;
  background: #f8fafc;
}

.number-detail-readonly input:disabled,
.number-detail-readonly select:disabled,
.number-detail-readonly textarea:disabled {
  border-color: #e2e8f0;
  color: var(--ink);
  background: #fff;
  cursor: default;
  opacity: 1;
}

.number-action-cell {
  width: 168px;
  white-space: nowrap;
  overflow: hidden;
}

.number-action-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.number-action-cell strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.number-row-actions {
  margin-top: 0;
  gap: 3px;
  justify-content: center;
  flex-wrap: nowrap;
  overflow: hidden;
}

.data-table .number-row-actions {
  justify-content: center;
}

.number-row-actions .button {
  min-height: 20px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 10px;
}

.number-api-inline {
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 4px;
  justify-content: center;
}

.number-api-inline span {
  min-width: 0;
  max-width: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-icon-button,
.number-api-copy {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #5b6470;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.table-icon-button:hover,
.number-api-copy:hover {
  border-color: #cfd6df;
  color: var(--ink);
  background: #f8fafc;
}

.product-table {
  min-width: 1180px;
  table-layout: fixed;
}

.product-table th,
.product-table td {
  padding: 9px 11px;
}

.product-table th:nth-child(1) {
  width: 40px;
}

.product-table th:nth-child(2) {
  width: 270px;
}

.product-table th:nth-child(3) {
  width: 150px;
}

.product-table th:nth-child(4) {
  width: 180px;
}

.product-table th:nth-child(5) {
  width: 120px;
}

.product-table th:nth-child(6) {
  width: 210px;
}

.product-table th:nth-child(7) {
  width: 210px;
}

.product-table td {
  overflow-wrap: normal;
  word-break: keep-all;
}

.product-table .cell-stack {
  min-width: 0;
}

.product-table .quality-cell {
  min-width: 0;
}

.product-table .compact-actions,
.supplier-country-table .compact-actions {
  gap: 6px;
  overflow-x: auto;
}

.product-table .compact-actions .button,
.supplier-country-table .compact-actions .button {
  min-height: 30px;
  padding: 0 10px;
}

.product-table th:nth-child(5),
.product-table td:nth-child(5),
.product-table th:nth-child(6),
.product-table td:nth-child(6),
.product-table th:nth-child(7),
.product-table td:nth-child(7),
.product-table th:nth-child(8),
.product-table td:nth-child(8) {
  text-align: center;
}

.product-name-cell strong,
.supplier-cell strong,
.product-scope-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-name-cell small,
.supplier-cell small,
.product-scope-cell small {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: normal;
}

.quality-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.quality-line small {
  display: block;
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-line .pill {
  flex: 0 0 auto;
}

.compact-actions {
  margin-top: 5px;
  gap: 6px;
}

.compact-actions .button {
  min-height: 32px;
  padding: 0 10px;
}

.action-cell .pill {
  width: fit-content;
}

.attention-row td {
  background: #fff9ed;
}

/* Front workbench refresh */
.front-page {
  background:
    linear-gradient(180deg, #f7f8fa 0%, #eef2f6 100%),
    var(--bg);
}

.front-page .topbar {
  height: 52px;
  border-bottom-color: #d9dee6;
  background: rgba(255, 255, 255, 0.94);
}

.front-page .shell {
  width: min(var(--front-shell-max), calc(100% - var(--page-gutter)));
  margin: var(--page-top) auto var(--page-bottom);
}

.front-page:not(.front-has-session) .shell {
  display: block;
  width: min(760px, calc(100% - var(--page-gutter)));
  margin: var(--page-top) auto var(--page-bottom);
  min-height: auto;
  padding: 0;
}

.front-page .workspace,
.front-page:not(.front-has-session) .workspace {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.58fr);
  gap: 12px;
  justify-items: stretch;
  width: 100%;
}

.front-page:not(.front-has-session) .workspace {
  grid-template-columns: 1fr;
}

.front-page .redeem-pane,
.front-page .status-pane {
  border-color: #dce2ea;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(24, 31, 42, 0.08);
}

.front-page:not(.front-has-session) .redeem-pane {
  max-width: none;
  min-height: 0;
  padding: 18px;
  gap: 14px;
}

.front-page:not(.front-has-session) .redeem-copy {
  gap: 7px;
  padding-bottom: 12px;
}

.front-page:not(.front-has-session) .front-title-row {
  margin-bottom: 2px;
}

.front-page:not(.front-has-session) .redeem-copy h1 {
  font-size: 28px;
  line-height: 1.15;
}

.front-page:not(.front-has-session) .redeem-copy p {
  color: #576170;
}

.front-page:not(.front-has-session) .redeem-input-wrap {
  gap: 10px;
}

.front-page:not(.front-has-session) #cdkInput {
  min-height: 58px;
  height: 58px;
  padding: 12px;
  border-color: #d8dee8;
  border-radius: 8px;
  color: #18202b;
  background: #fbfcfe;
  font-size: 15px;
}

.front-page:not(.front-has-session) #redeemBtn {
  min-height: 40px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 12px 22px rgba(17, 24, 39, 0.14);
}

.front-page:not(.front-has-session) .secondary-actions {
  justify-content: flex-start;
  gap: 8px;
  margin-top: 0;
}

.front-page:not(.front-has-session) .secondary-actions .button {
  min-width: 104px;
  border-color: #d8dee8;
  color: #4b5563;
}

.front-page:not(.front-has-session) .status-pane {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 16px;
}

.front-page:not(.front-has-session) .status-pane > .section-head {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.front-page:not(.front-has-session) .number-box,
.front-page:not(.front-has-session) .code-panel {
  margin: 0;
  border-color: #dce2ea;
  background: #f8fafc;
}

.front-page:not(.front-has-session) .number-box.empty {
  min-height: 96px;
  place-items: start;
  align-content: center;
  text-align: left;
}

.front-page:not(.front-has-session) .number-box.empty span {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.front-page:not(.front-has-session) .code-panel {
  padding: 12px;
}

.front-page:not(.front-has-session) .code-panel strong {
  color: #94a3b8;
  font-size: 30px;
}

.front-page:not(.front-has-session) .code-actions {
  display: none;
}

.front-page:not(.front-has-session) #switchHint,
.front-page:not(.front-has-session) .change-request {
  display: none;
}

:root[data-theme="dark"] .topbar {
  border-bottom-color: rgba(42, 48, 59, 0.92);
  background: rgba(15, 18, 24, 0.88);
}

:root[data-theme="dark"] .front-page {
  --front-ink: var(--ink);
  --front-muted: var(--muted);
  --front-line: var(--line);
  --front-surface: var(--panel);
  --front-soft: var(--soft);
  --front-primary: var(--primary);
  --front-primary-dark: var(--primary-dark);
  --front-teal: var(--green);
  --front-gold: var(--amber);
  --front-shadow: var(--shadow);
  background: var(--bg);
}

:root[data-theme="dark"] .front-page:not(.front-has-session) .redeem-pane {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .front-page:not(.front-has-session) .status-pane {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .front-page:not(.front-has-session) #cdkInput,
:root[data-theme="dark"] .front-page:not(.front-has-session) .number-box,
:root[data-theme="dark"] .front-page:not(.front-has-session) .code-panel {
  border-color: var(--line);
  background: var(--soft);
}

:root[data-theme="dark"] .front-page:not(.front-has-session) .secondary-actions .button {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel);
}

:root[data-theme="dark"] .front-brand-line {
  color: var(--muted);
}

:root[data-theme="dark"] .front-brand-line span {
  background: var(--green);
}

:root[data-theme="dark"] .front-page:not(.front-has-session) .redeem-input-wrap {
  background: transparent;
  box-shadow: none;
}

:root[data-theme="dark"] .front-page:not(.front-has-session) #cdkInput {
  border-color: var(--line);
  background: #171b23;
}

:root[data-theme="dark"] .front-page:not(.front-has-session) #redeemBtn {
  background: var(--primary);
}

:root[data-theme="dark"] .front-product-badge {
  border-color: rgba(155, 149, 255, 0.3);
  color: #d7d4ff;
  background: rgba(155, 149, 255, 0.1);
}

:root[data-theme="dark"] .front-page.front-has-session .redeem-pane,
:root[data-theme="dark"] .front-page.front-has-session .number-box,
:root[data-theme="dark"] .front-page.front-has-session .code-panel {
  border-color: var(--line);
  background: var(--panel);
}

:root[data-theme="dark"] .front-page.front-has-session .info-grid {
  border-color: var(--line);
  background: var(--panel);
}

:root[data-theme="dark"] .front-page.front-has-session .info-grid div {
  border-right-color: var(--line);
}

:root[data-theme="dark"] .front-page.front-has-session .number-box strong {
  color: var(--ink);
}

:root[data-theme="dark"] .front-page.front-has-session .code-panel strong {
  color: var(--blue);
}

:root[data-theme="dark"] .front-page.front-has-session #switchHint {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel);
}

:root[data-theme="dark"] .brand-mark,
:root[data-theme="dark"] .button.primary {
  background: var(--primary);
  color: #111620;
}

:root[data-theme="dark"] .button.primary:hover {
  background: var(--primary-dark);
}

:root[data-theme="dark"] .topnav a,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .button.secondary,
:root[data-theme="dark"] .button.light,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .lease-stat,
:root[data-theme="dark"] .dashboard-card,
:root[data-theme="dark"] .dashboard-rank-item,
:root[data-theme="dark"] .segment-summary-item,
:root[data-theme="dark"] .number-summary-item,
:root[data-theme="dark"] .segment-card,
:root[data-theme="dark"] .info-grid div,
:root[data-theme="dark"] .metric,
:root[data-theme="dark"] .number-box,
:root[data-theme="dark"] .code-panel,
:root[data-theme="dark"] .front-notice,
:root[data-theme="dark"] .change-request,
:root[data-theme="dark"] .session-chip,
:root[data-theme="dark"] .record,
:root[data-theme="dark"] .empty-record,
:root[data-theme="dark"] .batch-section,
:root[data-theme="dark"] .batch-card,
:root[data-theme="dark"] .login-card,
:root[data-theme="dark"] .modal-actions,
:root[data-theme="dark"] .rule-box,
:root[data-theme="dark"] .rule-preview,
:root[data-theme="dark"] .detail-hero div,
:root[data-theme="dark"] .detail-section,
:root[data-theme="dark"] .detail-kv div,
:root[data-theme="dark"] .detail-item,
:root[data-theme="dark"] .mini-tabs,
:root[data-theme="dark"] .filter-tabs,
:root[data-theme="dark"] .number-toolbar,
:root[data-theme="dark"] .supplier-health-card,
:root[data-theme="dark"] .status-rule-card,
:root[data-theme="dark"] .master-data-card,
:root[data-theme="dark"] .review-option-row,
:root[data-theme="dark"] .bulk-bar,
:root[data-theme="dark"] .op-item {
  border-color: var(--line);
  background: #171b23;
  color: var(--ink);
}

:root[data-theme="dark"] .supplier-health-card.ok {
  border-color: rgba(90, 212, 157, 0.24);
  background: rgba(26, 83, 61, 0.18);
}

:root[data-theme="dark"] .supplier-health-card.warning {
  border-color: rgba(240, 180, 91, 0.28);
  background: rgba(100, 67, 25, 0.2);
}

:root[data-theme="dark"] .supplier-health-card.danger {
  border-color: rgba(241, 121, 110, 0.28);
  background: rgba(103, 40, 36, 0.22);
}

:root[data-theme="dark"] .supplier-health-metrics span {
  background: rgba(15, 18, 24, 0.44);
  color: var(--muted);
}

:root[data-theme="dark"] .table-icon-button,
:root[data-theme="dark"] .number-api-copy {
  border-color: var(--line);
  background: #202634;
  color: var(--muted);
}

:root[data-theme="dark"] .table-icon-button:hover,
:root[data-theme="dark"] .number-api-copy:hover {
  background: #252d3d;
  color: var(--ink);
}

:root[data-theme="dark"] .number-action-cell strong {
  color: #e5e7eb;
  background: rgba(42, 48, 59, 0.95);
}

:root[data-theme="dark"] .change-request {
  border-color: var(--line);
  background: #171b23;
}

:root[data-theme="dark"] .front-page.front-has-session .change-request {
  border-color: rgba(42, 48, 59, 0.92);
  background: var(--panel);
}

:root[data-theme="dark"] .front-page.front-has-session .change-request input[type="file"],
:root[data-theme="dark"] .front-page.front-has-session .change-request textarea {
  border-color: rgba(42, 48, 59, 0.95);
  background: rgba(18, 22, 29, 0.82);
}

:root[data-theme="dark"] .change-request input[type="file"]::file-selector-button {
  border-color: rgba(42, 48, 59, 0.95);
  color: var(--ink);
  background: rgba(32, 38, 52, 0.9);
}

:root[data-theme="dark"] .front-page.front-has-session .change-request .small {
  border-color: rgba(42, 48, 59, 0.95);
  color: var(--muted);
  background: rgba(18, 22, 29, 0.82);
}

:root[data-theme="dark"] .front-page.front-has-session #changeRequestStatus.change-status-approved {
  border-color: rgba(30, 214, 139, 0.56);
  color: #d9ffec;
  background: linear-gradient(90deg, rgba(16, 166, 107, 0.22), rgba(16, 166, 107, 0.08));
  box-shadow: inset 4px 0 0 #2ee59d, 0 8px 20px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .front-notice {
  border-color: rgba(82, 146, 255, 0.34);
  color: #bad5ff;
  background: rgba(82, 146, 255, 0.1);
}

:root[data-theme="dark"] .front-notice.ok {
  border-color: rgba(76, 175, 110, 0.34);
  color: #b8e7c8;
  background: rgba(76, 175, 110, 0.1);
}

:root[data-theme="dark"] .front-notice.changed {
  border-color: rgba(30, 214, 139, 0.54);
  color: #d9ffec;
  background: linear-gradient(90deg, rgba(16, 166, 107, 0.2), rgba(16, 166, 107, 0.08));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .front-notice.changed::before {
  background: #2ee59d;
}

:root[data-theme="dark"] .screenshot-preview {
  background: #111620;
}

:root[data-theme="dark"] .menu-item.active,
:root[data-theme="dark"] .filter-tabs .metric-button:hover,
:root[data-theme="dark"] .filter-tabs .metric-button.active,
:root[data-theme="dark"] .mini-tabs button.active,
:root[data-theme="dark"] .theme-toggle button.active,
:root[data-theme="dark"] .session-chip.active,
:root[data-theme="dark"] .batch-card.active {
  background: #222a3a;
  color: var(--ink);
}

:root[data-theme="dark"] .detail-body {
  background: #111620;
}

:root[data-theme="dark"] .segment-lists > section,
:root[data-theme="dark"] .segment-analytics-panel .table-wrap {
  border-color: var(--line);
  background: #171b23;
}

:root[data-theme="dark"] .segment-analytics-panel .segment-summary-item {
  border-color: var(--line);
  background: #171b23;
}

:root[data-theme="dark"] .sms-log-parsed,
:root[data-theme="dark"] .sms-log-raw {
  border-color: var(--line);
  background: #121720;
}

:root[data-theme="dark"] .sms-log-raw pre {
  color: #d3d8e2;
}

:root[data-theme="dark"] .sms-log-code {
  background: #171d27;
}

:root[data-theme="dark"] .api-link-text,
:root[data-theme="dark"] .api-copy-button {
  border-color: var(--line);
  background: #121720;
  color: var(--ink);
}

:root[data-theme="dark"] .api-copy-button:hover {
  background: #202634;
}

:root[data-theme="dark"] input:disabled,
:root[data-theme="dark"] select:disabled,
:root[data-theme="dark"] textarea:disabled {
  background: #202634;
}

:root[data-theme="dark"] th {
  background: #1d2330;
  color: var(--muted);
}

:root[data-theme="dark"] td {
  border-color: var(--line);
  color: #d3d8e2;
}

:root[data-theme="dark"] .data-table tbody tr:hover td {
  background: #1b202b;
}

:root[data-theme="dark"] td small {
  color: #8f98a8;
}

:root[data-theme="dark"] .cell-status,
:root[data-theme="dark"] .cell-status.muted {
  color: #d6dbe5;
}

:root[data-theme="dark"] .cell-status.ok {
  color: #75d8a7;
}

:root[data-theme="dark"] .attention-row td,
:root[data-theme="dark"] .op-item.warning,
:root[data-theme="dark"] .segment-card.warning {
  background: rgba(240, 180, 91, 0.1);
}

:root[data-theme="dark"] .op-item.critical,
:root[data-theme="dark"] .segment-card.danger,
:root[data-theme="dark"] .batch-card.error {
  background: rgba(241, 121, 110, 0.1);
}

:root[data-theme="dark"] .segment-card.ok {
  background: rgba(90, 212, 157, 0.1);
}

:root[data-theme="dark"] .dashboard-card.ok {
  background: rgba(90, 212, 157, 0.09);
}

:root[data-theme="dark"] .dashboard-card.info {
  background: rgba(119, 167, 255, 0.09);
}

:root[data-theme="dark"] .dashboard-card.warning {
  background: rgba(240, 180, 91, 0.1);
}

:root[data-theme="dark"] .dashboard-card.danger {
  background: rgba(241, 121, 110, 0.1);
}

:root[data-theme="dark"] .pill.neutral {
  background: #252c39;
}

:root[data-theme="dark"] .pill.ok {
  background: rgba(90, 212, 157, 0.14);
}

:root[data-theme="dark"] .pill.info {
  background: rgba(119, 167, 255, 0.15);
}

:root[data-theme="dark"] .pill.warning {
  background: rgba(240, 180, 91, 0.14);
}

:root[data-theme="dark"] .pill.danger,
:root[data-theme="dark"] .pill.error {
  background: rgba(241, 121, 110, 0.14);
}

/* Global admin density and emphasis pass */
.topbar {
  height: 50px;
  padding: 0 clamp(12px, 2vw, 24px);
}

.brand,
.topnav {
  gap: 7px;
}

.brand-mark {
  width: 32px;
  height: 24px;
  border-radius: 7px;
}

.topnav a {
  padding: 5px 9px;
  border-radius: 8px;
}

.admin-layout {
  gap: var(--layout-gap);
  margin: var(--page-top) auto var(--page-bottom);
}

.admin-menu {
  top: 60px;
  gap: 4px;
  padding: 8px;
}

.menu-title {
  padding: 1px 7px 4px;
  font-size: 12px;
}

.menu-item {
  min-height: 40px;
  padding: 7px 9px;
  border-radius: 7px;
}

.menu-item.active {
  border-color: #ccd3dc;
  border-left: 3px solid var(--blue);
  background: #eef2f6;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.02);
}

.admin-content,
.admin-view,
.admin-shell,
.workspace,
.dashboard-business-grid,
.dashboard-health-panel,
.dashboard-rank-panel {
  gap: 10px;
}

.redeem-pane,
.status-pane,
.records-section,
.admin-panel,
.table-panel,
.admin-auth {
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(23, 26, 31, 0.05);
}

.section-head {
  gap: 10px;
  margin-bottom: 9px;
}

.section-head.compact {
  margin-bottom: 7px;
}

.eyebrow {
  margin-bottom: 2px;
  font-size: 11px;
}

.admin-view > .section-head h1 {
  font-size: 24px;
}

.table-panel .section-head h2,
.admin-panel .section-head h2 {
  font-size: 17px;
}

.form-grid,
.admin-panel,
.field {
  gap: 8px;
}

input,
select {
  height: var(--control-height);
  padding: 0 10px;
  border-radius: 7px;
}

textarea {
  min-height: 74px;
  padding: 8px 10px;
  border-radius: 7px;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.action-row,
.row-actions {
  gap: 6px;
}

.data-table .row-actions {
  flex-wrap: nowrap;
  gap: 3px;
  align-content: center;
  overflow: visible;
  justify-content: flex-start;
}

.number-table .number-row-actions {
  justify-content: flex-start;
}

.data-table td.row-actions,
.data-table td .row-actions,
.data-table .compact-actions {
  align-items: center;
  justify-content: flex-start;
}

.data-table td.row-actions {
  display: table-cell;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

.cdk-table td:nth-child(10).row-actions,
.records-table td.row-actions,
.recycle-table td:nth-child(7).row-actions,
.supplier-country-table td:nth-child(11).row-actions,
.admin-view[data-view-panel="products"] .segment-table td:nth-child(12).row-actions,
.change-request-table td:nth-child(9).row-actions,
.exception-table td:nth-child(7).row-actions,
.incident-history-table td:nth-child(7).row-actions,
.supplier-manage-table td:nth-child(9).row-actions,
.supplier-product-table td:nth-child(12).row-actions,
.master-data-table td.master-action-cell {
  text-align: center;
}

.data-table td.row-actions .button,
.data-table td .row-actions .button,
.data-table .compact-actions .button {
  min-height: 24px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 12px;
}

.data-table td.row-actions .button {
  margin: 1px 3px 1px 0;
  vertical-align: middle;
}

.data-table td[colspan],
.mini-table td[colspan] {
  text-align: center;
}

.number-table td.number-note-cell {
  padding-right: 4px;
}

.number-table td.number-action-cell {
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
  overflow: hidden;
}

.number-table .number-action-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.number-table .number-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}

.number-table .number-row-actions .button {
  min-width: auto;
  min-height: 20px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1;
}

.number-table .number-action-cell strong {
  margin-right: 0;
}

.business-stats-table th,
.business-stats-table td,
.segment-table th,
.segment-table td,
.product-table th,
.product-table td,
.records-table th,
.records-table td,
.incident-history-table th,
.incident-history-table td,
.audit-table th,
.audit-table td,
.recycle-table th,
.recycle-table td,
.review-message-table th,
.review-message-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.table-panel > .table-wrap .product-table,
.product-table {
  min-width: 1320px;
}

.product-table th:nth-child(2) { width: 240px; }
.product-table th:nth-child(3) { width: 130px; }
.product-table th:nth-child(4) { width: 170px; }
.product-table th:nth-child(5) { width: 115px; }
.product-table th:nth-child(6) { width: 145px; }
.product-table th:nth-child(7) { width: 200px; }
.product-table th:nth-child(8) { width: 252px; }

.product-table th:nth-child(8) {
  text-align: center;
}

.product-table td.action-cell {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
}

.product-table td.action-cell > .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  line-height: 1;
  vertical-align: middle;
  margin-right: 10px;
  transform: translateY(2.5px);
}

.product-table td.action-cell .compact-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  gap: 5px;
  overflow: visible;
  white-space: nowrap;
}

.product-table td.action-cell .compact-actions .button {
  min-width: auto;
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  line-height: 1;
  vertical-align: middle;
}

.data-table td:not(.row-actions) > strong,
.data-table td:not(.row-actions) > small,
.data-table .cell-stack > strong,
.data-table .cell-stack > small {
  max-width: 100%;
}

.data-table td > small,
.data-table .cell-stack > small {
  color: var(--muted);
  line-height: 1.35;
}

.supplier-catalog-table,
.supplier-manage-table,
.supplier-product-table,
.change-request-table,
.exception-table,
.audit-table,
.review-message-table {
  table-layout: fixed;
}

.table-panel > .table-wrap .supplier-catalog-table {
  min-width: 1120px;
}

.supplier-catalog-table th,
.supplier-catalog-table td,
.supplier-manage-table th,
.supplier-manage-table td,
.supplier-product-table th,
.supplier-product-table td,
.change-request-table th,
.change-request-table td,
.exception-table th,
.exception-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.supplier-catalog-table th:nth-child(1) { width: 130px; }
.supplier-catalog-table th:nth-child(2) { width: 78px; }
.supplier-catalog-table th:nth-child(3) { width: 170px; }
.supplier-catalog-table th:nth-child(4) { width: 140px; }
.supplier-catalog-table th:nth-child(5) { width: 150px; }
.supplier-catalog-table th:nth-child(6) { width: 130px; }
.supplier-catalog-table th:nth-child(7) { width: 120px; }
.supplier-catalog-table th:nth-child(8) { width: 110px; }
.supplier-catalog-table th:nth-child(9) { width: 120px; }

.table-panel > .table-wrap .supplier-manage-table {
  min-width: 1160px;
}

.supplier-manage-table th:nth-child(1) { width: 42px; }
.supplier-manage-table th:nth-child(2) { width: 130px; }
.supplier-manage-table th:nth-child(3) { width: 90px; }
.supplier-manage-table th:nth-child(4) { width: 160px; }
.supplier-manage-table th:nth-child(5) { width: 100px; }
.supplier-manage-table th:nth-child(6) { width: 170px; }
.supplier-manage-table th:nth-child(7) { width: 84px; }
.supplier-manage-table th:nth-child(8) { width: 270px; }
.supplier-manage-table th:nth-child(9) { width: 114px; }

.table-panel > .table-wrap .supplier-product-table {
  min-width: 1260px;
}

.supplier-product-table th:nth-child(1) { width: 42px; }
.supplier-product-table th:nth-child(2) { width: 115px; }
.supplier-product-table th:nth-child(3) { width: 180px; }
.supplier-product-table th:nth-child(4) { width: 120px; }
.supplier-product-table th:nth-child(5) { width: 100px; }
.supplier-product-table th:nth-child(6) { width: 120px; }
.supplier-product-table th:nth-child(7) { width: 110px; }
.supplier-product-table th:nth-child(8) { width: 116px; }
.supplier-product-table th:nth-child(9) { width: 108px; }
.supplier-product-table th:nth-child(10) { width: 118px; }
.supplier-product-table th:nth-child(11) { width: 78px; }
.supplier-product-table th:nth-child(12) { width: 138px; }

.table-panel > .table-wrap .change-request-table {
  min-width: 1280px;
}

.change-request-table th:nth-child(1) { width: 150px; }
.change-request-table th:nth-child(2) { width: 180px; }
.change-request-table th:nth-child(3) { width: 160px; }
.change-request-table th:nth-child(4) { width: 190px; }
.change-request-table th:nth-child(5) { width: 190px; }
.change-request-table th:nth-child(6) { width: 100px; }
.change-request-table th:nth-child(7) { width: 150px; }
.change-request-table th:nth-child(8) { width: 130px; }
.change-request-table th:nth-child(9) { width: 190px; }

.table-panel > .table-wrap .exception-table {
  min-width: 1040px;
}

.exception-table th:nth-child(1) { width: 42px; }
.exception-table th:nth-child(2) { width: 150px; }
.exception-table th:nth-child(3) { width: 220px; }
.exception-table th:nth-child(4) { width: 190px; }
.exception-table th:nth-child(5) { width: 90px; }
.exception-table th:nth-child(6) { width: 160px; }
.exception-table th:nth-child(7) { width: 188px; }

.supplier-catalog-table th:nth-child(2),
.supplier-catalog-table td:nth-child(2),
.supplier-catalog-table th:nth-child(6),
.supplier-catalog-table td:nth-child(6),
.supplier-catalog-table th:nth-child(7),
.supplier-catalog-table td:nth-child(7),
.supplier-catalog-table th:nth-child(8),
.supplier-catalog-table td:nth-child(8),
.supplier-catalog-table th:nth-child(9),
.supplier-catalog-table td:nth-child(9),
.supplier-manage-table th:nth-child(3),
.supplier-manage-table td:nth-child(3),
.supplier-manage-table th:nth-child(6),
.supplier-manage-table td:nth-child(6),
.supplier-manage-table th:nth-child(7),
.supplier-manage-table td:nth-child(7),
.supplier-manage-table th:nth-child(9),
.supplier-manage-table td:nth-child(9),
.supplier-product-table th:nth-child(n + 4),
.supplier-product-table td:nth-child(n + 4),
.change-request-table th:nth-child(1),
.change-request-table td:nth-child(1),
.change-request-table th:nth-child(6),
.change-request-table td:nth-child(6),
.change-request-table th:nth-child(7),
.change-request-table td:nth-child(7),
.change-request-table th:nth-child(8),
.change-request-table td:nth-child(8),
.change-request-table th:nth-child(9),
.change-request-table td:nth-child(9),
.exception-table th:nth-child(2),
.exception-table td:nth-child(2),
.exception-table th:nth-child(5),
.exception-table td:nth-child(5),
.exception-table th:nth-child(6),
.exception-table td:nth-child(6),
.exception-table th:nth-child(7),
.exception-table td:nth-child(7) {
  text-align: center;
}

.supplier-catalog-table td,
.supplier-manage-table td,
.supplier-product-table td,
.change-request-table td,
.exception-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.supplier-catalog-table td > strong,
.supplier-catalog-table td > small,
.supplier-manage-table td > strong,
.supplier-manage-table td > small,
.supplier-product-table td > strong,
.supplier-product-table td > small,
.change-request-table td > strong,
.change-request-table td > small,
.exception-table td > strong,
.exception-table td > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-request-table td:nth-child(9).row-actions,
.exception-table td:nth-child(7).row-actions,
.supplier-manage-table td:nth-child(9).row-actions,
.supplier-product-table td:nth-child(12).row-actions {
  overflow: visible;
  text-align: center;
}

.admin-view[data-view-panel="products"] .toolbar-controls,
.admin-view[data-view-panel="products"] .bulk-bar,
.admin-view[data-view-panel="products"] .row-actions,
.admin-view[data-view-panel="products"] .inline-create-form {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.admin-view[data-view-panel="products"] .product-overview-controls {
  grid-template-columns: minmax(280px, 360px) repeat(6, minmax(140px, 170px)) minmax(104px, 120px);
}

.admin-view[data-view-panel="products"] .product-overview-controls #productSearch {
  grid-column: auto;
}

.admin-view[data-view-panel="products"] .supplier-controls {
  grid-template-columns:
    minmax(180px, 240px)
    minmax(140px, 180px)
    repeat(4, minmax(116px, 150px))
    minmax(140px, 170px)
    minmax(104px, 118px);
}

.admin-view[data-view-panel="products"] .toolbar-controls,
.admin-view[data-view-panel="products"] .bulk-bar {
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-view[data-view-panel="products"] .table-wrap {
  overflow-x: auto;
}

.admin-view[data-view-panel="products"] .data-table th,
.admin-view[data-view-panel="products"] .data-table td {
  overflow-wrap: normal;
  word-break: keep-all;
  white-space: nowrap;
}

.admin-view[data-view-panel="products"] .data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-view[data-view-panel="products"] .data-table td.row-actions,
.admin-view[data-view-panel="products"] .data-table td .row-actions,
.admin-view[data-view-panel="products"] .data-table .compact-actions {
  overflow: visible;
  white-space: nowrap;
}

.admin-view[data-view-panel="products"] .cell-stack,
.admin-view[data-view-panel="products"] .compact-main-cell,
.admin-view[data-view-panel="products"] .compact-metric-cell,
.admin-view[data-view-panel="products"] .quality-cell {
  min-width: 0;
  overflow: hidden;
}

.admin-view[data-view-panel="products"] .cell-stack > strong,
.admin-view[data-view-panel="products"] .cell-stack > small,
.admin-view[data-view-panel="products"] .data-table td > strong,
.admin-view[data-view-panel="products"] .data-table td > small,
.admin-view[data-view-panel="products"] .compact-main-cell strong,
.admin-view[data-view-panel="products"] .compact-main-cell small,
.admin-view[data-view-panel="products"] .compact-metric-cell strong,
.admin-view[data-view-panel="products"] .compact-metric-cell small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: initial;
  -webkit-box-orient: initial;
}

.admin-view[data-view-panel="products"] .product-name-cell small,
.admin-view[data-view-panel="products"] .supplier-cell small,
.admin-view[data-view-panel="products"] .product-scope-cell small {
  display: block;
}

.admin-view[data-view-panel="products"] .quality-line {
  overflow: hidden;
  white-space: nowrap;
}

.admin-view[data-view-panel="products"] .quality-line small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-view[data-view-panel="products"] .pill,
.admin-view[data-view-panel="products"] .button,
.admin-view[data-view-panel="products"] .check-row,
.admin-view[data-view-panel="products"] .segment-summary-item span,
.admin-view[data-view-panel="products"] .segment-summary-item strong {
  white-space: nowrap;
}

.admin-view[data-view-panel="products"] .segment-summary {
  overflow-x: auto;
  scrollbar-width: thin;
}

.button {
  min-height: var(--control-height);
  padding: 0 10px;
  border-radius: 7px;
  box-shadow: none;
}

.button:hover {
  box-shadow: 0 2px 7px rgba(17, 19, 24, 0.08);
}

.button.primary {
  box-shadow: 0 4px 10px rgba(17, 19, 24, 0.12);
}

.button.warn {
  border-color: #c98731;
  background: #c98731;
}

.button.warn:hover {
  background: #ad6f1f;
}

.button.danger {
  border-color: #c24135;
  background: #c24135;
}

.button.danger:hover {
  background: #a9382e;
}

.button.tiny {
  min-height: var(--control-height-sm);
  padding: 0 7px;
  border-radius: 6px;
}

.pill {
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid transparent;
  line-height: 1;
}

.pill.neutral {
  border-color: #dbe1e8;
  color: #5a6472;
  background: #eef2f5;
}

.pill.ok {
  border-color: rgba(22, 131, 91, 0.2);
  color: #0d7651;
  background: #e8f7ef;
}

.pill.info {
  border-color: rgba(37, 99, 235, 0.18);
  color: #1d5fd6;
  background: #edf4ff;
}

.pill.warning {
  border-color: rgba(183, 121, 31, 0.22);
  color: #a36816;
  background: #fff3dc;
}

.pill.danger,
.pill.error {
  border-color: rgba(194, 65, 53, 0.2);
  color: #b5352b;
  background: #fff0ee;
}

.info-grid div,
.metric,
.number-summary-item,
.segment-summary-item,
.dashboard-card {
  min-height: 50px;
  padding: var(--card-pad);
  border-radius: 7px;
  background: #fcfdff;
}

.info-grid span,
.metric span,
.number-summary-item span,
.segment-summary-item span,
.dashboard-card span {
  margin-bottom: 2px;
}

.metric strong,
.dashboard-card strong {
  font-size: 18px;
}

.dashboard-card strong {
  margin-top: 2px;
}

.dashboard-card-grid,
.number-summary,
.metric-row,
.supplier-health-grid {
  gap: 7px;
}

.segment-summary-item strong {
  font-size: 16px;
}

.supplier-health-card,
.status-rule-card {
  padding: 9px;
  border-radius: 7px;
}

.filter-tabs {
  padding: 3px;
  border-radius: 10px;
  background: #fff;
}

.filter-tabs .metric {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
}

.filter-tabs .metric span,
.filter-tabs .metric strong {
  font-size: 13px;
}

.filter-tabs .metric-button:hover,
.filter-tabs .metric-button.active {
  color: #111827;
  background: #eef2f6;
}

.filter-tabs .metric-button.active {
  box-shadow: inset 0 0 0 1px #dde3ea;
}

.mini-tabs {
  gap: 3px;
  padding: 4px;
  border-radius: 9px;
}

.mini-tabs button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 7px;
}

.bulk-bar,
.cdk-bulk-bar,
.record-bulk-bar {
  gap: 8px;
  min-height: 36px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #fcfdff;
}

.check-row {
  gap: 7px;
  font-size: 12px;
}

th {
  border-bottom-color: #dbe1e8;
  background: #f6f8fa;
  color: #394150;
}

td {
  color: #374151;
}

td strong {
  font-size: 13px;
}

td small {
  margin-top: 1px;
}

.data-table tbody tr:hover td {
  background: #f7f9fb;
}

.attention-row td {
  border-bottom-color: #efd3aa;
  background: #fff8eb;
}

.attention-row td:first-child {
  box-shadow: inset 3px 0 0 var(--amber);
}

.cell-status.ok {
  color: #0d7651;
}

.cell-status.danger {
  color: #b5352b;
}

.cell-status.warning {
  color: #a36816;
}

.cell-status.info {
  color: #1d5fd6;
}

.table-bottom-controls {
  margin-top: 7px;
  padding-top: 7px;
}

.number-toolbar {
  padding: 5px;
  background: #fcfdff;
}

.number-controls {
  gap: 6px;
}

.number-controls > input,
.number-controls > select,
.number-controls > .button {
  flex-basis: 122px;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 9px;
  border-radius: 7px;
}

.number-search-control {
  flex-basis: 280px;
}

.product-table th,
.product-table td,
.records-table th,
.records-table td {
  padding: var(--table-pad-y) var(--table-pad-x);
}

.empty-record.compact,
.compact-empty {
  padding: 8px;
}

:root[data-theme="dark"] .topbar {
  border-color: rgba(42, 48, 59, 0.92);
  background: rgba(23, 27, 35, 0.92);
}

:root[data-theme="dark"] .menu-item.active {
  border-color: #394252;
  border-left-color: var(--blue);
  background: #222a3a;
  box-shadow: none;
}

:root[data-theme="dark"] .filter-tabs .metric-button:hover,
:root[data-theme="dark"] .filter-tabs .metric-button.active {
  color: var(--ink);
  background: #222a3a;
  box-shadow: inset 0 0 0 1px #303847;
}

:root[data-theme="dark"] th {
  border-bottom-color: #303744;
  background: #202634;
  color: #cbd3df;
}

:root[data-theme="dark"] .table-panel > .table-wrap {
  border-color: var(--line);
  background: var(--panel);
}

:root[data-theme="dark"] .data-table tbody tr:hover td {
  background: #202634;
}

:root[data-theme="dark"] .attention-row td {
  border-bottom-color: rgba(240, 180, 91, 0.28);
  background: rgba(240, 180, 91, 0.09);
}

:root[data-theme="dark"] .pill.neutral {
  border-color: #374151;
  color: #aeb7c7;
}

:root[data-theme="dark"] .pill.ok {
  border-color: rgba(90, 212, 157, 0.24);
  color: #76dda9;
}

:root[data-theme="dark"] .pill.info {
  border-color: rgba(119, 167, 255, 0.24);
  color: #9abfff;
}

:root[data-theme="dark"] .pill.warning {
  border-color: rgba(240, 180, 91, 0.28);
  color: #f2c272;
}

:root[data-theme="dark"] .pill.danger,
:root[data-theme="dark"] .pill.error {
  border-color: rgba(241, 121, 110, 0.28);
  color: #ff9389;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (min-width: 1680px) {
  :root {
    --page-gutter: 28px;
    --shell-max: 1280px;
    --front-shell-max: 1320px;
    --admin-max: 1600px;
    --admin-menu-width: 212px;
    --layout-gap: 12px;
    --panel-pad: 14px;
    --card-pad: 9px;
    --control-height: 34px;
    --control-height-sm: 26px;
    --table-pad-y: 8px;
    --table-pad-x: 10px;
    --wide-table-min: 1240px;
  }
}

@media (max-width: 1280px) {
  :root {
    --page-gutter: 18px;
    --page-top: 14px;
    --page-bottom: 28px;
    --admin-menu-width: 200px;
    --layout-gap: 10px;
    --panel-pad: 12px;
    --card-pad: 8px;
    --control-height: 32px;
    --control-height-sm: 24px;
    --table-pad-y: 7px;
    --table-pad-x: 9px;
    --table-min: 820px;
    --wide-table-min: 1080px;
  }
}

@media (max-width: 1040px) {
  :root {
    --page-gutter: 16px;
    --page-top: 14px;
    --layout-gap: 10px;
    --panel-pad: 12px;
    --card-pad: 8px;
    --control-height: 32px;
    --control-height-sm: 24px;
    --table-pad-y: 7px;
    --table-pad-x: 9px;
    --table-min: 800px;
    --wide-table-min: 1040px;
  }

  .front-page .workspace {
    grid-template-columns: 1fr;
  }

  .front-page:not(.front-has-session) .workspace {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session .redeem-pane {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session .status-pane {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session .change-request {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session .change-request .section-head {
    padding-right: 0;
  }

  .front-page.front-has-session .change-request .button.warn {
    width: 100%;
  }

  .front-page .status-pane {
    position: static;
  }

  .front-page .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
    width: min(100% - var(--page-gutter), 1320px);
    margin-top: 12px;
  }

  .admin-menu {
    position: static;
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .menu-title {
    display: none;
  }

  .menu-item {
    flex: 0 0 138px;
    min-height: 42px;
  }

  .admin-content,
  .admin-view,
  .table-panel,
  .section-head,
  .bulk-bar {
    min-width: 0;
    max-width: 100%;
  }

  .product-overview-controls {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .product-overview-controls #productSearch {
    grid-column: span 2;
  }

  .number-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .number-controls > input,
  .number-controls > select,
  .number-controls > .button {
    width: 100%;
    flex-basis: auto;
  }

  .segment-summary {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .front-page.front-has-session .info-grid {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session .info-grid div {
    border-right: 0;
    border-bottom: 1px solid rgba(223, 229, 236, 0.96);
  }

  .front-page.front-has-session .info-grid div:last-child {
    border-bottom: 0;
  }

  .segment-analytics-panel > .section-head.compact {
    grid-template-columns: 1fr;
  }

  .segment-analytics-panel .segment-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segment-analytics-panel .segment-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-hero {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .cdk-controls {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  }

  #cdkSearch {
    grid-column: 1 / -1;
  }

  .cdk-bulk-bar {
    grid-template-columns: 1fr;
  }

  .cdk-bulk-bar #cdkBulkCount,
  .cdk-bulk-bar .row-actions {
    justify-self: start;
  }

  .record-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .record-toolbar .toolbar-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .record-toolbar .toolbar-controls input {
    width: 100%;
  }

  .record-bulk-bar {
    grid-template-columns: minmax(180px, auto) minmax(90px, 1fr) auto;
  }

  .record-bulk-bar #sessionBulkCount,
  .record-bulk-bar .row-actions {
    justify-self: center;
  }

  .record-bulk-bar .row-actions {
    justify-self: end;
  }
}

@media (max-width: 860px) {
  :root {
    --page-gutter: 14px;
    --page-top: 12px;
    --page-bottom: 24px;
    --layout-gap: 10px;
    --panel-pad: 12px;
    --card-pad: 8px;
    --control-height: 32px;
    --control-height-sm: 24px;
    --table-pad-y: 7px;
    --table-pad-x: 9px;
    --table-min: 720px;
    --wide-table-min: 920px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    width: min(100% - var(--page-gutter), 1320px);
    margin-top: 12px;
  }

  .admin-menu {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 8px;
  }

  .menu-title {
    display: none;
  }

  .menu-item {
    flex: 0 0 138px;
    min-height: 42px;
  }

  .workspace,
  .dashboard-grid,
  .dashboard-business-grid,
  .lease-dashboard,
  .segment-lists,
  .admin-grid,
  .settings-grid,
  .metric-row,
  .ops-toolbar,
  .admin-auth {
    grid-template-columns: 1fr;
  }

  .toolbar-controls,
  .cdk-controls,
  .number-controls,
  .record-controls {
    grid-template-columns: 1fr;
  }

  .number-controls {
    display: grid;
    overflow: visible;
  }

  .number-controls > input,
  .number-controls > select,
  .number-controls > .button {
    width: 100%;
    flex-basis: auto;
  }

  .dashboard-rank-item {
    grid-template-columns: 1fr;
  }

  .dashboard-rank-panel {
    height: 340px;
  }

  .dashboard-rank-side {
    justify-items: start;
    text-align: left;
  }

  .number-search-control {
    grid-column: auto;
  }

  .product-overview-controls #productSearch {
    grid-column: auto;
  }

  .table-bottom-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .table-bottom-controls > select,
  .table-bottom-controls .pager {
    width: 100%;
    min-width: 0;
  }

  .filter-tabs {
    justify-content: flex-start;
  }

  .lease-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segment-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segment-analytics-panel {
    padding: 18px;
  }

  .segment-card {
    grid-template-columns: 1fr;
  }

  .bulk-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-bulk-bar {
    grid-template-columns: minmax(180px, auto) minmax(90px, 1fr) auto;
  }

  .record-bulk-bar #sessionBulkCount {
    justify-self: center;
  }

  .record-bulk-bar .row-actions {
    justify-self: end;
  }

  .record-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .record-toolbar .toolbar-controls {
    grid-column: 1 / -1;
  }

  .section-head,
  .section-head.compact {
    display: grid;
  }

  .info-grid,
  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

  .record {
    grid-template-columns: 1fr;
  }

  .front-page .record {
    grid-template-columns: 1fr;
  }

  .op-item {
    grid-template-columns: 1fr;
  }

  .op-item.compact {
    grid-template-columns: 1fr;
  }

  .panel-tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-pager {
    justify-content: start;
  }

  .pager {
    align-items: stretch;
  }

  .pager {
    display: grid;
  }

  .pager-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .detail-hero,
  .detail-kv,
  .bind-row,
  .detail-item {
    grid-template-columns: 1fr;
  }

  .sms-log-code {
    grid-template-columns: 1fr;
  }

  .bind-row p {
    grid-column: auto;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .number-box {
    grid-template-columns: 1fr;
  }

  .front-page .number-box {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .front-page:not(.front-has-session) .secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .front-page:not(.front-has-session) .secondary-actions .button {
    width: 100%;
  }

  .row-actions .button,
  .admin-menu .button,
  .menu-item,
  .filter-tabs .button,
  .filter-tabs .metric,
  .modal-actions .button {
    width: auto;
  }
}

@media (max-width: 680px) {
  :root {
    --page-gutter: 14px;
    --page-top: 12px;
    --panel-pad: 12px;
    --card-pad: 8px;
    --control-height: 32px;
    --control-height-sm: 24px;
    --table-pad-y: 7px;
    --table-pad-x: 8px;
    --table-min: 700px;
    --wide-table-min: 880px;
  }

  .product-submenu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .record-bulk-bar {
    grid-template-columns: 1fr;
  }

  .record-bulk-bar #sessionBulkCount,
  .record-bulk-bar .row-actions {
    justify-self: start;
  }

  .record-toolbar {
    grid-template-columns: 1fr;
  }

  .record-toolbar .toolbar-controls {
    grid-column: auto;
  }

  .front-page .shell {
    width: min(100% - var(--page-gutter), 1180px);
    margin-top: 12px;
    margin-bottom: 22px;
  }

  .front-page:not(.front-has-session) .shell {
    width: min(100% - var(--page-gutter), 1180px);
    min-height: auto;
    align-content: start;
    padding: 0 0 18px;
  }

  .front-page:not(.front-has-session) .redeem-pane {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 12px;
    row-gap: 12px;
  }

  .front-page:not(.front-has-session) .status-pane {
    min-height: 0;
    padding: 12px;
  }

  .front-page.front-has-session .redeem-copy h1 {
    font-size: 24px;
  }

  .front-page:not(.front-has-session) .redeem-input-wrap,
  .front-page.front-has-session .redeem-input-wrap {
    grid-template-columns: 1fr;
  }

  .front-page:not(.front-has-session) #redeemBtn {
    width: 100%;
  }

  .front-page .redeem-pane,
  .front-page .status-pane,
  .front-page .records-section {
    padding: 12px;
  }

  .front-page.front-has-session .status-pane {
    padding: 0;
  }

  .front-page.front-has-session .number-box,
  .front-page.front-has-session .code-panel {
    min-height: 126px;
  }

  .front-page.front-has-session .number-box strong {
    margin-top: 8px;
  }

  .front-page.front-has-session .code-main {
    margin-top: 10px;
  }

  .front-page .section-head {
    display: grid;
    gap: 10px;
  }

  .front-page .section-head.compact {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .front-page .section-head.compact .button {
    width: auto;
  }

  .front-page .info-grid {
    grid-template-columns: 1fr;
  }

  .front-page .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .front-page:not(.front-has-session) .secondary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .front-page .action-row .button {
    min-width: 0;
  }

  .front-page #cdkInput {
    min-height: 60px;
    font-size: 14px;
  }

  .front-page:not(.front-has-session) #cdkInput,
  .front-page.front-has-session #cdkInput {
    min-height: 54px;
    height: 54px;
  }

  .code-main {
    display: grid;
    gap: 10px;
  }

  .code-actions {
    justify-content: stretch;
  }

  .code-actions .button {
    width: 100%;
  }

  .batch-card,
  .batch-card.error,
  .front-page .record {
    grid-template-columns: 1fr;
  }

  .batch-actions {
    justify-content: stretch;
  }

  .batch-actions .button,
  .record .button {
    width: 100%;
  }

  .front-page .number-box {
    padding: 10px;
  }

  .front-page .number-box strong {
    font-size: 20px;
  }

  .front-page .code-panel strong {
    font-size: 28px;
  }

  .front-page .toast {
    right: 9px;
    bottom: 9px;
    max-width: calc(100vw - 18px);
  }

  .segment-analytics-panel .segment-controls,
  .segment-analytics-panel .segment-summary {
    grid-template-columns: 1fr;
  }

  .segment-lists > section {
    padding: 10px;
  }
}

@media (max-width: 560px) {
  :root {
    --page-gutter: 14px;
    --page-top: 12px;
    --panel-pad: 12px;
    --card-pad: 8px;
    --control-height: 34px;
    --control-height-sm: 26px;
    --table-pad-y: 7px;
    --table-pad-x: 8px;
    --table-min: 680px;
    --wide-table-min: 860px;
  }

  .shell,
  .admin-shell {
    width: min(100% - var(--page-gutter), 1180px);
    margin-top: 12px;
  }

  .topbar {
    height: auto;
    min-height: 48px;
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .topnav {
    flex: 0 0 auto;
    justify-content: space-between;
    gap: 8px;
  }

  .theme-toggle {
    flex: 1 1 auto;
  }

  .theme-toggle button {
    flex: 1;
    min-height: 32px;
  }

  .button {
    min-height: var(--control-height);
  }

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
    border-radius: 10px;
  }

  .modal-head,
  .modal-body,
  .modal-actions {
    padding: 12px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions .button {
    width: 100%;
  }

  .filter-tabs .metric {
    min-height: 34px;
    padding: 0 10px;
  }

  .filter-tabs .metric span,
  .filter-tabs .metric strong {
    font-size: 14px;
  }

  h1 {
    font-size: 22px;
  }

  .section-head,
  .section-head.compact {
    display: grid;
  }
}

@media (max-width: 420px) {
  .topbar {
    align-items: stretch;
  }

  .brand {
    min-width: 0;
    font-size: 14px;
  }

  .brand span:not(.brand-mark) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .topnav a {
    padding: 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .front-page .redeem-pane,
  .front-page .status-pane,
  .front-page .records-section {
    padding: 14px;
  }

  .front-page .section-head.compact {
    grid-template-columns: 1fr;
  }

  .front-page .pill {
    width: fit-content;
    max-width: 100%;
  }

  .front-page .number-box strong {
    font-size: 20px;
  }

  .front-page .code-panel strong {
    font-size: 30px;
  }

  .batch-section {
    padding: 14px;
  }
}

/* Front exchange final polish: align with the admin login visual language. */
.front-page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 248, 252, 0.97)),
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.08), transparent 30%),
    var(--bg);
  font-size: 13px;
}

.front-page .topbar {
  height: 44px;
  padding: 0 clamp(14px, 2.5vw, 28px);
  border-bottom-color: rgba(229, 231, 235, 0.92);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.front-page .brand {
  gap: 8px;
  font-size: 13px;
}

.front-page .brand-mark {
  width: 32px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
}

.front-page .theme-toggle {
  padding: 2px;
  border-radius: 10px;
}

.front-page .theme-toggle button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
}

.front-page:not(.front-has-session) .shell {
  display: grid;
  place-items: center;
  width: min(430px, calc(100% - 32px));
  min-height: calc(100vh - 44px);
  margin: 0 auto;
  padding: 20px 0;
}

.front-page:not(.front-has-session) .workspace {
  display: block;
  width: 100%;
}

.front-page:not(.front-has-session) .redeem-pane {
  width: 100%;
  max-width: 430px;
  padding: 22px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.front-page:not(.front-has-session) .redeem-copy {
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.front-page:not(.front-has-session) .front-title-row {
  gap: 8px;
  margin: 0;
}

.front-page .front-brand-line {
  gap: 8px;
  color: #69717d;
  font-size: 12px;
  font-weight: 850;
}

.front-page .front-brand-line span {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 3px rgba(22, 131, 91, 0.1);
}

.front-page:not(.front-has-session) .redeem-copy h1 {
  font-size: 24px;
  line-height: 1.18;
  font-weight: 850;
}

.front-page:not(.front-has-session) .redeem-copy p {
  color: #4f5c6b;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 750;
}

.front-page:not(.front-has-session) .redeem-form {
  display: grid;
  gap: 10px;
}

.front-page:not(.front-has-session) .redeem-input-wrap {
  gap: 9px;
}

.front-page:not(.front-has-session) .redeem-input-wrap .field span {
  margin-bottom: 2px;
  color: #2f3945;
  font-size: 12px;
  font-weight: 850;
}

.front-page:not(.front-has-session) #cdkInput {
  min-height: 52px;
  height: 52px;
  padding: 12px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fbfcfe;
  color: #1d2430;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.front-page:not(.front-has-session) #cdkInput::placeholder {
  color: #7b8491;
  font-weight: 800;
}

.front-page:not(.front-has-session) #redeemBtn {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.13);
}

.front-page:not(.front-has-session) .secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  overflow: visible;
}

.front-page:not(.front-has-session) .secondary-actions .button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border-color: #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #425064;
  font-size: 12px;
  font-weight: 850;
}

.front-page.front-has-session .shell {
  width: min(1080px, calc(100% - var(--page-gutter)));
}

.front-page.front-has-session .workspace {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.front-page.front-has-session .redeem-pane {
  grid-template-columns: minmax(220px, 0.46fr) minmax(340px, 1fr);
  gap: 14px;
  padding: 16px;
  border-radius: 10px;
}

.front-page.front-has-session .redeem-copy {
  gap: 8px;
}

.front-page.front-has-session .redeem-copy h1 {
  font-size: 22px;
}

.front-page.front-has-session .redeem-copy p {
  font-size: 13px;
}

.front-page.front-has-session .redeem-input-wrap {
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
}

.front-page.front-has-session #cdkInput {
  min-height: 44px;
  height: 44px;
  font-size: 14px;
}

.front-page.front-has-session #redeemBtn {
  min-height: 44px;
  padding: 0 18px;
}

.front-page.front-has-session .status-pane {
  gap: 10px;
}

.front-page.front-has-session .number-box,
.front-page.front-has-session .code-panel,
.front-page .records-section,
.front-page .batch-section {
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.front-page.front-has-session .number-box,
.front-page.front-has-session .code-panel {
  min-height: 128px;
  padding: 12px;
}

.front-page.front-has-session .number-box strong {
  font-size: clamp(20px, 2.4vw, 26px);
}

.front-page.front-has-session .code-panel strong {
  font-size: clamp(30px, 3.6vw, 42px);
}

:root[data-theme="dark"] .front-page {
  background: var(--bg);
}

:root[data-theme="dark"] .front-page .topbar,
:root[data-theme="dark"] .front-page:not(.front-has-session) .redeem-pane {
  border-color: var(--line);
  background: var(--panel);
}

:root[data-theme="dark"] .front-page:not(.front-has-session) #cdkInput {
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
}

@media (max-width: 680px) {
  .front-page .topbar {
    min-height: 44px;
    padding: 7px 10px;
  }

  .front-page:not(.front-has-session) .shell {
    width: min(100% - 24px, 430px);
    min-height: calc(100vh - 48px);
    padding: 12px 0;
  }

  .front-page:not(.front-has-session) .redeem-pane {
    padding: 18px;
  }

  .front-page.front-has-session .redeem-pane {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session .status-pane {
    grid-template-columns: 1fr;
  }
}

/* Front exchange centering pass. Keep the initial redemption card centered in the viewport. */
.front-page:not(.front-has-session) .shell {
  display: grid;
  width: min(430px, calc(100% - 32px));
  min-height: calc(100dvh - 44px);
  margin: 0 auto;
  padding: 0;
  place-items: center;
}

.front-page:not(.front-has-session) .workspace {
  display: grid;
  width: 100%;
  min-height: inherit;
  place-items: center;
}

.front-page:not(.front-has-session) .redeem-pane {
  align-self: center;
  justify-self: center;
}

@media (max-width: 680px) {
  .front-page:not(.front-has-session) .shell {
    width: min(100% - 24px, 430px);
    min-height: calc(100dvh - 48px);
    padding: 0;
  }
}

/* Front session view cleanup: one compact operations panel with aligned controls. */
.front-page.front-has-session .shell {
  width: min(1080px, calc(100% - 40px));
  padding-top: 18px;
  padding-bottom: 28px;
}

.front-page.front-has-session .redeem-pane {
  display: grid;
  grid-template-columns: minmax(260px, 0.56fr) minmax(420px, 1fr);
  align-items: stretch;
  gap: 0 18px;
  padding: 16px;
  border: 1px solid #dfe5ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.front-page.front-has-session .redeem-copy {
  align-self: stretch;
  gap: 8px;
  min-width: 0;
  padding: 4px 18px 4px 0;
  border-right: 1px solid #edf1f5;
}

.front-page.front-has-session .front-title-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.front-page.front-has-session .front-brand-line {
  min-width: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1;
}

.front-page.front-has-session .front-brand-line strong {
  display: block;
  max-width: 178px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.front-page.front-has-session .front-product-badge {
  flex: 0 1 auto;
  max-width: 190px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f3f6fa;
  color: #111827;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.front-page.front-has-session .redeem-copy h1 {
  margin: 2px 0 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 850;
  letter-spacing: 0;
}

.front-page.front-has-session .redeem-copy p {
  margin: 0;
  color: #566173;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.front-page.front-has-session .redeem-copy #statePill {
  margin-top: 2px;
  width: fit-content;
}

.front-page.front-has-session .redeem-form {
  align-self: start;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.front-page.front-has-session .redeem-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: end;
  padding: 8px;
  border: 1px solid #dfe5ec;
  border-radius: 9px;
  background: #f8fafc;
}

.front-page.front-has-session .redeem-input-wrap .field {
  gap: 5px;
  min-width: 0;
}

.front-page.front-has-session .redeem-input-wrap .field span {
  color: #263241;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.front-page.front-has-session #cdkInput {
  min-height: 34px;
  height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  box-shadow: none;
  resize: none;
}

.front-page.front-has-session #redeemBtn {
  min-width: 92px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 7px 16px rgba(17, 24, 39, 0.14);
}

.front-page.front-has-session .secondary-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.front-page.front-has-session .secondary-actions .button {
  flex: 0 0 128px;
  min-width: 128px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

.front-page.front-has-session .info-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  background: #fff;
}

.front-page.front-has-session .info-grid div {
  min-height: 66px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid #edf1f5;
  border-radius: 0;
  background: #fbfcfe;
}

.front-page.front-has-session .info-grid div:last-child {
  border-right: 0;
}

.front-page.front-has-session .info-grid span {
  margin-bottom: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.front-page.front-has-session .info-grid strong {
  color: #111827;
  font-size: 17px;
  line-height: 1.16;
  font-weight: 850;
}

.front-page.front-has-session .info-grid small {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.front-page.front-has-session .status-pane {
  gap: 10px;
}

.front-page.front-has-session .number-box,
.front-page.front-has-session .code-panel,
.front-page .records-section,
.front-page .batch-section {
  border: 1px solid #dfe5ec;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

@media (max-width: 860px) {
  .front-page.front-has-session .shell {
    width: min(100% - 24px, 680px);
  }

  .front-page.front-has-session .redeem-pane {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .front-page.front-has-session .redeem-copy {
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid #edf1f5;
  }

  .front-page.front-has-session .info-grid {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session .info-grid div {
    border-right: 0;
    border-bottom: 1px solid #edf1f5;
  }

  .front-page.front-has-session .info-grid div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 520px) {
  .front-page.front-has-session .redeem-input-wrap {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session #redeemBtn,
  .front-page.front-has-session .secondary-actions .button {
    width: 100%;
    min-width: 0;
  }

  .front-page.front-has-session .secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Front session alignment pass: keep repeated columns and control rows visually locked. */
.front-page.front-has-session .redeem-pane {
  grid-template-columns: minmax(330px, 0.56fr) minmax(0, 0.5fr) minmax(0, 0.5fr);
  column-gap: 0;
}

.front-page.front-has-session .redeem-copy {
  grid-column: 1;
  padding-right: 18px;
}

.front-page.front-has-session .redeem-form {
  grid-column: 2 / 4;
  padding-left: 18px;
}

.front-page.front-has-session .info-grid {
  grid-template-columns: minmax(330px, 0.56fr) minmax(0, 0.5fr) minmax(0, 0.5fr);
}

.front-page.front-has-session .info-grid div {
  min-height: 64px;
  padding: 10px 12px;
}

.front-page.front-has-session .status-pane {
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.front-page.front-has-session .number-box,
.front-page.front-has-session .code-panel {
  min-height: 132px;
  padding: 14px 12px;
}

.front-page.front-has-session .number-box {
  align-content: start;
}

.front-page.front-has-session .number-box strong {
  margin-top: 8px;
}

.front-page.front-has-session .code-panel small {
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  padding: 8px 10px;
}

.front-page.front-has-session #switchHint,
.front-page.front-has-session .front-notice {
  min-height: 38px;
  display: flex;
  align-items: center;
}

.front-page.front-has-session .change-request {
  grid-template-columns: minmax(188px, 0.58fr) minmax(300px, 1fr) minmax(380px, 1.24fr) minmax(112px, auto);
  gap: 8px 10px;
  align-items: end;
}

.front-page.front-has-session .change-request .section-head {
  min-height: 44px;
}

.front-page.front-has-session .change-request .field {
  align-self: end;
}

.front-page.front-has-session .change-request input[type="file"],
.front-page.front-has-session .change-request textarea,
.front-page.front-has-session .change-request .button.warn {
  height: 34px;
}

@media (max-width: 860px) {
  .front-page.front-has-session .redeem-pane,
  .front-page.front-has-session .info-grid,
  .front-page.front-has-session .status-pane,
  .front-page.front-has-session .change-request {
    grid-template-columns: 1fr;
  }

  .front-page.front-has-session .redeem-copy,
  .front-page.front-has-session .redeem-form {
    grid-column: auto;
    padding-left: 0;
  }
}

/* Admin responsive audit fixes: keep dense toolbars and segment cards inside the viewport. */
@media (max-width: 1040px) {
  .segment-lists {
    grid-template-columns: 1fr;
  }

  .segment-card {
    grid-template-columns: minmax(72px, auto) 58px minmax(0, 1fr) auto;
    gap: 8px;
    max-width: 100%;
  }

  .segment-card > * {
    min-width: 0;
  }

  .segment-card p {
    min-width: 0;
    max-width: 100%;
  }

  .segment-card .row-actions {
    min-width: 0;
    justify-content: flex-end;
  }

  .admin-view[data-view-panel="products"] .product-overview-controls,
  .admin-view[data-view-panel="products"] .supplier-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    white-space: normal;
  }

  .admin-view[data-view-panel="products"] .product-overview-controls #productSearch {
    grid-column: 1 / -1;
  }

  .admin-view[data-view-panel="products"] .product-overview-controls > input,
  .admin-view[data-view-panel="products"] .product-overview-controls > select,
  .admin-view[data-view-panel="products"] .product-overview-controls > .button,
  .admin-view[data-view-panel="products"] .supplier-controls > input,
  .admin-view[data-view-panel="products"] .supplier-controls > select,
  .admin-view[data-view-panel="products"] .supplier-controls > .button {
    width: 100%;
    min-width: 0;
  }

  .admin-view[data-view-panel="products"] .supplier-controls #supplierSegmentSearch {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .segment-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .segment-card .row-actions {
    justify-content: flex-start;
  }

  .admin-view[data-view-panel="products"] .product-overview-controls,
  .admin-view[data-view-panel="products"] .supplier-controls {
    grid-template-columns: 1fr;
  }
}

/* Dense admin filter rows should wrap before they create horizontal overflow. */
.admin-view[data-view-panel="products"] .product-overview-controls {
  grid-template-columns: minmax(220px, 1.8fr) repeat(6, minmax(96px, 1fr)) minmax(88px, 0.8fr);
  overflow: visible;
}

.admin-view[data-view-panel="numbers"] .number-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(100px, 1fr));
  overflow: visible;
}

.admin-view[data-view-panel="numbers"] .number-controls > input,
.admin-view[data-view-panel="numbers"] .number-controls > select,
.admin-view[data-view-panel="numbers"] .number-controls > .button {
  width: 100%;
  min-width: 0;
  flex-basis: auto;
}

.admin-view[data-view-panel="numbers"] .number-search-control {
  grid-column: span 2;
}

@media (max-width: 1040px) {
  .admin-view[data-view-panel="products"] .product-overview-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-view[data-view-panel="numbers"] .number-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-view[data-view-panel="numbers"] .number-search-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .admin-view[data-view-panel="products"] .product-overview-controls,
  .admin-view[data-view-panel="numbers"] .number-controls {
    grid-template-columns: 1fr;
  }

  .admin-view[data-view-panel="numbers"] .number-search-control {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .bulk-bar {
    grid-template-columns: 1fr;
  }

  .bulk-bar > * {
    justify-self: start;
  }

  .bulk-bar .row-actions {
    width: 100%;
    justify-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow: visible;
  }

  .admin-view[data-view-panel="products"] .bulk-bar .row-actions,
  .admin-view[data-view-panel="numbers"] .bulk-bar .row-actions {
    flex-wrap: wrap;
    white-space: normal;
    overflow: visible;
  }

  .bulk-bar .row-actions .button {
    flex: 0 0 auto;
  }
}

/* Keep admin tables visually centered: headers, short values, and inner content blocks. */
.admin-view .data-table th,
.admin-view .data-table td,
.modal-card .mini-table th,
.modal-card .mini-table td {
  text-align: center;
}

.admin-view .data-table .cell-stack,
.admin-view .data-table .compact-main-cell,
.admin-view .data-table .compact-metric-cell,
.admin-view .data-table .number-identity-stack,
.admin-view .data-table .number-type-status-inline,
.admin-view .data-table .number-note-inline,
.admin-view .data-table .number-action-inline,
.admin-view .data-table .number-api-inline,
.admin-view .data-table .cdk-code-inline,
.admin-view .data-table .quality-line,
.admin-view .data-table .compact-actions,
.admin-view .data-table td > strong,
.admin-view .data-table td > small,
.admin-view .data-table .cell-stack > strong,
.admin-view .data-table .cell-stack > small,
.admin-view .data-table .compact-main-cell strong,
.admin-view .data-table .compact-main-cell small,
.admin-view .data-table .compact-metric-cell strong,
.admin-view .data-table .compact-metric-cell small,
.admin-view .data-table .compact-text {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.number-table th:nth-child(8) {
  padding-right: 69px;
}

.number-table th:nth-child(10) {
  padding-right: 35px;
}

.admin-view .data-table td.row-actions,
.admin-view .data-table td.action-cell,
.admin-view .data-table td.master-action-cell,
.admin-view .data-table td.segment-action-cell {
  text-align: center;
}

.admin-view .data-table td .row-actions,
.admin-view .data-table .compact-actions,
.admin-view .data-table .number-row-actions {
  justify-content: center;
}

.admin-view .data-table td.row-actions .button:last-child {
  margin-right: 0;
}
