:root {
  --ink: #182230;
  --muted: #718096;
  --line: #e6ebf2;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --blue: #1688ff;
  --blue-dark: #086bd4;
  --green: #15945d;
  --orange: #d97a18;
  --red: #d8483c;
  --shadow: 0 18px 50px rgba(26, 55, 89, 0.08);
  --sidebar-width: 238px;
  --sidebar-collapsed-width: 72px;
  --radius-card: 14px;
  --space-page: 32px;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Source Han Sans SC",
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.55;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

.eyebrow.dark {
  color: var(--blue);
}

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

.brand-mark {
  display: grid;
  overflow: hidden;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: #ff6500;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
}

.brand-mark img,
.login-card__mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #ff6500;
  font-size: 19px;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.86fr) minmax(420px, 1.14fr);
  background: #f3f6fa;
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 64px clamp(44px, 7vw, 112px);
  background: #123b63;
  color: #fff;
}

.login-brand-panel::after {
  position: absolute;
  right: -170px;
  bottom: -190px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  content: "";
}

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

.login-brand > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.login-brand strong {
  font-size: 18px;
}

.login-brand span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.login-intro {
  margin-top: 84px;
}

.login-intro h1 {
  max-width: 490px;
  margin: 0;
  font-size: 34px;
  line-height: 1.42;
  letter-spacing: -0.5px;
}

.login-intro p {
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  line-height: 1.7;
}

.login-capabilities {
  display: flex;
  width: fit-content;
  flex-direction: column;
  gap: 12px;
  margin: 36px 0 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  list-style: none;
}

.login-capabilities li::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-radius: 50%;
  background: #7bd7b2;
  content: "";
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid #e1e7ef;
  border-radius: 18px;
  background: #fff;
  padding: 34px;
  box-shadow: 0 16px 42px rgba(30, 52, 78, 0.08);
}

.login-card__header {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 28px;
}

.login-card__mark {
  display: grid;
  overflow: hidden;
  width: 46px;
  height: 46px;
  flex: none;
  place-items: center;
  border-radius: 13px;
  background: #ff6500;
  color: #1268c3;
  font-size: 19px;
  font-weight: 800;
}

.login-card__header h2 {
  margin: 0;
  font-size: 24px;
}

.login-card__header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-card .login-field {
  gap: 7px;
  color: #33465d;
  font-size: 14px;
}

.login-field input {
  min-height: 44px;
  border-radius: 9px;
  font-size: 14px;
}

.login-card form {
  gap: 17px;
  margin-top: 0;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.remember-account {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-direction: row;
  color: #536176;
  font-size: 13px;
}

.remember-account input {
  width: auto;
}

.login-security {
  color: #8a98a9;
  font-size: 12px;
}

.login-submit {
  min-height: 44px;
  font-size: 15px;
}

.login-submit[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.login-error {
  border-radius: 8px;
  background: #fff1f0;
  padding: 10px 12px;
  color: var(--red);
  font-size: 13px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(22, 136, 255, 0.28);
  outline-offset: 2px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #435269;
  font-size: 13px;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 136, 255, 0.1);
}

.primary-button,
.ghost-button,
.danger-button,
.success-button {
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

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

.ghost-button {
  border: 1px solid #dbe3ed;
  background: #fff;
  color: #536176;
}

.success-button {
  border: 1px solid #ccebdc;
  background: #edf9f3;
  color: var(--green);
}

.danger-button {
  border: 1px solid #f1d2ce;
  background: #fff3f2;
  color: var(--red);
}

.demo-accounts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.demo-accounts button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 11px;
  color: #536176;
}

.demo-accounts small {
  color: #8e9aaa;
}

.demo-accounts__title {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.demo-accounts__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.error-text {
  color: var(--red);
  font-size: 13px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 160ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
  display: flex;
  height: 100vh;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background: #0d1a2b;
  padding: 22px 16px;
  color: #fff;
}

.sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 24px;
}

.sidebar-brand__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.sidebar-brand strong {
  font-size: 14px;
}

.sidebar-brand span {
  color: #8998ac;
  font-size: 11px;
}

.sidebar-collapse {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 7px;
  color: #8fa0b5;
  font-size: 12px;
}

.sidebar-collapse:hover {
  color: #fff;
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 22px 10px;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.sidebar-collapsed .sidebar-brand__text,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-group,
.app-shell.sidebar-collapsed .sidebar-user > div:nth-child(2) {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-collapse {
  position: absolute;
  right: -2px;
  bottom: 0;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 9px;
}

.app-shell.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding-inline: 0;
}

.nav {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-group {
  margin: 18px 12px 6px;
  color: #63748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 10px 12px;
  color: #a9b6c8;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: rgba(22, 136, 255, 0.18);
  color: #fff;
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 800;
}

.nav-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item.active .nav-icon {
  background: var(--blue);
  color: #fff;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 8px 4px;
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: #eaf3ff;
  color: var(--blue);
  font-weight: 800;
}

.sidebar-user > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.sidebar-user strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user span {
  color: #8595aa;
  font-size: 10px;
}

.icon-button {
  border: 0;
  background: transparent;
  color: #8c9bae;
  font-size: 18px;
}

.main {
  min-width: 0;
  padding: var(--space-page) 38px 48px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.topbar-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.3px;
}

.topbar-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}

.role-badge {
  border: 1px solid #dce5f0;
  border-radius: 999px;
  background: #fff;
  padding: 5px 10px;
  color: #43566e;
  font-size: 12px;
  white-space: nowrap;
}

.auto-refresh-dot {
  position: relative;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.1);
}

.auto-refresh-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(34, 160, 107, 0.35);
  border-radius: 50%;
  animation: auto-refresh-pulse 2s ease-out infinite;
  content: "";
}

