:root{color-scheme:dark;--bg:#0d1916;--panel:#172622;--panel2:#223630;--fg:#f5f4ec;--muted:#b3c2ba;--line:#365049;--accent:#8acbb9;--danger:#ffa89b;font:16px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif}*{box-sizing:border-box}body{margin:0;color:var(--fg);background:var(--bg)}button,input,textarea,select{font:inherit}button{cursor:pointer}a{color:var(--accent)}.eyebrow{font-size:.72rem;letter-spacing:.16em;text-transform:uppercase;color:var(--accent);font-weight:700}h1,h2,h3,h4,p{margin:0}h1{font-size:1.9rem;letter-spacing:-.04em}h2{font-size:1.65rem}h3{font-size:1.15rem}h4{font-size:1rem}.login-layout{min-height:100dvh;display:grid;place-items:center;padding:20px;background:radial-gradient(circle at 20% 20%,#25433a,transparent 42%),var(--bg)}.auth-card{padding:36px;max-width:460px;width:100%;border:1px solid var(--line);border-radius:20px;background:var(--panel);display:grid;gap:18px;box-shadow:0 18px 70px #0004}.auth-card form{display:grid;gap:15px}.auth-card p{color:var(--muted)}.auth-card .error,.error{color:var(--danger)}.topbar{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:22px max(3vw,20px);border-bottom:1px solid var(--line);background:#11211c}.topbar-actions{display:flex;gap:15px;align-items:center}.topbar-actions form{margin:0}.workspace{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:calc(100dvh - 112px)}.sidebar{border-right:1px solid var(--line);padding:24px 18px;background:#13231e}.search-label{display:grid;gap:7px;color:var(--muted);font-size:.85rem}.items{display:grid;align-content:start;gap:7px;margin-top:20px}.item{display:flex;align-items:center;gap:12px;text-align:left;width:100%;padding:9px;background:transparent;border:1px solid transparent;border-radius:11px;color:var(--fg)}.item:hover{background:#273d35}.item.is-selected{background:#25443b;border-color:var(--accent)}.item__photo{width:56px;height:56px;flex:none;object-fit:cover;border-radius:8px;background:#28352f}.item span{display:grid;gap:3px;min-width:0}.item strong{font-size:.93rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item small{font-size:.75rem;color:var(--muted)}.editor{padding:25px clamp(18px,3.3vw,62px) 70px;max-width:1150px;width:100%;margin:auto}.notice{margin-bottom:18px;border:1px solid var(--line);padding:10px 15px;border-radius:9px;background:var(--panel2);color:var(--muted);font-size:.9rem}.notice[data-type=success]{border-color:#76ba9e;color:#d6ffe9}.notice[data-type=error]{border-color:#ba6262;color:#ffd6d2}.editor-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px}.chip{border:1px solid var(--line);border-radius:99px;padding:8px 12px;font-size:.78rem;color:var(--muted)}.tabs{display:flex;gap:8px;padding-bottom:15px;flex-wrap:wrap}.tab{padding:10px 16px;border-radius:9px;border:1px solid var(--line);background:transparent;color:var(--muted)}.tab.active{background:var(--accent);border-color:var(--accent);color:#0d251d;font-weight:700}.form-section{padding:24px;margin-bottom:16px;background:var(--panel);border:1px solid var(--line);border-radius:16px;display:grid;gap:15px}.form-section h3{margin-bottom:3px}.field{display:grid;gap:7px;min-width:0}.field-name{color:var(--muted);font-size:.87rem}.field input,.field textarea,.field select,.search-label input{width:100%;min-width:0;background:#0e201b;color:var(--fg);border:1px solid #4b6257;border-radius:9px;padding:11px 12px;outline-offset:2px}.field textarea{resize:vertical}.field :is(input,textarea,select):focus,.search-label input:focus{outline:2px solid var(--accent);border-color:transparent}.fields-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.wholesale-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.weight-rows{display:grid;gap:14px}.weight-row{background:#1f322b;border:1px solid var(--line);border-radius:12px;padding:17px;display:grid;gap:13px}.weight-heading{display:flex;justify-content:space-between;align-items:center}.checkline{display:flex;align-items:center;gap:10px;color:var(--fg)}.checkline input{width:18px;height:18px;accent-color:var(--accent)}.help{color:var(--muted);font-size:.82rem}.main-photo{width:230px;height:145px;object-fit:cover;max-width:100%;border-radius:11px;border:1px solid var(--line)}.primary,.secondary,.ghost{border:1px solid var(--line);border-radius:9px;padding:10px 16px;color:var(--fg);background:transparent}.primary{background:var(--accent);color:#0b2920;font-weight:750;border-color:var(--accent)}.primary:hover{filter:brightness(1.09)}.secondary{color:var(--accent)}.secondary:hover,.ghost:hover{background:#32493e}.danger{color:var(--danger)}button:disabled{opacity:.55;cursor:wait}.savebar{position:sticky;bottom:0;border:1px solid var(--line);border-radius:12px;background:#182922f5;backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px}.save-button.needs-save{box-shadow:0 0 0 3px #8acbb94d}@media(max-width:820px){.workspace{grid-template-columns:1fr}.sidebar{border-right:0;border-bottom:1px solid var(--line);padding:15px}.items{display:flex;overflow:auto;gap:7px;margin-top:12px}.item{min-width:190px;max-width:235px}.item__photo{width:44px;height:44px}.editor{padding:20px 15px 60px}.fields-grid{grid-template-columns:1fr 1fr}.topbar{flex-wrap:wrap}.topbar h1{font-size:1.5rem}}@media(max-width:510px){.fields-grid{grid-template-columns:1fr}.savebar{align-items:stretch;flex-direction:column}.chip{display:none}.auth-card{padding:23px}}@media(prefers-reduced-motion:no-preference){button{transition:background-color .15s ease,filter .15s ease,border-color .15s ease}}



/* v4 — компактная форма входа, фоновый градиент только на CSS. */
.login-layout {
  min-height: 100dvh;
  padding: 20px;
  background:
    radial-gradient(ellipse 58% 70% at 17% 13%, rgba(55, 125, 99, .33) 0%, transparent 69%),
    radial-gradient(ellipse 47% 62% at 88% 88%, rgba(37, 97, 78, .29) 0%, transparent 72%),
    radial-gradient(ellipse 55% 42% at 55% 54%, rgba(20, 67, 51, .2) 0%, transparent 78%),
    linear-gradient(135deg, #0a1714 0%, #10251e 46%, #091814 100%);
}
.auth-card {
  display: block;
  width: min(100%, 510px);
  max-width: 510px;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid rgba(127, 206, 177, .43);
  border-radius: 23px;
  background: linear-gradient(147deg, rgba(22, 57, 46, .94), rgba(12, 35, 29, .96));
  box-shadow: 0 24px 74px rgba(0, 0, 0, .26), inset 0 1px rgba(194, 255, 227, .045);
}
.login-eyebrow {
  display: block;
  margin: 0 0 29px;
  letter-spacing: .23em;
  font-size: .73rem;
  line-height: 1.6;
}
.auth-card .login-form { display: flex; flex-direction: column; gap: 0; }
.password-field { display:block; margin-bottom:9px; font-size:1rem; color:var(--fg); }
.password-box { display:flex; position:relative; align-items:center; }
.password-box input {
  display:block;
  width:100%;
  height:58px;
  min-width:0;
  padding:0 56px 0 54px;
  border:1.5px solid #7ecab3;
  border-radius:12px;
  background:rgba(4, 23, 18, .62);
  color:var(--fg);
  outline:none;
  font-size:1rem;
  box-shadow:inset 0 1px 2px rgba(0, 0, 0, .18);
}
.password-box input::placeholder {color:#9db7ad; opacity:1;}
.password-box input:focus {border-color:#b1f2db;box-shadow:0 0 0 3px rgba(138, 203, 185, .17);}
.password-lock {position:absolute;left:18px;width:23px;height:23px;pointer-events:none;color:#a6bdb6;}
.password-toggle {
  position:absolute;
  right:7px;
  top:50%; transform:translateY(-50%);
  width:44px;height:44px;
  display:grid;place-items:center;
  border:0;border-radius:10px;
  background:transparent;color:#a7bfb6;padding:10px;
}
.password-toggle svg {display:block;width:24px;height:24px;}
.password-toggle:hover {background:rgba(138,203,185,.12);color:#d7faed;}
.password-toggle:focus-visible {outline:2px solid var(--accent);outline-offset:2px;}
.password-toggle .eye-slash {display:none;}
.password-toggle.is-visible .eye-slash {display:block;}
.login-submit {
  width:100%;min-height:58px;
  margin-top:21px;
  border-radius:12px;
  font-size:1.16rem;font-weight:750;
  box-shadow:0 7px 25px rgba(53, 158, 126, .13);
}
.login-submit:focus-visible {outline:3px solid #d8fdef;outline-offset:3px;}
.auth-error {margin-bottom:16px;}
.auth-preview-link {display:block;margin-top:25px;text-align:center;font-size:.92rem;text-decoration:underline;text-underline-offset:4px;}
.notice[hidden] {display:none;}
@media(max-width:510px) {
  .login-layout {padding:16px;}
  .auth-card {border-radius:18px;padding:28px 24px 30px;}
  .login-eyebrow {font-size:.69rem;letter-spacing:.18em;margin-bottom:25px;}
  .password-box input {height:56px;border-radius:11px;padding-left:51px;padding-right:52px;}
  .password-lock {left:17px;width:22px;height:22px;}
  .password-toggle {right:5px;}
  .login-submit {min-height:56px;border-radius:11px;font-size:1.09rem;margin-top:19px;}
  .auth-preview-link {margin-top:22px;}
}
@media(prefers-reduced-motion:reduce) {
  .password-toggle,.login-submit,.password-box input {transition:none!important;}
}


/* Только интерфейс админки: статус сохранения слева от кнопки. */
.savebar { justify-content:flex-end; }
.savebar .notice {
  margin:0;
  padding:7px 12px;
  width:auto;
  max-width:100%;
  font-size:.88rem;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.savebar .notice[data-type="success"] {
  background:rgba(55,113,88,.22);
  border-color:rgba(138,203,185,.4);
}
.savebar .save-button { margin-left:0; }
@media (max-width:820px) {
  /* Не даём длинной строке товаров растягивать мобильную сетку. */
  .workspace { grid-template-columns:minmax(0,1fr); }
  .sidebar, .editor, .items { min-width:0; }
}
@media (max-width:510px) {
  .savebar { align-items:stretch; }
  .savebar .notice { align-self:flex-start; }
  .savebar .save-button { width:100%; margin-left:0; }
}

/* Master Cake — более мягкая тёмно-зелёная палитра панели управления.
   Изменения ограничены рабочим интерфейсом: форму входа не трогаем. */
.dashboard {
  --bg: #192e27;
  --panel: #294238;
  --panel2: #315145;
  --fg: #f6f8f3;
  --muted: #c2d3c9;
  --line: #49695c;
}
.dashboard .topbar { background: #1e372e; }
.dashboard .sidebar { background: #142b23; }
.dashboard .item:hover { background: #335447; }
.dashboard .item.is-selected { background: #315749; border-color: var(--accent); }
.dashboard .item__photo { background: #38574a; }
.dashboard .settings-icon { background: #345b4c; }
.dashboard .field input,
.dashboard .field textarea,
.dashboard .field select,
.dashboard .search-label input {
  background: #1c372d;
  border-color: #59776a;
}
.dashboard .weight-row { background: #315044; }
.dashboard .secondary:hover,
.dashboard .ghost:hover,
.dashboard .tab:not(.active):hover { background: #3b5c4e; }
.dashboard .savebar { background: rgba(39, 66, 55, .96); }


/* Навигация между разделами админки: вкладки с единой активной подсветкой. */
.dashboard .admin-topbar {
  padding: 21px clamp(18px, 3vw, 54px) 15px;
  border-bottom: 0;
  gap: 24px;
}
.dashboard .admin-topbar__heading { min-width: 0; }
.dashboard .admin-topbar h1 { margin-top: 5px; line-height: 1.16; }
.dashboard .admin-topbar__actions { gap: 18px; }
.dashboard .admin-topbar__actions form { flex: none; }
.dashboard .admin-site-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 47px; padding: 11px 18px;
  border: 1px solid var(--line); border-radius: 13px;
  color: var(--accent); background: transparent;
  text-decoration: none; font-size: .97rem; font-weight: 500;
  line-height: 1.2; white-space: nowrap;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.dashboard .admin-site-link__arrow { font-size: 1.15em; line-height: 1; }
.dashboard .admin-site-link:hover { color: #c2ffe9; background: var(--panel2); border-color: #648775; }
.dashboard .admin-logout { padding: 10px 17px; border-color: #4e7161; }
.dashboard .admin-nav-shell {
  background: #1e372e;
  border-bottom: 1px solid #456454;
  position: sticky; top: 0; z-index: 25;
  box-shadow: 0 5px 15px rgba(6, 23, 17, .1);
}
.dashboard .admin-nav {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 2px clamp(18px, 3vw, 54px) 0;
  overflow-x: auto; scrollbar-width: thin; scrollbar-color: #4d7664 transparent;
  -webkit-overflow-scrolling: touch;
}
.dashboard .admin-nav__tab {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; flex: none; min-height: 51px; padding: 0 19px;
  text-decoration: none; color: #bdd7ca;
  border: 1px solid transparent; border-bottom: 0;
  border-radius: 12px 12px 0 0;
  font-size: .97rem; font-weight: 650; letter-spacing: -.005em;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.dashboard .admin-nav__tab svg { width: 20px; height: 20px; flex: none; opacity: .9; }
.dashboard .admin-nav__tab:not(.is-active):hover,
.dashboard .admin-nav__tab:not(.is-active):focus-visible {
  color: #f5fff9; background: #2d4d40;
}
.dashboard .admin-nav__tab.is-active {
  background: linear-gradient(180deg, #335a49 0%, #2b4f41 100%);
  color: #f5fff9;
  border-color: #537a66;
  box-shadow: inset 0 1px 0 rgba(207, 255, 230, .08);
  font-weight: 760;
}
.dashboard .admin-nav__tab.is-active::after {
  position: absolute; content: ''; bottom: 0; left: 14px; right: 14px;
  height: 3px; border-radius: 3px 3px 0 0; background: #9be1c7;
}
.dashboard .admin-nav__tab.is-active svg { color: #b7f8df; opacity: 1; }
.dashboard .admin-nav__tab:focus-visible,
.dashboard .admin-site-link:focus-visible,
.dashboard .admin-logout:focus-visible {
  outline: 2px solid #aeefd6; outline-offset: -3px;
}
.dashboard .workspace { min-height: calc(100dvh - 165px); }
@media (max-width: 750px) {
  .dashboard .admin-topbar { padding: 17px 18px 12px; gap: 13px; }
  .dashboard .admin-topbar__actions { gap: 10px; }
  .dashboard .admin-nav { padding-inline: 14px; gap: 5px; }
  .dashboard .admin-nav__tab { min-height: 48px; padding: 0 14px; font-size: .89rem; gap: 8px; }
  .dashboard .admin-nav__tab svg { width: 18px; height: 18px; }
}
@media (max-width: 480px) {
  .dashboard .admin-topbar h1 { font-size: 1.4rem; }
  .dashboard .admin-topbar__actions { margin-left: auto; }
  .dashboard .admin-site-link { min-height: 39px; padding: 8px 11px; font-size: .83rem; }
  .dashboard .admin-logout { padding: 8px 11px; font-size: .9rem; }
  .dashboard .admin-nav__tab { min-height: 45px; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard .admin-nav__tab { transition: none; }
}
