:root {
  --bg: #eef4f7;
  --surface: rgba(255, 255, 255, 0.68);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --line: rgba(126, 148, 161, 0.24);
  --text: #18242b;
  --muted: #6a7b86;
  --green: #20b15a;
  --green-soft: rgba(32, 177, 90, 0.12);
  --red: #e5484d;
  --red-soft: rgba(229, 72, 77, 0.1);
  --yellow: #b7791f;
  --blue: #2878d9;
  --shadow: 0 18px 48px rgba(61, 88, 102, 0.14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(74, 222, 128, 0.22), transparent 34rem),
    radial-gradient(circle at 80% 0%, rgba(125, 211, 252, 0.22), transparent 32rem),
    linear-gradient(135deg, #f8fbfc, var(--bg));
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
}
.hidden { display: none !important; }
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(135%);
}
.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}
.login-box {
  border-radius: 16px;
  max-width: 420px;
  padding: 26px;
  width: 100%;
}
.login-mark {
  align-items: center;
  background: linear-gradient(135deg, #1fb957, #0b7d35);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(32, 177, 90, 0.24);
  color: #fff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: 0;
  margin-bottom: 14px;
  width: 42px;
}
.login-box p { color: var(--muted); }
.app {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  min-height: 100vh;
}
aside {
  border-right: 1px solid var(--line);
  height: 100vh;
  overflow: auto;
  padding: 16px 12px;
  position: sticky;
  top: 0;
}
main {
  min-width: 0;
  padding: 18px;
}
.brand { margin-bottom: 18px; }
h1 {
  color: #0f7e3b;
  font-size: 17px;
  letter-spacing: 0;
  margin: 0 0 4px;
}
h2 {
  color: #14232b;
  font-size: 16px;
  margin: 0;
}
.muted,
.small,
.empty {
  color: var(--muted);
  font-size: 12px;
}
.status { color: var(--muted); margin: 10px 0; }
.tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.tab {
  justify-content: flex-start;
  margin: 0;
  width: 100%;
}
.tab.active {
  background: var(--green-soft);
  border-color: rgba(32, 177, 90, 0.42);
  color: #0d8b43;
}
.summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin-bottom: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(61, 88, 102, 0.1);
  padding: 12px 14px;
}
.stat-card b {
  color: #0d8b43;
  display: block;
  font-size: 22px;
  line-height: 1.1;
}
.stat-card span {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.top-actions {
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 0.9fr) minmax(320px, 1fr);
}
.compact-grid { margin: 0; }
.panel {
  border-radius: 16px;
  padding: 16px;
}
.section-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}
label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin: 8px 0 5px;
}
textarea,
input,
select {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(126, 148, 161, 0.3);
  border-radius: 10px;
  color: var(--text);
  outline: none;
  padding: 10px 12px;
  width: 100%;
}
textarea:focus,
input:focus,
select:focus {
  border-color: rgba(32, 177, 90, 0.6);
  box-shadow: 0 0 0 3px rgba(32, 177, 90, 0.12);
}
textarea {
  font-family: Consolas, "Courier New", monospace;
  min-height: 112px;
  resize: vertical;
}
.task-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.6fr) 100px;
}
.task-form button,
.task-form select { grid-column: span 1; }
.task-form select { grid-column: 1 / -1; }
.external-pay-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.external-pay-form input,
.external-pay-form select { grid-column: 1 / -1; }
.external-pay-form button { grid-column: 1 / -1; }
.external-order-summary {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(32, 177, 90, 0.24);
  border-radius: 10px;
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 10px 12px;
}
.external-order-summary div {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.external-order-summary b { overflow-wrap: anywhere; text-align: right; }
.saved-product-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 72px 72px;
  margin-bottom: 8px;
}
.saved-product-row button {
  min-height: 36px;
  padding: 6px 10px;
}
.user-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
button,
.buttonlike {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(126, 148, 161, 0.32);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  text-align: center;
  text-decoration: none;
}
button:hover,
.buttonlike:hover { border-color: rgba(32, 177, 90, 0.5); }
button.primary {
  background: linear-gradient(180deg, rgba(49, 196, 107, 0.92), rgba(26, 154, 75, 0.92));
  border-color: rgba(15, 128, 60, 0.35);
  color: white;
}
button.compact { margin-top: 10px; width: auto; }
button.danger {
  background: var(--red-soft);
  border-color: rgba(229, 72, 77, 0.34);
  color: var(--red);
}
button.slim,
.slim-link {
  min-height: 32px;
  padding: 6px 10px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.choice-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
.choice {
  align-items: start;
  display: grid;
  gap: 7px;
  justify-content: stretch;
  min-height: 74px;
  text-align: left;
}
.choice b {
  color: #0c8b43;
  line-height: 1.35;
}
.choice span { color: var(--muted); }
.table-wrap {
  overflow: auto;
  width: 100%;
}
.data-table {
  border-collapse: collapse;
  min-width: 920px;
  table-layout: fixed;
  width: 100%;
}
.account-table { min-width: 1180px; }
.users-table { min-width: 640px; }
.account-table th:nth-child(1),
.account-table td:nth-child(1) { width: 42px; }
.account-table th:nth-child(2),
.account-table td:nth-child(2) { width: 230px; }
.account-secret-line {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-search input {
  min-width: 260px;
}
.account-table th:nth-child(3),
.account-table td:nth-child(3),
.account-table th:nth-child(4),
.account-table td:nth-child(4) { width: 84px; }
.account-table th:nth-child(5),
.account-table td:nth-child(5),
.account-table th:nth-child(6),
.account-table td:nth-child(6),
.account-table th:nth-child(7),
.account-table td:nth-child(7),
.account-table th:nth-child(8),
.account-table td:nth-child(8) { width: 92px; }
.account-table th:nth-child(7),
.account-table td:nth-child(7),
.account-table th:nth-child(8),
.account-table td:nth-child(8) { white-space: nowrap; }
.account-table th:nth-child(9),
.account-table td:nth-child(9) { width: 100px; }
.account-table th:nth-child(10),
.account-table td:nth-child(10) { width: 120px; }
.account-table th:nth-child(11),
.account-table td:nth-child(11) { width: 145px; }
.account-table th:nth-child(12),
.account-table td:nth-child(12) { width: 92px; }
.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  color: #637580;
  font-size: 12px;
  font-weight: 800;
}
.table-sort {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  font-size: inherit;
  justify-content: flex-start;
  min-height: 26px;
  padding: 3px 5px;
  white-space: nowrap;
}
.table-sort:hover,
.table-sort.active {
  background: var(--green-soft);
  color: #0d8b43;
}
.data-table td { font-size: 12px; }
.data-table b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table small.note { color: var(--yellow); }
.account-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.account-filter {
  display: grid;
  gap: 4px;
  min-width: 150px;
}
.account-filter label,
.account-count {
  color: var(--muted);
  font-size: 11px;
}
.account-filter select {
  min-height: 34px;
  padding: 6px 10px;
}
.account-count {
  margin-left: auto;
  padding-bottom: 8px;
}
.account-email b {
  max-width: 230px;
}
.account-actions {
  overflow: visible;
}
.action-menu {
  position: relative;
  width: max-content;
}
.action-menu summary {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  padding: 7px 10px;
}
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu[open] summary {
  border-color: var(--green);
  color: var(--green);
}
.action-menu-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 6px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: 34px;
  width: 116px;
  z-index: 20;
}
.action-menu-list button {
  justify-content: center;
  margin: 0;
  width: 100%;
}
.money,
.ok {
  color: #0d8b43;
  font-weight: 800;
}
.warn { color: var(--yellow); }
.status-pill {
  background: var(--green-soft);
  border-radius: 999px;
  color: #0d8b43;
  display: inline-flex;
  font-weight: 800;
  padding: 4px 9px;
}
.status-pill.bad {
  background: var(--red-soft);
  color: var(--red);
}
.status-pill.running {
  background: rgba(40, 120, 217, 0.12);
  color: var(--blue);
}
.task-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
}
.task-filter {
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--line);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  justify-content: center;
  min-width: 112px;
  padding: 8px 11px;
}
.task-filter span {
  background: var(--green-soft);
  border-radius: 999px;
  color: #0d8b43;
  font-size: 12px;
  font-weight: 800;
  min-width: 24px;
  padding: 3px 8px;
  text-align: center;
}
.task-filter.active {
  background: var(--green-soft);
  border-color: var(--green);
  color: #087c3b;
}
.task-filter.failed span {
  background: var(--red-soft);
  color: var(--red);
}
.task-filter.failed.active {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}
.task-table-wrap { border-radius: 10px; }
.task-empty {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 54px;
}
pre {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #0d8b43;
  font-family: Consolas, "Courier New", monospace;
  min-height: 180px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}