@keyframes auto-refresh-pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.7);
  }

  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

.mobile-nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #40536a;
  font-size: 18px;
}

.sidebar-overlay {
  display: none;
}

.view-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

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

.metric-card,
.panel,
.table-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.metric-card::after {
  position: absolute;
  right: -26px;
  bottom: -45px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #eef6ff;
  content: "";
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
}

.metric-card small {
  display: block;
  margin-top: 7px;
  color: #95a0ae;
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.3fr 0.7fr;
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.queue-list,
.health-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-item,
.health-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #edf1f6;
  border-radius: 13px;
  padding: 13px;
}

.queue-badge {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 11px;
  background: #edf5ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.queue-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.queue-main strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-main span {
  color: var(--muted);
  font-size: 11px;
}

.count-pill,
.status-pill,
.risk-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 750;
}

.count-pill {
  background: #f1f5fa;
  color: #5f6d80;
}

.status-pill.PENDING {
  background: #fff4df;
  color: #b76a06;
}

.status-pill.UNPAID {
  background: #fff4df;
  color: #b76a06;
}

.status-pill.APPROVED,
.status-pill.REFUNDED,
.status-pill.RESOLVED,
.status-pill.COMPLETED {
  background: #e8f8ef;
  color: var(--green);
}

.status-pill.REJECTED {
  background: #fff0ef;
  color: var(--red);
}

.risk-pill.HIGH {
  background: #fff0ef;
  color: var(--red);
}

.risk-pill.MEDIUM {
  background: #fff4df;
  color: var(--orange);
}

.risk-pill.LOW {
  background: #e8f8ef;
  color: var(--green);
}

.table-card {
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 20px;
}

.table-toolbar h2 {
  margin: 0;
  font-size: 17px;
}

.table-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-top: 1px solid #edf1f6;
  padding: 14px 20px;
  text-align: left;
}

