﻿:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f7;
  color: #111827;
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --line: #d9dee0;
  --line-strong: #c5cccf;
  --text: #111827;
  --muted: #66737a;
  --muted-2: #8a969d;
  --sidebar: #151f1d;
  --primary: #0f766e;
  --primary-strong: #0b625b;
  --amber: #f2b84b;
  --danger: #b42318;
  --success: #0f7a4b;
  --shadow: 0 12px 34px rgba(17, 24, 39, .07);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  isolation: isolate;
  background: #101c1a;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: -42px;
  z-index: -2;
  background-image: url("/assets/login-hero.png");
  background-size: cover;
  background-position: center;
  filter: blur(9px) saturate(1.05) contrast(1.03);
  transform: scale(1.035);
}
.login-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(238, 244, 242, .68), rgba(238, 244, 242, .40) 44%, rgba(242, 239, 226, .50)),
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.22), transparent 36%);
}


.login-panel {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  width: min(1040px, 100%);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(197, 204, 207, .86);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 34px 90px rgba(17, 24, 39, .18), 0 10px 26px rgba(15, 118, 110, .08);
  transform-style: preserve-3d;
  perspective: 1200px;
  position: relative;
  z-index: 1;
}

.login-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
  position: relative;
  z-index: 2;
}

.login-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
}

.login-brand, .sidebar-brand, .account-strip, .panel-header, .source-preview, .charge-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand { align-items: flex-start; }
.login-brand h1 { max-width: 360px; font-size: 32px; line-height: 1.08; }
.login-copy { max-width: 360px; margin: 18px 0 22px; color: var(--muted); line-height: 1.55; font-size: 15px; }
.fine-print { max-width: 360px; margin: 14px 0 0; color: var(--muted-2); font-size: 12px; line-height: 1.5; }

.login-showcase {
  position: relative;
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
  background-color: #172320;
  background-image:
    linear-gradient(90deg, rgba(17, 28, 26, .04), rgba(17, 28, 26, .12)),
    url("/assets/login-hero.png");
  background-size: cover;
  background-position: center center;
  transform: translateZ(18px);
}
.login-showcase::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 36%, rgba(255,255,255,.20), transparent 22%),
    linear-gradient(90deg, rgba(255,255,255,.03), transparent 52%),
    linear-gradient(270deg, rgba(23,35,32,.16) 0, rgba(23,35,32,0) 18%);
  pointer-events: none;
}
.login-language {
  width: fit-content;
  margin: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.auth-tabs button {
  height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}
.auth-tabs button.active {
  color: #ffffff;
  background: var(--primary);
}
.auth-message {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 122, 75, .25);
  border-radius: 8px;
  color: var(--success);
  background: rgba(15, 122, 75, .08);
  font-size: 13px;
  line-height: 1.45;
}
.auth-message.error {
  border-color: rgba(180, 35, 24, .25);
  color: var(--danger);
  background: rgba(180, 35, 24, .08);
}
.verify-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}
.verify-link:hover { text-decoration: underline; }
.text-button {
  width: fit-content;
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}
.text-button:hover { text-decoration: underline; }
.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.login-language {
  width: fit-content;
  margin: 0 0 18px auto;
}
.lang-button {
  min-width: 42px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}
.lang-button.active {
  color: #ffffff;
  background: var(--primary);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: white;
  background: var(--primary);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { letter-spacing: 0; }
h1, h2, h3 { margin: 0; }
h1 { font-size: 25px; line-height: 1.14; }
h2 { font-size: 18px; line-height: 1.22; }

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  color: #f8fafc;
  background: var(--sidebar);
}

.sidebar-brand {
  min-height: 48px;
  margin: 0 4px 24px;
}
.sidebar-brand .brand-mark { width: 38px; height: 38px; }
.sidebar-brand strong { display: block; font-size: 15px; }
.sidebar-brand small { display: block; color: #a6b3b0; margin-top: 2px; font-size: 12px; }

.nav-list { display: grid; gap: 6px; }
.nav-item {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #d8e1de;
  background: transparent;
  text-align: left;
  font-weight: 750;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); }
