:root {
  --dark: #0b2e38;
  --teal: #03a0ae;
  --teal-deep: #007c8c;
  --copper: #e5782a;
  --copper-deep: #b4531a;
  --line: rgb(3 160 174 / 26%);
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--dark);
  font-family: "Open Sans", system-ui, sans-serif;
  background:
    radial-gradient(760px 520px at 8% -8%, rgb(3 112 126 / 13%), transparent 65%),
    radial-gradient(720px 480px at 92% 8%, rgb(173 88 43 / 10%), transparent 62%),
    linear-gradient(135deg, #dfe8e6, #e7ebe9 52%, #e7dfd9) fixed;
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.glass {
  border: 1px solid rgb(19 74 82 / 24%);
  background: linear-gradient(145deg, rgb(248 250 249 / 94%), rgb(229 237 235 / 92%));
  box-shadow: 0 14px 34px rgb(20 45 48 / 8%), inset 0 1px rgb(255 255 255 / 80%);
  backdrop-filter: none;
}
.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.login-card { width: min(430px, 100%); padding: 34px; border-radius: 24px; text-align: center; }
.login-logo { display: flex; justify-content: center; height: 126px; margin-bottom: 10px; }
.login-logo img { width: 152px; height: 126px; object-fit: contain; }
.eyebrow { margin: 0 0 7px; color: var(--teal-deep); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-card h1, .admin-topbar h1 { margin: 0; letter-spacing: -.03em; }
.login-card > p:not(.eyebrow) { margin: 8px 0 24px; color: #667674; }
.login-card label { display: grid; gap: 7px; margin-top: 14px; text-align: left; color: #395252; font-size: 13px; font-weight: 700; }
.login-card input, .search input { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid rgb(3 160 174 / 30%); border-radius: 10px; outline: 0; color: var(--dark); background: rgb(255 255 255 / 76%); }
.login-card input:focus, .search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(3 160 174 / 14%); }
.form-error { min-height: 20px; margin: 12px 0 0 !important; color: #b34236 !important; font-size: 12px; }
.button { min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; color: var(--dark); background: transparent; }
.login-card .button { width: 100%; margin-top: 12px; min-height: 48px; }
.button-primary { border-color: rgb(3 160 174 / 55%); color: #0b2e38; background: linear-gradient(115deg, #19c9cc, #03a0ae 54%, #e5782a); box-shadow: 0 10px 26px rgb(3 160 174 / 22%), inset 0 1px rgb(255 255 255 / 50%); }
.button-quiet { border-color: var(--line); color: var(--teal-deep); background: rgb(255 255 255 / 42%); }
.button-danger { border-color: rgb(229 120 42 / 65%); color: #563b34; background: linear-gradient(135deg, #efd2bf, #e5782a); box-shadow: 0 8px 24px rgb(180 83 26 / 18%); }
.button-wide { width: 100%; margin-top: 12px; }
.admin-shell { min-height: 100vh; }
.admin-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column;
  width: 250px; padding: 20px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #183e45, #263d3c 62%, #302e2a);
  box-shadow: 8px 0 24px rgb(11 28 31 / 12%);
  backdrop-filter: none;
}
.brand { display: flex; justify-content: center; height: 64px; margin-bottom: 24px; }
.brand img { width: 205px; height: 64px; object-fit: contain; }
.admin-sidebar nav { display: grid; gap: 8px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 8px 11px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 10px; color: #eaf3f2; background: rgb(255 255 255 / 4%); font-weight: 700; text-decoration: none; }
.nav-item:hover { background: rgb(255 255 255 / 10%); }
.nav-item.active { border-color: rgb(26 158 163 / 36%); color: #fff; background: linear-gradient(110deg, rgb(3 118 130 / 58%), rgb(79 79 61 / 58%)); box-shadow: inset 3px 0 #26a4a7; }
.badge { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; color: #fff; background: var(--copper-deep); font-size: 11px; }
.sidebar-footer { display: grid; gap: 14px; margin-top: auto; }
.admin-sidebar .sidebar-footer .button-quiet {
  color: #eaf3f2;
  border-color: rgb(255 255 255 / 18%);
  background: rgb(255 255 255 / 8%);
}
.admin-sidebar .profile {
  color: #eaf3f2;
  border-top-color: rgb(255 255 255 / 18%);
}
.admin-sidebar .profile b { color: #fff; }
.admin-sidebar .profile small { color: rgb(255 255 255 / 58%); }
.profile { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); text-align: left; background: transparent; }
.profile > span:first-child { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--teal-deep); background: #e2ece9; font-weight: 800; }
.profile b, .profile small { display: block; }
.profile small { color: #71807d; font-size: 10px; }
.admin-main { margin-left: 250px; padding: 34px clamp(22px, 3vw, 48px) 60px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-topbar h1 { font-size: 32px; }
.admin-topbar small { color: #74817f; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.notification-button { min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--teal-deep); background: rgb(255 255 255 / 52%); font-weight: 700; }
.notification-button span { margin-left: 6px; padding: 3px 7px; border-radius: 999px; color: #fff; background: var(--copper-deep); }
.notice { margin: 0 0 20px; padding: 14px 17px; border-radius: 14px; color: #5b423a; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { padding: 22px; border-radius: 18px; }
.metric span, .metric small { display: block; color: #697875; font-size: 12px; }
.metric strong { display: block; margin: 12px 0 8px; font-size: 34px; letter-spacing: -.04em; color: var(--teal-deep); }
.metric.copper strong { color: var(--copper-deep); }
.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.panel { margin-top: 18px; padding: 24px; border-radius: 18px; }
.section-grid .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.status { padding: 6px 10px; border: 1px solid rgb(3 160 174 / 30%); border-radius: 999px; color: var(--teal-deep); background: rgb(214 241 243 / 72%); font-size: 11px; font-weight: 800; }
.status.copper { border-color: rgb(229 120 42 / 35%); color: #835e50; background: rgb(253 234 221 / 76%); }
.panel > p { color: #687875; }
.hint { margin-bottom: 0; font-size: 11px; }
.notification-list { display: grid; gap: 9px; }
.notification-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid rgb(3 160 174 / 20%); border-radius: 12px; background: rgb(255 255 255 / 42%); }
.notification-item b, .notification-item small { display: block; }
.notification-item small { margin-top: 3px; color: #71807d; }
.notification-item a { color: var(--teal-deep); font-size: 12px; font-weight: 800; text-decoration: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid rgb(3 160 174 / 17%); text-align: left; font-size: 12px; }
th { color: #536968; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
td small { display: block; margin-top: 3px; color: #778582; }
.empty { padding: 26px 12px !important; color: #7b8986; text-align: center; }
.action-row { display: flex; gap: 7px; }
.action-row .button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.pill { display: inline-flex; padding: 4px 9px; border-radius: 999px; color: #426b6b; background: #e2ece9; font-size: 10px; font-weight: 800; }
.pill.pending, .pill.expired { color: #7e5749; background: #f4dfd4; }
.pill.offline, .pill.disabled { color: #765c55; background: #eee5e1; }
.pill.running, .pill.active { color: #286d63; background: #dceee9; }
.pill.paused { color: #7a4a14; background: #fbe6c4; }
.membership-cell { min-width: 280px; }
.membership-line { display: grid; gap: 8px; padding: 8px 0; }
.membership-line + .membership-line { border-top: 1px solid rgb(3 160 174 / 18%); }
.membership-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.remaining { font-size: 13px; color: var(--teal-deep); white-space: nowrap; }
.remaining.paused { color: #a05a12; }
.remaining.expired { color: #8a4a2b; }
.trade-list { display: grid; gap: 4px; margin-top: 6px; font-size: 11px; color: #4f6665; }
.trade-line b { color: var(--teal-deep); }
.strategy-form { display: grid; gap: 16px; }
.spot-rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.spot-rule-grid > div { display: grid; gap: 3px; padding: 12px; border: 1px solid rgb(3 120 132 / 24%); border-radius: 11px; background: rgb(232 240 238 / 80%); }
.spot-rule-grid span { color: #60716f; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.spot-rule-grid strong { color: #164c54; font-size: 17px; }
.spot-rule-grid small { color: #63736f; line-height: 1.4; }
.strategy-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.strategy-field { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: #496261; }
.strategy-field input, .panel-head select { min-height: 42px; padding: 8px 11px; border: 1px solid rgb(3 160 174 / 30%); border-radius: 10px; color: var(--dark); }
.strategy-group { margin: 0; padding: 12px 14px; border: 1px solid rgb(3 160 174 / 24%); border-radius: 12px; }
.strategy-group legend { padding: 0 6px; font-size: 12px; font-weight: 800; color: var(--teal-deep); }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid rgb(3 160 174 / 24%); border-radius: 999px; font-size: 12px; font-weight: 700; color: #315f60; cursor: pointer; }
.check input { accent-color: #03a0ae; }
.view .hint { margin: 0 0 14px; font-size: 12px; }
.support-bot-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin: 18px 0 10px; }
.support-bot-form label { display: grid; gap: 7px; color: #496261; font-size: 12px; font-weight: 700; }
.support-bot-form input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid rgb(3 160 174 / 30%); border-radius: 10px; color: var(--dark); background: rgb(255 255 255 / 72%); outline: 0; }
.support-bot-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(3 160 174 / 14%); }
.support-bot-card .status.support-ready { color: #176b5d; border-color: rgb(23 107 93 / 30%); background: rgb(220 238 233 / 88%); }
@media (max-width: 720px) { .strategy-numbers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .spot-rule-grid { grid-template-columns: 1fr 1fr; } }
.search { display: flex; align-items: center; gap: 8px; color: #617471; font-size: 12px; font-weight: 700; }
.search input { width: 250px; min-height: 38px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: 440px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--dark); background: rgb(248 252 251 / 94%); box-shadow: 0 18px 50px rgb(11 46 56 / 18%); backdrop-filter: blur(16px); }
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .section-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .admin-sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 68px; padding: 7px 10px; flex-direction: row; border-top: 1px solid var(--line); border-right: 0; }
  .admin-sidebar .brand, .sidebar-footer { display: none; }
  .admin-sidebar nav { width: 100%; grid-template-columns: repeat(5, 1fr); }
  .nav-item { justify-content: center; gap: 5px; min-height: 52px; padding: 8px 5px; font-size: 10px; text-align: center; }
  .admin-main { margin-left: 0; padding: 22px 14px calc(90px + env(safe-area-inset-bottom)); }
  .admin-topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; }
  .top-actions > * { flex: 1; }
  .metric-grid { gap: 10px; }
  .metric { padding: 18px 14px; }
  .metric strong { font-size: 28px; }
  .panel { padding: 18px 14px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; align-items: flex-start; flex-direction: column; }
  .search input { width: 100%; min-height: 44px; font-size: 16px; }
  .support-bot-form { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .admin-topbar h1 { font-size: 28px; }
  .top-actions { flex-direction: column; }
  .top-actions > * { width: 100%; }
}