th {
  background: #fafbfd;
  color: #7a8798;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

td {
  color: #46566c;
  font-size: 12px;
}

td strong {
  display: block;
  max-width: 380px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td small {
  display: block;
  margin-top: 4px;
  color: #99a4b2;
  font-size: 10px;
}

.row-actions {
  display: flex;
  gap: 7px;
}

.empty-state {
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.config-form {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 22px;
}

.config-form .full {
  grid-column: 1 / -1;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-direction: row;
}

.checkbox-line input {
  width: auto;
}

.config-actions {
  display: flex;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.industry-editor-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 20px;
}

.industry-editor {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbfd;
  padding: 16px;
}

.industry-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.industry-editor__head span {
  color: #66758a;
  font-size: 12px;
  font-weight: 750;
}

.industry-editor__grid {
  display: grid;
  align-items: start;
  gap: 14px;
  grid-template-columns: minmax(220px, 0.7fr) minmax(420px, 1.3fr);
}

.industry-editor textarea {
  min-height: 118px;
  resize: vertical;
}

.role-editor {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbfd;
  padding: 16px;
}

.role-editor .full {
  grid-column: 1 / -1;
}

.permission-groups {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.permission-group {
  border: 1px solid #e8edf4;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.permission-group strong {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
}

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

.permission-option {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-direction: row;
  font-size: 11px;
}

.permission-option input {
  width: auto;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 20;
  border-radius: 12px;
  background: #182230;
  padding: 12px 18px;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 14px 36px rgba(15, 27, 43, 0.25);
}

@media (max-width: 1280px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: 248px;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-collapsed .sidebar {
    padding: 22px 16px;
  }

  .app-shell.sidebar-collapsed .sidebar-brand {
    justify-content: flex-start;
    padding: 4px 8px 24px;
  }

  .app-shell.sidebar-collapsed .sidebar-brand__text,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .nav-group,
  .app-shell.sidebar-collapsed .sidebar-user > div:nth-child(2) {
    display: flex;
  }

  .app-shell.sidebar-collapsed .nav-group {
    display: block;
  }

  .app-shell.sidebar-collapsed .nav-item {
    justify-content: flex-start;
    padding: 10px 12px;
  }

  .app-shell.sidebar-collapsed .sidebar-user {
    justify-content: flex-start;
    padding: 18px 8px 4px;
  }

  .sidebar-collapse {
    display: none;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    border: 0;
    background: rgba(13, 26, 43, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .app-shell.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-toggle {
    display: grid;
    place-items: center;
  }

  .main {
    padding: 24px 22px 38px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 1024px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 250px;
    padding: 34px 40px;
  }

  .login-intro {
    margin-top: 32px;
  }

  .login-intro h1 {
    font-size: 27px;
  }

  .login-capabilities {
    display: none;
  }

  .login-panel {
    padding: 30px 24px 42px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-brand-panel {
    min-height: 210px;
    padding: 26px 22px;
  }

  .login-intro {
    margin-top: 24px;
  }

  .login-intro h1 {
    font-size: 23px;
  }

  .login-intro p {
    font-size: 13px;
  }

  .login-panel {
    padding: 20px 14px 32px;
  }

  .login-card {
    padding: 24px 20px;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .main {
    padding-inline: 14px;
  }
}

/* Unified administrative layout */
.main {
  overflow-x: hidden;
  background: #f4f7fa;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 22px;
  border-bottom: 1px solid #e8edf3;
  background: rgba(244, 247, 250, 0.96);
  padding: 14px 0 16px;
}

.topbar h1 {
  color: #172230;
}

.topbar-subtitle {
  margin-top: 3px;
}

.view-content {
  min-width: 0;
}

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

.metric-card {
  min-height: 122px;
  padding: 18px 20px;
}

.metric-card::after {
  display: none;
}

.metric-card span {
  font-size: 13px;
}

.metric-card strong {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.2;
}

.metric-card small {
  margin-top: 8px;
  font-size: 12px;
}

.dashboard-grid {
  align-items: stretch;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
}

.panel {
  padding: 20px;
}

.panel-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

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

.queue-list,
.health-list {
  gap: 8px;
}

.queue-item,
.health-item {
  padding: 12px 13px;
}

.table-card {
  min-width: 0;
  overflow: hidden;
}

.table-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 18px;
}

.table-toolbar > div:first-child {
  min-width: 0;
}

.table-toolbar h2 {
  font-size: 18px;
}

.table-toolbar span {
  display: block;
  margin-top: 3px;
  line-height: 1.5;
}

.table-scroll {
  overflow: auto;
  border-top: 1px solid #edf1f6;
}

table {
  min-width: 860px;
}

th,
td {
  padding: 12px 16px;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  color: #65758a;
  font-size: 12px;
  letter-spacing: 0;
}

th:last-child,
td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 132px;
  background: #fff;
  box-shadow: -8px 0 12px rgba(31, 52, 78, 0.04);
}

th:last-child {
  z-index: 3;
  background: #f7f9fc;
}

td {
  font-size: 13px;
}

td strong {
  max-width: 340px;
  font-size: 14px;
}

td small {
  font-size: 12px;
}

.row-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions button {
  white-space: nowrap;
}

.status-pill,
.risk-pill,
.count-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.empty-state {
  padding: 46px 20px;
  font-size: 13px;
}

.config-form {
  align-items: start;
  gap: 16px 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding: 20px;
}

.config-form label {
  min-width: 0;
}

.config-form input,
.config-form select {
  min-height: 40px;
}

.config-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  border-top: 1px solid #edf1f6;
  background: rgba(255, 255, 255, 0.97);
  padding: 14px 0 2px;
}

.industry-editor-list {
  display: grid;
  align-items: start;
  gap: 14px;
  padding: 0 18px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.industry-editor {
  min-width: 0;
  padding: 15px;
}

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

.industry-editor textarea {
  min-height: 130px;
}

.role-editor {
  min-width: 0;
  padding: 16px;
}

.permission-groups {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.table-card .table-toolbar + table {
  border-top: 1px solid #edf1f6;
}

@media (max-width: 1400px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  }
}

@media (max-width: 1100px) {
  .topbar {
    position: static;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .industry-editor-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .permission-groups,
  .config-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Operations screen and order editor */
.dashboard-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-kpi {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-large);
  background: #fff;
  padding: 17px 18px;
  box-shadow: var(--shadow-card);
}

.dashboard-kpi > span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.dashboard-kpi > strong {
  display: block;
  margin-top: 9px;
  color: var(--text-primary);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.dashboard-kpi > small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.dashboard-kpi > i {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.dashboard-kpi .tone-orange {
  background: #f59e0b;
}

.dashboard-kpi .tone-blue {
  background: #2587df;
}

.dashboard-kpi .tone-red {
  background: #e45b51;
}

.dashboard-kpi .tone-purple {
  background: #7c68d8;
}

.dashboard-kpi .tone-green {
  background: #27a46f;
}

.dashboard-kpi .tone-gray {
  background: #8a98aa;
}

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

.screen-panel {
  min-width: 0;
  grid-column: span 4;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-large);
  background: #fff;
  padding: 17px 18px;
  box-shadow: var(--shadow-card);
}

.screen-panel--trend {
  grid-column: span 8;
}

.screen-panel--orders {
  grid-column: span 12;
}

.screen-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.screen-panel__head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
}

.screen-panel__head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.screen-total {
  color: #1f6fb8;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.screen-link {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.trend-chart {
  display: grid;
  height: 210px;
  align-items: end;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.trend-column {
  display: grid;
  height: 100%;
  min-width: 0;
  align-items: end;
  justify-items: center;
  gap: 6px;
  grid-template-rows: 20px minmax(80px, 1fr) 18px 16px;
}

.trend-value {
  overflow: hidden;
  width: 100%;
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-bar-wrap {
  position: relative;
  width: min(38px, 72%);
  height: 100%;
  overflow: hidden;
  border-radius: 7px 7px 3px 3px;
  background: #eff4fa;
}

.trend-bar-wrap i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 6px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #3b9be9, #176ebf);
}

.trend-column strong {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.trend-column small {
  color: var(--text-muted);
  font-size: 10px;
}

.dimension-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dimension-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.dimension-row strong {
  color: var(--text-primary);
  font-size: 13px;
}

.dimension-track {
  height: 7px;
  overflow: hidden;
  margin-top: 7px;
  border-radius: 999px;
  background: #eef2f7;
}

.dimension-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #70b8ee, #176ebf);
}

.recent-order-list {
  display: flex;
  flex-direction: column;
}

.recent-order-row {
  display: grid;
  align-items: center;
  gap: 14px;
  border-top: 1px solid #edf1f6;
  padding: 11px 4px;
  color: var(--text-secondary);
  font-size: 13px;
  grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) 110px 86px;
}

.recent-order-row:first-child {
  border-top: 0;
}

.recent-order-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.recent-order-main strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-order-main small {
  color: var(--text-muted);
  font-size: 11px;
}

.recent-order-row .money-cell {
  text-align: right;
}

.screen-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--text-muted);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  overflow-y: auto;
  place-items: center;
  background: rgba(15, 27, 43, 0.5);
  padding: 24px;
}

.modal-card {
  width: min(680px, 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 27, 43, 0.22);
}

.modal-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #e7edf4;
  padding: 18px 20px;
}

.modal-card__head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 19px;
}

.modal-card__head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: 7px;
  background: #f5f7fa;
  color: #637488;
  font-size: 22px;
  line-height: 1;
}

.order-form {
  display: grid;
  gap: 15px 18px;
  padding: 18px 20px 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-form .full,
.modal-card__actions {
  grid-column: 1 / -1;
}

.modal-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #edf1f6;
  padding-top: 16px;
}

@media (max-width: 1360px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-visuals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-panel,
  .screen-panel--trend,
  .screen-panel--orders {
    grid-column: span 1;
  }

  .screen-panel--orders {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .dashboard-kpis,
  .dashboard-visuals {
    grid-template-columns: minmax(0, 1fr);
  }

  .screen-panel,
  .screen-panel--orders {
    grid-column: span 1;
  }

  .recent-order-row {
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .recent-order-row > span:nth-child(2) {
    grid-column: 1 / -1;
  }

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

  .modal-backdrop {
    align-items: start;
    padding: 12px;
  }
}

/* Full-page typography and density pass */
html {
  min-width: 0;
  background: #f4f7fa;
}

body {
  min-width: 0;
  overflow-x: hidden;
  color: #1f2b3a;
  font-size: 14px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

p,
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}

.app-shell {
  min-width: 0;
}

.sidebar {
  height: 100vh;
  height: 100dvh;
  padding: 18px 14px;
}

.sidebar-brand {
  padding: 2px 6px 18px;
}

.sidebar-brand strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.sidebar-brand span {
  font-size: 12px;
}

.brand-mark.small {
  border-radius: 12px;
}

.nav {
  padding-right: 2px;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.nav-group {
  margin: 12px 11px 4px;
  color: #7f90a7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-item {
  min-height: 38px;
  gap: 10px;
  padding: 8px 11px;
  color: #b8c4d3;
  font-size: 13px;
  font-weight: 600;
}

.nav-item.active {
  background: #176ebf;
  box-shadow: 0 5px 16px rgba(0, 74, 152, 0.2);
}

.nav-icon {
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 7px;
  font-size: 12px;
}

.sidebar-user {
  padding-top: 14px;
}

.sidebar-user strong {
  font-size: 13px;
}

.sidebar-user span {
  font-size: 11px;
}

.icon-button {
  min-width: 38px;
  padding: 4px;
  color: #9eacbe;
  font-size: 12px;
}

.icon-button:hover {
  color: #fff;
}

.logout-icon {
  display: none;
}

.main {
  min-width: 0;
  padding: 24px 30px 44px;
  overflow: hidden;
}

.main > .topbar,
.main > .view-content {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
}

.topbar {
  padding: 10px 0 14px;
}

.topbar h1 {
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.topbar-subtitle {
  margin-top: 5px;
  color: #6f7d90;
  font-size: 14px;
}

.topbar-actions {
  gap: 12px;
  font-size: 13px;
}

.role-badge {
  padding: 6px 11px;
  font-size: 13px;
}

.primary-button,
.ghost-button,
.danger-button,
.success-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.success-button:hover {
  box-shadow: 0 2px 8px rgba(32, 55, 80, 0.08);
}

.view-content {
  gap: 16px;
}

.settings-shell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.settings-tabs {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(27, 48, 73, 0.045);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-tab {
  display: flex;
  min-width: 0;
  min-height: 68px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  padding: 11px 14px;
  color: #52647a;
  text-align: left;
}

.settings-tab strong {
  color: #2b3a4d;
  font-size: 14px;
}

.settings-tab span {
  color: #7b899a;
  font-size: 12px;
  line-height: 1.45;
}

.settings-tab:hover {
  border-color: #dce7f4;
  background: #f7faff;
}

.settings-tab.active {
  border-color: #cfe3fb;
  background: #edf6ff;
}

.settings-tab.active strong {
  color: #176ebf;
}

.settings-panel {
  min-width: 0;
}

.settings-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-top: 1px solid #e8edf4;
  background: #f8fbff;
  padding: 11px 18px;
  color: #65758a;
  font-size: 13px;
  line-height: 1.55;
}

.settings-tip strong {
  flex: none;
  color: #31506f;
  font-size: 13px;
  font-weight: 600;
}

.field-help {
  color: #7b899a;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.is-inactive {
  opacity: 0.62;
}

.is-inactive input {
  cursor: not-allowed;
  background: #f5f7fa;
}

.fee-preview {
  border-top: 1px solid #e9eef4;
  border-bottom: 1px solid #e9eef4;
  background: #fbfcfe;
  padding: 14px 18px;
}

.fee-preview__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

.fee-preview__heading strong {
  color: #26384c;
  font-size: 14px;
}

.fee-preview__heading span {
  color: #788698;
  font-size: 12px;
}

.fee-preview__grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.fee-preview__grid > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
}

.fee-preview__grid span {
  color: #738196;
  font-size: 12px;
}

.fee-preview__grid strong {
  color: #1f2e3f;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.config-actions__note {
  margin-right: auto;
  color: #7b899a;
  font-size: 12px;
  font-weight: 400;
}

.industry-editor__title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.industry-editor__title strong {
  overflow: hidden;
  color: #2e4055;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.industry-editor__title small {
  color: #7b899a;
  font-size: 12px;
  font-weight: 400;
}

.role-editor__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.permission-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.permission-group__head strong {
  margin: 0;
}

.permission-group__head small {
  color: #8290a2;
  font-size: 11px;
  font-weight: 500;
}

.permission-select-all {
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: #176ebf;
  font-size: 12px;
  font-weight: 500;
}

.permission-select-all:hover {
  color: #075eaa;
}

.metric-card,
.panel,
.table-card {
  border-color: #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(27, 48, 73, 0.055);
}

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

.metric-card {
  min-height: 112px;
  padding: 17px 18px;
}

.metric-card span {
  font-size: 13px;
  font-weight: 600;
}

.metric-card strong {
  margin-top: 9px;
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.metric-card strong.metric-text {
  font-size: 20px;
}

.metric-unit {
  font-size: 14px;
  font-weight: 600;
}

.metric-card small {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-grid {
  gap: 16px;
}

.panel {
  padding: 19px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head h2,
.table-toolbar h2 {
  font-size: 18px;
}

.panel-head p,
.table-toolbar span {
  color: #6f7d90;
  font-size: 13px;
  line-height: 1.55;
}

.queue-item,
.health-item {
  min-height: 62px;
  padding: 11px 12px;
}

.queue-main strong {
  font-size: 14px;
}

.queue-main span {
  font-size: 12px;
  line-height: 1.5;
}

.count-pill,
.status-pill,
.risk-pill {
  min-height: 26px;
  padding: 4px 9px;
  font-size: 12px;
  line-height: 1.25;
}

.table-card {
  min-width: 0;
}

.table-toolbar {
  min-height: 70px;
  gap: 14px;
  padding: 15px 18px;
}

.table-toolbar > div:first-child {
  min-width: 0;
}

.table-toolbar__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.inline-select {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  color: #65758a;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.inline-select select {
  width: auto;
  min-width: 138px;
  min-height: 38px;
  padding-block: 7px;
  font-size: 13px;
}

.notice-pill,
.form-note {
  border: 1px solid #e3e9f1;
  border-radius: 999px;
  background: #f7f9fc;
  padding: 5px 10px;
  color: #65758a;
  font-size: 12px;
  white-space: nowrap;
}

.form-note {
  border: 0;
  background: transparent;
  padding: 0;
}

.table-scroll {
  max-height: min(64vh, 720px);
  overflow: auto;
  border-top: 1px solid #e9eef4;
  scrollbar-gutter: stable;
  scrollbar-color: #c8d2df #f7f9fc;
}

.table-scroll:focus-visible {
  outline: 3px solid rgba(22, 136, 255, 0.22);
  outline-offset: -3px;
}

table.data-table {
  width: 100%;
  min-width: 960px;
  table-layout: auto;
}

.table-card table {
  width: 100%;
  table-layout: auto;
}

.table-card th,
.table-card td {
  text-align: center;
  vertical-align: middle;
}

.table-card th {
  white-space: normal;
}

.data-table th,
.data-table td {
  border-top-color: #edf1f6;
  border-right: 1px solid #cfd9e5;
  padding: 11px 14px;
  text-align: center;
  vertical-align: middle;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  color: #52647a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
}

.data-table td {
  color: #3d4e63;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.data-table input:not([type="checkbox"]),
.data-table select {
  text-align: center;
}

.data-table .checkbox-line {
  justify-content: center;
}

.data-table .input-with-unit {
  margin-inline: auto;
}

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

.data-table tbody tr:first-child td {
  border-top: 1px solid #e9eef4;
}

.sort-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 2px 0;
  color: inherit;
  font: inherit;
  padding-inline: 20px;
  text-align: center;
}

.sort-button:hover {
  color: #176ebf;
}

.sort-indicator {
  position: absolute;
  top: 50%;
  right: 0;
  min-width: 20px;
  color: #8a98aa;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  transform: translateY(-50%);
}

.data-table th.is-sorted {
  background: #eef6ff;
  color: #176ebf;
}

.data-table th.is-sorted .sort-indicator {
  color: #176ebf;
}

.data-table th.is-default-sort .sort-indicator {
  color: #65758a;
  font-size: 11px;
}

.data-table .action-column {
  width: auto;
  min-width: max-content;
  white-space: nowrap;
}

.data-table .serial-column {
  width: auto;
  min-width: max-content;
  color: #7b899a;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.data-table th.serial-column {
  color: #52647a;
  text-align: center;
}

.data-table.has-row-actions th:last-child,
.data-table.has-row-actions td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  box-shadow: -7px 0 12px rgba(31, 52, 78, 0.045);
}

.data-table.has-row-actions th:last-child {
  z-index: 3;
  background: #f7f9fc;
}

.data-table.has-row-actions tbody tr:hover td:last-child {
  background: #fbfdff;
}

.data-table:not(.has-row-actions) th:last-child,
.data-table:not(.has-row-actions) td:last-child {
  position: static;
  min-width: auto;
  background: inherit;
  box-shadow: none;
}

.primary-cell,
.stacked-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.data-table td strong {
  display: block;
  max-width: 420px;
  overflow: visible;
  color: #1e2b3a;
  font-size: 14px;
  line-height: 1.45;
  text-overflow: clip;
  white-space: normal;
}

.data-table td small {
  display: block;
  margin: 0;
  color: #7b899a;
  font-size: 12px;
  line-height: 1.45;
}

.data-table .nowrap {
  white-space: nowrap;
}

.text-cell {
  display: block;
  min-width: 150px;
  max-width: 340px;
  overflow-wrap: anywhere;
  text-align: center;
}

.money-cell {
  color: #1f2b3a;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.flow-arrow {
  margin-inline: 4px;
  color: #94a1b1;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.status-pill.IN_PROGRESS,
.status-pill.DELIVERING,
.status-pill.ESCROWED,
.status-pill.PAID {
  background: #eaf4ff;
  color: #176ebf;
}

.status-pill.RELEASED,
.status-pill.UPDATED {
  background: #e8f8ef;
  color: #128153;
}

.status-pill.CLOSED,
.status-pill.CANCELLED {
  background: #f0f3f7;
  color: #627186;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.row-actions button {
  min-height: 32px;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.table-footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #e9eef4;
  background: #fbfcfe;
  padding: 8px 18px;
  color: #6f7d90;
  font-size: 12px;
}

.table-footer .primary-button {
  margin-left: auto;
}

.sort-hint {
  color: #8a96a7;
}

.table-empty,
.error-state {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  padding: 36px 20px;
  color: #6f7d90;
  text-align: center;
}

.table-empty strong,
.error-state strong {
  color: #253344;
  font-size: 16px;
}

.table-empty span,
.error-state span {
  font-size: 13px;
}

.error-state {
  border: 1px solid #e3e9f1;
  border-radius: 12px;
  background: #fff;
}

.error-state .ghost-button {
  margin-top: 8px;
}

.loading-panel {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #e3e9f1;
  border-radius: 12px;
  background: #fff;
  color: #64748a;
  font-size: 14px;
}

.loading-indicator {
  width: 18px;
  height: 18px;
  border: 2px solid #cfdae7;
  border-top-color: #176ebf;
  border-radius: 50%;
  animation: admin-spin 800ms linear infinite;
}

@keyframes admin-spin {
  to {
    transform: rotate(360deg);
  }
}

label {
  color: #435269;
  font-size: 13px;
  font-weight: 650;
}

input,
textarea,
select {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
}

select {
  cursor: pointer;
}

.checkbox-line,
.remember-account,
.permission-option {
  font-weight: 500;
}

.checkbox-line input,
.permission-option input,
.remember-account input {
  width: 17px;
  height: 17px;
  min-height: auto;
  accent-color: #176ebf;
}

.settings-form {
  overflow: visible;
}

.form-section {
  display: grid;
  gap: 16px 28px;
  border-top: 1px solid #e9eef4;
  padding: 18px;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
}

.form-section__heading h3 {
  margin: 0;
  color: #253344;
  font-size: 15px;
}

.form-section__heading p {
  margin: 5px 0 0;
  color: #778599;
  font-size: 12px;
  line-height: 1.55;
}

.form-section > .config-form {
  padding: 0;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.config-form {
  gap: 15px 18px;
}

.config-form label {
  min-width: 0;
}

.config-form input,
.config-form select {
  min-height: 40px;
}

.input-with-unit {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.input-with-unit input {
  border-radius: 8px 0 0 8px;
}

.input-with-unit > span {
  display: grid;
  place-items: center;
  border: 1px solid #dce4ee;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f6f8fb;
  color: #64748a;
  font-size: 12px;
}

.input-with-unit.compact {
  width: 106px;
  grid-template-columns: minmax(0, 1fr) 28px;
}

.switch-row {
  display: grid;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fafbfd;
  padding: 10px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.switch-row > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.switch-row strong {
  color: #304156;
  font-size: 13px;
}

.switch-row small {
  color: #7c8999;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.switch-row input {
  width: 20px;
  height: 20px;
  min-height: auto;
  accent-color: #176ebf;
}

.config-actions {
  border-top: 1px solid #e9eef4;
  background: rgba(255, 255, 255, 0.98);
  padding: 12px 18px;
}

.settings-form > .config-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.industry-editor-list {
  gap: 14px;
  padding: 14px 18px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.industry-editor,
.role-editor {
  border-color: #e1e8f0;
  border-radius: 10px;
  background: #fbfcfe;
  padding: 14px;
}

.industry-editor__head {
  align-items: center;
  margin-bottom: 12px;
}

.industry-editor__head > span:first-child {
  color: #2e4055;
  font-size: 14px;
  font-weight: 700;
}

.industry-editor__grid {
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.industry-editor textarea {
  min-height: 144px;
  line-height: 1.75;
}

.roles-form .industry-editor-list {
  grid-template-columns: minmax(0, 1fr);
}

.role-editor {
  padding: 16px;
}

.role-editor .industry-editor__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.permission-groups {
  gap: 10px;
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.permission-group {
  min-width: 0;
  border-color: #e3e9f1;
  padding: 11px;
}

.permission-group strong {
  margin-bottom: 8px;
  color: #304156;
  font-size: 13px;
}

.permission-grid {
  gap: 6px;
  grid-template-columns: minmax(0, 1fr);
}

.permission-option {
  min-height: 28px;
  gap: 8px;
  font-size: 12px;
}

.table-card--accountRoles .data-table {
  min-width: 640px;
}

.table-card--accountRoles select {
  min-width: 180px;
  text-align: center;
}

.toast {
  border-radius: 9px;
  font-size: 14px;
}

@media (max-height: 800px) and (min-width: 1101px) {
  .sidebar {
    padding-block: 14px;
  }

  .sidebar-brand {
    padding-bottom: 11px;
  }

  .brand-mark.small {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .nav {
    gap: 2px;
  }

  .nav-group {
    margin: 7px 11px 2px;
  }

  .nav-item {
    min-height: 34px;
    padding-block: 5px;
  }

  .sidebar-user {
    padding-top: 9px;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
  }
}

@media (min-width: 1101px) {
  .app-shell.sidebar-collapsed .sidebar-brand {
    flex-direction: column;
    gap: 7px;
  }

  .app-shell.sidebar-collapsed .sidebar-collapse {
    position: static;
    width: 32px;
    height: 20px;
    margin: 0;
    padding: 0;
    border-radius: 6px;
  }

  .app-shell.sidebar-collapsed .logout-label {
    display: none;
  }

  .app-shell.sidebar-collapsed .logout-icon {
    display: inline;
  }

  .app-shell.sidebar-collapsed .sidebar-user {
    gap: 6px;
    flex-direction: column;
  }
}

@media (max-width: 1280px) {
  .main {
    padding-inline: 24px;
  }

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

  .form-section > .config-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .permission-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .topbar {
    padding-top: 4px;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .role-editor .industry-editor__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-editor .industry-editor__grid .full {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 14px 14px 30px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .settings-tip,
  .fee-preview__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .fee-preview__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-toolbar__actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .table-toolbar__actions .ghost-button {
    width: 100%;
  }

  .form-section > .config-form,
  .role-editor .industry-editor__grid,
  .permission-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .industry-editor-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .table-footer .primary-button {
    width: 100%;
    margin-left: 0;
    margin-top: 6px;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar h1 {
    font-size: 22px;
  }

  .topbar-actions .muted {
    width: 100%;
  }

  .footer,
  .table-toolbar,
  .form-section {
    padding-inline: 14px;
  }

  .industry-editor-list {
    padding-inline: 14px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Unified visual system */
:root {
  --text-primary: #1d2a3a;
  --text-body: #35465a;
  --text-secondary: #586b80;
  --text-muted: #738196;
  --text-placeholder: #98a4b3;
  --surface-subtle: #f6f8fb;
  --border-subtle: #e0e7ef;
  --border-strong: #cfd8e4;
  --brand-primary: #176ebf;
  --brand-primary-soft: #edf6ff;
  --font-body: 14px;
  --font-table: 14px;
  --font-small: 13px;
  --font-label: 12px;
  --font-page-title: 24px;
  --font-section-title: 18px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --radius-small: 7px;
  --radius-medium: 10px;
  --radius-large: 12px;
  --shadow-card: 0 5px 18px rgba(25, 44, 68, 0.045);
}

body {
  color: var(--text-primary);
  background: #f4f7fa;
  font-size: var(--font-body);
  font-weight: var(--weight-regular);
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font-size: var(--font-body);
  font-weight: var(--weight-regular);
}

button {
  font-weight: var(--weight-semibold);
}

h1,
h2,
h3,
strong {
  font-weight: var(--weight-semibold);
}

.muted,
.topbar-subtitle,
.panel-head p,
.table-toolbar span,
.form-section__heading p,
.settings-tab span,
.queue-main span,
.login-intro p,
.login-card__header p {
  color: var(--text-secondary);
  font-size: var(--font-small);
  font-weight: var(--weight-regular);
}

.nav-item {
  color: #bdc8d6;
  font-size: var(--font-body);
  font-weight: var(--weight-medium);
}

.nav-item.active {
  font-weight: var(--weight-semibold);
}

.sidebar-brand strong {
  font-size: 12px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  white-space: nowrap;
}

.sidebar-brand span,
.sidebar-user span {
  color: #8f9db0;
  font-size: var(--font-label);
  font-weight: var(--weight-regular);
}

.sidebar-user strong {
  color: #f3f6fa;
  font-size: var(--font-small);
  font-weight: var(--weight-semibold);
}

.topbar h1 {
  color: var(--text-primary);
  font-size: var(--font-page-title);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

.topbar-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-body);
}

.role-badge,
.notice-pill,
.form-note {
  color: var(--text-secondary);
  font-size: var(--font-small);
  font-weight: var(--weight-medium);
}

.primary-button,
.ghost-button,
.danger-button,
.success-button {
  min-height: 38px;
  border-radius: var(--radius-small);
  font-size: var(--font-body);
  font-weight: var(--weight-semibold);
}

.primary-button {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

.ghost-button {
  border-color: var(--border-strong);
  color: var(--text-body);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled,
.success-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.metric-card,
.panel,
.table-card,
.login-card,
.settings-tabs {
  border-color: var(--border-subtle);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-card);
}

.metric-card span {
  color: var(--text-secondary);
  font-size: var(--font-body);
  font-weight: var(--weight-medium);
}

.metric-card strong {
  color: var(--text-primary);
  font-size: 28px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}

.metric-card strong.metric-text {
  font-size: 20px;
}

.metric-card small {
  color: var(--text-muted);
  font-size: var(--font-label);
  font-weight: var(--weight-regular);
}

.panel-head h2,
.table-toolbar h2 {
  color: var(--text-primary);
  font-size: var(--font-section-title);
  font-weight: var(--weight-bold);
}

.queue-main strong,
.data-table td strong {
  color: var(--text-primary);
  font-size: var(--font-body);
  font-weight: var(--weight-semibold);
}

.queue-main span,
.data-table td small {
  color: var(--text-muted);
  font-size: var(--font-label);
  font-weight: var(--weight-regular);
}

label {
  color: var(--text-body);
  font-size: var(--font-body);
  font-weight: var(--weight-semibold);
}

.checkbox-line,
.remember-account,
.permission-option {
  font-weight: var(--weight-regular);
}

input,
select,
textarea {
  min-height: 40px;
  border-color: var(--border-subtle);
  border-radius: var(--radius-small);
  color: var(--text-primary);
  font-size: var(--font-body);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-placeholder);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(23, 110, 191, 0.12);
}

.table-toolbar {
  background: #fff;
}

.data-table th {
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: var(--font-small);
  font-weight: var(--weight-semibold);
}

.data-table td {
  color: var(--text-body);
  font-size: var(--font-table);
  font-weight: var(--weight-regular);
}

.data-table td strong {
  font-size: var(--font-table);
}

.data-table td small {
  font-size: var(--font-label);
}

.count-pill,
.status-pill,
.risk-pill {
  font-size: var(--font-label);
  font-weight: var(--weight-semibold);
}

.row-actions button {
  font-size: var(--font-small);
  font-weight: var(--weight-semibold);
}

.table-footer {
  color: var(--text-muted);
  font-size: var(--font-label);
  font-weight: var(--weight-regular);
}

.form-section__heading h3 {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: var(--weight-semibold);
}

.switch-row strong,
.permission-group strong {
  color: var(--text-body);
  font-size: var(--font-small);
  font-weight: var(--weight-semibold);
}

.switch-row small,
.permission-option {
  color: var(--text-muted);
  font-size: var(--font-small);
  font-weight: var(--weight-regular);
}

.settings-tab {
  border-radius: var(--radius-medium);
}

.settings-tab strong {
  color: var(--text-primary);
  font-size: var(--font-body);
  font-weight: var(--weight-semibold);
}

.settings-tab.active strong {
  color: var(--brand-primary);
}

.settings-tab span {
  color: var(--text-muted);
  font-size: var(--font-small);
}

.login-brand strong {
  font-size: 18px;
  font-weight: var(--weight-semibold);
}

.login-brand span {
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--font-small);
}

.login-intro h1 {
  font-size: 34px;
  font-weight: var(--weight-bold);
}

.login-intro p {
  color: rgba(255, 255, 255, 0.76);
  font-size: var(--font-small);
  font-weight: var(--weight-regular);
}

.login-card .login-field {
  font-size: var(--font-body);
  font-weight: var(--weight-semibold);
}

.login-card__header h2 {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: var(--weight-bold);
}

.login-card__header p,
.login-security,
.demo-accounts,
.demo-accounts small {
  color: var(--text-muted);
  font-size: var(--font-small);
  font-weight: var(--weight-regular);
}

.toast {
  font-size: var(--font-body);
  font-weight: var(--weight-medium);
}

@media (max-width: 480px) {
  .topbar h1 {
    font-size: 22px;
  }

  .metric-card strong {
    font-size: 26px;
  }

  .login-intro h1 {
    font-size: 23px;
  }
}