.events {
  display: grid;
  gap: 7px;
  max-height: 300px;
  overflow: auto;
}
.event {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
  padding: 8px 10px;
}
.event.ok { color: #0d8b43; }
.event.error { color: var(--red); }
.meta {
  color: var(--yellow);
  display: block;
}
.pin-page { min-height: calc(100vh - 130px); }
.pin-text {
  color: #0d8b43;
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
}
.proxy-card {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
}
.proxy-card.compact-proxy {
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px 12px;
}
.proxy-summary {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1.4fr) repeat(5, minmax(96px, 0.72fr)) auto;
}
.proxy-summary b {
  color: #0d8b43;
  display: block;
  font-size: 13px;
}
.proxy-summary small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proxy-summary span {
  color: var(--muted);
  font-size: 12px;
}
.proxy-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.proxy-main {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.5fr);
}
.proxy-main b {
  color: #0d8b43;
  display: block;
  font-size: 14px;
}
.proxy-main small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.proxy-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.proxy-stats span {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.proxy-error {
  border-left: 3px solid var(--red);
  color: var(--red);
  padding-left: 8px;
}
.proxy-accounts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.proxy-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  max-height: min(62vh, 560px);
  overflow: auto;
  padding-right: 4px;
}
.checkline {
  align-items: center;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 8px;
}
.checkline input { width: auto; }
.checkline span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.big-empty { min-height: 340px; }
.modal {
  align-items: center;
  background: rgba(216, 228, 235, 0.72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 50;
}
.modal-box {
  border-radius: 16px;
  max-width: 560px;
  padding: 18px;
  width: 100%;
}
.modal-box.wide-modal {
  max-width: 820px;
}
.system-dialog-box {
  max-width: 430px;
  text-align: center;
}
.system-dialog-icon {
  align-items: center;
  background: rgba(47, 191, 105, 0.12);
  border: 1px solid rgba(47, 191, 105, 0.45);
  border-radius: 50%;
  color: var(--green);
  display: flex;
  font-size: 20px;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  margin: 0 auto 12px;
  width: 44px;
}
.system-dialog-box.is-danger .system-dialog-icon {
  background: rgba(255, 74, 74, 0.1);
  border-color: rgba(255, 74, 74, 0.4);
  color: var(--danger);
}
.system-dialog-message {
  color: var(--muted);
  line-height: 1.65;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.confirm-details {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.confirm-details div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 110px 1fr;
  padding: 7px 0;
}
.confirm-details span {
  color: var(--muted);
  font-size: 12px;
}
.confirm-details b { overflow-wrap: anywhere; }
.modal-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}
.edit-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.checkline.loose {
  justify-content: flex-start;
  width: fit-content;
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  aside {
    height: auto;
    position: static;
  }
  .grid.two,
  .grid.top-actions,
  .summary,
  .task-form,
  .proxy-main,
  .proxy-summary,
  .proxy-stats,
  .proxy-accounts,
  .proxy-picker { grid-template-columns: 1fr; }
}
html {
  overflow-anchor: none;
}