.nav-item.active { color: #0f1715; background: #edf0e8; }

.main-area { min-width: 0; padding: 20px 22px 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.account-strip {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.balance-card {
  display: grid;
  gap: 1px;
  min-width: 126px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.balance-card span { color: var(--muted); font-size: 11px; font-weight: 800; }
.balance-card strong { color: var(--primary); font-size: 17px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); }
.account-name { display: grid; min-width: 172px; }
.account-name strong { font-size: 14px; }
.account-name span { color: var(--muted); font-size: 12px; }

.ghost-button, .download-button, .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #1f2933;
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.ghost-button:hover, .secondary-action:hover { border-color: #8e9aa1; background: #f8faf9; }
.download-button { color: #ffffff; border-color: #1f2937; background: #1f2937; }
.download-button.disabled { pointer-events: none; color: #7b858a; border-color: var(--line); background: #e8ecee; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(17, 24, 39, .03);
}
.stat-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.stat-card strong { display: block; margin-top: 8px; font-size: 25px; line-height: 1; }
.stat-card.accent {
  min-height: 66px;
  padding: 10px 12px;
  border-color: #e6c36f;
  background: #fff8e6;
}
.stat-card.accent strong {
  margin-top: 7px;
  font-size: 17px;
  line-height: 1.25;
  white-space: normal;
}

.view { display: none; }
.active-view { display: block; }
.studio-layout, .wallet-layout {
  display: grid;
  grid-template-columns: minmax(330px, 452px) minmax(0, 1fr);
  gap: 14px;
}

.tool-panel, .preview-panel, .table-panel, .wallet-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tool-panel, .preview-panel, .table-panel, .wallet-panel { padding: 16px; }
.panel-header { justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.panel-header h2 { font-size: 18px; }

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f2;
}
.mode-switch button {
  min-width: 78px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  color: #526067;
  background: transparent;
  font-weight: 850;
}
.mode-switch button.active { color: #ffffff; background: var(--primary); }

.field { display: grid; gap: 7px; margin-bottom: 12px; }
.field span, .upload-box span { color: #3f4a50; font-size: 12px; font-weight: 850; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #172026;
  background: #ffffff;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
input, select { height: 40px; padding: 0 10px; }
textarea { min-height: 154px; padding: 12px; line-height: 1.5; resize: vertical; }

.upload-row { margin-bottom: 12px; }
.upload-box {
  display: grid;
  gap: 7px;
  min-height: 76px;
  padding: 12px;
  border: 1px dashed #8fa09f;
  border-radius: 8px;
  background: #f5faf9;
}
.upload-box input { display: none; }
.upload-box strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.option-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(92px, .7fr) minmax(104px, .7fr); gap: 10px; }
.charge-row { justify-content: space-between; margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.charge-row strong { color: var(--primary); }

.primary-action {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--primary);
  font-weight: 900;
}
.primary-action:hover { background: var(--primary-strong); }
.primary-action:disabled { opacity: .68; cursor: wait; }
.message { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.message.error { color: var(--danger); }
.policy-note {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e1e7e4;
  border-radius: 8px;
  background: #f8faf9;
}
.policy-heading { display: grid; gap: 2px; }
.policy-heading strong { font-size: 13px; color: #14211f; }
.policy-heading span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.policy-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #e4e9e7;
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
}
.policy-table th,
.policy-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #edf1ef;
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
}
.policy-table tr:last-child th,
.policy-table tr:last-child td { border-bottom: 0; }
.policy-table th { width: 34%; color: #27332f; background: #f0f5f3; font-weight: 900; }
.policy-table td { color: #52615c; }

.preview-panel { display: grid; grid-template-rows: auto auto auto; gap: 12px; }
.preview-frame {
  --preview-aspect: 1 / 1;
  --preview-ratio: 1;
  display: grid;
  place-items: center;
  width: min(100%, calc((100vh - 260px) * var(--preview-ratio)));
  aspect-ratio: var(--preview-aspect);
  max-height: calc(100vh - 260px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #e8ebed 25%, transparent 25%),
    linear-gradient(-45deg, #e8ebed 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8ebed 75%),
    linear-gradient(-45deg, transparent 75%, #e8ebed 75%);
  background-color: #f7f8f8;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
}
.preview-frame img { width: 100%; height: 100%; object-fit: contain; }
.empty-state {
  display: grid;
  place-items: center;
  gap: 12px;
  width: min(360px, 90%);
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  text-align: center;
}
.empty-state span { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 8px; color: white; background: #1f2937; font-weight: 900; }
.empty-state.loading { border-color: #e4bf63; background: rgba(255, 249, 230, .96); }
.empty-state.loading p { margin: 0; }
.empty-state.loading strong { color: #1f2937; }
.preview-spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 5px solid #e8e0c2;
  border-top-color: var(--primary);
  border-right-color: var(--amber);
  background: transparent !important;
  animation: preview-spin .85s linear infinite;
}
@keyframes preview-spin { to { transform: rotate(360deg); } }
.empty-state p, .muted { color: var(--muted); line-height: 1.5; }
.source-preview { align-items: center; justify-content: flex-start; padding-top: 10px; border-top: 1px solid #edf0f1; }
.source-preview img { width: 72px; height: 52px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.source-preview strong { font-size: 13px; }

.jobs-table, .transactions-list { display: grid; gap: 8px; }
.job-row, .tx-row, .flow-row {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr) 112px 96px 120px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5e9ea;
  border-radius: 8px;
  background: #ffffff;
}
.job-row strong small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 11px; font-weight: 850; }
.job-row .prompt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2f3a40; }
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #34403a;
  background: #e9eef0;
  font-size: 11px;
  font-weight: 900;
}
.status-success { color: #09583e; background: #d7f3e5; }
.status-failed { color: #8b1f16; background: #ffdeda; }
.status-processing, .status-queued { color: #744d00; background: #ffebb8; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mini-link { color: var(--primary); font-weight: 900; text-decoration: none; }

.wallet-layout { grid-template-columns: 360px minmax(0, 1fr); }
.wallet-panel h2 { margin-top: 8px; font-size: 38px; color: var(--primary); }
.bank-topup-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.bank-qr {
  width: min(220px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 42%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f7;
}
.bank-info-grid {
  display: grid;
  gap: 8px;
}
.bank-info-grid div,
.transfer-memo-box {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #e5e9ea;
  border-radius: 8px;
  background: #ffffff;
}
.bank-info-grid span,
.transfer-memo-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.bank-info-grid strong,
.transfer-memo-box strong {
  color: #111827;
  font-size: 14px;
}
.transfer-memo-box {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.transfer-memo-box span { grid-column: 1 / -1; }
.transfer-memo-box strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--primary);
  font-size: 18px;
}
.mini-copy {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #1f2933;
  background: var(--surface);
  font-size: 12px;
  font-weight: 900;
}
.topup-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.topup-actions { display: grid; gap: 10px; margin-top: 20px; }
.tx-row { grid-template-columns: 140px minmax(0, 1fr) 116px 136px; }
.tx-row .plus { color: var(--primary); font-weight: 900; }
.tx-row .minus { color: var(--danger); font-weight: 900; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gallery-card { overflow: hidden; border: 1px solid #e5e9ea; border-radius: 8px; background: #ffffff; }
.gallery-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #eef1f2; }
.gallery-card div { padding: 10px; }
.quality-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  margin-bottom: 8px;
  border-radius: 999px;
  color: #09583e;
  background: #d7f3e5;
  font-size: 11px;
  font-weight: 900;
}
.gallery-card p { margin: 0 0 8px; color: #2f3a40; font-size: 13px; line-height: 1.4; }


.flow-status { display: grid; gap: 12px; }
.worker-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.worker-summary-strip div {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e2e8e6;
  border-radius: 8px;
  background: #f8fbfa;
}
.worker-summary-strip span { display: block; color: var(--muted); font-size: 11px; font-weight: 900; }
.worker-summary-strip strong { display: block; margin-top: 5px; font-size: 20px; line-height: 1; }
.worker-table { display: grid; gap: 8px; }
.worker-table-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 96px minmax(210px, .8fr) 70px 82px;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid #e3e8e6;
  border-radius: 8px;
  background: #ffffff;
}
.worker-name-cell { min-width: 0; }
.worker-name-cell strong,
.worker-control-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.worker-name-cell small,
.worker-control-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; color: var(--muted); font-size: 11px; }
.worker-auth-badges { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.mini-badge.ok { color: #09583e; background: #ddf5e8; }
.mini-badge.bad { color: #8b1f16; background: #ffe5e1; }
.worker-slot-count { text-align: center; font-size: 14px; }
.worker-processed { color: var(--muted); font-size: 12px; text-align: right; }

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 500px);
  gap: 14px;
  align-items: start;
}
.admin-grid > .table-panel:first-child { grid-row: span 2; min-height: 278px; }
.compact-worker-panel { padding: 14px; }
.compact-worker-panel .compact-header { align-items: center; margin-bottom: 10px; }
.compact-worker-panel .compact-header h2 { font-size: 17px; }
.compact-worker-panel .secondary-action { min-height: 36px; padding: 0 13px; }
.compact-account-list { display: grid; gap: 8px; margin-top: 0; }
.worker-control-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e3e8e6;
  border-radius: 8px;
  background: #ffffff;
}
.worker-control-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.worker-control-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.worker-control-metrics span {
  min-height: 30px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
  background: #f4f7f6;
  font-size: 11px;
  font-weight: 900;
}
.worker-control-metrics strong { float: right; color: var(--text); }
.worker-auth-badges-control { padding-top: 1px; }
.worker-error-line {
  margin: 0;
  padding: 7px 9px;
  border-radius: 8px;
  color: #8b4a00;
  background: #fff4d7;
  font-size: 11px;
  line-height: 1.35;
}
.worker-actions.compact-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-width: none;
}
.worker-actions.compact-actions .ghost-button {
  min-height: 31px;
  padding: 0 7px;
  font-size: 11px;
}
.wide-admin { grid-column: 1 / -1; }
.compact-price-panel {
  grid-column: 2;
  padding: 12px 14px;
}
.compact-price-row {
  display: grid;
  grid-template-columns: auto minmax(74px, 92px) minmax(74px, 92px) minmax(92px, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.compact-price-row h2 {
  margin: 0 4px 8px 0;
  font-size: 16px;
  white-space: nowrap;
}
.compact-price-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.compact-price-row input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--text);
  background: #ffffff;
  font-weight: 800;
}
.compact-price-row .secondary-action { height: 36px; min-height: 36px; }
.price-save-status {
  min-width: 78px;
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
  align-self: center;
}
.price-save-status.error { color: var(--danger); }
.admin-list { display: grid; gap: 8px; margin-top: 12px; }
.admin-user-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.admin-user-search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #ffffff;
}
.user-money-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.user-admin-row .adjust-input {
  width: 120px;
  min-width: 100px;
}
.manual-topup-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, .7fr) minmax(150px, 1fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.admin-message {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}
.admin-message.error { color: var(--danger); }
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5e9ea;
  border-radius: 8px;
  background: #ffffff;
}
.admin-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.user-admin-row { grid-template-columns: minmax(0, 1fr) 116px 142px auto; }
.log-row { grid-template-columns: 84px minmax(0, 1fr); }
.adjust-input { height: 36px; }
.ghost-button.danger { color: var(--danger); border-color: #f0bab2; background: #fff7f5; }


@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .sidebar-brand { margin-bottom: 14px; }
  .nav-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .studio-layout, .wallet-layout { grid-template-columns: 1fr; }
  .preview-frame { width: min(100%, calc(68vh * var(--preview-ratio))); max-height: 68vh; }
}

@media (max-width: 760px) {
  .main-area { padding: 12px; }
  .topbar, .account-strip { align-items: flex-start; flex-direction: column; }
  .stats-grid, .option-grid, .nav-list { grid-template-columns: 1fr; }
  .job-row, .tx-row, .flow-row { grid-template-columns: 1fr; }
  .admin-grid, .admin-form-grid, .inline-settings, .worker-form-compact, .manual-topup-form, .admin-user-search, .compact-price-row { grid-template-columns: 1fr; }
  .admin-grid > .table-panel:first-child { grid-row: auto; }
  .compact-price-panel { grid-column: auto; }
  .worker-summary-strip, .worker-table-row, .worker-actions.compact-actions, .worker-control-metrics { grid-template-columns: 1fr; }
  .admin-row, .user-admin-row, .log-row, .flow-account-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 10px;
}
  textarea { min-height: 132px; }
  .preview-panel { grid-template-rows: auto auto auto; }
  .preview-frame { width: min(100%, calc(62vh * var(--preview-ratio))); max-height: 62vh; }
}








/* Content-sized admin refinements */
.account-strip { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.language-switch { grid-template-columns: repeat(2, max-content); width: max-content; }
.balance-card { min-width: 0; width: max-content; padding: 7px 11px; }
.account-name { min-width: 0; max-width: 230px; }
.account-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-grid { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
.stat-card { min-height: 70px; padding: 10px 14px; }
.stat-card strong { margin-top: 6px; font-size: 23px; }

.worker-summary-strip {
  grid-template-columns: repeat(3, minmax(96px, max-content));
  justify-content: start;
}
.worker-summary-strip div { min-width: 96px; min-height: 52px; padding: 9px 12px; }
.worker-summary-strip strong { font-size: 18px; }
.worker-table-row {
  grid-template-columns: minmax(170px, 1fr) max-content max-content max-content max-content;
  min-height: 42px;
  padding: 8px 10px;
}
.worker-auth-badges { width: max-content; max-width: 100%; }
.worker-slot-count { min-width: 42px; text-align: right; }
.worker-processed { min-width: 58px; }
.status-chip { width: fit-content; min-width: 0; }
.worker-table-row .status-chip { min-width: 54px; }

.worker-control-card { padding: 9px; }
.worker-control-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.worker-control-metrics span { width: max-content; min-height: 28px; padding: 6px 8px; }
.worker-control-metrics strong { float: none; margin-left: 6px; }
.worker-actions.compact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}
.worker-actions.compact-actions .ghost-button { width: auto; min-width: 0; padding: 0 9px; }

.compact-price-panel { justify-self: start; width: min(100%, 500px); }
.compact-price-row {
  grid-template-columns: auto 82px 82px max-content max-content;
  justify-content: start;
}
.compact-price-row input { width: 82px; }
.compact-price-row .secondary-action { width: auto; min-width: 84px; padding: 0 14px; }
.price-save-status { min-width: 0; width: max-content; }

.admin-user-search { grid-template-columns: minmax(280px, 1fr) max-content; }
.user-admin-row { grid-template-columns: minmax(0, 1fr) max-content max-content max-content; }
.user-admin-row .adjust-input { width: 118px; }
.user-money-actions .ghost-button { min-height: 34px; padding: 0 10px; }

@media (max-width: 760px) {
  .stats-grid { grid-template-columns: 1fr; }
  .worker-summary-strip, .worker-table-row, .compact-price-row, .admin-user-search, .user-admin-row { grid-template-columns: 1fr; }
  .compact-price-panel { width: 100%; }
  .compact-price-row input { width: 100%; }
  .worker-actions.compact-actions { display: grid; grid-template-columns: 1fr 1fr; }
}


/* Compact AI worker content cards */
.flow-status { align-content: start; }
.worker-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
}
.worker-summary-strip div {
  width: max-content;
  min-width: 96px;
  min-height: 50px;
  padding: 8px 12px;
}
.worker-table {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
}
.worker-table-row {
  display: inline-grid;
  grid-template-columns: minmax(150px, max-content) max-content max-content max-content max-content;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 10px;
}
.worker-name-cell { width: max-content; max-width: 220px; }
.worker-auth-badges { flex-wrap: nowrap; }
.worker-table-row .status-chip { min-width: 52px; }
.worker-slot-count { min-width: 34px; }
.worker-processed { min-width: auto; white-space: nowrap; }
.admin-grid > .table-panel:first-child { min-height: auto; }

@media (max-width: 980px) {
  .worker-table { width: 100%; }
  .worker-table-row {
    grid-template-columns: minmax(0, 1fr) max-content;
    width: 100%;
  }
  .worker-auth-badges, .worker-slot-count, .worker-processed { grid-column: 1 / -1; }
  .worker-auth-badges { flex-wrap: wrap; }
}


/* Compact processing account cards */
.compact-worker-panel {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}
.compact-worker-panel .compact-header {
  width: max-content;
  max-width: 100%;
}
.compact-account-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
}
.worker-control-card {
  width: fit-content;
  min-width: 280px;
  max-width: 390px;
}
.worker-control-top {
  grid-template-columns: minmax(150px, max-content) max-content;
  width: fit-content;
  max-width: 100%;
}
.worker-control-title { width: max-content; max-width: 220px; }
.worker-control-metrics { width: fit-content; }
.worker-auth-badges-control { width: fit-content; }
.worker-actions.compact-actions {
  width: fit-content;
  max-width: 100%;
}
.worker-actions.compact-actions .ghost-button {
  flex: 0 0 auto;
  width: max-content;
}

@media (max-width: 760px) {
  .compact-worker-panel, .compact-worker-panel .compact-header, .compact-account-list, .worker-control-card, .worker-control-top, .worker-actions.compact-actions { width: 100%; }
  .worker-control-card { min-width: 0; max-width: 100%; }
  .worker-control-top { grid-template-columns: minmax(0, 1fr) max-content; }
  .worker-actions.compact-actions .ghost-button { width: auto; }
}


/* Google quick login */
.google-auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 12px 0 10px;
  border: 1px solid #d6dddf;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.google-auth-button:hover { border-color: #b8c4c7; background: #fbfcfc; }
.google-auth-button::before {
  content: "G";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #dce3e5;
  color: #0f766e;
  font-size: 14px;
  font-weight: 1000;
  background: #ffffff;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e1e7e8;
}


/* Polished login overrides */
.login-content .google-auth-button {
  min-height: 48px;
  margin: 0;
  border-color: #cfd8da;
  font-size: 15px;
}
.login-content .google-auth-button::before {
  color: #0f766e;
}
@media (max-width: 900px) {
  .login-shell { padding: 16px; align-items: start; }
  .login-panel { grid-template-columns: 1fr; min-height: 0; }
  .login-content { padding: 26px; }
  .login-brand h1 { font-size: 27px; }
  .login-showcase { min-height: 320px; }
}
@media (max-width: 560px) {
  .login-content { padding: 20px; }
  .login-topline { margin-bottom: 24px; }
  .login-brand h1 { font-size: 24px; }
  .login-showcase { display: none; }
}


/* Login 3D depth */
.login-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 0;
  border-radius: 14px;
  background: rgba(15, 31, 29, .16);
  filter: blur(24px);
  transform: translate3d(18px, 22px, -42px);
}
.login-content::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(17, 24, 39, .12), transparent);
}
.login-content .brand-mark {
  box-shadow: 0 14px 28px rgba(15, 118, 110, .24), inset 0 1px 0 rgba(255,255,255,.22);
}
.login-content .google-auth-button {
  transform: translateZ(24px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, .08), inset 0 1px 0 rgba(255,255,255,.7);
}
.login-content .google-auth-button:hover {
  transform: translateY(-1px) translateZ(24px);
  box-shadow: 0 16px 30px rgba(17, 24, 39, .12), inset 0 1px 0 rgba(255,255,255,.8);
}
.login-showcase::before {
  content: "";
  position: absolute;
  left: 45%;
  top: 22%;
  width: 46%;
  aspect-ratio: 1.18 / 1;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.04));
  box-shadow: 0 28px 70px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.26);
  backdrop-filter: blur(2px);
  transform: translate3d(-4px, -4px, 30px);
}
@media (max-width: 900px) {
  .login-showcase::before { left: 50%; width: 38%; }
}
@media (max-width: 560px) {
  .login-panel::before, .login-content::after, .login-showcase::before { display: none; }
}


/* App workspace visual polish */
.app-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #e5eeeb !important;
}
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(9, 24, 21, .98) 0 232px, rgba(229, 238, 235, .92) 232px, rgba(237, 235, 222, .88) 100%),
    radial-gradient(circle at 78% 12%, rgba(15, 118, 110, .20), transparent 30%),
    radial-gradient(circle at 52% 96%, rgba(196, 151, 83, .16), transparent 34%);
  pointer-events: none;
}
.app-shell::after {
  content: "";
  position: fixed;
  top: -7vh;
  right: -5vw;
  bottom: -7vh;
  width: min(58vw, 920px);
  z-index: 1;
  background-image:
    linear-gradient(90deg, rgba(229,238,235,.96), rgba(229,238,235,.54) 34%, rgba(229,238,235,.10)),
    url("/assets/login-hero.png");
  background-size: cover;
  background-position: center right;
  opacity: .36;
  filter: blur(10px) saturate(.95) contrast(.96);
  transform: scale(1.035);
  pointer-events: none;
}
.sidebar,
.main-area {
  position: relative;
  z-index: 2;
}
.main-area {
  isolation: isolate;
  background:
    radial-gradient(circle at 86% 16%, rgba(255,255,255,.34), transparent 28%),
    linear-gradient(135deg, rgba(231,240,237,.72), rgba(242,239,226,.42)) !important;
  backdrop-filter: none !important;
}
.main-area::before {
  content: "";
  position: fixed;
  inset: -24px -24px -24px 232px;
  z-index: 0;
  background-image:
    linear-gradient(120deg, rgba(232,241,238,.92), rgba(232,241,238,.76) 42%, rgba(232,241,238,.56)),
    linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.10)),
    url("/assets/login-hero.png");
  background-size: cover, cover, cover;
  background-position: center, center, center right;
  opacity: .88;
  filter: blur(6px) saturate(.94) contrast(.96);
  transform: scale(1.018);
  pointer-events: none;
}
.main-area::after {
  content: "";
  position: fixed;
  inset: 0 0 0 232px;
  z-index: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.42), transparent 26%),
    radial-gradient(circle at 40% 92%, rgba(194, 158, 92, .10), transparent 34%);
  pointer-events: none;
}
.main-area > * {
  position: relative;
  z-index: 1;
}
.sidebar {
  border-right: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(9, 24, 21, .98), rgba(12, 30, 27, .96));
  box-shadow: 14px 0 36px rgba(7, 18, 16, .14);
}
.sidebar-brand .brand-mark,
.topbar .brand-mark {
  box-shadow: 0 12px 26px rgba(15, 118, 110, .20), inset 0 1px 0 rgba(255,255,255,.22);
}
.nav-item {
  border: 1px solid transparent;
}
.nav-item:hover {
  border-color: rgba(255,255,255,.08);
  background: rgba(255, 255, 255, .08);
}
.nav-item.active {
  color: #0f1715;
  border-color: rgba(255,255,255,.64);
  background: linear-gradient(180deg, #fbfcf8, #e8eee8);
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
}
.topbar {
  position: relative;
  padding: 10px 12px;
  border: 1px solid rgba(205, 216, 216, .88);
  border-radius: 10px;
  background: rgba(255,255,255,.78) !important;
  box-shadow: 0 12px 30px rgba(17, 24, 39, .06), inset 0 1px 0 rgba(255,255,255,.82);
  backdrop-filter: blur(10px) saturate(1.02);
}
.balance-card,
.language-switch,
.ghost-button,
.secondary-action,
.download-button {
  box-shadow: 0 7px 16px rgba(17, 24, 39, .055), inset 0 1px 0 rgba(255,255,255,.72);
}
.stat-card,
.tool-panel,
.preview-panel,
.table-panel,
.wallet-panel {
  border-color: rgba(203, 215, 215, .90) !important;
  background: rgba(255,255,255,.80) !important;
  box-shadow: 0 18px 44px rgba(17, 24, 39, .075), inset 0 1px 0 rgba(255,255,255,.84) !important;
  backdrop-filter: blur(9px) saturate(1.02) !important;
}
.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.76)) !important;
}
.stat-card strong {
  color: #071513;
}
.panel-header {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(219, 226, 227, .84);
}
.tool-panel textarea,
.tool-panel input,
.tool-panel select,
.adjust-input,
.admin-row input,
.manual-topup-form input,
.compact-price-row input,
#adminUserSearch {
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, .035);
}
.mode-switch,
.language-switch {
  background: rgba(244, 247, 246, .92);
  backdrop-filter: blur(6px);
}
.primary-action {
  box-shadow: 0 12px 24px rgba(15, 118, 110, .18), inset 0 1px 0 rgba(255,255,255,.18);
}
.primary-action:hover {
  filter: brightness(.99);
  transform: translateY(-1px);
}
.preview-panel {
  overflow: hidden;
}
.preview-frame {
  border-color: rgba(198, 209, 210, .94);
  background-color: rgba(255,255,255,.70) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 16px 40px rgba(17, 24, 39, .07);
}
.empty-state {
  border-color: rgba(211, 220, 221, .90);
  background: rgba(255,255,255,.86) !important;
  box-shadow: 0 16px 38px rgba(17, 24, 39, .08), inset 0 1px 0 rgba(255,255,255,.78);
  backdrop-filter: blur(8px);
}
.policy-note,
.admin-row,
.flow-account-row,
.worker-table-row,
.worker-control-card,
.tx-row,
.job-row,
.gallery-card,
.bank-topup-card {
  background: rgba(255,255,255,.76) !important;
  box-shadow: 0 9px 24px rgba(17, 24, 39, .05), inset 0 1px 0 rgba(255,255,255,.72);
  backdrop-filter: blur(7px) !important;
}
.policy-table th,
.policy-table td {
  background: rgba(255,255,255,.64);
}
@media (max-width: 1180px) {
  .app-shell::before {
    background: linear-gradient(180deg, rgba(9, 24, 21, .98) 0 160px, rgba(229, 238, 235, .92) 160px, rgba(237, 235, 222, .88));
  }
  .app-shell::after { width: 100vw; opacity: .22; }
  .main-area::before { inset-left: 0; }
  .sidebar { box-shadow: 0 14px 34px rgba(7, 18, 16, .12); }
}
@media (max-width: 760px) {
  .topbar { padding: 10px; }
}



