:root {
  --primary: #04070b;
  --primary-light: #0c131f;
  --deep: #010101;
  --ink: #f7fbff;
  --ink-soft: #d8e5f5;
  --muted: #98aabd;
  --secondary: #0ee951;
  --tertiary: #00dabf;
  --gradient: linear-gradient(135deg, #0ee951 0%, #00dabf 100%);
  --surface: rgba(10, 20, 32, .82);
  --surface-2: rgba(18, 38, 56, .66);
  --surface-3: rgba(255,255,255,.055);
  --line: rgba(14, 233, 81, .23);
  --line-soft: rgba(255,255,255,.1);
  --red: #ff6686;
  --yellow: #ffd166;
  --blue: #62d7ff;
  --radius: 24px;
  --shadow: 0 30px 80px rgba(0,0,0,.42);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--deep); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(ellipse at 20% -5%, rgba(14,233,81,.18), transparent 32%),
    radial-gradient(ellipse at 95% 8%, rgba(0,218,191,.15), transparent 31%),
    radial-gradient(ellipse at center, #152636 0%, #152636 20%, #0c131f 52%, #010101 78%, #010101 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 75%);
}
body::after {
  content: "";
  position: fixed;
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: rgba(14,233,81,.08);
  filter: blur(12px);
  pointer-events: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell, .layout { position: relative; z-index: 1; display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(180deg, rgba(1,1,1,.86), rgba(4,7,11,.74));
  backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 13px; align-items: center; min-width: 0; margin-bottom: 28px; padding: 0 4px; }
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(14,233,81,.26);
  background: rgba(255,255,255,.035);
  box-shadow: 0 0 36px rgba(14,233,81,.22), inset 0 0 22px rgba(0,218,191,.08);
}
.logo-text { font-weight: 900; font-size: 22px; letter-spacing: -.45px; line-height: 1; color: #fff; }
.logo-text span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-copy { min-width: 0; display: grid; gap: 4px; }
.brand-subtitle { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 178px; }
.side-nav, .nav { display: grid; gap: 8px; }
.nav-group { margin: 18px 12px 6px; color: rgba(247,251,255,.48); font-size: 11px; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; }
.nav-link, .nav a {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #cbd8e6;
  border: 1px solid transparent;
  transition: .18s ease;
}
.nav-link em, .nav a span { opacity: .72; font-style: normal; }
.nav-link:hover, .nav-link.active, .nav a:hover, .nav a.active {
  color: #fff;
  background: rgba(14,233,81,.08);
  border-color: rgba(14,233,81,.26);
  transform: translateX(2px);
  box-shadow: inset 0 0 24px rgba(0,218,191,.035);
}
.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; }
.logout-form { margin: 0; }
.logout {
  width: 100%;
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.05);
  color: #cfdae7;
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
}
.logout:hover { color: #ffd3dc; border-color: rgba(255,102,134,.42); background: rgba(255,102,134,.08); }
.main { min-width: 0; padding: 36px; }
.page-head, .topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
h1, h2, h3, h4 { margin: 0; color: #fff; }
h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.02; letter-spacing: -1.3px; font-weight: 780; }
h2 { font-size: 22px; letter-spacing: -.35px; }
.subtitle { margin: 10px 0 0; color: var(--muted); line-height: 1.58; max-width: 780px; }
.eyebrow, .card-kicker { color: #9dffd8; text-transform: uppercase; letter-spacing: .15em; font-weight: 900; font-size: 11px; margin-bottom: 8px; }
.hero-card, .hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(14,233,81,.22);
  border-radius: 30px;
  padding: 34px;
  background:
    radial-gradient(circle at 98% 0%, rgba(0,218,191,.17), transparent 36%),
    radial-gradient(circle at 0% 0%, rgba(14,233,81,.16), transparent 32%),
    linear-gradient(135deg, rgba(21,38,54,.92), rgba(4,7,11,.82));
  box-shadow: var(--shadow);
}
.hero-card::after, .hero::after {
  content: "";
  position: absolute;
  right: 36px;
  bottom: -56px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(14,233,81,.23);
  border-radius: 42px;
  transform: rotate(18deg);
  background: rgba(255,255,255,.025);
}
.market-grid, .grid { display: grid; gap: 18px; }
.market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.market-panel, .card, .form-card, .filter-card, .table-card, .api-card {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21,38,54,.76), rgba(4,7,11,.72));
  box-shadow: var(--shadow);
  padding: 22px;
  color: var(--ink);
}
.market-panel { min-height: 340px; position: relative; overflow: hidden; }
.market-panel::before { content: ""; position: absolute; inset: -90px -70px auto auto; width: 230px; height: 230px; border-radius: 999px; background: rgba(14,233,81,.1); }
.market-panel.ozon::before { background: rgba(0,218,191,.12); }
.market-panel > * { position: relative; z-index: 1; }
.market-head, .api-main, .split { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.stats-row div { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.045); border-radius: 18px; padding: 14px; }
.stats-row span { display: block; font-size: 30px; font-weight: 900; color: #fff; letter-spacing: -1px; }
.stats-row small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.info-list { display: grid; gap: 9px; margin: 18px 0; }
.info-list div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid rgba(255,255,255,.075); padding-bottom: 9px; }
.info-list span { color: var(--muted); }
.info-list strong { color: #fff; text-align: right; font-weight: 750; }
.compact-list { margin: 16px 0; }
.status-pill, .badge, .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 850;
  color: #eaf4ff;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  white-space: nowrap;
}
.status-pill.success, .badge.success { color: #caffdf; border-color: rgba(14,233,81,.38); background: rgba(14,233,81,.12); }
.status-pill.warn, .badge.warn { color: #ffe8ae; border-color: rgba(255,209,102,.35); background: rgba(255,209,102,.12); }
.status-pill.error, .badge.error { color: #ffd2dc; border-color: rgba(255,102,134,.38); background: rgba(255,102,134,.13); }
.status-pill.info, .badge.info { color: #cafffb; border-color: rgba(0,218,191,.38); background: rgba(0,218,191,.12); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 11px 15px;
  background: rgba(255,255,255,.06);
  color: #f8fcff;
  font-weight: 850;
  cursor: pointer;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(14,233,81,.3); background: rgba(255,255,255,.085); }
.btn.primary { background: var(--gradient); color: #021014; border-color: transparent; box-shadow: 0 16px 34px rgba(14,233,81,.18); }
.btn.ghost { background: rgba(255,255,255,.052); }
.btn.danger { color: #ffd4dd; border-color: rgba(255,102,134,.35); background: rgba(255,102,134,.07); }
.btn.compact { min-height: 34px; padding: 7px 10px; border-radius: 12px; font-size: 12px; }
.filter-card { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; padding: 14px; box-shadow: none; }
.table-card { padding: 0; overflow: hidden; }
.table-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.09); }
.table-actions.bottom { border-top: 1px solid rgba(255,255,255,.09); border-bottom: 0; }
.table-wrap { overflow: auto; border-radius: 0; }
.card .table-wrap { border-radius: 18px; border: 1px solid rgba(255,255,255,.09); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
.editable-table { min-width: 1320px; }
th, td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.085); vertical-align: middle; color: var(--ink-soft); text-align: left; }
th { position: sticky; top: 0; z-index: 2; background: rgba(8,18,29,.96); color: #a6b7c9; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
td strong { color: #fff; }
tr:hover td { background: rgba(14,233,81,.035); }
.name-cell { min-width: 260px; max-width: 380px; line-height: 1.35; }
input, select, textarea, .form-control {
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 15px;
  background: rgba(1,1,1,.42);
  color: #fff;
  padding: 11px 12px;
  outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .form-control:focus { border-color: rgba(14,233,81,.62); box-shadow: 0 0 0 4px rgba(14,233,81,.08); }
select option { background: #0c131f; color: #fff; }
.table-input { min-width: 112px; height: 38px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.055); }
.table-input.small { min-width: 76px; }
label { display: block; margin-bottom: 7px; color: #e8f1fb; font-size: 13px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-full { grid-column: 1 / -1; }
.form-actions { margin-top: 18px; }
.helptext, .muted, .card-muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.errorlist { color: #ffd2dc; padding-left: 18px; margin: 6px 0 0; }
.messages { display: grid; gap: 10px; margin-bottom: 18px; }
.message { border: 1px solid rgba(14,233,81,.26); background: rgba(14,233,81,.10); color: #eefff6; border-radius: 16px; padding: 13px 15px; }
.message.warning { border-color: rgba(255,209,102,.35); background: rgba(255,209,102,.1); color: #ffe8ae; }
.message.error { border-color: rgba(255,102,134,.38); background: rgba(255,102,134,.12); color: #ffd4dd; }
.breadcrumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); margin-bottom: 18px; font-size: 13px; }
.breadcrumbs a { color: #b5ffe4; }
.cards-list { display: grid; gap: 16px; }
.empty-state { border: 1px dashed rgba(255,255,255,.18); border-radius: 20px; padding: 26px; color: var(--muted); text-align: center; background: rgba(255,255,255,.035); }
.upload-box { max-width: 680px; }
.switch { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 50px; height: 28px; border-radius: 999px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.12); position: relative; transition: .18s ease; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 999px; background: #d4e0ed; transition: .18s ease; }
.switch input:checked + span { background: linear-gradient(135deg, rgba(14,233,81,.9), rgba(0,218,191,.9)); border-color: transparent; box-shadow: 0 0 24px rgba(14,233,81,.2); }
.switch input:checked + span::after { transform: translateX(22px); background: #021014; }
.preview-bar { margin-bottom: 18px; border: 1px solid rgba(0,218,191,.3); background: rgba(0,218,191,.09); border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.metric { font-size: 34px; font-weight: 900; letter-spacing: -1px; color: #fff; }
.metric-small { font-size: 22px; font-weight: 850; color: #fff; }
.stack { display: grid; gap: 12px; }
.mini-list { display: grid; gap: 10px; }
.mini-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.045); }
.mini-item:hover { border-color: rgba(14,233,81,.28); background: rgba(14,233,81,.055); }
.card-title { font-size: 16px; font-weight: 900; color: #fff; margin-bottom: 8px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.login-card { width: min(470px, 100%); }
@media (max-width: 1180px) {
  .app-shell, .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main { padding: 24px; }
  .market-grid, .grid-4, .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .page-head, .topbar, .market-head, .api-main { flex-direction: column; }
  .stats-row { grid-template-columns: 1fr; }
}
.kpi-line { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.market-card { position: relative; overflow: hidden; min-height: 170px; }
.market-card::before { content:""; position:absolute; right:-70px; top:-85px; width:210px; height:210px; border-radius:999px; background:rgba(14,233,81,.09); }
.market-card.ozon::before { background:rgba(0,218,191,.11); }
.market-card > * { position:relative; z-index:1; }
.product-link {
  color: #eafff5;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(14, 233, 81, .42);
  transition: .18s ease;
}
.product-link:hover {
  color: #0ee951;
  border-bottom-color: rgba(0, 218, 191, .95);
  text-shadow: 0 0 18px rgba(14, 233, 81, .22);
}
input:disabled, select:disabled, textarea:disabled, .table-input:disabled {
  opacity: .72;
  cursor: not-allowed;
  background: rgba(255,255,255,.035);
  color: #aeb8c6;
}
