:root {
  color-scheme: light;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #302332;
  background: #f7f4f8;
  --ink: #302332;
  --muted: #68596b;
  --border: #e7dfe8;
  --accent: #803b70;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
a { color: inherit; }
.sidebar { background: #302133; color: #fff; padding: 32px 22px; display: flex; flex-direction: column; gap: 42px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.2rem; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 12px; background: #f1c9e2; color: #532849; }
.sidebar nav, .sidebar-footer { display: grid; gap: 8px; }
.sidebar nav button, .sidebar-footer button, .sidebar-footer a { text-align: left; color: inherit; background: transparent; border-color: transparent; border-radius: 9px; padding: 10px 12px; text-decoration: none; }
.sidebar nav button:hover, .sidebar-footer button:hover, .sidebar-footer a:hover { background: #49384c; }
.sidebar button[aria-current="page"] { background: #5e4260; font-weight: 700; }
.sidebar-footer { margin-top: auto; }
.workspace { width: min(100%, 1250px); padding: clamp(20px, 5vw, 62px); }
.page-header { margin-bottom: 22px; }
.context { color: var(--muted); margin: 0 0 6px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.55rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 1.25rem; }
p { color: var(--muted); margin: 6px 0; }
.card, dialog { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: clamp(16px, 3vw, 30px); }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.login-card { max-width: 455px; }
.login-card form { margin-top: 20px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 5px; font-size: .9rem; font-weight: 600; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea, button { border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; background: #fff; }
input, select, textarea { width: 100%; min-width: 0; }
textarea { resize: vertical; }
button { cursor: pointer; font-weight: 600; }
button:disabled { cursor: wait; opacity: .65; }
button:hover { background: #f5edf4; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #69305c; }
:focus-visible { outline: 3px solid #b367a2; outline-offset: 3px; }
.filters, .category-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 15px; }
.filters label:first-child { flex: 1 1 180px; }
.filters label:last-child { flex: 0 1 170px; }
.category-form label { flex: 1 1 180px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: .85rem; white-space: nowrap; }
td:first-child { font-weight: 600; }
td:last-child { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
dialog { color: var(--ink); width: min(560px, calc(100% - 28px)); max-height: calc(100% - 28px); }
dialog::backdrop { background: #30213388; }
dialog .card-header, dialog .filters { margin-bottom: 0; }
.check { display: flex; align-items: center; }
.check input { width: auto; accent-color: var(--accent); }
#status:empty, #editor-status:empty { display: none; }
#status, #editor-status { margin: 0 0 14px; padding: 9px 12px; background: #f4e8f2; border-radius: 9px; }
.reviews { display: grid; gap: 12px; }
.review { border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.review h3 { margin: 0; font-size: 1rem; }
.review p { white-space: pre-wrap; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 740px) {
  body { display: block; }
  .sidebar { gap: 12px; padding: 14px 18px; }
  .sidebar nav, .sidebar-footer { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar-footer { margin-top: 0; }
  .workspace { padding: 20px 14px; }
  th, td { padding: 8px; }
}
.login-layout { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 20px; align-items: stretch; max-width: 900px; }
.login-intro { padding: clamp(24px,4vw,44px); color: #fff; background: #4b2946; border-radius: 18px; }
.login-intro p { color: #f1c9e2; margin: 0 0 10px; }
.login-intro h2 { font-size: clamp(1.45rem,3vw,2.15rem); line-height: 1.15; }
.login-intro ul { margin: 22px 0 0; padding-left: 20px; }
.login-card { max-width: none; }
#show-password { justify-self: start; padding: 5px 8px; font-size: .88rem; }
@media (max-width: 1050px) { .login-layout { grid-template-columns: 1fr; max-width: 480px; } }
.image-editor { min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.image-editor legend { font-weight: 700; padding: 0 6px; }
.image-preview { width: 110px; height: 84px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.image-editor button { margin-top: 5px; }
.category-form .image-editor { flex: 1 1 100%; }
.review-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.review-summary span { background: #f4e8f2; border-radius: 8px; padding: 6px 10px; }
.catalog-label { display: flex; gap: 9px; align-items: center; }
.catalog-label img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; }
.product-actions { margin-top: 0; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.overview-card { display: grid; text-align: left; gap: 5px; }
.overview-card strong { font-size: 2rem; line-height: 1.1; color: var(--accent); }
