:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-deep: #111827;
  --surface: rgba(255, 255, 255, .94);
  --surface-solid: #ffffff;
  --surface-2: #f1f5f9;
  --line: rgba(17, 24, 39, .12);
  --text: #111827;
  --muted: #6b7280;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --secondary: #374151;
  --accent: #f59e0b;
  --danger: #b91c1c;
  --warning: #b45309;
  --success: #15803d;
  --shadow: 0 16px 36px rgba(17, 24, 39, .08);
  --shadow-soft: 0 8px 20px rgba(17, 24, 39, .08);
  --radius: 8px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.app-shell { min-height: 100vh; position: relative; }
.has-sidebar .app-shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); }
.main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 34px; }
.guest .main { max-width: none; padding: 0 24px 48px; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background: #111827;
  color: #e5e7eb;
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 14px 0 44px rgba(2, 6, 23, .16);
}
.brand, .mobile-brand { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 900; letter-spacing: 0; }
.brand img, .mobile-brand img, .auth-head img { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 8px; box-shadow: 0 12px 26px rgba(15, 118, 110, .22); }
.brand span, .mobile-brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.brand.compact { color: var(--text); }
.nav-list { display: grid; gap: 8px; }
.nav-list a {
  display: flex; align-items: center; min-height: 46px; padding: 11px 14px;
  border: 1px solid transparent; border-radius: 8px; color: #cbd5e1; font-weight: 750;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.nav-list a:hover, .nav-list a.active {
  background: rgba(255, 255, 255, .10); color: #ffffff; border-color: rgba(255,255,255,.10); transform: translateX(3px);
}
.nav-list a.active { box-shadow: inset 3px 0 0 var(--accent); }
.nav-label { margin: 4px 0 -8px; color: #fbbf24; font-size: 11px; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer span { color: #94a3b8; font-size: 13px; }
.sidebar-footer a { color: #5eead4; font-weight: 850; }
.mobile-bar, .guest-bar { display: none; }
.guest-bar { max-width: 1120px; margin: 0 auto; padding: 28px 24px 0; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.82); display: grid; place-content: center; gap: 4px; box-shadow: var(--shadow-soft); }
.icon-button span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 99px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 26px; }
.page-head h1, .auth-head h1 { margin: 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.08; letter-spacing: 0; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 12px; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }

.panel, .service-item, .quick-link, .stat, .auth-panel {
  background: var(--surface); border: 1px solid rgba(255,255,255,.68); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.panel { padding: 24px; margin-bottom: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-title h2, .service-item h2 { margin: 0; font-size: 19px; letter-spacing: 0; }
.muted, .service-item p, .auth-switch, .empty { color: var(--muted); }
.stats-grid, .quick-grid, .service-grid, .split-grid { display: grid; gap: 18px; margin-bottom: 22px; }
.stats-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.split-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 22px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -34px; top: -34px; width: 92px; height: 92px; border-radius: 50%; background: linear-gradient(135deg, rgba(37,99,235,.18), rgba(6,182,212,.12)); }
.stat span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.stat strong { display: block; margin-top: 8px; font-size: 31px; line-height: 1.1; letter-spacing: 0; }
.quick-link, .service-item { padding: 20px; transition: transform .18s ease, box-shadow .18s ease; }
.quick-link:hover, .service-item:hover { transform: translateY(-3px); box-shadow: 0 26px 70px rgba(15,23,42,.14); }
.quick-link strong, .quick-link span { display: block; }
.quick-link span { margin-top: 4px; color: var(--muted); }
.service-item { display: flex; min-height: 158px; flex-direction: column; justify-content: space-between; gap: 18px; }
.service-item p { margin: 8px 0 0; }
.service-item strong { color: var(--primary); font-size: 18px; }

.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 10px 16px;
  border: 1px solid transparent; border-radius: 8px; background: var(--primary); color: #ffffff;
  font-weight: 900; cursor: pointer; white-space: nowrap; box-shadow: 0 12px 26px rgba(37,99,235,.24); transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(37,99,235,.30); }
