:root {
  color-scheme: light;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: #101a39;
  background: #f3f6fc;
  --pine: #101a39;
  --green: #2456e8;
  --pale: #e8efff;
  --line: #dce3ef;
  --muted: #53617a;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
a { color: var(--green); }
[hidden] { display: none !important; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.rail { background: #fff; border-right: 1px solid var(--line); padding: 20px 13px 16px; min-height: 100vh; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 8px; }
.brand-mark { display: block; width: 43px; height: 43px; object-fit: cover; border-radius: 9px; flex: none; background: #000; }
.brand strong { color: #0c1637; display: block; font-size: 19px; letter-spacing: -.035em; overflow-wrap: anywhere; }
.nav-group { display: grid; gap: 2px; padding: 7px 0 13px; }
.nav-group + .nav-group { border-top: 1px solid var(--line); padding-top: 13px; }
.nav-label { margin: 4px 11px 7px; font-size: 10px; font-weight: 750; color: #4a5870; letter-spacing: .075em; text-transform: uppercase; }
.nav-link { color: #17213c; padding: 9px 11px; display: flex; align-items: center; gap: 11px; text-decoration: none; font-size: 14px; border: 1px solid transparent; border-radius: 8px; min-height: 39px; }
.nav-icon { display: grid; width: 19px; place-items: center; flex: none; }
.nav-link:hover { background: #f0f4fb; }
.nav-link[aria-current] { color: #1745cf; background: #e6edff; font-weight: 700; }
.nav-toggle { display: none !important; }
.rail-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 15px 7px 0; display: grid; gap: 9px; }
.rail-foot a, .rail-foot button { color: #485a80; font-size: 12px; }
.rail-foot button { justify-self: start; background: transparent; border: 0; padding: 0; }
.shell { min-width: 0; }
.topbar { min-height: 54px; border-bottom: 1px solid var(--line); padding: 8px clamp(18px, 2.4vw, 38px); display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #fff; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.top-actions a { font-size: 13px; font-weight: 600; }
.badge { width: fit-content; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; line-height: 1.15; padding: 5px 8px; border-radius: 5px; background: #ebece6; color: #4b5b51; white-space: nowrap; }
.badge.good { background: #e0eedc; color: #285438; }
.badge.warn { background: #f9edcf; color: #704916; }
.badge.bad { background: #f7e2db; color: #803027; }
.content { width: min(100%, 1690px); margin: auto; padding: 26px clamp(18px, 2.4vw, 38px) 52px; }
.page-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 15px; margin-bottom: 23px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(29px, 4vw, 42px); line-height: 1.11; letter-spacing: -.045em; font-weight: 700; }
h2 { font-size: 17px; letter-spacing: -.018em; }
h3 { font-size: 15px; }
.page-head p, .panel-head p, .subtitle { color: var(--muted); margin-top: 6px; font-size: 14px; line-height: 1.45; }
.stack { display: grid; gap: 18px; min-width: 0; }
.columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(230px, 1fr); gap: 18px; align-items: start; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
.metric { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 17px 18px; min-width: 0; }
.metric.accent { background: #e8efff; border-color: #dce6ff; }
.metric span { color: var(--muted); display: block; font-size: 12px; }
.metric strong { display: block; margin-top: 8px; font-size: 27px; font-weight: 650; letter-spacing: -.04em; overflow-wrap: anywhere; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.panel-head { min-height: 58px; padding: 14px 19px; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 19px; }
.scroll-table { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { background: #f3f6fb; color: #4d5b73; font-size: 11px; font-weight: 700; white-space: nowrap; }
td, th { padding: 11px 14px; border-bottom: 1px solid #e7ebf3; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f5f8ff; }
td strong { display: block; font-weight: 650; }
td small { display: block; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; min-width: 85px; }
td.numeric { white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { padding: 28px 19px; color: var(--muted); line-height: 1.5; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.btn { min-height: 35px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #cbd5e6; border-radius: 7px; background: #fff; color: var(--green); padding: 7px 11px; text-decoration: none; font-weight: 650; font-size: 12px; white-space: nowrap; }
.btn:hover { background: #ebf1ff; }
.btn.primary { background: var(--green); border-color: var(--green); color: white; }
.btn.primary:hover { background: #1a44c3; }
.btn.danger { color: #822c26; border-color: #e6c0bc; }
.btn.small { min-height: 30px; padding: 4px 8px; }
.banner { padding: 12px 15px; border-radius: 8px; background: #e8efff; border: 1px solid #dce6ff; color: #203b75; font-size: 13px; line-height: 1.5; }
.banner.warn { background: #fcf1d7; border-color: #eedcaf; color: #6e4e21; }
.grid-form { display: grid; gap: 13px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.field { display: grid; gap: 5px; min-width: 0; font-size: 12px; color: #25334e; font-weight: 650; }
.field small { font-weight: 400; line-height: 1.4; color: var(--muted); }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 36px; border-radius: 6px; border: 1px solid #cbd5e6; color: #16213d; background: #fff; padding: 7px 9px; }
textarea { resize: vertical; min-height: 78px; }
.check { display: flex; align-items: center; gap: 8px; color: #273654; font-size: 13px; }
.check input { accent-color: var(--green); }
.toolbar { padding: 11px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 9px; flex-wrap: wrap; }
.toolbar input { width: min(100%, 290px); }
.toolbar select { width: min(100%, 160px); }
.summary { display: grid; gap: 9px; }
.summary p { font-size: 13px; line-height: 1.55; color: var(--muted); }
.summary code { overflow-wrap: anywhere; }
.chart { display: grid; gap: 9px; }
.chart-row { display: grid; grid-template-columns: 90px 1fr 70px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
meter { width: 100%; height: 14px; accent-color: var(--green); }
.loading, .login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(100%, 390px); }
.login h1 { font-size: 29px; }
.login-brand { display: block; width: 72px; height: 72px; border-radius: 14px; margin-bottom: 16px; background: #000; }
.login form { margin-top: 18px; }
dialog { width: min(620px, calc(100% - 36px)); max-height: 92vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--white); color: #101a39; box-shadow: 0 22px 80px #16234f38; }
dialog.wide { width: min(930px, calc(100% - 36px)); }
dialog::backdrop { background: #101a3970; }
#notice { position: fixed; inset: auto 18px 18px auto; max-width: min(400px, calc(100% - 36px)); padding: 12px 14px; z-index: 10; box-shadow: 0 6px 22px #162e2840; background: #18274e; color: white; border-radius: 8px; display: none; font-size: 13px; }
#notice.visible { display: block; }
#notice.error { background: #793a31; }
.form-error { color: #822c26; font-size: 13px; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bot-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 20px; background: #eef1f6; color: #394760; font-size: 13px; font-weight: 650; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #737e91; }
.bot-status.online { color: #126541; background: #e0f3e9; }
.bot-status.online .status-dot { background: #17875b; }
.bot-status.offline { background: #fbe9e6; color: #8c352b; }
.bot-status.offline .status-dot { background: #ad4437; }
.setup-banner { background: #0d1a52; color: #fff; min-height: 155px; position: relative; overflow: hidden; border-radius: 14px; padding: 24px 30px; isolation: isolate; }
.setup-banner-copy { position: relative; }
.setup-banner h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.035em; }
.setup-banner p { color: #edf2ff; margin: 6px 0 16px; font-size: 14px; }
.setup-banner .btn { border-color: white; background: white; }
.setup-banner .btn:hover { background: #e7eeff; }
.setup-art { position: absolute; inset: 0 0 0 52%; z-index: -1; background: linear-gradient(129deg,#102475 25%, #0d3ac4 59%,#1d55f5 78%); clip-path: polygon(0 100%, 12% 78%, 25% 78%, 38% 55%, 53% 55%, 64% 33%, 77% 33%, 87% 11%,100% 11%,100% 100%); }
.overview-metrics { border: 1px solid var(--line); border-radius: 12px; background: white; gap: 0; padding: 13px 0; }
.overview-metrics .metric { background: transparent; border: 0; border-radius: 0; padding: 4px 19px; }
.overview-metrics .metric + .metric { border-left: 1px solid var(--line); }
.overview-metrics .metric strong { font-size: 29px; color: #0b1535; }
.overview-columns { grid-template-columns: minmax(0, 1.73fr) minmax(255px, 1fr); }
.text-action { text-decoration: none; font-size: 13px; font-weight: 700; }
.text-action:hover { text-decoration: underline; }
.setup-step { display: grid; grid-template-columns: 22px minmax(0,1fr) 12px; gap: 11px; align-items: center; min-height: 56px; padding: 10px 16px; color: var(--pine); text-decoration: none; border-bottom: 1px solid #e7ebf3; }
.setup-step:hover { background: #f6f8ff; }
.setup-step:last-child { border-bottom: 0; }
.setup-step strong { display: block; font-size: 13px; }
.setup-step small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.step-state { width: 19px; height: 19px; display: grid; place-items: center; border: 1.5px solid #74819a; border-radius: 50%; }
.step-state.done { color: white; border-color: #2456e8; background: #2456e8; font-size: 12px; font-weight: 700; }
.chevron { font-size: 22px; color: #526182; }
.tabs { display: flex; gap: clamp(2px, 2vw, 22px); border-bottom: 1px solid #ccd7ea; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; min-height: 43px; flex: none; border: 0; border-bottom: 3px solid transparent; font-size: 14px; font-weight: 600; padding: 0 10px; color: #415170; background: transparent; }
.tab[aria-pressed=true] { color: #1744ce; border-bottom-color: #2456e8; font-weight: 750; }
.tab:hover { color: #1744ce; }
.toolbar { align-items: center; }
.toolbar-end { display: flex; gap: 8px; margin-left: auto; }
.toolbar .select-label { display: block; }
.toolbar .select-label select { width: auto; max-width: 230px; }
.product-label { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.product-thumb { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 8px; flex: none; object-fit: cover; }
.product-thumb.fallback { background: #eaf0ff; color: #2e54b4; }
.price-input { min-width: 112px; }
.profit { color: #126a44; font-weight: 700; white-space: nowrap; }
.loss { color: #a13731; font-weight: 700; white-space: nowrap; }
.table-error { margin: 12px 18px; }
.media-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; place-items: center stretch; }
.edit-preview { width: 80px; height: 70px; object-fit: cover; border-radius: 8px; }
input[type=checkbox] { accent-color: #2456e8; width: 16px; height: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 185px minmax(0, 1fr); }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .brand strong { font-size: 17px; }
}
@media (max-width: 700px) {
  .workspace { display: block; }
  .rail { min-height: auto; height: auto; padding: 11px 14px; position: static; display: block; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .nav-toggle { display: inline-flex !important; margin-left: auto; }
  .workspace-nav { display: none; }
  .workspace-nav.expanded { display: block; margin-top: 8px; }
  .nav-group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px 0; }
  .nav-group + .nav-group { padding-top: 6px; }
  .nav-link { padding: 7px 8px; font-size: 13px; }
  .nav-label, .nav-icon, .rail-foot { display: none; }
  .topbar { min-height: 48px; }
  .top-actions { gap: 8px; }
  .content { padding-top: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-metrics .metric:nth-child(3) { border-left: 0; }
  .overview-metrics .metric:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 7px; padding-top: 9px; }
  .setup-banner { padding: 19px; }
  .setup-art { inset-inline-start: 67%; }
  .toolbar-end { margin-left: 0; }
  td, th { padding: 9px 11px; }
}
