:root {
  --bg: #071524;
  --panel: #0f253b;
  --muted: #8fb1ce;
  --line: #214565;
  --accent: #38d39f;
  --danger: #f26d6d;
  --text: #e8f3ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: radial-gradient(circle at 5% 10%, #173a61 0, var(--bg) 45%);
  color: var(--text);
}
.wrap { max-width: 1100px; margin: 24px auto 60px; padding: 0 16px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.brand { font-size: 24px; font-weight: 700; }
.card {
  background: linear-gradient(180deg, #0f2841, #0d2134);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
input, select {
  width: 100%;
  border: 1px solid #31597d;
  background: #0b1b2c;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
}
button, .btn {
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--accent);
  color: #042019;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-danger { background: var(--danger); color: #300; }
.btn-secondary { background: #6366f1; color: #fff; }
.btn-info { background: #3b82f6; color: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #1f3f5f; padding: 9px 6px; text-align: left; font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.notice { padding: 10px; border-radius: 9px; background: #35211d; border: 1px solid #905047; color: #ffcec5; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.small { font-size: 12px; color: var(--muted); }
.alert {
  margin-bottom: 14px;
  border: 1px solid;
  border-radius: 10px;
  padding: 10px 12px;
}
.alert-error {
  border-color: #9a4d46;
  background: linear-gradient(180deg, #4a2320, #3b1c1a);
  color: #ffd7d2;
}
.alert-success {
  border-color: #2b7a63;
  background: linear-gradient(180deg, #153d34, #102f29);
  color: #d4ffef;
}
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: #1f2d44;
  border-right: 1px solid #2c4567;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  color: #d7e9ff;
  font-size: 24px;
  font-weight: 800;
  margin: 6px 8px 18px;
}
.nav-item {
  display: block;
  color: #c6d9ee;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid transparent;
}
.nav-item:hover { background: #293a56; border-color: #3e587e; }
.nav-item-active { background: #112843; border-color: #33618e; }
.nav-item-bottom { margin-top: auto; }
.main-area { flex: 1; padding: 24px; }
.subaccounts-box input {
  width: 100%;
  margin-bottom: 10px;
}
.subaccount-list { max-height: 220px; overflow-y: auto; display: grid; gap: 8px; }
.subaccount-item {
  display: block;
  padding: 10px;
  border: 1px solid #31567b;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text);
  background: #12263b;
}
.subaccount-item:hover { background: #17324d; }

.script-wrap { max-width: 1200px; }
.tabs-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab-item {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1b2d;
  color: var(--muted);
  font-size: 14px;
}
.tab-active { border-color: #3dc994; color: #d6ffef; background: #0f2f35; }
.alert-danger-box {
  border-color: #9a4d46;
  background: linear-gradient(180deg, #4a2320, #3b1c1a);
  color: #ffd7d2;
}
.alert-info-box {
  border-color: #3a6386;
  background: linear-gradient(180deg, #17344f, #122b41);
  color: #c9ebff;
}
.steps { margin: 8px 0 0 18px; }
.steps li { margin-bottom: 6px; }
.code-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.script-code {
  margin: 0;
  background: #0a1118;
  border: 1px solid #2a3e52;
  border-radius: 10px;
  padding: 16px;
  color: #d6f7df;
  font-family: "Courier New", monospace;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-x: auto;
}

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; min-height: auto; }
  .main-area { padding: 14px; }
}