.button.secondary { background: rgba(255,255,255,.82); border-color: var(--line); color: var(--text); box-shadow: none; }
.button.secondary:hover { background: #ffffff; }
.button.danger { background: var(--danger); }
.button.small { min-height: 34px; padding: 7px 11px; font-size: 13px; border-radius: 11px; }
.button.block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.text-link, .auth-switch a { color: var(--primary); font-weight: 900; }
.copy-line, .api-line { display: flex; gap: 10px; align-items: center; }
.copy-line code { min-width: 0; flex: 1; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(248,250,252,.9); overflow: auto; }
.table-wrap { width: 100%; overflow-x: auto; }
.order-summary { margin-bottom: 22px; }
.order-summary .stat strong { color: var(--text); }
.order-summary .status-count-done strong { color: var(--success); }
.order-summary .status-count-pending strong { color: var(--warning); }
.order-summary .status-count-rejected strong { color: var(--danger); }
.order-toolbar { align-items: center; justify-content: space-between; gap: 14px; }
.order-toolbar-title { display: grid; gap: 2px; }
.order-toolbar-title strong { font-size: 15px; font-weight: 900; }
.order-toolbar-title span { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
td code { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-table { min-width: 920px; }
.admin-orders-table { min-width: 1080px; }
.orders-table .column-result { width: 34%; }
.orders-table .column-timing { width: 190px; }
.orders-table .column-action { width: 1%; }
.order-id, .price { font-weight: 900; white-space: nowrap; }
.order-main { display: grid; gap: 3px; min-width: 0; }
.order-main strong, .order-main span { min-width: 0; overflow-wrap: anywhere; }
.order-main span { color: var(--muted); font-size: 13px; }
.order-timing { display: grid; gap: 7px; min-width: 0; }
.order-timing div { display: grid; gap: 1px; min-width: 0; }
.order-timing span { color: var(--muted); font-size: 10px; font-weight: 900; }
.order-timing time, .order-timing strong { min-width: 0; color: var(--text); font-size: 12px; font-weight: 900; overflow-wrap: anywhere; }
.order-timing.compact { gap: 5px; }
.result-box { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(248,250,252,.86); }
.result-box.is-pending .result-text { color: var(--muted); }
.result-text { min-width: 0; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; line-height: 1.35; }
.copy-result { flex: 0 0 auto; }
tr.is-new td { background: #eff6ff; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.status-1 { background: #fff7ed; color: var(--warning); }
.status-3 { background: #fef2f2; color: var(--danger); }
.status-4, .role-admin { background: #ecfdf5; color: var(--success); }
.role-user { background: #eef2ff; color: var(--secondary); }
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.table-search { width: min(100%, 330px); }

label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 850; }
input, select, textarea { width: 100%; min-height: 44px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.88); color: var(--text); outline: none; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
textarea { min-height: 98px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(15, 118, 110, .62); box-shadow: 0 0 0 4px rgba(15, 118, 110, .14); background: #fff; }
.order-entry-panel { display: grid; gap: 18px; }
.order-mode-toggle { display: inline-grid; grid-auto-flow: column; justify-self: start; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(248,250,252,.86); }
.mode-button { min-height: 36px; padding: 7px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 900; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.mode-button.active { background: #ffffff; color: var(--text); box-shadow: 0 7px 18px rgba(15,23,42,.08); }
.order-form, .admin-form { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 14px; align-items: end; }
.batch-order-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.batch-order-form .wide { grid-column: 1 / -1; }
.batch-order-form textarea { min-height: 158px; line-height: 1.55; }
.batch-actions { display: flex; gap: 10px; align-items: center; }
.admin-form { grid-template-columns: 1fr 160px 1.4fr; }
.admin-form .wide { grid-column: span 3; }
.admin-form.inline { margin-bottom: 12px; }
.form-stack { display: grid; gap: 14px; }
.toggle { display: flex; align-items: center; gap: 10px; }
.toggle input { width: 18px; min-height: 18px; }
.credit-form { display: flex; gap: 8px; align-items: center; }
.credit-form input { width: 110px; }
.delete-form { margin-top: 8px; }
.edit-row td { background: #f8fafc; }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.doc-grid div { padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: rgba(248,250,252,.86); }
.doc-grid span, .doc-grid strong { display: block; }
.doc-grid span { color: var(--muted); font-size: 12px; font-weight: 900; }
pre { margin: 0; padding: 18px; border: 1px solid rgba(255,255,255,.10); border-radius: 8px; background: #07111f; color: #e5e7eb; overflow-x: auto; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.auth-wrap { min-height: calc(100vh - 96px); display: grid; place-items: center; padding: 44px 0; }
.auth-panel { width: min(100%, 440px); padding: 30px; display: grid; gap: 16px; }
.auth-panel.wide { width: min(100%, 700px); }
.auth-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.auth-switch { margin: 0; text-align: center; }
.flash { margin: 0 0 16px; padding: 13px 15px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.9); font-weight: 800; box-shadow: var(--shadow-soft); }
.flash.success { border-color: #bbf7d0; background: #f0fdf4; color: var(--success); }
.flash.error { border-color: #fecaca; background: #fef2f2; color: var(--danger); }
.notice { padding: 14px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; color: var(--danger); }
.batch-results-panel { display: grid; gap: 14px; }
.batch-results-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.batch-results-head strong, .batch-results-head span { display: block; }
.batch-results-head strong { font-size: 15px; font-weight: 900; }
.batch-results-head span { color: var(--muted); font-size: 13px; }
.batch-count { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(248,250,252,.9); color: var(--text); font-size: 12px; font-weight: 900; }
.batch-progress { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(15,23,42,.08); }
.batch-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .28s ease; }
.batch-result-list { display: grid; gap: 10px; }
.batch-result-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(0, 2fr); gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(248,250,252,.86); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.batch-result-row.is-loading { border-color: rgba(15, 118, 110, .28); background: #ecfdf5; }
.batch-result-row.is-done { border-color: #bbf7d0; background: #f0fdf4; }
.batch-result-row.is-pending { border-color: #fed7aa; background: #fff7ed; }
.batch-result-row.is-error { border-color: #fecaca; background: #fef2f2; }
.batch-result-meta { display: grid; gap: 3px; min-width: 0; }
.batch-result-meta strong, .batch-result-meta span { min-width: 0; overflow-wrap: anywhere; }
.batch-result-meta strong { font-size: 14px; }
.batch-result-meta span { color: var(--muted); font-size: 12px; font-weight: 850; }
.batch-result-text { min-width: 0; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; line-height: 1.4; }
.batch-result-text .copy-result { margin-top: 8px; }
.batch-helper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.batch-helper span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}
.batch-helper [data-batch-duplicate] {
  color: var(--warning);
}
.batch-helper [data-batch-limit-warning] {
  border-color: #fed7aa;
  background: #fff7ed;
  color: var(--warning);
}
button[disabled] { opacity: .62; cursor: progress; transform: none; box-shadow: none; }
.install-list { margin: 0; color: var(--muted); }
.install-panel { align-content: start; }
.install-section { display: grid; gap: 12px; }
.install-section h2 { margin: 0; font-size: 17px; }
.check-list { display: grid; gap: 10px; }
.check-item { display: grid; grid-template-columns: 48px minmax(110px, 1fr) minmax(0, 2fr); gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(248,250,252,.86); }
.check-item span { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.check-item.ok span { background: #dcfce7; color: var(--success); }
.check-item.bad span { background: #fee2e2; color: var(--danger); }
.check-item strong { font-size: 14px; }
.check-item em { min-width: 0; color: var(--muted); font-style: normal; overflow-wrap: anywhere; }
.install-note { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(248,250,252,.86); color: var(--muted); }
.api-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.api-action-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.api-action-grid span {
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 900;
}
.api-action-grid strong {
  color: var(--muted);
  font-size: 13px;
}
.notice.neutral {
  margin-bottom: 14px;
  border-color: var(--line);
  background: #f8fafc;
  color: var(--text);
}

/* Design refresh */
:root {
  --bg: #f6f7fb;
  --bg-deep: #111827;
  --surface: rgba(255, 255, 255, .94);
  --surface-solid: #ffffff;
  --surface-2: #f1f5f9;
  --line: rgba(17, 24, 39, .12);
  --text: #111827;
  --muted: #6b7280;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --secondary: #374151;
  --accent: #f59e0b;
  --danger: #b91c1c;
  --warning: #b45309;
  --success: #15803d;
  --shadow: 0 16px 36px rgba(17, 24, 39, .08);
  --shadow-soft: 0 8px 20px rgba(17, 24, 39, .08);
  --radius: 8px;
  --radius-sm: 8px;
}
* { letter-spacing: 0 !important; }
body {
  background: var(--bg);
}
body::before,
.stat::after {
  display: none;
}
.sidebar {
  background: #111827;
  box-shadow: 10px 0 28px rgba(17, 24, 39, .12);
}
.panel, .service-item, .quick-link, .stat, .auth-panel,
.button, button.button, input, select, textarea, .copy-line code,
.result-box, .batch-result-row, .doc-grid div, pre, .flash, .notice,
.check-item, .install-note, .icon-button, .brand img, .mobile-brand img,
.auth-head img {
  border-radius: 8px;
}
.panel, .service-item, .quick-link, .stat, .auth-panel {
  border-color: rgba(17, 24, 39, .08);
  backdrop-filter: none;
}
.nav-list a {
  border-radius: 8px;
}
.nav-list a:hover, .nav-list a.active {
  transform: none;
}
.button, button.button {
  background: var(--primary);
  box-shadow: var(--shadow-soft);
}
.button:hover {
  box-shadow: 0 12px 26px rgba(15, 118, 110, .18);
}
.button.danger {
  background: var(--danger);
}
.button.secondary {
  background: var(--surface-solid);
}
.page-head h1, .auth-head h1 {
  line-height: 1.15;
}
.stat {
  padding: 20px;
}
.stat strong {
  font-size: 29px;
}
.order-toolbar {
  align-items: flex-start;
}
.order-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(100%, 760px);
}
.status-filter {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.status-filter .mode-button {
  min-height: 34px;
  border-radius: 6px;
}
.table-search {
  flex: 1 1 220px;
}
.orders-table {
  min-width: 1080px;
}
.admin-orders-table {
  min-width: 1220px;
}
.orders-table .column-result {
  width: 30%;
}
.orders-table .column-action {
  width: 104px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.row-actions form {
  margin: 0;
}
.order-timing {
  gap: 8px;
}
.order-timing span {
  text-transform: uppercase;
}
.result-box {
  background: #f8fafc;
}
.service-tools {
  display: grid;
  gap: 14px;
}
.service-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.service-code {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #ecfdf5;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}
.modal-open {
  overflow: hidden;
}
.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, .52);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  max-height: min(760px, calc(100vh - 36px));
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  box-shadow: 0 24px 70px rgba(17, 24, 39, .24);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modal-head h2 {
  margin: 0;
  font-size: 24px;
}
.modal-head .icon-button {
  box-shadow: none;
}
.modal-head .icon-button span:first-child {
  transform: rotate(45deg) translate(2px, 2px);
}
.modal-head .icon-button span:last-child {
  transform: rotate(-45deg) translate(2px, -2px);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.detail-grid div, .detail-section {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.detail-grid span, .detail-section span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.detail-grid strong, .detail-section strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.detail-section pre {
  white-space: pre-wrap;
  color: #e5e7eb;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
[hidden] {
  display: none !important;
}

/* Premium UI pass */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f8fafc;
  --line: rgba(15, 23, 42, .10);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --secondary: #334155;
  --accent: #eab308;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --shadow: 0 18px 42px rgba(15, 23, 42, .08);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, .06);
  --radius: 8px;
  --radius-sm: 6px;
}
body {
  background:
    linear-gradient(180deg, #eef2f7 0, #f4f6f8 260px),
    #f4f6f8;
}
.has-sidebar .app-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}
.main {
  max-width: 1480px;
  padding: 30px 38px 46px;
}
.sidebar {
  gap: 18px;
  padding: 22px 18px;
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 8px 0 30px rgba(15, 23, 42, .18);
}
.brand {
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}
.brand img, .mobile-brand img, .auth-head img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(13, 148, 136, .20);
}
.nav-list {
  gap: 5px;
}
.nav-list a {
  position: relative;
  min-height: 42px;
  padding: 10px 12px 10px 16px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
}
.nav-list a::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 99px;
  background: transparent;
}
.nav-list a:hover {
  background: rgba(255, 255, 255, .07);
  color: #ffffff;
}
.nav-list a.active {
  background: rgba(13, 148, 136, .18);
  color: #ffffff;
  border-color: rgba(45, 212, 191, .18);
  box-shadow: none;
}
.nav-list a.active::before {
  background: #2dd4bf;
}
.nav-label {
  margin: 6px 10px 0;
  color: #fde68a;
  font-size: 10px;
}
.sidebar-footer {
  gap: 10px;
  margin: auto 10px 0;
  padding: 16px 0 0;
}
.sidebar-footer a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(94, 234, 212, .18);
  border-radius: 8px;
  color: #99f6e4;
}
.mobile-bar {
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.page-head {
  min-height: 68px;
  align-items: center;
  margin-bottom: 22px;
}
.page-head h1 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 950;
}
.eyebrow {
  color: var(--primary-dark);
  font-size: 11px;
}
.panel, .service-item, .quick-link, .stat, .auth-panel {
  border: 1px solid rgba(15, 23, 42, .08);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.panel {
  padding: 22px;
}
.stats-grid {
  gap: 14px;
}
.stat {
  padding: 18px;
}
.stat span {
  font-size: 12px;
}
.stat strong {
  margin-top: 6px;
  font-size: 30px;
}
.quick-link, .service-item {
  border-color: rgba(15, 23, 42, .08);
}
.quick-link:hover, .service-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.button, button.button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--primary);
  box-shadow: none;
}
.button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(13, 148, 136, .20);
}
.button.secondary {
  background: #ffffff;
  border-color: rgba(15, 23, 42, .14);
  color: #0f172a;
}
.button.secondary:hover {
  background: #f8fafc;
}
.button.small {
  min-height: 32px;
  border-radius: 7px;
}
input, select, textarea {
  border-radius: 8px;
  background: #ffffff;
}
input:hover, select:hover, textarea:hover {
  border-color: rgba(15, 23, 42, .18);
}
table {
  font-size: 14px;
}
th {
  background: #f8fafc;
}
th:first-child {
  border-top-left-radius: 8px;
}
th:last-child {
  border-top-right-radius: 8px;
}
td {
  background: #ffffff;
}
tbody tr:hover td {
  background: #f8fafc;
}
.table-wrap {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: #ffffff;
}
.table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
}
.table-wrap th, .table-wrap td {
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}
.order-toolbar {
  margin-bottom: 14px;
}
.order-toolbar-title strong {
  font-size: 16px;
}
.status-filter {
  background: #eef2f7;
}
.mode-button {
  border-radius: 7px;
}
.mode-button.active {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}
.badge {
  min-height: 26px;
  border-radius: 999px;
}
.status-1 {
  background: #fffbeb;
}
.status-3 {
  background: #fef2f2;
}
.status-4, .role-admin {
  background: #ecfdf5;
}
.result-box {
  border-color: rgba(15, 23, 42, .08);
  background: #f8fafc;
}
.service-item {
  min-height: 168px;
}
.service-item h2 {
  font-size: 18px;
}
.service-item p {
  line-height: 1.45;
}
.service-card-foot {
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, .08);
}
.auth-wrap {
  min-height: calc(100vh - 72px);
}
.auth-panel {
  box-shadow: var(--shadow);
}
.flash {
  border-left: 4px solid var(--primary);
}
.modal-panel {
  padding: 24px;
}
.detail-grid div, .detail-section {
  background: #f8fafc;
}
.modal-actions {
  padding-top: 4px;
}

@media (max-width: 1100px) {
  .has-sidebar .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: min(84vw, 308px); transform: translateX(-105%); transition: transform .18s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: rgba(248, 251, 255, .86); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
  .main { padding: 22px 18px; }
}
@media (max-width: 880px) {
  .stats-grid.three, .stats-grid.four, .quick-grid, .split-grid, .doc-grid { grid-template-columns: 1fr; }
  .order-form, .batch-order-form, .admin-form, .admin-form.inline { grid-template-columns: 1fr; }
  .admin-form .wide { grid-column: auto; }
  .page-head, .copy-line { align-items: stretch; flex-direction: column; }
  .toolbar { justify-content: stretch; }
  .order-toolbar-actions { width: 100%; justify-content: stretch; }
  .status-filter { width: 100%; grid-auto-columns: 1fr; }
  .table-search { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .order-toolbar { align-items: stretch; flex-direction: column; }
  .table-wrap { overflow-x: visible; }
  .orders-table, .admin-orders-table { min-width: 0; border-collapse: separate; border-spacing: 0 12px; }
  .orders-table thead { display: none; }
  .orders-table tbody, .orders-table tr, .orders-table td { display: block; }
  .orders-table tr { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
  .orders-table td { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 0; border-bottom: 0; }
  .orders-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
  .orders-table .column-timing, .orders-table .column-result, .orders-table .column-action { grid-template-columns: 1fr; }
  .orders-table .column-result::before { margin-bottom: 2px; }
  .orders-table .column-action::before { display: none; }
  .result-box { align-items: stretch; flex-direction: column; }
  .copy-result, .column-action .button, .row-actions, .row-actions form { width: 100%; }
  .orders-table .empty-row { padding: 0; border: 0; background: transparent; box-shadow: none; }
  .orders-table .empty-row td { display: block; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(248,250,252,.86); }
  .orders-table .empty-row td::before { display: none; }
  .batch-results-head, .batch-actions { align-items: stretch; flex-direction: column; }
  .batch-result-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .guest-bar { display: flex; }
  .guest .main { padding-inline: 16px; }
  .auth-panel { padding: 22px; }
  .page-head h1, .auth-head h1 { font-size: 25px; }
  .stat strong { font-size: 25px; }
  .button-row, .credit-form { align-items: stretch; flex-direction: column; }
  .order-mode-toggle { width: 100%; grid-auto-columns: 1fr; }
  .credit-form input { width: 100%; }
  .check-item { grid-template-columns: 1fr; }
}

/* Galle API HUB 2.0 interface */
:root {
  --bg: #f4f6fb;
  --bg-deep: #0b1020;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f7f8fc;
  --line: #e5e8f1;
  --text: #12182a;
  --muted: #6b7285;
  --primary: #5b5ce2;
  --primary-dark: #4647c8;
  --accent: #13b8a6;
  --danger: #dc3f56;
  --warning: #d98717;
  --success: #0d9b70;
  --shadow: 0 16px 40px rgba(28, 34, 58, .07);
  --shadow-soft: 0 6px 18px rgba(28, 34, 58, .07);
  --radius: 16px;
  --radius-sm: 11px;
}

[hidden] { display: none !important; }
body { background: var(--bg); color: var(--text); }
body::before {
  display: block;
  background:
    radial-gradient(circle at 96% 2%, rgba(91, 92, 226, .09), transparent 28%),
    radial-gradient(circle at 63% 85%, rgba(19, 184, 166, .05), transparent 26%);
  mask-image: none;
}
.has-sidebar .app-shell { grid-template-columns: 272px minmax(0, 1fr); }
.main { max-width: 1500px; padding: 24px 32px 42px; }
.guest .main { padding: 0 32px 32px; }

.sidebar {
  gap: 12px;
  padding: 22px 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(91, 92, 226, .24), transparent 28%),
    linear-gradient(180deg, #11172b 0%, #090d19 100%);
  border-right: 0;
  box-shadow: 14px 0 40px rgba(15, 19, 36, .12);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.brand { padding: 0 8px; }
.brand img, .mobile-brand img, .auth-head img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 10px 30px rgba(91,92,226,.28); }
.brand > span, .mobile-brand > span { display: grid; gap: 0; }
.brand span strong { font-size: 15px; color: #fff; }
.brand span small { color: #8f9ab7; font-size: 10px; font-weight: 700; letter-spacing: .04em !important; }
.brand.compact span strong { color: var(--text); }
.brand.compact span small { color: var(--muted); }
.sidebar-close { display: none; border: 0; background: transparent; color: #fff; font-size: 26px; cursor: pointer; }
.nav-label { margin: 12px 10px 4px; color: #67728f; font-size: 10px; letter-spacing: .12em !important; }
.nav-list { gap: 4px; }
.nav-list a {
  min-height: 44px;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  color: #96a0b9;
  font-size: 13px;
  font-weight: 750;
}
.nav-list a svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-list a:hover { background: rgba(255,255,255,.055); color: #e8ebf4; }
.nav-list a.active {
  background: linear-gradient(135deg, rgba(101,102,241,.24), rgba(91,92,226,.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(135,136,255,.19);
}
.nav-list a.active::after { content: ""; width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #818cf8; box-shadow: 0 0 12px #818cf8; }
.nav-list a.active { box-shadow: inset 0 0 0 1px rgba(135,136,255,.19); }
.sidebar-footer { gap: 14px; padding: 16px 6px 2px; border-top-color: rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid !important; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: linear-gradient(135deg, #6768ed, #3f40b9); color: #fff !important; font-size: 12px !important; font-weight: 900; }
.user-chip > span:last-child { min-width: 0; }
.user-chip strong { overflow: hidden; color: #f3f5fb; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: #77829e; font-size: 10px; }
.logout-form { margin: 0; }
.logout-link { display: flex; width: 100%; justify-content: space-between; padding: 0; border: 0; background: transparent; color: #8c97b2 !important; font-size: 12px; font-weight: 750 !important; cursor: pointer; }
.logout-link:hover { color: #fff !important; }
.sidebar-scrim { position: fixed; z-index: 29; inset: 0; border: 0; background: rgba(4, 7, 15, .58); backdrop-filter: blur(3px); }

.workspace-bar { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.system-pill, .health-hero-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.system-pill i, .health-hero-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(13,155,112,.12); }
.workspace-actions { display: flex; align-items: center; gap: 14px; }
.workspace-date { color: var(--muted); font-size: 12px; font-weight: 750; }
.theme-button { display: inline-flex; min-height: 36px; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-soft); }
.theme-button:hover { color: var(--text); }
.theme-button.compact { width: 36px; padding: 0; justify-content: center; }

.page-head { align-items: center; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(27px, 2.8vw, 38px); font-weight: 800; letter-spacing: -.035em !important; }
.page-subtitle { max-width: 660px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.eyebrow { margin-bottom: 7px; color: var(--primary); font-size: 10px; letter-spacing: .12em !important; }
.count-pill { display: inline-flex; min-height: 29px; align-items: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; }

.panel, .service-item, .quick-link, .stat, .auth-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel { padding: 22px; margin-bottom: 20px; }
.section-title { margin-bottom: 17px; }
.section-title h2 { font-size: 18px; letter-spacing: -.015em !important; }
.button, button.button { min-height: 42px; padding: 9px 15px; border-radius: 11px; background: linear-gradient(135deg, #6263eb, #5051d3); box-shadow: 0 9px 20px rgba(91,92,226,.2); font-size: 13px; }
.button:hover { background: linear-gradient(135deg, #5556db, #4445c3); box-shadow: 0 12px 24px rgba(91,92,226,.26); }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.button.secondary:hover { background: var(--surface-2); }
.button.with-icon { gap: 9px; }
.button.with-icon > span { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 6px; background: rgba(255,255,255,.15); font-size: 17px; font-weight: 500; }
.button.small { min-height: 34px; border-radius: 9px; }
input, select, textarea { min-height: 45px; border-color: var(--line); border-radius: 11px; background: var(--surface-2); color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: rgba(91,92,226,.65); box-shadow: 0 0 0 4px rgba(91,92,226,.11); background: var(--surface); }
input::placeholder, textarea::placeholder { color: #a0a6b5; }
label { color: var(--text); font-size: 12px; }
:focus-visible { outline: 3px solid rgba(91,92,226,.32); outline-offset: 2px; }

.dashboard-metrics { gap: 14px; }
.metric-card { min-height: 132px; padding: 20px; isolation: isolate; }
.metric-card::before { content: ""; position: absolute; z-index: -1; right: -16px; bottom: -34px; width: 100px; height: 100px; border-radius: 50%; background: var(--metric-soft, rgba(91,92,226,.08)); }
.metric-card::after { display: block; right: 18px; top: 20px; width: 10px; height: 10px; border-radius: 3px; background: var(--metric, var(--primary)); }
.metric-card > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em !important; }
.metric-card strong { margin-top: 12px; font-size: 28px; letter-spacing: -.035em !important; }
.metric-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
.tone-blue { --metric: #5b5ce2; --metric-soft: rgba(91,92,226,.08); }
.tone-purple { --metric: #9866df; --metric-soft: rgba(152,102,223,.08); }
.tone-green { --metric: #0d9b70; --metric-soft: rgba(13,155,112,.08); }
.tone-orange { --metric: #e69328; --metric-soft: rgba(230,147,40,.09); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); gap: 20px; }
.activity-panel, .quick-panel { min-height: 320px; }
.activity-score { display: flex; align-items: center; gap: 32px; padding: 5px 10px 18px; }
.score-ring { --score: 0; display: grid; width: 132px; height: 132px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--score) * 1%), var(--surface-2) 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.score-ring > span { z-index: 1; display: grid; text-align: center; }
.score-ring strong { font-size: 24px; letter-spacing: -.03em !important; }
.score-ring small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.activity-breakdown { display: grid; flex: 1; gap: 14px; }
.activity-breakdown > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.activity-breakdown span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.activity-breakdown strong { font-size: 15px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.done { background: var(--primary); }.dot.pending { background: var(--warning); }.dot.rejected { background: var(--danger); }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f2ad49, #e78a22); }
.action-list { display: grid; gap: 7px; }
.action-list a { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px; border: 1px solid transparent; border-radius: 12px; transition: .18s ease; }
.action-list a:hover { border-color: var(--line); background: var(--surface-2); transform: translateX(2px); }
.action-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: rgba(91,92,226,.09); color: var(--primary); font-size: 10px; font-weight: 900; }
.action-list a > span:nth-child(2) { display: grid; min-width: 0; }
.action-list strong { font-size: 13px; }.action-list small { color: var(--muted); font-size: 10px; }
.action-list b { color: #a3a8b6; font-size: 17px; }
.endpoint-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.endpoint-panel > div:first-child { display: flex; align-items: center; gap: 12px; }
.endpoint-panel > div:first-child > span:last-child { display: grid; }
.endpoint-panel small { color: var(--muted); font-size: 10px; }
.endpoint-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #11172b; color: #8b8cf5; font-family: ui-monospace, monospace; font-size: 11px; font-weight: 900; }
.compact-copy { width: min(100%, 560px); }
.compact-copy code { border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.recent-panel table { min-width: 720px; }
.recent-panel td time { color: var(--muted); font-size: 12px; }

th { color: #8990a2; font-size: 10px; letter-spacing: .08em !important; }
th, td { padding: 13px 11px; border-color: var(--line); }
tbody tr { transition: background .15s ease; }
tbody tr:not(.edit-row):hover { background: rgba(91,92,226,.025); }
td { font-size: 12px; }
.result-box { border-color: var(--line); border-radius: 11px; background: var(--surface-2); }
.badge { gap: 6px; min-height: 25px; padding: 4px 9px; font-size: 10px; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.service-item { min-height: 180px; padding: 20px; }
.service-item:hover { border-color: rgba(91,92,226,.24); box-shadow: 0 22px 44px rgba(42,47,74,.1); }
.service-code { color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .08em !important; text-transform: uppercase; }
.service-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.service-card-foot strong { color: var(--text); }

.manage-order-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.manage-order-head h3 { margin: 0; font-size: 17px; }
.resolve-order-form { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; align-items: start; }
.resolve-order-form .wide { grid-column: 2; grid-row: 1 / span 2; }
.resolve-order-form .button-row { align-self: end; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 13px; border: 1px solid rgba(220,63,86,.2); border-radius: 11px; background: rgba(220,63,86,.045); }
.danger-zone > span { display: grid; }.danger-zone small { color: var(--muted); font-size: 10px; }
.refund-zone { display: grid; grid-template-columns: minmax(190px,.8fr) minmax(260px,1.2fr) auto; align-items: end; gap: 14px; margin-top: 18px; padding: 13px; border: 1px solid rgba(13,155,112,.2); border-radius: 11px; background: rgba(13,155,112,.045); }
.refund-zone > span { display: grid; align-self: center; }.refund-zone small { color: var(--muted); font-size: 10px; }.refund-zone label { margin: 0; }.refund-zone input { min-height: 38px; }.refund-zone.is-complete { grid-template-columns: 1fr; color: var(--success); }
.refund-badge { display: flex; width: fit-content; margin-top: 5px; background: rgba(13,155,112,.1); color: var(--success); }
.health-hero-badge { padding: 9px 12px; border: 1px solid rgba(13,155,112,.18); border-radius: 999px; background: rgba(13,155,112,.07); color: var(--success); }
.health-grid { align-items: start; }
.health-check-list { display: grid; gap: 8px; }
.health-check { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.health-check-icon { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 9px; font-size: 12px; font-weight: 900; }
.health-check.ok .health-check-icon { background: rgba(13,155,112,.1); color: var(--success); }
.health-check.warning .health-check-icon { background: rgba(217,135,23,.12); color: var(--warning); }
.health-check > span:last-child { display: grid; }.health-check strong { font-size: 12px; }.health-check small { color: var(--muted); font-size: 10px; }
.callout-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden; background: linear-gradient(120deg, var(--surface), rgba(91,92,226,.07)); }
.callout-panel h2 { margin: 0; font-size: 19px; }.callout-panel p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.guest-bar { display: flex; max-width: 1320px; align-items: center; justify-content: space-between; padding: 22px 24px 0; }
.auth-wrap { min-height: calc(100vh - 82px); }
.auth-layout { width: min(100%, 1240px); grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr); gap: 80px; margin: 0 auto; padding: 30px 30px 60px; }
.auth-story { min-height: 570px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 64px; border-radius: 24px; background:
  radial-gradient(circle at 78% 22%, rgba(101,102,241,.34), transparent 25%),
  radial-gradient(circle at 15% 90%, rgba(19,184,166,.18), transparent 27%),
  #0c1121; color: #fff; box-shadow: 0 30px 80px rgba(11,16,32,.2); }
.auth-story::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(125deg, transparent 5%, #000 60%, transparent); }
.story-kicker { z-index: 1; display: inline-flex; width: fit-content; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.06); color: #b8c1d8; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em !important; }
.story-kicker i { width: 6px; height: 6px; border-radius: 50%; background: #2dd4bf; box-shadow: 0 0 10px #2dd4bf; }
.auth-story h1 { z-index: 1; max-width: 590px; margin: 25px 0 16px; font-size: clamp(40px, 5vw, 66px); line-height: .98; letter-spacing: -.055em !important; }
.auth-story > p { z-index: 1; max-width: 540px; margin: 0; color: #9ea8c1; font-size: 15px; }
.story-proof { z-index: 1; display: flex; gap: 36px; margin-top: 42px; }
.story-proof div { display: grid; }.story-proof strong { font-size: 20px; }.story-proof span { color: #7d88a4; font-size: 10px; }
.story-list { z-index: 1; display: grid; gap: 11px; margin: 34px 0 0; padding: 0; list-style: none; color: #aab3c8; font-size: 12px; }
.story-list li::before { content: "✓"; margin-right: 10px; color: #2dd4bf; font-weight: 900; }
.story-orbit { position: absolute; right: -80px; bottom: -95px; width: 310px; height: 310px; border: 1px solid rgba(137,139,255,.18); border-radius: 50%; }
.story-orbit::before, .story-orbit::after { content: ""; position: absolute; border: 1px solid rgba(137,139,255,.13); border-radius: 50%; }
.story-orbit::before { inset: 42px; }.story-orbit::after { inset: 88px; }
.story-orbit b { position: absolute; inset: 108px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #6566ed, #3e3fae); color: #fff; font-size: 20px; }
.story-orbit span { position: absolute; z-index: 2; width: 9px; height: 9px; border-radius: 50%; background: #2dd4bf; box-shadow: 0 0 14px #2dd4bf; }.story-orbit span:nth-child(1){left:36px;top:60px}.story-orbit span:nth-child(2){right:25px;top:118px}.story-orbit span:nth-child(3){left:84px;bottom:25px}
.auth-panel { width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; }
.auth-head { margin-bottom: 14px; }
.auth-head h2 { margin: 0; font-size: 28px; letter-spacing: -.035em !important; }
.auth-head span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.auth-panel label { gap: 8px; margin-top: 2px; }
.auth-panel input { min-height: 50px; padding-inline: 15px; }
.auth-panel .button.block { min-height: 50px; margin-top: 5px; justify-content: space-between; padding-inline: 18px; }
.auth-switch { font-size: 11px; }
.secure-note { margin: 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 10px; }.secure-note span { color: var(--success); }

.flash { position: fixed; z-index: 100; top: 20px; right: 20px; max-width: min(420px, calc(100vw - 40px)); border-radius: 12px; box-shadow: 0 18px 45px rgba(15,20,40,.2); animation: slide-in .25s ease; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1422;
  --surface: #171d2d;
  --surface-solid: #171d2d;
  --surface-2: #111725;
  --line: #293044;
  --text: #eef1f7;
  --muted: #939cb2;
  --shadow: 0 16px 40px rgba(0,0,0,.14);
  --shadow-soft: 0 6px 18px rgba(0,0,0,.13);
}
html[data-theme="dark"] body::before { background: radial-gradient(circle at 95% 0%, rgba(91,92,226,.16), transparent 28%); }
html[data-theme="dark"] .button.secondary, html[data-theme="dark"] .mode-button.active { background: #20273a; }
html[data-theme="dark"] .status-1 { background: rgba(217,135,23,.12); }
html[data-theme="dark"] .status-3 { background: rgba(220,63,86,.12); }
html[data-theme="dark"] .status-4, html[data-theme="dark"] .role-admin { background: rgba(13,155,112,.12); }
html[data-theme="dark"] pre { background: #090d17; }
html[data-theme="dark"] .edit-row td { background: #111725; }
html[data-theme="dark"] .notice.neutral, html[data-theme="dark"] .api-action-grid div { background: var(--surface-2); color: var(--text); }

@media (max-width: 1180px) {
  .has-sidebar .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: min(86vw, 290px); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .mobile-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); }
  .mobile-brand { flex: 1; }.mobile-brand img { width: 34px; height: 34px; }.mobile-brand span { font-size: 14px; }
  .main { padding: 20px 22px 38px; }
  .workspace-bar { display: none; }
}
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; gap: 34px; padding-top: 15px; }
  .auth-story { min-height: 390px; padding: 42px; }.auth-story h1 { font-size: 45px; max-width: 520px; }.story-orbit { opacity: .7; }
  .auth-panel { max-width: 570px; margin: 0 auto; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .endpoint-panel { align-items: stretch; flex-direction: column; }.compact-copy { width: 100%; }
  .resolve-order-form { grid-template-columns: 1fr; }.resolve-order-form .wide { grid-column: 1; grid-row: auto; }
}
@media (max-width: 700px) {
  .guest .main { padding-inline: 15px; }
  .guest-bar { padding: 14px 16px 0; }
  .main { padding-inline: 15px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .metric-card { min-height: 120px; }
  .activity-score { gap: 20px; padding-inline: 0; }.score-ring { width: 112px; height: 112px; }
  .auth-layout { padding-inline: 0; }.auth-story { min-height: 360px; padding: 30px; border-radius: 18px; }.auth-story h1 { font-size: 38px; }.story-proof { gap: 22px; }.story-orbit { display: none; }
  .danger-zone, .callout-panel { align-items: stretch; flex-direction: column; }
  .refund-zone { grid-template-columns: 1fr; align-items: stretch; }
}
@media (max-width: 460px) {
  .dashboard-metrics { grid-template-columns: 1fr !important; }
  .activity-score { align-items: flex-start; flex-direction: column; }.activity-breakdown { width: 100%; }
  .auth-story { min-height: 330px; }.auth-story h1 { font-size: 32px; }.story-proof { justify-content: space-between; gap: 10px; }
  .guest-bar .theme-button span:last-child { display: none; }
}

/* v2.1 wallet, support, and scale features */
.sidebar { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.credit-form { flex-wrap: wrap; }
.credit-form .credit-note { width: 150px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 24px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-soft); }
.pagination > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.pagination > div { display: flex; flex-wrap: wrap; gap: 5px; }
.pagination a { display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; }
.pagination a:hover, .pagination a.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.pagination.single { justify-content: flex-start; }

.wallet-hero { position: relative; overflow: hidden; display: flex; min-height: 205px; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 20px; padding: 34px; border-radius: 20px; background:
  radial-gradient(circle at 82% 10%, rgba(129,140,248,.4), transparent 25%),
  linear-gradient(125deg, #10162c, #20275a); color: #fff; box-shadow: 0 22px 48px rgba(15,22,50,.2); }
.wallet-hero::after { content: ""; position: absolute; right: -60px; bottom: -100px; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: inset 0 0 0 44px rgba(255,255,255,.025), inset 0 0 0 88px rgba(255,255,255,.018); }
.wallet-hero > div:first-child { z-index: 1; }
.wallet-hero > div > span { color: #9da7c3; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em !important; }
.wallet-hero strong { display: block; margin: 8px 0 10px; font-size: clamp(36px,5vw,54px); line-height: 1; letter-spacing: -.05em !important; }
.wallet-hero strong small { color: #999fea; font-size: 15px; letter-spacing: 0 !important; }
.wallet-hero p { max-width: 650px; margin: 0; color: #9ca6c0; font-size: 12px; }
.wallet-mark { z-index: 1; display: grid; width: 88px; height: 88px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 28px; background: rgba(255,255,255,.08); transform: rotate(8deg); backdrop-filter: blur(8px); }
.wallet-mark span { color: #fff !important; font-size: 38px !important; font-weight: 900; }
.ledger-table { min-width: 880px; }
.ledger-type { display: inline-flex; padding: 5px 8px; border-radius: 8px; background: rgba(91,92,226,.08); color: var(--primary); font-size: 10px; font-weight: 850; }
.ledger-amount { white-space: nowrap; }.ledger-amount.positive { color: var(--success); }.ledger-amount.negative { color: var(--danger); }

.support-layout { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0,1fr); gap: 20px; align-items: start; }
.support-compose { position: sticky; top: 20px; }
.ticket-list { display: grid; gap: 13px; }
.ticket-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-soft); }
.ticket-card.priority-high { border-left: 3px solid var(--danger); }
.ticket-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 17px 18px 13px; }
.ticket-card > header > div { min-width: 0; }
.ticket-card h2 { margin: 3px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.ticket-ref { color: var(--primary); font-size: 10px; font-weight: 900; }
.ticket-card > p { margin: 0; padding: 0 18px 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.ticket-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.ticket-card > footer > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.ticket-status, .priority-label { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 9px; font-weight: 900; white-space: nowrap; text-transform: uppercase; }
.ticket-status.status-open { background: rgba(220,63,86,.1); color: var(--danger); }
.ticket-status.status-in_progress { background: rgba(217,135,23,.12); color: var(--warning); }
.ticket-status.status-resolved { background: rgba(13,155,112,.1); color: var(--success); }
.ticket-status.status-closed { background: var(--surface-2); color: var(--muted); }
.priority-label.priority-high { background: rgba(220,63,86,.1); color: var(--danger); }.priority-label.priority-normal { background: var(--surface-2); color: var(--muted); }
.ticket-reply { margin: 0 18px 16px; padding: 13px; border: 1px solid rgba(91,92,226,.16); border-radius: 11px; background: rgba(91,92,226,.055); }
.ticket-reply > span, .ticket-admin-detail span { color: var(--primary); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em !important; }
.ticket-reply p { margin: 5px 0 0; color: var(--text); font-size: 12px; }
.ticket-empty { min-height: 180px; display: grid; place-items: center; text-align: center; }
.support-table { min-width: 900px; }
.ticket-admin-detail { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.ticket-admin-detail > div { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.ticket-admin-detail p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ticket-reply-form { display: grid; grid-template-columns: 190px minmax(0,1fr) auto; gap: 12px; align-items: end; }
.ticket-reply-form .wide { min-width: 0; }

@media (max-width: 900px) {
  .support-layout { grid-template-columns: 1fr; }.support-compose { position: static; }
  .ticket-reply-form { grid-template-columns: 1fr; }.ticket-admin-detail { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .pagination { align-items: stretch; flex-direction: column; }.pagination > div { overflow-x: auto; flex-wrap: nowrap; }
  .wallet-hero { min-height: 230px; padding: 26px; }.wallet-mark { display: none; }
  .ticket-card > header, .ticket-card > footer { align-items: stretch; flex-direction: column; }.ticket-card > footer form, .ticket-card > footer button { width: 100%; }
  .credit-form .credit-note { width: 100%; }
}

/* v2.2 security operations */
#users-table { min-width: 1120px; }
.user-admin-actions { display: grid; gap: 7px; min-width: 170px; }
.suspend-form { display: grid; gap: 6px; }
.suspend-form input[type="text"] { min-height: 34px; padding: 6px 9px; font-size: 10px; }
.api-dashboard-grid { align-items: stretch; }
.api-action-bars { display: grid; gap: 14px; }
.api-action-bars > div { display: grid; grid-template-columns: minmax(140px,.7fr) minmax(160px,1.3fr); gap: 14px; align-items: center; }
.api-action-bars > div > span { display: grid; min-width: 0; }.api-action-bars strong { overflow: hidden; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.api-action-bars small { color: var(--muted); font-size: 9px; }
.api-action-bars > div > div { height: 9px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.api-action-bars i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--primary),#8b8cf5); }
.api-log-table { min-width: 1060px; }
.retention-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.retention-bar span { color: var(--muted); font-size: 10px; font-weight: 700; }
@media (max-width: 720px) {
  .api-action-bars > div { grid-template-columns: 1fr; gap: 6px; }
  .retention-bar { align-items: stretch; flex-direction: column; }
  .retention-bar button { width: 100%; }
}

/* v2.3 UI stabilization and navigation */
body { overflow-x: hidden; }
.mobile-bottom-nav { display: none; }
.command-trigger { display: inline-flex; min-height: 36px; align-items: center; gap: 18px; padding: 7px 9px 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; box-shadow: var(--shadow-soft); }
.command-trigger:hover { border-color: rgba(91,92,226,.35); color: var(--text); }
kbd { display: inline-flex; min-width: 23px; min-height: 21px; align-items: center; justify-content: center; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font: 700 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace; }
.command-shell { position: fixed; z-index: 120; inset: 0; display: grid; align-items: start; justify-items: center; padding: min(14vh,120px) 18px 30px; }
.command-backdrop { position: absolute; inset: 0; border: 0; background: rgba(5,8,18,.68); backdrop-filter: blur(5px); cursor: default; }
.command-panel { position: relative; display: grid; width: min(100%,640px); max-height: min(72vh,690px); overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 30px 90px rgba(3,6,18,.3); }
.command-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.command-search-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--primary); font-size: 22px; }
.command-head input { min-height: 42px; padding: 8px 4px; border: 0; background: transparent; box-shadow: none; font-size: 14px; }
.command-head input:focus { border: 0; background: transparent; box-shadow: none; }
.command-head > button { min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 850; cursor: pointer; }
.command-list { overflow-y: auto; padding: 8px; }
.command-list > p { margin: 10px 10px 5px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em !important; text-transform: uppercase; }
.command-list > a { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 10px; border: 1px solid transparent; border-radius: 11px; }
.command-list > a:hover, .command-list > a.selected { border-color: rgba(91,92,226,.18); background: rgba(91,92,226,.07); }
.command-list svg { width: 19px; height: 19px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.command-list a > span { display: grid; min-width: 0; }.command-list strong { font-size: 12px; }.command-list small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.command-list b { color: var(--muted); font-size: 11px; }
.command-empty { padding: 34px; color: var(--muted); text-align: center; font-size: 12px; }
.command-panel > footer { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 9px; }
.command-panel > footer span { display: inline-flex; align-items: center; gap: 4px; }
body.command-open { overflow: hidden; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 14px; transition: opacity .2s ease, transform .2s ease; }
.flash > span { min-width: 0; }
.flash > button { width: 28px; height: 28px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 8px; background: transparent; color: currentColor; font-size: 20px; cursor: pointer; opacity: .7; }
.flash > button:hover { background: rgba(0,0,0,.06); opacity: 1; }

.password-field { position: relative; display: block; }
.password-field input { padding-right: 66px; }
.password-field button { position: absolute; right: 8px; top: 50%; min-width: 48px; min-height: 32px; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--primary); font-size: 10px; font-weight: 900; transform: translateY(-50%); cursor: pointer; }
.password-field button:hover { background: rgba(91,92,226,.08); }

.service-filter-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.favorite-filter { display: inline-flex; min-height: 45px; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 850; cursor: pointer; }
.favorite-filter span { display: grid; min-width: 22px; height: 22px; place-items: center; border-radius: 7px; background: var(--surface); color: var(--text); font-size: 9px; }
.favorite-filter.active { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.08); color: #c47d0b; }
.service-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.favorite-button { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: #9ca3af; font-size: 19px; cursor: pointer; }
.favorite-button:hover, .favorite-button.active { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.09); color: #e79a18; }
.service-filter-empty { grid-column: 1 / -1; min-height: 130px; display: grid; place-items: center; }

.table-wrap { scrollbar-width: thin; scrollbar-color: rgba(91,92,226,.35) var(--surface-2); }
.table-wrap::-webkit-scrollbar { height: 9px; }.table-wrap::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 99px; }.table-wrap::-webkit-scrollbar-thumb { background: rgba(91,92,226,.35); border-radius: 99px; }

@media (min-width: 701px) and (max-width: 1100px) {
  .stats-grid.four, .dashboard-metrics { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .stats-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
  .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 700px) {
  .has-sidebar .main { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
  .mobile-bottom-nav { position: fixed; z-index: 25; left: 10px; right: 10px; bottom: max(9px,env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); min-height: 64px; padding: 6px; border: 1px solid var(--line); border-radius: 17px; background: color-mix(in srgb,var(--surface) 92%,transparent); box-shadow: 0 16px 45px rgba(5,9,22,.2); backdrop-filter: blur(18px); }
  .mobile-bottom-nav a, .mobile-bottom-nav button { display: grid; min-width: 0; place-items: center; gap: 2px; padding: 5px 2px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 8px; font-weight: 800; cursor: pointer; }
  .mobile-bottom-nav a.active { background: rgba(91,92,226,.1); color: var(--primary); }
  .mobile-bottom-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .auth-layout { gap: 23px; }
  .auth-story { min-height: 190px; padding: 27px; justify-content: center; }
  .auth-story h1 { max-width: 310px; margin: 17px 0 0; font-size: 30px; line-height: 1.02; }
  .auth-story > p, .auth-story .story-proof, .auth-story .story-list, .auth-story .story-orbit { display: none; }
  .auth-panel { padding-bottom: 20px; }
  .page-head > .button, .page-head > a.button { width: 100%; }
  .service-filter-row { grid-template-columns: 1fr; }
  .favorite-filter { justify-content: center; }
  .panel { padding: 18px; }
  .order-form > .button, .batch-actions .button { width: 100%; }
  .command-shell { align-items: start; padding: 12px; }
  .command-panel { max-height: calc(100vh - 24px); border-radius: 14px; }
  .command-panel > footer { display: none; }
}

@media (max-width: 460px) {
  .auth-story { min-height: 168px; padding: 23px; }
  .auth-story h1 { font-size: 27px; }
  .guest-bar .brand img { width: 36px; height: 36px; }
  .guest-bar .brand span strong { font-size: 13px; }
  .guest-bar .brand span small { font-size: 9px; }
  .status-filter { overflow-x: auto; grid-auto-columns: minmax(90px,1fr); }
}

/* v2.4 perceived-performance and motion pass */
.page-progress {
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease;
}
.page-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #5b5ce2, #8b8cf5 55%, #18b8a6);
  box-shadow: 0 2px 12px rgba(91, 92, 226, .48);
}
html.is-page-loading { cursor: progress; }
html.is-page-loading .page-progress { opacity: 1; }
html.is-page-loading .page-progress span { animation: page-progress 12s cubic-bezier(.1,.7,.2,1) forwards; }
.page-progress.is-finishing { opacity: 1; animation: progress-fade .25s ease forwards; }
.page-progress.is-finishing span { transform: scaleX(1); }

.main { animation: ui-enter .3s cubic-bezier(.2,.7,.25,1) both; }
.modal-shell:not([hidden]) .modal-backdrop,
.command-shell:not([hidden]) .command-backdrop { animation: veil-in .18s ease both; }
.modal-shell:not([hidden]) .modal-panel,
.command-shell:not([hidden]) .command-panel { animation: dialog-in .24s cubic-bezier(.2,.75,.25,1) both; }

button.is-loading,
.button.is-loading { cursor: progress; }
button.is-loading::before,
.button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: .8;
  animation: loading-spin .7s linear infinite;
}

.order-panel { position: relative; }
.order-panel::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 34%;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  pointer-events: none;
}
.order-panel.is-refreshing::after { opacity: 1; animation: live-scan 1.1s ease-in-out infinite; }
.order-title-line { display: flex; align-items: center; gap: 9px; }
.live-sync { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.live-sync i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(13,155,112,.11); }
.order-panel.is-refreshing .live-sync i { animation: live-pulse 1s ease infinite; }
.order-panel.has-sync-error .live-sync { color: var(--warning); }

.service-item,
.ticket-card { content-visibility: auto; contain-intrinsic-size: auto 160px; }

@keyframes page-progress {
  0% { transform: scaleX(.06); }
  20% { transform: scaleX(.42); }
  55% { transform: scaleX(.72); }
  100% { transform: scaleX(.92); }
}
@keyframes progress-fade { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ui-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@keyframes live-scan { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
@keyframes live-pulse { 50% { opacity: .4; transform: scale(.75); } }

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