.login-panel::before,
.login-content::after,
.login-showcase::before,
.login-showcase::after {
  pointer-events: none;
}


/* Login click safety */
.login-panel,
.login-content,
.login-content > *,
.google-auth-button {
  pointer-events: auto;
}
.login-shell::before,
.login-shell::after,
.login-panel::before,
.login-content::after,
.login-showcase,
.login-showcase::before,
.login-showcase::after {
  pointer-events: none;
}
.login-content {
  z-index: 3;
}
.google-auth-button {
  position: relative;
  z-index: 4;
}

/* Admin system health */
.system-health-panel {
  grid-column: 1 / -1;
}
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
  gap: 8px;
  align-items: stretch;
}
.health-card {
  min-width: 150px;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid rgba(203, 215, 215, .92);
  border-radius: 8px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 8px 18px rgba(17, 24, 39, .045), inset 0 1px 0 rgba(255,255,255,.72);
}
.health-card span,
.health-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.health-card strong {
  display: block;
  margin: 3px 0 2px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}
.health-card-warn {
  border-color: rgba(180, 35, 24, .28);
  background: rgba(255, 246, 244, .86);
}

/* Admin wallet audit */
.wallet-audit-panel {
  align-self: start;
}
.wallet-audit-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}
.wallet-audit-row {
  grid-template-columns: 112px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 14px;
}
.wallet-audit-row > strong {
  font-size: 16px;
  white-space: nowrap;
}
.wallet-audit-main {
  min-width: 0;
}
.wallet-audit-main strong,
.wallet-audit-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-audit-balance {
  text-align: right;
  white-space: nowrap;
}
.wallet-audit-balance span {
  display: block;
  font-weight: 900;
  color: #14211d;
}
.wallet-audit-balance small {
  color: var(--muted);
}
@media (max-width: 760px) {
  .wallet-audit-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .wallet-audit-balance {
    text-align: left;
  }
}

