/* Man-Shop — панель управления + платформа + вход. Те же токены, что и витрина. */
:root{
  --brand-50:#E7F4F0; --brand-100:#C9E7DF; --brand-500:#0B7261; --brand-600:#0A6353; --brand-700:#084C3F; --on-brand:#FFFFFF;
  --success:#15924F; --success-bg:#E4F5EC; --danger:#D14343; --danger-bg:#FBE9E9;
  --warning:#B4790E; --warning-bg:#FBF1DD; --info:#2563EB; --info-bg:#E7EEFD;
  --bg:#F7F7F4; --surface:#FFFFFF; --surface-2:#F2F2EE;
  --text:#1A1A17; --text-muted:#6B6B63; --text-faint:#9A9A90;
  --border:#E7E7E1; --border-strong:#D8D8D0;
  --shadow-sm:0 1px 2px rgba(20,20,17,.06),0 1px 1px rgba(20,20,17,.04);
  --shadow-md:0 4px 12px rgba(20,20,17,.08),0 1px 3px rgba(20,20,17,.05);
  --ring:0 0 0 3px rgba(11,114,97,.28);
  --font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-pill:999px;
}
:root[data-theme="dark"]{
  --brand-50:#10241E; --brand-100:#163329; --brand-500:#1FA98A; --brand-600:#33BE9E; --brand-700:#46CFAF; --on-brand:#04140F;
  --success:#37C976; --success-bg:#10251A; --danger:#F0736F; --danger-bg:#2A1414;
  --warning:#E0A83A; --warning-bg:#2A2110; --info:#7AA0F5; --info-bg:#14213D;
  --bg:#0E1110; --surface:#171A18; --surface-2:#1E2220;
  --text:#ECEFEC; --text-muted:#9BA29D; --text-faint:#6B726D;
  --border:#2A2F2C; --border-strong:#3A403C;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4); --shadow-md:0 4px 14px rgba(0,0,0,.5);
  --ring:0 0 0 3px rgba(31,169,138,.4);
}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]){
  --brand-50:#10241E; --brand-100:#163329; --brand-500:#1FA98A; --brand-600:#33BE9E; --brand-700:#46CFAF; --on-brand:#04140F;
  --success:#37C976; --success-bg:#10251A; --danger:#F0736F; --danger-bg:#2A1414;
  --warning:#E0A83A; --warning-bg:#2A2110; --info:#7AA0F5; --info-bg:#14213D;
  --bg:#0E1110; --surface:#171A18; --surface-2:#1E2220;
  --text:#ECEFEC; --text-muted:#9BA29D; --text-faint:#6B726D;
  --border:#2A2F2C; --border-strong:#3A403C;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4); --shadow-md:0 4px 14px rgba(0,0,0,.5);
  --ring:0 0 0 3px rgba(31,169,138,.4);
}}

*{ box-sizing:border-box; }
body{ margin:0; background:var(--bg); color:var(--text); font:15px/1.5 var(--font-sans); -webkit-font-smoothing:antialiased; }
a{ color:var(--brand-600); text-decoration:none; }
:root[data-theme="dark"] a{ color:var(--brand-500); }
h1{ font-size:22px; margin:0 0 4px; } h2{ font-size:16px; margin:0 0 12px; }
.muted{ color:var(--text-muted); } .small{ font-size:12.5px; } .tnum{ font-variant-numeric:tabular-nums; }
:focus-visible{ outline:none; box-shadow:var(--ring); border-radius:var(--r-sm); }

/* ---------- топбар ---------- */
.topbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--surface);
  padding:11px 18px; border-bottom:1px solid var(--border); flex-wrap:wrap; position:sticky; top:0; z-index:10; }
.topbar .brand{ font-weight:800; color:var(--text); display:flex; align-items:center; gap:8px; }
.topbar .brand svg{ width:20px; height:20px; color:var(--brand-500); }
.topbar nav{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.topbar nav a{ color:var(--text); opacity:.75; padding:6px 10px; border-radius:var(--r-sm); font-size:14px; position:relative; }
.topbar nav a:hover{ opacity:1; background:var(--surface-2); }
.topbar nav a.on{ opacity:1; color:var(--brand-700); background:var(--brand-50); font-weight:600; }
:root[data-theme="dark"] .topbar nav a.on{ color:var(--brand-500); }
.nav-badge{ display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px; margin-left:5px;
  border-radius:var(--r-pill); background:var(--danger); color:#fff; font-size:11px; font-weight:700; }
.inline{ display:inline; margin:0; }
.topbar form button{ background:none; border:none; color:var(--text-muted); cursor:pointer; font:inherit; padding:6px 8px; }
.icon-btn{ width:36px; height:34px; display:grid; place-items:center; padding:0; border:1px solid var(--border);
  border-radius:var(--r-sm); background:var(--surface); color:var(--text); cursor:pointer; }
.icon-btn svg{ width:18px; height:18px; }
.ic-sun{ display:none; } :root[data-theme="dark"] .ic-sun{ display:inline; } :root[data-theme="dark"] .ic-moon{ display:none; }
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) .ic-sun{ display:inline; } :root:not([data-theme="light"]) .ic-moon{ display:none; } }

