:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #fff8ed;
  --text: #111c3a;
  --muted: #667085;
  --muted-2: #98a2b3;
  --border: #e8edf5;
  --line: #eef2f7;
  --orange: #ff7900;
  --orange-2: #ffae2e;
  --orange-soft: #fff0dc;
  --green: #12a568;
  --green-soft: #e8f8ef;
  --red: #ef4444;
  --red-soft: #fff1f1;
  --blue: #2f6fdb;
  --blue-soft: #eef5ff;
  --yellow: #f8b400;
  --yellow-soft: #fff7dd;
  --shadow: 0 16px 38px rgba(16, 24, 40, 0.07);
  --sidebar: 252px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 121, 0, 0.2);
}

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

button.secondary {
  background: #111c3a;
  color: #ffffff;
  box-shadow: none;
}

button.ghost {
  background: #ffffff;
  color: #344054;
  border: 1px solid var(--border);
  box-shadow: none;
}

button.danger {
  background: var(--red-soft);
  color: var(--red);
  box-shadow: none;
}

button.success {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: none;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 116px;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 121, 0, 0.12);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease-out;
}

.toast.error {
  border-left-color: var(--red);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  background: rgba(245, 247, 251, 0.42);
  backdrop-filter: blur(2px);
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 180px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.loading-card i {
  width: 28px;
  height: 28px;
  border: 3px solid var(--orange-soft);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-card strong {
  font-size: 14px;
}

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

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

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-root {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(360px, 460px);
  gap: 48px;
  align-items: center;
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 48px 0;
}

.login-visual {
  position: relative;
  min-height: 560px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, #ffe68a 0%, #ffb43b 46%, #ff7900 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 76px 52px 58px 52px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.login-system {
  position: absolute;
  left: 78px;
  top: 102px;
  width: 420px;
  color: #20180f;
}

.login-system span {
  color: #9f5700;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-system strong {
  display: block;
  margin-top: 10px;
  font-size: 44px;
  line-height: 1.05;
  font-weight: 950;
}

.login-system p {
  margin-top: 18px;
  color: #674000;
  font-size: 16px;
  line-height: 1.7;
}

.login-kpi {
  position: absolute;
  width: 150px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 34px rgba(114, 54, 0, 0.12);
}

.login-kpi span,
.login-kpi strong {
  display: block;
}

.login-kpi span {
  color: #8a5b00;
  font-size: 13px;
  font-weight: 900;
}

.login-kpi strong {
  margin-top: 8px;
  color: #111c3a;
  font-size: 30px;
  font-weight: 950;
}

.kpi-a {
  right: 92px;
  top: 122px;
}

.kpi-b {
  left: 96px;
  bottom: 92px;
}

.kpi-c {
  right: 116px;
  bottom: 120px;
}

.login-panel {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brand-row,
.side-brand,
.globalbar,
.global-actions,
.admin-profile,
.page-heading,
.panel-head {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #ffd33d, #ff8500);
  color: #231407;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(255, 121, 0, 0.22);
}

.brand-row h1 {
  font-size: 30px;
  font-weight: 950;
}

.brand-row p,
.login-note {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.login-panel label {
  display: block;
  margin-top: 18px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.login-panel input {
  margin-top: 8px;
}

.login-panel button {
  width: 100%;
  margin-top: 24px;
}

.login-note {
  font-size: 13px;
}

.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.side-brand {
  gap: 12px;
  padding: 0 4px 18px;
}

.side-brand strong,
.side-brand span {
  display: block;
}

.side-brand strong {
  font-size: 18px;
  font-weight: 950;
}

.side-brand span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: grid;
  gap: 4px;
}

.nav-section {
  margin: 15px 10px 7px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.tabs button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  color: #344054;
  box-shadow: none;
  text-align: left;
}

.tabs button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f4f6f9;
  color: #667085;
  font-size: 13px;
  font-weight: 950;
}

.tabs button.active,
.tabs button:hover {
  background: var(--orange-soft);
  color: var(--orange);
  transform: none;
}

.tabs button.active span {
  background: linear-gradient(135deg, #ffd33d, #ff8500);
  color: #231407;
}

.tabs button.locked,
.tabs button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.tabs button.locked:hover,
.tabs button:disabled:hover {
  background: transparent;
  color: #344054;
  box-shadow: none;
}

.workspace {
  min-width: 0;
}

.globalbar {
  position: sticky;
  top: 0;
  z-index: 5;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.icon-button,
.bell {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: #344054;
  box-shadow: none;
}

.global-search {
  flex: 1;
  max-width: 620px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f9fbfd;
}

.global-search span {
  color: var(--muted-2);
  font-weight: 950;
}

.global-search input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.global-actions {
  gap: 10px;
}

.bell {
  position: relative;
}

.bell i {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #ffffff;
}

.admin-profile {
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 950;
}

.admin-profile strong,
.admin-profile span {
  display: block;
}

.admin-profile strong {
  font-size: 14px;
}

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

.page-heading {
  justify-content: space-between;
  gap: 18px;
  padding: 28px 28px 18px;
}

.page-heading h1 {
  font-size: 30px;
  font-weight: 950;
}

.page-heading p {
  margin-top: 8px;
  color: var(--muted);
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

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

.metric {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.metric-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 950;
}

.metric strong {
  display: block;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  font-weight: 950;
}

.metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.metric small {
  display: block;
  margin-top: 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.panel {
  margin: 0 28px 30px;
  min-height: 430px;
}

.panel-shell,
.panel-card,
.rail-card,
.data-card,
.summary-card,
.group-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.05);
}

.panel-shell {
  overflow: hidden;
}

.panel-head {
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 21px;
  font-weight: 950;
}

.panel-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.tool-chip,
.tag,
.status,
.risk-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tool-chip {
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: #475467;
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 338px;
  gap: 14px;
}

.main-stack,
.rail-stack {
  display: grid;
  gap: 14px;
}

.blueprint {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.blueprint-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #fffaf4);
}

.blueprint-item span,
.data-card span,
.summary-card span,
.rail-card span,
.group-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.blueprint-item strong,
.data-card strong,
.summary-card strong,
.rail-card strong,
.group-card strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  font-weight: 950;
}

.blueprint-item p {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.55;
}

.queue-tabs {
  display: flex;
  gap: 8px;
  padding: 15px 16px 0;
}

.queue-tabs button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #475467;
  box-shadow: none;
}

.queue-tabs button.active {
  border-color: #ffd2a6;
  background: var(--orange-soft);
  color: var(--orange);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

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

.table th {
  background: #fafbfc;
  color: #667085;
  font-size: 13px;
  font-weight: 950;
}

.table td {
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
}

.table tr:hover td {
  background: #fffaf2;
}

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

.ops-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 22px 0;
}

.ops-filter {
  display: grid;
  grid-template-columns: 150px 150px 150px minmax(220px, 1fr) 150px 150px auto;
  gap: 12px;
  align-items: end;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.ops-filter label,
.ops-extra-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ops-filter input,
.ops-filter select {
  margin-top: 7px;
}

.ops-filter-actions,
.ops-batch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ops-filter-actions {
  justify-content: flex-end;
}

.ops-batch {
  padding: 0 22px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky;
  top: 64px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.ops-batch span {
  margin-right: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ops-extra-form {
  margin: 0 22px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
}

.ops-table th.sortable {
  cursor: pointer;
  user-select: none;
}

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

.ops-table th,
.ops-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-table td .entity {
  min-width: 0;
}

.ops-table td .entity div:last-child {
  min-width: 0;
}

.ops-table td .entity strong,
.ops-table td .entity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-table tbody tr.keyboard-selected td {
  background: #fff3df;
  box-shadow: inset 0 1px 0 #ffd8ab, inset 0 -1px 0 #ffd8ab;
}

.ops-table tbody tr.keyboard-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--orange), inset 0 1px 0 #ffd8ab, inset 0 -1px 0 #ffd8ab;
}

.ops-table th:first-child,
.ops-table td:first-child {
  width: 44px;
  text-align: center;
}

.ops-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--orange);
}

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

.detail-list div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.detail-text {
  margin: 8px 0 12px;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

.preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.finance-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.finance-board > div {
  min-width: 0;
}

.finance-board h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
}

.embedded-section {
  padding: 0 22px 22px;
}

.embedded-section h3 {
  margin: 8px 0 14px;
  color: var(--text);
  font-size: 16px;
}

.trend-chart {
  width: 100%;
  min-height: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.trend-chart line {
  stroke: #d8e1ee;
  stroke-width: 1;
}

.trend-chart polyline {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-chart .amount-line {
  stroke: #ff8a00;
}

.trend-chart .order-line {
  stroke: #22c55e;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-legend .amount {
  background: #ff8a00;
}

.chart-legend .orders {
  background: #22c55e;
}

.entity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entity-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 950;
}

.entity strong {
  display: block;
  color: var(--text);
}

.entity span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.rail-card {
  padding: 16px;
}

.rail-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.health {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}

.health-ring {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 0 48%, transparent 49%),
    conic-gradient(var(--green) 0 78%, var(--yellow) 78% 90%, var(--red) 90% 100%);
  color: var(--green);
  font-size: 22px;
  font-weight: 950;
}

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

.rail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  font-size: 14px;
}

.rail-row small {
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--orange);
  margin-right: 8px;
}