/* Admin dashboard horizontal compact layout */
.admin-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
.admin-band {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(203, 215, 215, .72);
}
.admin-band:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.admin-band > .table-panel {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
}
.admin-band .panel-header {
  width: max-content;
  max-width: 100%;
  gap: 12px;
}
.admin-band .panel-header h2 {
  white-space: nowrap;
}
.system-health-panel {
  grid-column: auto;
  min-height: 0;
}
.admin-grid > .table-panel:first-child {
  grid-row: auto;
  min-height: 0;
}
.admin-worker-overview {
  min-width: min(100%, 460px);
}
.compact-worker-panel {
  min-width: min(100%, 360px);
  max-width: min(100%, 560px) !important;
}
.compact-worker-panel,
.compact-price-panel {
  justify-self: start;
  grid-column: auto;
}
.compact-price-panel {
  width: fit-content !important;
  max-width: 100%;
}
.compact-price-row {
  grid-template-columns: max-content 82px 82px max-content max-content;
  width: max-content;
  max-width: 100%;
}
.user-wallet-panel {
  width: min(100%, 1120px) !important;
}
.user-wallet-panel .panel-header,
.user-wallet-panel .admin-user-search {
  width: min(100%, 760px);
}
.user-wallet-panel .admin-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.user-wallet-panel .user-admin-row {
  width: fit-content;
  max-width: 100%;
}
.wallet-audit-panel {
  width: min(100%, 880px) !important;
}
.system-log-panel {
  width: min(100%, 720px) !important;
}
.system-log-panel .admin-row,
.wallet-audit-panel .admin-row {
  width: 100%;
}
.health-grid {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}
.health-card {
  flex: 0 0 auto;
  min-width: 138px;
  max-width: 210px;
  padding: 9px 11px;
}
.flow-status,
.worker-table {
  width: fit-content;
  max-width: 100%;
}
@media (max-width: 980px) {
  .admin-band {
    display: grid;
    grid-template-columns: 1fr;
  }
  .admin-band > .table-panel,
  .compact-price-row,
  .flow-status,
  .worker-table,
  .user-wallet-panel .user-admin-row {
    width: 100% !important;
  }
  .compact-price-row {
    grid-template-columns: 1fr 1fr;
  }
  .compact-price-row h2,
  .compact-price-row .price-save-status {
    grid-column: 1 / -1;
  }
}

