:root{
  --bg:#0b1020;
  --card:#101a33;
  --muted:#8da2c0;
  --text:#e9f0ff;
  --line:rgba(255,255,255,.10);

  --ok:#35c29a;
  --bad:#ff5c6c;
  --warn:#ffcc66;

  --btn:#2a66ff;
  --btn2:#1b2a4d;

  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(42,102,255,.25), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(53,194,154,.18), transparent 60%),
    var(--bg);
  color:var(--text);
}

a{color:#b8ccff; text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:1100px; margin:0 auto; padding:24px}

/* Top */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(16,26,51,.72);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand{display:flex; gap:10px; align-items:center}
.logo{
  width:34px; height:34px; border-radius:10px;
  background:linear-gradient(135deg, rgba(42,102,255,.9), rgba(53,194,154,.8));
}
.title{font-weight:800}
.subtitle{color:var(--muted); font-size:13px; margin-top:2px}

/* Cards / Layout */
.card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(16,26,51,.72);
  backdrop-filter: blur(10px);
  padding:18px;
  box-shadow: var(--shadow);
}

.grid{display:grid; gap:14px}
.grid2{grid-template-columns: 1fr 1fr}
@media (max-width:900px){.grid2{grid-template-columns:1fr}}

.h1{font-size:26px; margin:6px 0 8px}
.h2{font-size:18px; margin:0 0 10px}
.p{color:var(--muted); line-height:1.6; margin:0}

.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

hr{border:0; border-top:1px solid var(--line); margin:16px 0}

label{font-size:13px; color:var(--muted); display:block; margin:0 0 6px}

input,select,textarea{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
}

input::placeholder, textarea::placeholder{color:rgba(141,162,192,.75)}
textarea{min-height:110px; resize:vertical}

input:focus,select:focus,textarea:focus{
  border-color: rgba(42,102,255,.55);
  box-shadow: 0 0 0 4px rgba(42,102,255,.18);
}

/* Buttons */
.btn{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--btn);
  color:white;
  font-weight:800;
  cursor:pointer;
  transition: transform .06s ease, filter .12s ease, opacity .12s ease;
}
.btn:hover{filter:brightness(1.05)}
.btn:active{transform: translateY(1px)}
.btn.secondary{background:var(--btn2)}
.btn.ghost{background:transparent}
.btn:disabled{opacity:.55; cursor:not-allowed; transform:none}

.btn-xs{padding:6px 10px; border-radius:10px; font-size:12px; font-weight:800}

/* Badges / Notices */
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.12);
  color:var(--muted);
  font-size:12px;
}