.split-metric {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.split-metric div + div {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.split-metric strong {
  font-size: 28px;
}

.data-grid,
.cards-grid {
  display: grid;
  gap: 14px;
}

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

.data-card,
.summary-card,
.group-card {
  padding: 18px;
}

.cards-grid {
  grid-template-columns: repeat(3, 1fr);
  padding: 18px 22px;
}

.group-card h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 17px;
}

.group-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.group-stats div {
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.group-card .actions {
  margin-top: 16px;
}

.tag {
  padding: 5px 9px;
  background: var(--blue-soft);
  color: var(--blue);
}

.tag.amber,
.status.pending {
  background: var(--orange-soft);
  color: #c65f00;
}

.risk-chip {
  padding: 5px 9px;
}

.risk-low {
  background: var(--green-soft);
  color: var(--green);
}

.risk-mid {
  background: var(--yellow-soft);
  color: #a35c00;
}

.risk-high {
  background: var(--red-soft);
  color: var(--red);
}

.status {
  padding: 5px 9px;
}

.status.approved,
.status.completed,
.status.active,
.status.resolved {
  background: var(--green-soft);
  color: var(--green);
}

.status.rejected,
.status.cancelled,
.status.removed,
.status.disabled,
.status.banned,
.status.muted {
  background: var(--red-soft);
  color: var(--red);
}

.status.processing {
  background: var(--blue-soft);
  color: var(--blue);
}

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

.actions button {
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: none;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 42px;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 20px;
}

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

.form-grid label,
.settings-form label {
  display: block;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.form-grid input,
.form-grid textarea,
.form-grid select,
.settings-form input,
.settings-form textarea {
  margin-top: 8px;
}

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

.settings-form {
  max-width: 820px;
  padding: 22px;
}

.settings-form label {
  margin-bottom: 16px;
}

.hint {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.form-grid > form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.28);
}

.drawer-panel {
  width: min(720px, calc(100vw - 22px));
  min-height: 100vh;
  background: #ffffff;
  box-shadow: -20px 0 44px rgba(16, 24, 40, 0.18);
  display: flex;
  flex-direction: column;
}

.drawer-head,
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-foot {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.drawer-head h2 {
  font-size: 21px;
  font-weight: 950;
}

.drawer-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 18px 20px;
}

.drawer-foot {
  justify-content: flex-start;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.drawer-section + .drawer-section {
  margin-top: 22px;
}

.drawer-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.drawer-section .table {
  min-width: 620px;
}

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

.compact-nav {
  --sidebar: 84px;
}

.compact-nav .side-brand div:not(.brand-mark),
.compact-nav .nav-section,
.compact-nav .tabs button {
  font-size: 0;
}

.compact-nav .tabs button {
  justify-content: center;
}

.compact-nav .tabs button span {
  margin: 0;
}

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

  .ops-layout {
    grid-template-columns: 1fr;
  }

  .data-grid,
  .blueprint {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 900px) {
  .login-view {
    grid-template-columns: 1fr;
    width: min(480px, calc(100vw - 32px));
  }

  .login-visual {
    display: none;
  }

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 8;
    height: auto;
    padding: 12px;
  }

  .side-brand {
    padding-bottom: 10px;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  .nav-section {
    display: none;
  }

  .tabs button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .globalbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .global-search {
    order: 3;
    min-width: 100%;
    max-width: none;
  }

  .admin-profile {
    display: none;
  }

  .page-heading,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .data-grid,
  .blueprint,
  .cards-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .metrics {
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel {
    margin-left: 16px;
    margin-right: 16px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .metric {
    padding: 14px;
  }

  .metric-icon {
    width: 38px;
    height: 38px;
  }

  .metric strong {
    font-size: 22px;
  }

  .ops-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .queue-toolbar input {
    width: 150px;
  }

  .queue-toolbar select {
    width: 118px;
  }
}

/* Reference-style admin console layout */
:root {
  --sidebar: 176px;
  --topbar: 56px;
}

.dashboard {
  display: block;
  min-height: 100vh;
  background: #f5f7fb;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--topbar);
  padding: 7px 12px;
  border-bottom: 1px solid #edf1f6;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 18px rgba(16, 24, 40, 0.04);
}

.top-brand {
  width: 235px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.top-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.top-brand strong {
  color: #111c3a;
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

.top-brand span {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.app-topbar .global-search {
  max-width: 520px;
  height: 38px;
  margin-right: auto;
}

.app-topbar .admin-profile {
  min-width: 134px;
}

.app-topbar .avatar {
  background: linear-gradient(180deg, #ffe0b8, #fff2df);
}

.dashboard-body {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar));
}

.sidebar {
  top: var(--topbar);
  height: calc(100vh - var(--topbar));
  padding: 14px 12px;
  border-right: 1px solid #edf1f6;
  background: #ffffff;
}

.tabs {
  gap: 8px;
}

.tabs button {
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 900;
}

.tabs button span {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
}

.tabs button.active,
.tabs button:hover {
  background: #fff3df;
  box-shadow: inset 0 0 0 1px rgba(255, 121, 0, 0.1);
}

.tabs button.locked:hover,
.tabs button:disabled:hover {
  background: transparent;
  box-shadow: none;
}

.workspace {
  min-width: 0;
  padding: 0 18px 28px;
}

.page-heading {
  padding: 22px 2px 16px;
}

.page-heading h1 {
  font-size: 29px;
  line-height: 1.1;
}

.page-heading p {
  margin-top: 8px;
  font-size: 14px;
}

.heading-actions {
  align-items: center;
  color: #667085;
  font-size: 13px;
}

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

.metric {
  min-height: 105px;
  padding: 16px;
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.metric strong {
  font-size: 25px;
}

.metric small {
  margin-top: 12px;
}

.panel {
  margin: 0;
}

.ops-layout {
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 12px;
}

.main-stack,
.rail-stack {
  gap: 12px;
}

.panel-shell,
.rail-card,
.data-card,
.summary-card,
.group-card {
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
}

.panel-head {
  min-height: 68px;
  padding: 14px 16px;
}

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

.panel-head p {
  font-size: 13px;
}

.queue-tabs {
  align-items: center;
  padding: 10px 16px 8px;
}

.queue-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #344054;
  font-weight: 900;
}

.queue-tabs button.active {
  border-bottom: 2px solid var(--orange);
  background: transparent;
  color: var(--orange);
}

.queue-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.queue-toolbar select,
.queue-toolbar input {
  height: 34px;
  border-radius: 7px;
  font-size: 12px;
}

.queue-toolbar select {
  width: 126px;
}

.queue-toolbar input {
  width: 180px;
}

.queue-toolbar button {
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
}

.table {
  min-width: 760px;
}

.table th,
.table td {
  padding: 10px 12px;
}

.table th {
  background: #f8fafc;
  font-size: 12px;
}

.table td {
  font-size: 13px;
}

.entity-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.entity strong {
  font-size: 13px;
}

.entity span {
  font-size: 12px;
}

.row-check {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
}

.more-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 7px;
  background: transparent;
  color: #667085;
  box-shadow: none;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 14px;
  color: #667085;
  font-size: 13px;
}

.pagination .spacer {
  flex: 1;
}

.pagination select {
  width: 94px;
  height: 34px;
  font-size: 12px;
}

.ops-pagination .page-jump {
  width: 68px;
  height: 34px;
  text-align: center;
}

.page-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: #344054;
  box-shadow: none;
}

.page-btn.active {
  border-color: var(--orange);
  background: var(--orange);
  color: #ffffff;
}

@media (max-width: 1180px) {
  .ops-filter,
  .ops-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-filter-actions {
    justify-content: flex-start;
  }
}

.rail-card {
  padding: 14px;
}

.rail-card h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.health {
  grid-template-columns: 104px 1fr;
}

.health-ring {
  width: 90px;
  height: 90px;
}

.rail-row {
  font-size: 13px;
}

.split-metric strong {
  font-size: 27px;
}

.date-chip {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .ops-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  :root {
    --sidebar: 1fr;
  }

  .app-topbar {
    flex-wrap: wrap;
    position: relative;
    z-index: 30;
    min-height: 0;
  }

  .app-topbar .global-search {
    order: 3;
    flex: 0 0 100%;
    max-width: none;
    margin: 8px 0 0;
  }

  .top-brand {
    width: auto;
    flex: 1;
  }

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 18;
    height: auto;
    overflow-x: auto;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

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

  .queue-tabs {
    flex-wrap: wrap;
  }

  .queue-toolbar {
    width: 100%;
    margin-left: 0;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .ops-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
}

.queue-tabs {
  flex-wrap: nowrap;
}

.queue-tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}

.queue-toolbar {
  gap: 6px;
}

.queue-toolbar select {
  width: 112px;
}

.queue-toolbar input {
  width: 138px;
}

.ops-layout .table {
  min-width: 690px;
}

.actions {
  flex-wrap: nowrap;
}

.table th,
.table td {
  white-space: nowrap;
}

.actions button,
.queue-toolbar button {
  min-width: 46px;
  white-space: nowrap;
}

@media (min-width: 901px) and (max-width: 1180px) {
  .metric-top {
    gap: 8px;
  }

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

  .metric-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }
}

.ops-layout .table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.ops-layout .table th,
.ops-layout .table td {
  padding: 10px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-layout .table th:nth-child(1),
.ops-layout .table td:nth-child(1) {
  width: 28px;
}

.ops-layout .table th:nth-child(2),
.ops-layout .table td:nth-child(2) {
  width: 54px;
}

.ops-layout .table th:nth-child(3),
.ops-layout .table td:nth-child(3) {
  width: 150px;
}

.ops-layout .table th:nth-child(4),
.ops-layout .table td:nth-child(4) {
  width: 120px;
}

.ops-layout .table th:nth-child(5),
.ops-layout .table td:nth-child(5) {
  width: 76px;
}

.ops-layout .table th:nth-child(6),
.ops-layout .table td:nth-child(6) {
  width: 66px;
}

.ops-layout .table th:nth-child(7),
.ops-layout .table td:nth-child(7) {
  width: 106px;
}

.ops-layout .table th:nth-child(8),
.ops-layout .table td:nth-child(8) {
  width: 28px;
}

.ops-layout .actions {
  gap: 5px;
}

.ops-layout .actions button {
  min-width: 42px;
  padding-left: 8px;
  padding-right: 8px;
}

.dashboard .rail-stack {
  gap: 12px;
  align-content: start;
}

.dashboard .ops-layout {
  align-items: start;
}

.dashboard .rail-card {
  padding: 12px;
}

.dashboard .rail-card h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.dashboard .health {
  grid-template-columns: 86px 1fr;
  gap: 10px;
}

.dashboard .health-ring {
  width: 78px;
  height: 78px;
  font-size: 20px;
}

.dashboard .rail-list {
  gap: 8px;
}

.dashboard .rail-row {
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.dashboard .rail-row strong {
  margin-top: 0;
  font-size: 18px;
}

.dashboard .split-metric strong {
  font-size: 24px;
}

.dashboard .split-metric span {
  font-size: 12px;
}