/* Admin worker cards wrap horizontally + pricing on its own rail */
.admin-band-workers {
  align-items: stretch;
}
.admin-band-workers .admin-worker-overview {
  flex: 0 0 auto;
  width: fit-content;
  max-width: min(100%, 520px);
}
.admin-band-workers .compact-worker-panel {
  flex: 1 1 720px;
  width: auto !important;
  min-width: min(100%, 540px) !important;
  max-width: 100% !important;
}
.admin-band-workers .compact-worker-panel .compact-header {
  width: auto;
  justify-content: space-between;
}
.admin-band-workers .compact-account-list {
  display: flex !important;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}
.admin-band-workers .worker-control-card {
  flex: 0 1 280px;
  width: 280px;
  min-width: 260px;
  max-width: 300px;
}
.admin-band-pricing {
  align-items: center;
}
.admin-band-pricing .compact-price-panel {
  flex: 0 0 auto;
  width: fit-content !important;
  max-width: 100%;
  padding: 11px 14px;
}
.admin-band-pricing .compact-price-row {
  grid-template-columns: max-content 82px 82px max-content max-content;
  width: max-content;
  max-width: 100%;
  align-items: end;
}
.admin-band-pricing .compact-price-row h2 {
  margin-bottom: 8px;
}
@media (max-width: 980px) {
  .admin-band-workers .admin-worker-overview,
  .admin-band-workers .compact-worker-panel,
  .admin-band-workers .compact-account-list,
  .admin-band-workers .worker-control-card,
  .admin-band-pricing .compact-price-panel,
  .admin-band-pricing .compact-price-row {
    width: 100% !important;
    max-width: 100% !important;
  }
  .admin-band-workers .worker-control-card {
    flex-basis: 100%;
  }
  .admin-band-pricing .compact-price-row {
    grid-template-columns: 1fr 1fr;
  }
  .admin-band-pricing .compact-price-row h2,
  .admin-band-pricing .compact-price-row .price-save-status {
    grid-column: 1 / -1;
  }
}