.wrap{ max-width:940px; margin:0 auto; padding:22px 16px 64px; }
.head-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap; }

/* ---------- кнопки ---------- */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:10px 16px; border-radius:var(--r-md);
  border:1px solid var(--border-strong); background:var(--surface); color:var(--text); cursor:pointer; font:inherit; font-weight:600; }
.btn:active{ transform:translateY(1px); } .btn svg{ width:17px; height:17px; }
.btn.primary{ background:var(--brand-500); color:var(--on-brand); border-color:transparent; box-shadow:var(--shadow-sm); }
.btn.primary:active{ background:var(--brand-600); }
.btn.sm{ padding:7px 12px; font-size:13.5px; }
.btn.danger-btn{ background:var(--surface); color:var(--danger); border-color:var(--danger); }
.btn.block{ width:100%; }
.link{ color:var(--brand-600); font-weight:500; } :root[data-theme="dark"] .link{ color:var(--brand-500); }

/* ---------- карточки/секции ---------- */
.card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:18px; margin-bottom:18px; }
.card > h2:first-child{ margin-top:0; }

/* ---------- дашборд: плитки ---------- */
.stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:20px; }
.stat{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:16px; }
.stat .lbl{ font-size:12.5px; color:var(--text-muted); display:flex; align-items:center; gap:6px; }
.stat .lbl svg{ width:15px; height:15px; color:var(--brand-500); }
.stat .val{ font-size:26px; font-weight:800; margin-top:6px; line-height:1; }
.stat .val small{ font-size:14px; font-weight:600; color:var(--text-muted); }
.stat.accent{ background:var(--brand-50); border-color:transparent; }
.stat.accent .val{ color:var(--brand-700); } :root[data-theme="dark"] .stat.accent .val{ color:var(--brand-500); }

.quick{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:22px; }

/* ---------- таблицы ---------- */
.list{ width:100%; border-collapse:collapse; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); overflow:hidden; }
.list th,.list td{ text-align:left; padding:11px 13px; border-bottom:1px solid var(--border); vertical-align:middle; }
.list tr:last-child td{ border-bottom:none; }
.list th{ font-size:12px; color:var(--text-muted); font-weight:600; background:var(--surface-2); }
.list tbody tr:hover{ background:var(--surface-2); }
.thumb-cell img{ width:44px; height:56px; object-fit:cover; border-radius:var(--r-sm); display:block; }
.noimg-mini{ width:44px; height:56px; border-radius:var(--r-sm); background:var(--surface-2); display:grid; place-items:center; color:var(--text-faint); }
.row-title{ font-weight:600; color:var(--text); }

/* ---------- статусы/теги ---------- */
.tag{ font-size:12px; font-weight:600; padding:3px 9px; border-radius:var(--r-pill); white-space:nowrap; display:inline-block; }
.tag.ok{ background:var(--success-bg); color:var(--success); }
.tag.no{ background:var(--surface-2); color:var(--text-muted); }
.tag.warn{ background:var(--warning-bg); color:var(--warning); }
.st-new{ background:var(--info-bg); color:var(--info); }
.st-confirmed{ background:var(--warning-bg); color:var(--warning); }
.st-done{ background:var(--success-bg); color:var(--success); }
.st-canceled{ background:var(--danger-bg); color:var(--danger); }
.st{ font-size:12px; font-weight:700; padding:3px 10px; border-radius:var(--r-pill); }

/* ---------- формы ---------- */
.form label{ display:block; margin-bottom:14px; font-size:13px; color:var(--text-muted); }
.form input,.form select,.form textarea{ display:block; width:100%; margin-top:5px; padding:11px 13px; font:inherit; font-size:16px;
  border:1px solid var(--border-strong); border-radius:var(--r-md); background:var(--bg); color:var(--text); }