.notice{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.14);
  margin-top:10px;
}
.notice.ok{border-color:rgba(53,194,154,.35); color:#c7ffee}
.notice.bad{border-color:rgba(255,92,108,.35); color:#ffd3d7}
.notice.warn{border-color:rgba(255,204,102,.35); color:#ffe9b6}

/* Pills (status) */
.pill{
  display:inline-flex; align-items:center; justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.12);
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}
.pill.ok{border-color:rgba(53,194,154,.45); color:#c7ffee}
.pill.bad{border-color:rgba(255,92,108,.45); color:#ffd3d7}
.pill.warn{border-color:rgba(255,204,102,.45); color:#ffe9b6}

/* Tabs */
.tabs{display:flex; gap:8px; flex-wrap:wrap}
.tab{
  padding:9px 12px; border-radius:999px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.10);
  color:var(--muted);
  cursor:pointer;
}
.tab.active{background:rgba(42,102,255,.22); color:#dbe8ff}

/* Table */
.table{width:100%; border-collapse:collapse; font-size:13px}
.table th,.table td{padding:10px; border-bottom:1px solid var(--line); vertical-align:top}
.table th{color:#cfe0ff; text-align:left; font-weight:900}
.table tr:hover td{background:rgba(255,255,255,.03)}
.table .right{text-align:right}

/* Monospace */
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono"; font-size:12px}
.small{font-size:12px; color:var(--muted)}
.right{margin-left:auto}

/* Dropzone */
.dropzone{
  border:1px dashed rgba(255,255,255,.22);
  border-radius:16px;
  padding:16px;
  background:rgba(0,0,0,.10);
  min-height:120px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:10px;
}
.dropzone.dragover{
  border-color: rgba(42,102,255,.75);
  box-shadow: 0 0 0 4px rgba(42,102,255,.18);
  background:rgba(42,102,255,.08);
}

/* Upload Queue */
.queue{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.queue-item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  padding:12px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.10);
}
.queue-item--done{border-color:rgba(53,194,154,.25)}
.queue-item--error{border-color:rgba(255,92,108,.25)}
.queue-item--job,.queue-item--uploaded,.queue-item--uploading,.queue-item--queued{border-color:rgba(255,255,255,.10)}

.queue-main{min-width:0}
.qi-name{font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:520px}
.qi-meta{margin-top:4px}
.queue-side{display:flex; gap:8px; align-items:center}

/* Utilities */
.hidden{display:none !important}
.mt-14{margin-top:14px}
.mt-10{margin-top:10px}
.mt-12{margin-top:12px}
.prewrap{white-space:pre-wrap; margin:0}
.grow{flex:1}
.field{min-width:220px}

/* Accessibility */
.skip-link{
  position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  left:16px; top:16px; width:auto; height:auto;
  background:rgba(16,26,51,.92);
  border:1px solid var(--line);
  padding:10px 12px;
  border-radius:12px;
  z-index:9999;
}

/* ===========================
   THEME: Landing (light)
   Включается через <body class="theme-landing">
   =========================== */

body.theme-landing{
  /* токены светлой темы */
  --bg:#ffffff;
  --card:rgba(255,255,255,.86);
  --muted:rgba(15,23,42,.64);
  --text:#0b1020;
  --line:rgba(15,23,42,.10);

  --btn:#2a66ff;
  --btn2:rgba(15,23,42,.06);

  --shadow: 0 18px 60px rgba(2,6,23,.12);
  --radius:18px;

  /* фон как на лендинге */
  background:
    radial-gradient(1100px 700px at 18% 12%, rgba(42,102,255,.22), transparent 62%),
    radial-gradient(900px 650px at 82% 18%, rgba(53,194,154,.16), transparent 62%),
    radial-gradient(900px 650px at 60% 70%, rgba(42,102,255,.10), transparent 62%),
    var(--bg);
  color:var(--text);
}

/* ссылки — лендинговые */
body.theme-landing a{ color:#1e50ff; }
body.theme-landing a:hover{ text-decoration:underline; }

/* topbar — светлый */
body.theme-landing .topbar{
  background: rgba(255,255,255,.72);
  border-color: var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

/* карточки — светлые */
body.theme-landing .card{
  background: rgba(255,255,255,.78);
  border-color: rgba(15,23,42,.10);
  box-shadow: var(--shadow);
}

/* подписи/тексты */
body.theme-landing .p,
body.theme-landing .small,
body.theme-landing label,
body.theme-landing .subtitle{
  color: var(--muted);
}

/* hr */
body.theme-landing hr{ border-top-color: var(--line); }

/* инпуты — светлые */
body.theme-landing input,
body.theme-landing select,
body.theme-landing textarea{
  background: rgba(15,23,42,.04);
  border-color: rgba(15,23,42,.12);
  color: var(--text);
}
body.theme-landing input::placeholder,
body.theme-landing textarea::placeholder{
  color: rgba(15,23,42,.40);
}
body.theme-landing input:focus,
body.theme-landing select:focus,
body.theme-landing textarea:focus{
  border-color: rgba(42,102,255,.55);
  box-shadow: 0 0 0 4px rgba(42,102,255,.16);
}

/* кнопки */
body.theme-landing .btn{
  border-color: rgba(42,102,255,.20);
  box-shadow: 0 10px 24px rgba(42,102,255,.18);
}
body.theme-landing .btn.secondary{
  background: rgba(15,23,42,.06);
  border-color: rgba(15,23,42,.12);
  box-shadow: none;
  color: var(--text);
}
body.theme-landing .btn.ghost{
  background: transparent;
  border-color: rgba(15,23,42,.12);
  box-shadow: none;
  color: rgba(15,23,42,.78);
}

/* badge/notice — светлые */
body.theme-landing .badge{
  background: rgba(15,23,42,.04);
  border-color: rgba(15,23,42,.10);
  color: rgba(15,23,42,.64);
}

body.theme-landing .notice{
  background: rgba(15,23,42,.04);
  border-color: rgba(15,23,42,.10);
  color: rgba(15,23,42,.78);
}
body.theme-landing .notice.ok{
  background: rgba(53,194,154,.10);
  border-color: rgba(53,194,154,.25);
  color: rgba(3,42,32,.92);
}
body.theme-landing .notice.bad{
  background: rgba(255,92,108,.10);
  border-color: rgba(255,92,108,.22);
  color: rgba(71,6,12,.92);
}
body.theme-landing .notice.warn{
  background: rgba(255,204,102,.14);
  border-color: rgba(255,204,102,.28);
  color: rgba(60,35,0,.92);
}

/* skip-link — не тёмный */
body.theme-landing .skip-link:focus{
  background: rgba(255,255,255,.92);
  border-color: rgba(15,23,42,.12);
  color: rgba(15,23,42,.90);
}

/* ===========================
   APP UI tweaks + Mobile
   =========================== */

/* контейнер на мобиле — уже */
@media (max-width: 900px){
  .container{ padding:16px; }
  .topbar{ padding:12px 12px; border-radius:14px; }
  .card{ padding:14px; }
  .h1{ font-size:22px; }
  .h2{ font-size:16px; }
}

/* кнопки/табы — крупнее на мобиле */
@media (max-width: 900px){
  .btn{ padding:12px 14px; border-radius:14px; }
  .btn-xs{ padding:10px 12px; border-radius:12px; font-size:13px; }
  .tab{ padding:10px 12px; }
  input,select,textarea{ padding:12px 12px; border-radius:14px; }
}

/* шапка: на мобиле уводим действия вниз, чтобы не ломало */
@media (max-width: 900px){
  .topbar{ flex-wrap:wrap; gap:10px; }
  .topbar .brand{ flex: 1 1 100%; }
  .topbar .row{ width:100%; justify-content:flex-end; }
}

/* grid2 -> одна колонка на планшете/мобиле (у тебя уже есть на 900px, усилим на 1024) */
@media (max-width: 1024px){
  .grid2{ grid-template-columns:1fr; }
}

/* формы: "поиск + статус + кнопки" часто в один ряд — на мобиле в столбик */
@media (max-width: 900px){
  .row{ gap:10px; }
  .field{ min-width: 0; width: 100%; }
}

/* таблица: делаем горизонтальный скролл внутри карточки */
.table-wrap{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}
.table{ min-width: 720px; } /* чтобы не ломало колонки */

/* на мобиле таблица пусть будет шире, но скроллится */
@media (max-width: 900px){
  .table{ min-width: 860px; }
}

/* “липкие” заголовки таблицы — удобно на скролле */
.table thead th{
  position: sticky;
  top: 0;
  background: rgba(16,26,51,.92);
  backdrop-filter: blur(8px);
  z-index: 1;
}

/* статус/уведомления: не растягивать на всю ширину */
.notice{ max-width: 100%; }

/* ===========================
   APP: Landing theme + Mobile
   =========================== */

/* комфортнее hit-area */
.btn{ min-height: 40px; }
.tab{ min-height: 38px; }

/* table scroll wrapper */
.table-wrap{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}

/* чуть шире таблица, чтобы колонки не ломались */
.table{ min-width: 760px; }

/* sticky header — под theme-landing */
body.theme-landing .table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
}

/* hover не такой "тёмный" на светлой теме */
body.theme-landing .table tr:hover td{
  background: rgba(15,23,42,.03);
}

/* ===== Mobile ===== */
@media (max-width: 900px){
  .container{ padding:16px; }
  .topbar{
    padding:12px 12px;
    border-radius:14px;
    flex-wrap:wrap;
    gap:10px;
  }
  .card{ padding:14px; }
  .h1{ font-size:22px; }
  .h2{ font-size:16px; }

  input,select,textarea{
    padding:12px 12px;
    border-radius:14px;
  }

  .btn{
    padding:12px 14px;
    border-radius:14px;
  }
  .tab{ padding:10px 12px; }

  /* header */
  .topbar .brand{ flex: 1 1 100%; }
  .top-actions{ width:100%; justify-content:flex-end; }

  /* wardrobe filters -> column */
  .filters-row{
    flex-direction: column;
    align-items: stretch;
  }
  .filters-row .field,
  .filters-row .grow{
    width:100%;
    min-width:0;
  }

  /* action buttons -> full width */
  .actions-row{
    width:100%;
    flex-direction: column;
    align-items: stretch;
  }
  .actions-row .btn{ width:100%; }

  /* upload grid -> one col */
  .grid2{ grid-template-columns: 1fr !important; }

  /* editor header actions */
  .editor-actions{
    width:100%;
    margin-left:0;
    justify-content:flex-start;
  }
}

/* ===========================
   Mobile Pro UX: tabs scroll + table cards
   =========================== */

/* Tabs: горизонтальный скролл на мобиле */
@media (max-width: 600px){
  .tabs{
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 6px 2px;
    scrollbar-width: none; /* Firefox */
  }
  .tabs::-webkit-scrollbar{ display:none; } /* Chrome/Safari */
  .tab{
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Table -> Cards on very small screens */
@media (max-width: 520px){
  /* убираем горизонтальный скролл-режим */
  .table-wrap{ overflow: visible; }
  .table{ min-width: 0; }

  /* скрываем шапку */
  .table thead{ display:none; }

  /* превращаем строки в карточки */
  .table,
  .table tbody,
  .table tr,
  .table td{
    display:block;
    width:100%;
  }

  .table tr{
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.78);
    box-shadow: 0 18px 60px rgba(2,6,23,.10);
    border-radius: 16px;
    padding: 12px;
    margin: 10px 0;
  }

  /* ячейки: лейбл слева, значение справа */
  .table td{
    border-bottom: 1px solid rgba(15,23,42,.08);
    padding: 10px 0;
  }
  .table td:last-child{ border-bottom:0; }

  .table td::before{
    display:block;
    font-size: 12px;
    color: rgba(15,23,42,.60);
    margin-bottom: 6px;
    font-weight: 700;
  }

  /* Лейблы по порядку колонок */
  .table td:nth-child(1)::before{ content: "Товар"; }
  .table td:nth-child(2)::before{ content: "Статус"; }
  .table td:nth-child(3)::before{ content: "Категория"; }
  .table td:nth-child(4)::before{ content: "Действия"; }

  /* кнопки в действиях: в строку и с переносом */
  .table td:nth-child(4) .row{
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .table td:nth-child(4) .btn{
    width: auto;
  }
}

/* На 521-900: остаётся скролл-таблица (как раньше) */

/* Mobile Cards polish */
@media (max-width: 520px){
  /* 1-я строка (Товар) — как заголовок карточки */
  .table td:nth-child(1){
    padding-top: 6px;
  }
  .table td:nth-child(1){
    font-weight: 900;
    font-size: 15px;
  }

  /* Статус — аккуратнее */
  .table td:nth-child(2){
    padding-top: 8px;
  }

  /* Действия: кнопки на всю ширину по одной (удобно пальцем) */
  .table td:nth-child(4) .btn{
    width: 100%;
  }
  .table td:nth-child(4) .btn + .btn{
    margin-top: 8px;
  }
}