/* Admin users wallet as compact spreadsheet */
.user-wallet-panel {
  width: min(100%, 1260px) !important;
}
.user-wallet-panel .admin-list {
  display: block !important;
  width: 100%;
  overflow-x: auto;
  margin-top: 10px;
}
.admin-user-table {
  min-width: 1060px;
  border: 1px solid rgba(203, 215, 215, .95);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.86);
}
.admin-user-table-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(210px, 1.35fr) 120px 74px 78px 112px 112px 212px;
  min-height: 38px;
  align-items: center;
  border-bottom: 1px solid rgba(222, 228, 229, .92);
}
.admin-user-table-row:last-child {
  border-bottom: 0;
}
.admin-user-table-row > * {
  min-width: 0;
  padding: 7px 9px;
  border-right: 1px solid rgba(222, 228, 229, .82);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-table-row > *:last-child {
  border-right: 0;
}
.admin-user-table-head {
  min-height: 34px;
  color: #53605c;
  background: rgba(239, 245, 243, .95);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.admin-user-table code {
  color: #0b6f64;
  font-family: inherit;
  font-weight: 900;
  background: transparent;
}
.admin-user-table .wallet-cell {
  color: var(--primary);
  text-align: right;
}
.admin-user-table .adjust-input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
}
.admin-user-table .user-money-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 5px;
}
.admin-user-table .user-money-actions .ghost-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}
@media (max-width: 760px) {
  .admin-user-table {
    min-width: 980px;
  }
}