.form input:focus,.form select:focus,.form textarea:focus{ outline:none; border-color:var(--brand-500); box-shadow:var(--ring); }
.form textarea{ resize:vertical; }
.form .two{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form .check{ display:flex; align-items:center; gap:9px; color:var(--text); font-size:14.5px; margin-bottom:14px; }
.form .check input{ width:auto; margin:0; }
.hintline{ font-size:12.5px; color:var(--text-muted); margin:2px 0 0; }

.searchbar{ display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.searchbar input,.searchbar select{ flex:1; min-width:140px; padding:10px 13px; border:1px solid var(--border-strong); border-radius:var(--r-md); background:var(--surface); color:var(--text); font-size:15px; }

/* ---------- фото товара ---------- */
.photos{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.photo{ position:relative; }
.photo img{ width:88px; height:110px; object-fit:cover; border-radius:var(--r-md); display:block; }
.photo .x,.cat-pill .x{ position:absolute; top:-7px; right:-7px; width:22px; height:22px; border-radius:50%; border:none;
  background:var(--danger); color:#fff; cursor:pointer; font-size:12px; line-height:1; box-shadow:var(--shadow-sm); }
.upload{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.upload input[type=file]{ font-size:14px; }
.cats{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.cat-pill{ position:relative; background:var(--surface-2); padding:7px 15px; border-radius:var(--r-pill); font-size:13.5px; }
.danger{ margin-top:8px; }

/* ---------- баннеры ---------- */
.banner{ display:flex; align-items:center; gap:12px; padding:13px 16px; border-radius:var(--r-md); margin-bottom:16px; font-size:14px; }
.banner.warn{ background:var(--warning-bg); color:var(--warning); }
.banner.brand{ background:var(--brand-50); color:var(--brand-700); }
:root[data-theme="dark"] .banner.brand{ color:var(--brand-500); }
.banner .btn{ margin-left:auto; }

.err{ background:var(--danger-bg); color:var(--danger); padding:10px 14px; border-radius:var(--r-md); margin-bottom:12px; font-size:14px; }
.ok-msg{ background:var(--success-bg); color:var(--success); padding:10px 14px; border-radius:var(--r-md); margin-bottom:12px; }
.empty{ padding:56px 24px; text-align:center; color:var(--text-muted); }
.empty svg{ width:48px; height:48px; opacity:.35; margin-bottom:12px; }
.empty h3{ margin:0 0 6px; font-size:16px; color:var(--text); }

/* ---------- вход / регистрация ---------- */
.auth-wrap{ min-height:100vh; display:grid; place-items:center; padding:24px 16px; position:relative; }
.auth-card{ background:var(--surface); border:1px solid var(--border); padding:30px 26px; border-radius:var(--r-lg); width:100%; max-width:380px; box-shadow:var(--shadow-md); }
.auth-brand{ display:flex; align-items:center; gap:9px; font-weight:800; font-size:18px; margin-bottom:6px; }
.auth-brand svg{ width:22px; height:22px; color:var(--brand-500); }
.auth-card h1{ font-size:19px; margin:14px 0 4px; }
.auth-card p.sub{ color:var(--text-muted); font-size:13.5px; margin:0 0 18px; }
.auth-card label{ display:block; font-size:13px; color:var(--text-muted); margin-bottom:12px; }
.auth-card input{ display:block; width:100%; margin-top:5px; padding:12px 13px; border:1px solid var(--border-strong);
  border-radius:var(--r-md); font:inherit; font-size:16px; background:var(--bg); color:var(--text); }
.auth-card input:focus{ outline:none; border-color:var(--brand-500); box-shadow:var(--ring); }
.auth-card button.submit{ width:100%; padding:13px; border:none; border-radius:var(--r-md); background:var(--brand-500);
  color:var(--on-brand); font:inherit; font-weight:700; cursor:pointer; margin-top:4px; }
.auth-card button.submit:active{ transform:translateY(1px); background:var(--brand-600); }
.auth-foot{ text-align:center; margin-top:16px; font-size:13.5px; color:var(--text-muted); }
.auth-theme{ position:fixed; top:16px; right:16px; }

/* ---------- платформа: карточки магазинов ---------- */
.shop-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px; }
.shop-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:16px; }
.shop-card .top{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.shop-card h3{ margin:0; font-size:16px; }
.shop-card .slug{ font-size:12.5px; color:var(--text-muted); font-family:ui-monospace,monospace; }
.shop-card .metrics{ display:flex; gap:16px; margin:12px 0; font-size:13px; color:var(--text-muted); }
.shop-card .metrics b{ color:var(--text); font-size:16px; display:block; }
.shop-card .acts{ display:flex; gap:8px; flex-wrap:wrap; }
.shop-card select{ padding:6px 10px; border:1px solid var(--border-strong); border-radius:var(--r-sm); background:var(--bg); color:var(--text); font:inherit; font-size:13px; }

@media (max-width:560px){
  .form .two{ grid-template-columns:1fr; }
  .list th:nth-child(3),.list td:nth-child(3){ display:none; }
  .topbar nav a span.lbl{ display:none; }
}
