:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #18222f;
  --muted: #6f7c8c;
  --line: #e2e8f0;
  --brand: #2f6fed;
  --brand-dark: #1f56c9;
  --green: #159a63;
  --green-bg: #e8f7ef;
  --red: #d64545;
  --red-bg: #fdecec;
  --amber: #a96d0b;
  --amber-bg: #fff5df;
  --blue-bg: #eaf1ff;
  --sidebar: #111a2b;
  --sidebar-ink: #aab6c8;
  --shadow: 0 8px 28px rgba(23, 35, 54, 0.08);
  --shadow-lg: 0 24px 70px rgba(15, 26, 44, 0.18);
  --ring: 0 0 0 3px rgba(47, 111, 237, 0.16);
  --radius-sm: 8px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
::selection { background: rgba(47, 111, 237, 0.2); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: #c6d2e2 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #c6d2e2; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #a9b9cf; background-clip: content-box; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
pre { margin: 0; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(47, 111, 237, 0.28), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(21, 154, 99, 0.18), transparent 60%),
    #0d1524;
}
.login-shell {
  width: min(980px, 100%);
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}
.login-aside {
  position: relative; padding: 40px 38px;
  background:
    radial-gradient(520px 280px at 90% 0%, rgba(106, 162, 255, 0.35), transparent 62%),
    radial-gradient(420px 260px at 0% 100%, rgba(21, 154, 99, 0.28), transparent 60%),
    linear-gradient(150deg, #0b1526, #12253f);
  color: #fff; display: flex; flex-direction: column; gap: 18px;
}
.login-aside h2 { font-size: 27px; line-height: 1.3; letter-spacing: -0.02em; }
.login-aside .login-brand { margin-bottom: 6px; }
.login-aside .login-brand h1 { color: #fff; }
.login-aside .login-brand p { color: #93a5be; }
.login-points { display: grid; gap: 12px; margin-top: 4px; }
.login-points li { position: relative; padding-left: 26px; color: #c6d4e6; font-size: 13.5px; }
.login-points li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 15px; height: 15px;
  border-radius: 50%; background: rgba(106, 162, 255, 0.18);
  border: 1px solid rgba(106, 162, 255, 0.55);
  box-shadow: inset 0 0 0 3px rgba(11, 21, 38, 1);
}
.login-proof { display: flex; gap: 30px; margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); }
.login-proof b { display: block; font-size: 23px; letter-spacing: -0.02em; }
.login-proof span { display: block; color: #8fa2bc; font-size: 11.5px; }
.login-site { color: #9fc0ff; font-size: 12.5px; }
.login-site:hover { color: #fff; }
.login-card {
  width: 100%;
  background: #fff;
  border-radius: 0;
  padding: 44px 42px;
  box-shadow: none;
  display: flex; flex-direction: column; justify-content: center;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-logo {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #5f95ff);
  color: #fff; font-weight: 800; font-size: 20px;
}
.login-brand h1 { font-size: 20px; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login-card .subtitle { color: var(--muted); margin: 0 0 22px; }
.login-tip { margin-top: 16px; color: var(--muted); font-size: 12px; text-align: center; }

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #6ba0ff);
  color: #fff; font-weight: 800;
}
.brand strong { display: block; color: #fff; font-size: 15px; }
.brand span { display: block; font-size: 11px; color: #7f8ea6; }
.nav { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--sidebar-ink); font-size: 13.5px;
  position: relative; transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(47, 111, 237, 0.35); }
.nav .ico { width: 18px; height: 18px; display: grid; place-items: center; opacity: 0.85; flex: 0 0 auto; }
.nav .ico svg { width: 16px; height: 16px; }
.nav a.active .ico { opacity: 1; }
.nav-group { margin: 14px 10px 4px; font-size: 10.5px; letter-spacing: 0.12em; color: #59677d; text-transform: uppercase; }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-parent {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: 0; border-radius: 9px; background: transparent;
  color: var(--sidebar-ink); font: inherit; font-size: 13px; font-weight: 600;
  text-align: left; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-parent:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-parent .ico { width: 18px; height: 18px; display: grid; place-items: center; opacity: 0.8; flex: 0 0 auto; }
.nav-parent .ico svg { width: 16px; height: 16px; }
.nav-parent-label { flex: 1; min-width: 0; }
.nav-parent .chev { width: 14px; height: 14px; display: grid; place-items: center; color: #6f7f96; transition: transform 0.18s ease; }
.nav-parent .chev svg { width: 14px; height: 14px; }
.nav-parent[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, 0.05); }
.nav-parent[aria-expanded="true"] .chev { transform: rotate(90deg); color: #9fb0c9; }
.nav-section.has-active .nav-parent { color: #fff; }
.nav-section.has-active .nav-parent .ico { opacity: 1; }
.nav-sub {
  display: flex; flex-direction: column; gap: 2px;
  margin: 0 0 4px 20px; padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-sub[hidden] { display: none; }
.nav a.nav-sublink { padding: 7px 9px; font-size: 12.5px; }
.nav a.nav-sublink .ico { width: 16px; height: 16px; }
.nav a.nav-sublink .ico svg { width: 15px; height: 15px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 4px; font-size: 11px; color: #68768c; border-top: 1px solid rgba(255,255,255,0.07); display: grid; gap: 4px; }
.sidebar-foot a { color: #9fb0c9; }
.sidebar-foot a:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 26px; background: rgba(255,255,255,0.85);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.menu-toggle {
  display: none; width: 38px; height: 38px; flex: 0 0 auto;
  align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.menu-toggle:hover { background: #f5f8fc; border-color: #cfdaea; }
.menu-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.menu-toggle svg { width: 20px; height: 20px; }
.menu-close {
  display: none; margin-left: auto; width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px;
  background: rgba(255, 255, 255, 0.06); color: #cbd6e6; cursor: pointer;
}
.menu-close svg { width: 16px; height: 16px; }
.menu-close:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(107, 160, 255, 0.4); }
.nav-backdrop { display: none; }
.topbar-title { font-size: 13px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-hint { font-size: 11.5px; color: #9aa7b8; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; background: #f8fafc; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.user-chip:hover { border-color: #c9d4e2; background: #f8fafc; }
.user-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.user-chip .chevron { width: 14px; height: 14px; color: var(--muted); transition: transform 0.18s ease; }
.user-menu.open .user-chip .chevron { transform: rotate(180deg); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 164px; padding: 6px; display: grid; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 42px rgba(15, 23, 37, 0.16);
}
.user-dropdown[hidden] { display: none; }
.user-dropdown button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.user-dropdown button:hover { background: #f4f8fd; }
.user-dropdown button.danger-text:hover { background: var(--red-bg); color: var(--red); }
.user-dropdown .menu-ico { width: 15px; height: 15px; color: var(--muted); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-bg); color: var(--brand); font-weight: 700; font-size: 12px; }
.tenant-pill { padding: 5px 11px; border-radius: 999px; background: var(--blue-bg); color: var(--brand); font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.view { padding: 26px; max-width: 1500px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 15px; }
.card-head span { color: var(--muted); font-size: 12px; }
.card-body { padding: 18px; }

.stat { padding: 18px; display: flex; flex-direction: column; gap: 7px; min-height: 118px; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.stat-sub { color: var(--muted); font-size: 12px; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.amber { color: var(--amber); }

.table-wrap { overflow: auto; max-height: 62vh; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap thead th { position: sticky; top: 0; z-index: 3; }
th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--line);
}
td { padding: 12px 14px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #fcfdff; }
tbody tr:hover td { background: #f5f9ff; }
tbody tr { transition: background 0.12s ease; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.strong { font-weight: 650; }
.money, .stat-value, td.right, .mono, .usage-top b, .plan-card-price b { font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef2f7; color: #526173; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.blue { background: var(--blue-bg); color: var(--brand); }
.badge.muted { background: #eef2f7; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: all 0.15s ease; white-space: nowrap;
}
.btn:hover { border-color: #c9d4e2; background: #f8fafc; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--red); border-color: #f2c7c7; background: var(--red-bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 5px 7px; }
.btn.small { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
  background: #fff; color: var(--ink); outline: none; min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input:hover { border-color: #cfd9e6; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.13); }
textarea.input { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; }
.toolbar .input { min-width: 150px; }
.check { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--ink); border-color: #c7d2e0; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(47, 111, 237, 0.28); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-error { color: var(--red); font-size: 12.5px; margin-top: 8px; }

.progress { height: 8px; border-radius: 999px; background: #edf1f6; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #6ba0ff); }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.empty { padding: 38px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.loading { padding: 60px 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2px solid #dfe6ef; border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 15, 28, 0.52); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn 0.16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(680px, 100%); max-height: calc(100vh - 40px);
  background: #fff; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,0.3);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal.wide { width: min(920px, 100%); }
.modal header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal header h3 { font-size: 17px; }
.modal header button { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fbfcfe; }
.modal-section { margin-bottom: 18px; }
.modal-section h4 { font-size: 13px; margin-bottom: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.toast-wrap { position: fixed; right: 20px; top: 76px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 240px; max-width: 420px; padding: 12px 14px; border-radius: 10px;
  background: #18222f; color: #fff; box-shadow: 0 12px 34px rgba(0,0,0,0.22);
  font-size: 13px; animation: toastIn 0.2s ease;
  display: flex; align-items: flex-start; gap: 9px; pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.leaving { opacity: 0; transform: translateY(-6px); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: #9fb0c9; margin-top: 6px; flex: 0 0 auto; }
.toast.ok .toast-dot { background: #48d29e; }
.toast.err .toast-dot { background: #ff8080; }
.toast-text { line-height: 1.45; }
.toast.ok { background: #0f7d52; }
.toast.err { background: #b73636; }
@keyframes toastIn { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

.cards-list { display: flex; flex-direction: column; gap: 10px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef2f7; }
.list-row:last-child { border-bottom: 0; }
.list-row .name { font-weight: 600; }
.list-row .meta { color: var(--muted); font-size: 12px; }

.adapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.adapter-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.adapter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.adapter-head h4 { font-size: 15px; margin: 0; letter-spacing: 0.04em; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.adapter-head h4 .adapter-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); background: #f1f3f7; border-radius: 4px; padding: 1px 5px; }
.adapter-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.adapter-meta { display: grid; gap: 7px; font-size: 12.5px; color: var(--muted); }
.adapter-meta b { color: var(--ink); font-weight: 600; }
.adapter-meta .sep { margin: 0 6px; }
.adapter-config { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.cfg.ok { color: var(--green); border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.08); }
.cfg.miss { color: var(--muted); background: #f8fafc; }
.adapter-host { font-size: 12px; color: var(--muted); }
.adapter-host b { color: var(--ink); font-weight: 600; }
.adapter-methods { border-top: 1px dashed var(--line); padding-top: 8px; }
.adapter-methods-title { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.adapter-methods ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 132px; overflow-y: auto; }
.adapter-methods li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.adapter-methods .arrow { color: var(--muted); }
.adapter-methods .act { color: var(--ink); }
.adapter-methods .mth { color: var(--brand); }
.adapter-pending { border-top: 1px dashed var(--line); padding-top: 8px; font-size: 12px; color: var(--muted); }
.adapter-pending .mono { color: var(--ink); }
.adapter-card > .adapter-actions { margin-top: auto; }
.adapter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sim-method { font-size: 12.5px; color: var(--muted); }
.sim-method .mono { color: var(--brand); }
.cfg-note { display: grid; gap: 4px; font-size: 12.5px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.modal footer .spacer { flex: 1; }
.test-result { border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.test-result.ok { background: var(--green-bg); color: var(--green); }
.test-result.err { background: var(--red-bg); color: var(--red); }

.slo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.slo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.slo-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.slo-metric { background: #f8fafc; border-radius: 10px; padding: 10px 12px; }
.slo-metric .k { color: var(--muted); font-size: 11.5px; }
.slo-metric .v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.json { background: #0f1725; color: #d7e2f1; border-radius: 10px; padding: 14px; overflow: auto; font-size: 12px; line-height: 1.6; max-height: 520px; }

@media (max-width: 1100px) {
  .wb-two-col { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  .menu-close { display: inline-flex; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: min(84vw, 300px); height: 100vh;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    padding: 18px 14px; overflow-y: auto; overflow-x: hidden;
    transform: translateX(-100%); pointer-events: none;
    transition: transform 0.24s ease;
    z-index: 60; box-shadow: 24px 0 60px rgba(8, 14, 25, 0.32);
  }
  .sidebar.open { transform: translateX(0); pointer-events: auto; }
  .brand { padding: 2px 4px 16px; align-items: center; }
  .nav { flex-direction: column; flex-wrap: nowrap; overflow-y: auto; overflow-x: hidden; gap: 3px; }
  .nav-group { display: block; }
  .nav a { flex: 0 0 auto; }
  .sidebar-foot { display: grid; margin-top: auto; }
  .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(13, 22, 38, 0.48); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity 0.24s ease, visibility 0.24s ease;
  }
  .nav-backdrop.open { opacity: 1; visibility: visible; }
  body.nav-open { overflow: hidden; }
  .view { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
}

/* ---------- loading skeleton ---------- */
.skeleton-page { display: grid; gap: 14px; padding-top: 6px; }
.sk {
  border-radius: 10px;
  background: linear-gradient(100deg, #eef2f8 20%, #f8fafd 40%, #eef2f8 60%);
  background-size: 220% 100%;
  animation: shimmer 1.25s linear infinite;
}
.sk-title { width: 220px; height: 26px; }
.sk-sub { width: 380px; max-width: 70%; height: 13px; }
.sk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 6px 0; }
.sk-card { height: 112px; border-radius: 14px; }
.sk-table { height: 320px; border-radius: 14px; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---------- empty ---------- */
.empty { padding: 42px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-ico { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #f1f5fa; color: #9aa9bd; margin-bottom: 10px; }
.empty-ico svg { width: 23px; height: 23px; }
.empty p { margin: 0; }

/* ---------- quota banner ---------- */
.quota-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border: 1px solid rgba(47, 111, 237, 0.22);
  background:
    radial-gradient(420px 180px at 92% 0%, rgba(47, 111, 237, 0.12), transparent 70%),
    linear-gradient(120deg, #f7faff, #ffffff);
  border-radius: 14px; padding: 16px 20px; margin-bottom: 16px;
}
.quota-banner.warning { border-color: rgba(169, 109, 11, 0.32); background: linear-gradient(120deg, #fffaf0, #fff); }
.quota-banner.critical { border-color: rgba(214, 69, 69, 0.36); background: linear-gradient(120deg, #fff5f5, #fff); }
.qb-main { min-width: 240px; }
.qb-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.qb-trial { font-size: 11.5px; color: var(--amber); background: var(--amber-bg); border-radius: 99px; padding: 3px 9px; font-weight: 600; }
.quota-banner h3 { font-size: 16px; }
.quota-banner p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.qb-side { display: flex; align-items: center; gap: 14px; }
.qb-bar { width: 150px; height: 8px; border-radius: 99px; background: #e8eef7; overflow: hidden; }
.qb-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #6ba0ff); transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.quota-banner.warning .qb-bar span { background: linear-gradient(90deg, #d99b2b, #f0bf62); }
.quota-banner.critical .qb-bar span { background: linear-gradient(90deg, #c93b3b, #ef7777); }

/* ---------- trial ---------- */
.trial-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(120deg, #0d1728, #16294a); color: #fff;
  border-radius: 12px; padding: 13px 18px; margin-bottom: 16px;
}
.trial-banner b { display: inline-block; margin-right: 10px; color: #a8c6ff; }
.trial-banner span { color: #b7c6da; font-size: 12.5px; }
.trial-banner.warning { background: linear-gradient(120deg, #3a2a0c, #57400f); }
.trial-banner.warning b { color: #f3cd7a; }
.trial-banner.danger { background: linear-gradient(120deg, #3a1111, #5a1c1c); }
.trial-banner.danger b { color: #ff9a9a; }

#view .sub-manage { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sub-manage-info { display: flex; gap: 28px; flex-wrap: wrap; }
.sub-manage-info > div { display: flex; flex-direction: column; gap: 4px; }
.sub-manage-info .muted { font-size: 11.5px; }
.sub-manage-info b { font-size: 13.5px; }

/* ---------- usage ---------- */
.usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.usage-item { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fff; }
.usage-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.usage-top b { color: var(--ink); font-size: 14px; }
.usage-top em { font-style: normal; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.usage-bar { height: 7px; border-radius: 99px; background: #edf1f7; overflow: hidden; margin: 9px 0 7px; }
.usage-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #6ba0ff); transition: width 0.5s ease; }
.usage-item.warning .usage-bar span { background: linear-gradient(90deg, #d99b2b, #f0bf62); }
.usage-item.critical .usage-bar span { background: linear-gradient(90deg, #c93b3b, #ef7777); }
.usage-item.unlimited .usage-bar span { opacity: 0.28; }
.usage-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.usage-pct { font-weight: 700; color: var(--ink); }
.usage-item.warning .usage-pct { color: var(--amber); }
.usage-item.critical .usage-pct { color: var(--red); }

/* ---------- trend ---------- */
.trend-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trend-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.lg.orders { background: var(--brand); }
.lg.api { background: #5fd0a5; }
.trend-plot { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 180px; align-items: end; }
.trend-col { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; height: 100%; text-align: center; }
.trend-col > span { font-size: 11px; color: var(--muted); }
.trend-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.tb { width: 33%; border-radius: 4px 4px 2px 2px; min-height: 4px; transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.tb.orders { background: linear-gradient(180deg, #6ba0ff, var(--brand)); }
.tb.api { background: linear-gradient(180deg, #8ee0bf, #28b98a); }
.trend-col:hover .tb { filter: brightness(1.06); }

/* ---------- cycle toggle ---------- */
.cycle-toggle { display: inline-flex; gap: 4px; padding: 4px; background: #eef2f8; border-radius: 10px; }
.cycle-btn {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.cycle-btn:hover { color: var(--ink); }
.cycle-btn.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(23, 35, 54, 0.1); }

/* ---------- plan compare ---------- */
.plan-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card {
  border: 1px solid var(--line); border-radius: 13px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-card.featured { border-color: rgba(47, 111, 237, 0.38); }
.plan-card.current { border-color: rgba(21, 154, 99, 0.5); background: linear-gradient(180deg, #f6fdf9, #fff 50%); }
.plan-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.plan-card-head h4 { font-size: 15px; }
.plan-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; max-width: 190px; }
.plan-card-price { display: flex; align-items: baseline; gap: 4px; }
.plan-card-price b { font-size: 25px; letter-spacing: -0.03em; }
.plan-card-price span { color: var(--muted); font-size: 12px; }
.plan-card-limits { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.plan-card-limits span { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; background: #f7f9fc; border-radius: 8px; padding: 6px 8px; font-size: 11.5px; font-weight: 600; }
.plan-card-limits em { font-style: normal; color: var(--muted); font-weight: 500; }
.plan-card .btn { margin-top: auto; width: 100%; }
.plan-switch-note { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.plan-switch-note .spacer { flex: 1; }

/* ---------- modal options ---------- */
.option-list { display: grid; gap: 9px; }
.option-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 11px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option-row:hover { border-color: #c9d4e2; background: #fbfcfe; }
.option-row.is-current, .option-row:has(input:checked) { border-color: rgba(47, 111, 237, 0.45); background: #f7faff; }
.option-row input { accent-color: var(--brand); }
.option-main { flex: 1; min-width: 0; }
.option-main b { display: block; font-size: 13.5px; }
.option-main small { display: block; color: var(--muted); font-size: 11.5px; }
.option-price { text-align: right; font-weight: 700; font-size: 15px; }
.option-price small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.quota-block { max-width: 640px; }

/* ---------- workbench ---------- */
.wb-card { margin-bottom: 16px; }
.wb-head-actions { display: flex; align-items: center; gap: 8px; }
.wb-shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 16px 8px; padding: 4px 0; }
.wb-shortcut {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 4px 2px; border: 0; border-radius: 12px; background: none;
  color: var(--ink); font: inherit; text-align: center; text-decoration: none; cursor: pointer;
}
.wb-shortcut:hover .wb-shortcut-ico { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(21, 39, 66, 0.16); }
.wb-shortcut-ico {
  width: 52px; height: 52px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 14px rgba(21, 39, 66, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.wb-shortcut-ico svg { width: 24px; height: 24px; }
.wb-shortcut-label { font-size: 12px; line-height: 1.35; max-width: 96px; }
.tone-0 { background: linear-gradient(135deg, #ffb15c, #ff8a3d); }
.tone-1 { background: linear-gradient(135deg, #5f9cff, #2f6fed); }
.tone-2 { background: linear-gradient(135deg, #ff8a80, #e85454); }
.tone-3 { background: linear-gradient(135deg, #ff9bc4, #ec5f9b); }
.tone-4 { background: linear-gradient(135deg, #67c8a5, #2f9e7b); }
.tone-5 { background: linear-gradient(135deg, #a98bff, #7556e8); }
.wb-add-ico {
  background: #fff; border: 1px dashed #c9d4e2; color: #93a1b3;
  box-shadow: none; font-size: 26px; font-weight: 300;
}
.wb-shortcut-add:hover .wb-add-ico { border-color: #9aa7b8; color: var(--brand); }
.wb-two-col { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.wb-list { display: grid; }
.wb-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.wb-item:first-child { padding-top: 2px; }
.wb-item:last-child { border-bottom: 0; padding-bottom: 0; }
.wb-item-main { min-width: 0; }
.wb-item-main b { font-size: 13px; }
.wb-item-main p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-item-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #8c9bb1; font-size: 11.5px; }
.wb-item-meta .badge { font-size: 10.5px; }
.wb-news-list { display: grid; gap: 12px; }
.wb-news { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.wb-news:last-child { border-bottom: 0; padding-bottom: 0; }
.wb-news-thumb {
  height: 54px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6d5efc, #9a4dff); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
}
.wb-news-main { min-width: 0; }
.wb-news-main b { display: block; font-size: 12.5px; }
.wb-news-main p {
  margin: 3px 0; color: var(--muted); font-size: 11.5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wb-news-main small { color: #8c9bb1; font-size: 11px; }
.wb-promo {
  min-height: 190px; padding: 18px; border-radius: 12px; color: #fff;
  display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(135deg, #111c33, #274b8f 60%, #2f6fed);
}
.wb-promo-tag { align-self: flex-start; padding: 2px 8px; border-radius: 4px; background: #ffce4a; color: #4a3200; font-size: 10.5px; font-weight: 800; }
.wb-promo h4 { font-size: 18px; line-height: 1.35; color: #fff; }
.wb-promo p { color: rgba(255, 255, 255, 0.78); font-size: 12px; line-height: 1.6; }
.wb-promo-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.wb-promo-actions a { padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 8px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 11.5px; }
.wb-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wb-link {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfe; color: var(--ink);
}
.wb-link:hover { border-color: #c9d4e2; background: #f6f9fd; }
.wb-link-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; background: rgba(109, 94, 252, 0.12); color: #5b4bdb; }
.wb-link-ico svg { width: 16px; height: 16px; }
.wb-link-main { min-width: 0; }
.wb-link-main b { display: block; font-size: 12.5px; }
.wb-link-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 12px; flex-wrap: wrap; }
.wb-section-head h2 { font-size: 17px; }
.wb-section-head span { color: var(--muted); font-size: 12px; }
.wb-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; padding-right: 2px; }
.wb-pick { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.wb-pick:hover { border-color: #c9d4e2; background: #fbfcfe; }
.wb-pick input { accent-color: var(--brand); }
.wb-pick span { min-width: 0; }
.wb-pick b { display: block; font-size: 12.5px; }
.wb-pick small { display: block; color: var(--muted); font-size: 10.5px; }

/* ---------- responsive additions ---------- */
@media (max-width: 1100px) {
  .plan-compare { grid-template-columns: 1fr; }
  .trend-plot { height: 150px; }
}
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; width: min(440px, 100%); }
  .login-aside { display: none; }
  .login-card { padding: 32px 26px; }
  .topbar-hint { display: none; }
  .qb-side { width: 100%; }
  .qb-bar { flex: 1; }
  .usage-grid { grid-template-columns: 1fr; }
  .sk-grid { grid-template-columns: 1fr; }
  .table-wrap { max-height: 70vh; }
}
@media (max-width: 520px) {
  .wb-shortcut-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wb-links, .wb-picker { grid-template-columns: 1fr; }
  .topbar-title { display: none; }
  .quota-banner { padding: 14px; }
  .stat-value { font-size: 24px; }
  .modal { border-radius: 14px; }
  .modal-body { padding: 16px; }
}

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

@media (max-width: 640px) {
  .tenant-pill { display: none; }
  .topbar-hint { display: none; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-left { gap: 10px; }
  .topbar-right { gap: 8px; }
  #global-refresh { display: none; }
  .user-chip { padding: 5px 9px; gap: 7px; }
}

/* ---------- products & retail ---------- */
.modal.xl { width: min(1180px, 100%); }
.req { color: var(--red); font-style: normal; margin-right: 3px; font-weight: 700; }
.green { color: var(--green); }
.violet { color: #7c4dff; }
.danger-text { color: var(--red); }
.btn.ghost.danger-text:hover { background: var(--red-bg); color: var(--red); }
.input.right, select.input.right { text-align: right; }
.input.compact { padding: 5px 8px; font-size: 12.5px; border-radius: 7px; }
.cb { width: 36px; text-align: center; }
.cb input[type="checkbox"] { accent-color: var(--brand); cursor: pointer; }

.product-form { display: flex; flex-direction: column; }
.product-tabs { margin-bottom: 16px; }
.product-pane { min-height: 150px; }
.product-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-form .form-grid .wide { grid-column: 1 / -1; }

.barcode-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.barcode-actions, .retail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.barcode-actions .spacer { flex: 1; }
.barcode-wrap { max-height: 300px; border: 1px solid var(--line); border-radius: 10px; }
.barcode-table { min-width: 900px; }
.barcode-table th, .barcode-table td { padding: 6px 8px; }
.barcode-table td .input { width: 100%; min-width: 84px; padding: 6px 8px; font-size: 12.5px; }

.retail-form { display: flex; flex-direction: column; gap: 16px; }
.retail-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.retail-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.retail-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.retail-actions { margin-bottom: 0; }
.scan-box { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.scan-box .input { flex: 1; }
.retail-table { max-height: 46vh; border: 1px solid var(--line); border-radius: 10px; }
.retail-table table { min-width: 1000px; }
.retail-table th, .retail-table td { padding: 7px 9px; }
.retail-table td .input.compact { width: 100%; min-width: 64px; }
.retail-dim { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.retail-name b { display: block; font-weight: 600; }
.retail-name .stat-sub { margin-top: 2px; }
.retail-summary-line { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12.5px; padding: 2px 2px 0; }
.retail-summary-line b { color: var(--ink); font-size: 14px; }
.retail-side {
  display: flex; flex-direction: column; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe;
  position: sticky; top: 0;
}
.retail-amount { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.retail-amount b { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.retail-amount b.violet { font-size: 22px; letter-spacing: -0.02em; }
.retail-amount .input { width: 120px; }
.retail-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.attachment-field .btn-row { align-items: center; }
.attachment-field .link[hidden] { display: none; }

.unit-row { display: flex; align-items: center; gap: 10px; }
.unit-row .input { flex: 1 1 auto; min-width: 0; }
.check-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.check-inline input[type="checkbox"] { accent-color: var(--brand); cursor: pointer; }

.product-remark { margin-top: 12px; }
.barcode-pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.barcode-pager .muted { margin-left: 6px; }

.upload-panel { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.upload-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 26px 18px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: #f8fafd; color: var(--muted); cursor: pointer; text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.upload-drop:hover, .upload-drop.dragover { border-color: var(--brand); background: var(--blue-bg); }
.upload-drop b { color: var(--ink); font-size: 13.5px; }
.upload-drop small { font-size: 12px; color: var(--muted); }
.upload-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 22px; line-height: 34px; margin-bottom: 4px; }
.upload-url { display: flex; gap: 8px; }
.upload-url .input { flex: 1 1 auto; }

.image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 8px; }
.image-card { position: relative; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.image-card.primary { border-color: var(--brand); box-shadow: var(--ring); }
.image-card img { display: block; width: 100%; height: 110px; object-fit: cover; background: #eef2f7; }
.image-card figcaption { display: flex; gap: 4px; padding: 6px; justify-content: flex-end; flex-wrap: wrap; }
.image-card figcaption .btn.small { padding: 2px 8px; font-size: 12px; }
.image-badge { position: absolute; top: 6px; left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; }
.image-empty { grid-column: 1 / -1; padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-sm); font-size: 12.5px; }

@media (max-width: 1100px) {
  .product-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retail-body { grid-template-columns: 1fr; }
  .retail-side { position: static; }
  .retail-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .product-form .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .retail-head, .retail-foot { grid-template-columns: 1fr; }
  .scan-box { min-width: 100%; }
}

/* 销售模块：客户、报价与其他收款 */
.sales-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sales-form .form-grid .wide { grid-column: 1 / -1; }
.sales-form .form-error { margin: 12px 0 0; }
.sales-table { max-height: 46vh; }
.sales-table .input.compact { min-width: 78px; }
.sales-total-line { display: flex; gap: 24px; justify-content: flex-end; align-items: center; padding: 12px 6px 0; color: var(--muted); }
.sales-total-line b { color: var(--violet); font-size: 16px; margin-left: 6px; }
.modal-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.modal-section-head h4 { margin: 0; }
.center { text-align: center; }
@media (max-width: 1100px) {
  .sales-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .sales-form .form-grid { grid-template-columns: 1fr; }
  .sales-total-line { flex-direction: column; align-items: flex-end; gap: 6px; }
}
.tenant-cell { display: flex; flex-direction: column; gap: 2px; }
.tenant-cell .mono { font-size: 11px; color: var(--muted); }

/* 资金账户与仓库经营报表 */
.form-section-title { margin: 18px 0 10px; padding-left: 9px; border-left: 3px solid var(--brand); font-size: 14px; font-weight: 700; color: var(--text); }
.report-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.chart-card .card-body { padding: 8px 12px 14px; }
.chart-card canvas { display: block; width: 100%; }
.account-balance { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) {
  .report-charts { grid-template-columns: 1fr; }
}

/* ---------- workbench responsive overrides ---------- */
@media (max-width: 1100px) {
  .wb-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .wb-shortcut-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wb-links, .wb-picker { grid-template-columns: 1fr; }
  .wb-shortcut-ico { width: 46px; height: 46px; border-radius: 12px; }
  .wb-shortcut-ico svg { width: 21px; height: 21px; }
  .wb-shortcut-label { font-size: 11.5px; }
  .wb-news { grid-template-columns: 52px minmax(0, 1fr); }
  .wb-news-thumb { height: 46px; font-size: 10px; }
}

/* ---------- purchase & production ---------- */
.items-editor { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.items-editor .table-wrap { max-height: 340px; overflow: auto; }
.items-editor table { min-width: 560px; }
.items-editor th, .items-editor td { padding: 8px; }
.items-editor td .input { width: 100%; min-width: 96px; }
.items-editor-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); background: #fafcff; }
.items-editor-foot .muted { font-size: 12px; }
.mini-progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mini-progress .progress { flex: 1; margin: 0; }
.mini-progress span { font-size: 12px; white-space: nowrap; }
tr.row-best { background: var(--green-bg); }
tr.row-best td { font-weight: 600; }