/* Admin wallet audit as compact spreadsheet */
.wallet-audit-panel {
  width: min(100%, 1180px) !important;
}
.wallet-audit-list {
  display: block !important;
  max-height: 430px;
  overflow: auto;
  padding-right: 0;
}
.wallet-audit-table {
  min-width: 1080px;
  border: 1px solid rgba(203, 215, 215, .95);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.86);
}
.wallet-audit-table-row {
  display: grid;
  grid-template-columns: 112px minmax(130px, 1fr) minmax(220px, 1.35fr) minmax(150px, 1fr) 112px 148px minmax(260px, 1.6fr);
  min-height: 38px;
  align-items: center;
  border-bottom: 1px solid rgba(222, 228, 229, .92);
}
.wallet-audit-table-row:last-child {
  border-bottom: 0;
}
.wallet-audit-table-row > * {
  min-width: 0;
  padding: 7px 9px;
  border-right: 1px solid rgba(222, 228, 229, .82);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-audit-table-row > *:last-child {
  border-right: 0;
}
.wallet-audit-table-head {
  min-height: 34px;
  color: #53605c;
  background: rgba(239, 245, 243, .95);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.wallet-audit-table .wallet-cell {
  color: var(--primary);
  text-align: right;
}
.wallet-audit-table-row > strong:first-child {
  font-size: 14px;
}
@media (max-width: 760px) {
  .wallet-audit-table {
    min-width: 980px;
  }
}

/* User table readability fixes */
.admin-user-table {
  min-width: 1160px;
}
.admin-user-table-row {
  grid-template-columns: minmax(130px, 1fr) minmax(210px, 1.35fr) 150px 74px 82px 112px 112px 212px;
}
.admin-user-table code {
  font-size: 13px;
  letter-spacing: 0;
}
@media (max-width: 760px) {
  .admin-user-table {
    min-width: 1080px;
  }
}

/* Admin system logs as compact spreadsheet */
.system-log-panel {
  width: min(100%, 1180px) !important;
}
.system-log-panel .admin-list {
  display: block !important;
  width: 100%;
  max-height: 430px;
  overflow: auto;
  margin-top: 10px;
}
.system-log-table {
  min-width: 1080px;
  border: 1px solid rgba(203, 215, 215, .95);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.86);
}
.system-log-table-row {
  display: grid;
  grid-template-columns: 90px minmax(130px, 1fr) minmax(220px, 1.35fr) minmax(300px, 2fr) 148px minmax(240px, 1.4fr);
  min-height: 38px;
  align-items: center;
  border-bottom: 1px solid rgba(222, 228, 229, .92);
}
.system-log-table-row:last-child {
  border-bottom: 0;
}
.system-log-table-row > * {
  min-width: 0;
  padding: 7px 9px;
  border-right: 1px solid rgba(222, 228, 229, .82);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-log-table-row > *:last-child {
  border-right: 0;
}
.system-log-table-head {
  min-height: 34px;
  color: #53605c;
  background: rgba(239, 245, 243, .95);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.system-log-table .status-chip {
  min-height: 24px;
  padding: 0 9px;
  font-size: 11px;
}
.status-chip.status-warning {
  color: #8a5a00;
  background: #fff1ca;
}
@media (max-width: 760px) {
  .system-log-table {
    min-width: 980px;
  }
}

/* System logs prompt-first view */
.system-log-table-row {
  grid-template-columns: 90px minmax(130px, 1fr) minmax(220px, 1.25fr) minmax(360px, 2.4fr) 148px minmax(240px, 1.2fr);
}
.system-log-prompt {
  color: #17211e;
  font-weight: 700;
}

/* Deploy readiness cards */
.deploy-readiness-panel {
  width: min(100%, 860px) !important;
}
.readiness-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
}
.readiness-card {
  flex: 0 0 auto;
  min-width: 150px;
  max-width: 230px;
  padding: 9px 11px;
  border: 1px solid rgba(203, 215, 215, .92);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 8px 18px rgba(17, 24, 39, .045), inset 0 1px 0 rgba(255,255,255,.72);
}
.readiness-card span,
.readiness-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.readiness-card strong {
  display: block;
  margin: 3px 0 2px;
  color: var(--success);
  font-size: 15px;
  line-height: 1.25;
}
.readiness-card-warn {
  border-color: rgba(185, 125, 0, .28);
  background: rgba(255, 250, 234, .86);
}
.readiness-card-warn strong { color: #8a5a00; }
.readiness-card-error {
  border-color: rgba(180, 35, 24, .28);
  background: rgba(255, 246, 244, .86);
}
.readiness-card-error strong { color: var(--danger); }

.cleanup-panel {
  flex: 0 0 auto;
  width: fit-content !important;
  max-width: 100%;
  padding: 12px 14px;
}
.cleanup-row {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
}
.cleanup-copy h2 {
  margin: 0 0 4px;
  font-size: 16px;
  white-space: nowrap;
}
.cleanup-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.danger-lite {
  color: var(--danger);
  border-color: #f0bab2;
  background: #fffaf8;
}
.cleanup-status {
  width: max-content;
  max-width: 260px;
  color: var(--success);
  font-size: 12px;
  line-height: 1.35;
}
.cleanup-status.error { color: var(--danger); }
@media (max-width: 980px) {
  .cleanup-panel, .cleanup-row { width: 100% !important; }
  .cleanup-row { grid-template-columns: 1fr; }
}

/* Mobile customer polish */
.job-kind { min-width: 0; display: grid; gap: 2px; }
.job-kind strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-main { min-width: 0; display: grid; gap: 3px; }
.job-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-price { text-align: right; white-space: nowrap; }
.job-row .row-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.job-row-processing, .job-row-queued { border-color: rgba(218, 165, 32, .30); }
.job-row-success { border-color: rgba(12, 128, 91, .20); }
.job-row-failed { border-color: rgba(209, 58, 45, .24); }

@media (max-width: 760px) {
  .sidebar { padding: 10px 12px; }
  .sidebar-brand { margin: 0 0 10px; }
  .sidebar-brand small { display: none; }
  .nav-list { display: flex; grid-template-columns: none; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
  .nav-item { flex: 0 0 auto; width: auto; min-height: 38px; height: 38px; padding: 0 14px; white-space: nowrap; }
  .topbar { gap: 10px; }
  .account-strip { flex-direction: row; align-items: center; gap: 8px; width: 100%; }
  .account-name { min-width: 0; flex: 1 1 150px; }
  .balance-card { min-width: 0; }
  #logoutButton { min-height: 38px; padding: 0 12px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
  .stat-card { min-height: 64px; padding: 9px 10px; }
  .stat-card strong { font-size: 22px; }
  .tool-panel, .preview-panel, .table-panel, .wallet-panel { padding: 12px; }
  .panel-header { gap: 10px; }
  .mode-switch { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  textarea { min-height: 120px; }
  .option-grid { grid-template-columns: 1fr 1fr; }
  .option-grid .field:first-child { grid-column: 1 / -1; }
  .preview-frame { width: 100%; max-height: 58vh; }
  .job-row { grid-template-columns: 1fr !important; gap: 8px; align-items: start; padding: 12px; }
  .job-main .prompt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .job-main small { white-space: normal; }
  .job-price { text-align: left; }
  .job-row .status-chip { width: fit-content; max-width: 100%; white-space: normal; text-align: left; }
  .job-row .row-actions { justify-content: flex-start; }
  .wallet-layout { grid-template-columns: 1fr !important; }
  .bank-topup-card { grid-template-columns: 1fr; }
  .bank-qr { max-width: 180px; justify-self: center; }
  .tx-row { grid-template-columns: 1fr 1fr !important; gap: 6px 10px; }
}
@media (max-width: 430px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .option-grid { grid-template-columns: 1fr; }
  .account-strip { flex-wrap: wrap; }
}

/* UI screenshot overflow fixes */
.app-shell, .sidebar, .main-area, .view, .admin-dashboard, .admin-band {
  min-width: 0;
  max-width: 100%;
}
.admin-dashboard {
  overflow: hidden;
}
.admin-band {
  width: 100%;
  overflow: hidden;
}
.admin-band > .table-panel {
  min-width: 0;
  max-width: 100% !important;
}
.admin-band-health > .table-panel,
.admin-band-workers > .table-panel,
.admin-band-pricing > .table-panel {
  flex: 1 1 360px;
}
.admin-band-workers .compact-worker-panel {
  min-width: 0 !important;
}
.admin-band-workers .compact-account-list,
.health-grid,
.readiness-grid,
.flow-status,
.worker-table,
.admin-list {
  max-width: 100%;
}
.user-wallet-panel,
.wallet-audit-panel,
.system-log-panel {
  width: 100% !important;
}
.admin-user-table,
.wallet-audit-table,
.system-log-table {
  max-width: none;
}

@media (max-width: 760px) {
  html, body, .app-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .app-shell {
    display: block;
  }
  .sidebar,
  .main-area {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }
  .sidebar-brand,
  .nav-list,
  .topbar,
  .account-strip,
  .stats-grid,
  .studio-layout,
  .wallet-layout,
  .admin-dashboard,
  .admin-band,
  .tool-panel,
  .preview-panel,
  .table-panel,
  .wallet-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .nav-list {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .account-strip {
    justify-content: flex-start;
  }
  .account-name {
    max-width: 100%;
  }
  .account-name strong,
  .account-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-user-table,
  .wallet-audit-table,
  .system-log-table {
    display: grid;
  }
  .user-wallet-panel,
  .wallet-audit-panel,
  .system-log-panel {
    overflow-x: auto;
  }
}

.admin-band-audit {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}
.admin-band-audit > .table-panel,
.user-wallet-panel,
.wallet-audit-panel,
.system-log-panel {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto;
}
.system-log-table,
.wallet-audit-table,
.admin-user-table {
  width: max-content;
  max-width: none;
}
