/* Раздел «Заказ печати». Цвета берутся из app/css/style.css; здесь запасные значения. */
:root {
  --st-bg: var(--bg, #f6f7f9);
  --st-surface: var(--surface, #ffffff);
  --st-border: var(--border, #dfe3e8);
  --st-text: var(--text, #1b1f24);
  --st-muted: var(--muted, #5f6b7a);
  --st-accent: var(--accent, #1f4e8c);
  --st-font: var(--font, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif);
  --st-ok: #1e7a46;
  --st-warn: #9a6100;
  --st-bad: #b3261e;
  --st-radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --st-bg: var(--bg, #14171b); --st-surface: var(--surface, #1c2026); --st-border: var(--border, #2e343c);
    --st-text: var(--text, #e8ebef); --st-muted: var(--muted, #9aa5b1); --st-accent: var(--accent, #6ea4e6);
    --st-ok: #5cc98b; --st-warn: #e0a84a; --st-bad: #f08a80;
  }
}
:root[data-theme="dark"] {
  --st-bg: var(--bg, #14171b); --st-surface: var(--surface, #1c2026); --st-border: var(--border, #2e343c);
  --st-text: var(--text, #e8ebef); --st-muted: var(--muted, #9aa5b1); --st-accent: var(--accent, #6ea4e6);
  --st-ok: #5cc98b; --st-warn: #e0a84a; --st-bad: #f08a80;
}

body { margin: 0; background: var(--st-bg); color: var(--st-text); font-family: var(--st-font); line-height: 1.5; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Шапка: если общий стиль не подключился, выглядит прилично и сама. */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px;
  background: var(--st-surface); border-bottom: 1px solid var(--st-border); flex-wrap: wrap; }
.topbar .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--st-accent); text-decoration: none; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { color: var(--st-text); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.topnav a:hover { background: color-mix(in srgb, var(--st-accent) 10%, transparent); }
.topnav a[aria-current="page"] { color: var(--st-accent); font-weight: 600; }

.st-main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.st-hero h1, .st-head-row h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
.st-hero p { max-width: 680px; margin: 0 0 16px; }
.muted { color: var(--st-muted); }
.small { font-size: 13px; }
.st-note { background: color-mix(in srgb, var(--st-warn) 12%, var(--st-surface)); border: 1px solid color-mix(in srgb, var(--st-warn) 35%, transparent);
  padding: 8px 12px; border-radius: 8px; font-size: 14px; }

.st-card { background: var(--st-surface); border: 1px solid var(--st-border); border-radius: var(--st-radius); padding: 24px; margin-top: 16px; }
.st-card h2 { font-size: 20px; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.st-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--st-accent); color: #fff; font-size: 14px; }

/* Поля */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; color: inherit; background: var(--st-bg); border: 1px solid var(--st-border); border-radius: 8px; padding: 8px 12px; min-height: 40px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .btn:focus-visible, .st-color:focus-visible {
  outline: 2px solid var(--st-accent); outline-offset: 2px; }
.field input[aria-invalid="true"] { border-color: var(--st-bad); }
.st-error { color: var(--st-bad); font-size: 13px; margin: 4px 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--st-border); background: var(--st-surface); color: var(--st-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--st-accent); border-color: var(--st-accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: progress; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: color-mix(in srgb, var(--st-ok) 14%, transparent); color: var(--st-ok); }

.st-inn { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.st-inn .field { flex: 1 1 240px; max-width: 360px; margin: 0; }
.st-inn .btn { margin-top: 25px; }

#orgBox { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--st-border); }
.st-org-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.st-org-name { font-weight: 700; font-size: 16px; }
.st-edit { margin-top: 12px; }
.st-edit summary { cursor: pointer; color: var(--st-accent); font-size: 14px; margin-bottom: 12px; }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.st-span2 { grid-column: 1 / -1; }

/* Варианты */
.st-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.st-colors { display: flex; gap: 8px; }
.st-color { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--st-surface); background: var(--c); box-shadow: 0 0 0 1px var(--st-border); cursor: pointer; }
.st-color[aria-checked="true"] { box-shadow: 0 0 0 2px var(--st-accent); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.st-variant { border: 1px solid var(--st-border); border-radius: var(--st-radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.st-variant.selected { border-color: var(--st-accent); box-shadow: 0 0 0 1px var(--st-accent); }
.st-variant h3 { font-size: 15px; margin: 0; }
.st-variant p { margin: 0; flex: 1; }
.st-prev-wrap { background: #fff; border-radius: 8px; height: 200px; padding: 8px; display: grid; place-items: center; overflow: hidden; }
.st-prev { max-width: 100%; max-height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.st-wm-note { margin: 16px 0 0; }

/* Заказ */
.st-picked { display: flex; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--st-border); border-radius: var(--st-radius); margin-bottom: 16px; }
.st-picked-img { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: 8px; pointer-events: none; }
.st-picked .btn { margin-top: 6px; }
.st-fs { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.st-fs legend { font-weight: 700; font-size: 16px; margin-bottom: 8px; padding: 0; }
.st-radios { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.st-radios label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
.st-qty { max-width: 140px; }
.st-files { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.st-file input[type=file] { padding: 6px; width: 100%; min-width: 0; }
.st-file p { margin: 0; }
.st-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 4px 0 12px; }
.st-consent input { margin-top: 4px; }
.st-submit { min-width: 200px; }
.st-done h2 { display: block; }

/* Заказы */
.st-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-orders .st-card { padding: 16px 20px; }
.st-order-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 6px; }
.st-order p { margin: 6px 0 0; }
.st-status { padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tone-info { background: color-mix(in srgb, var(--st-accent) 14%, transparent); color: var(--st-accent); }
.tone-ok { background: color-mix(in srgb, var(--st-ok) 14%, transparent); color: var(--st-ok); }
.tone-warn { background: color-mix(in srgb, var(--st-warn) 16%, transparent); color: var(--st-warn); }
.tone-bad { background: color-mix(in srgb, var(--st-bad) 14%, transparent); color: var(--st-bad); }
.tone-muted { background: color-mix(in srgb, var(--st-muted) 14%, transparent); color: var(--st-muted); }
.st-empty { text-align: center; padding: 40px 24px; }
.st-empty h2 { display: block; }

@media (max-width: 640px) {
  .st-card { padding: 16px; }
  .st-grid2, .st-files { grid-template-columns: 1fr; }
  .st-inn .btn { margin-top: 0; width: 100%; }
  .st-inn .field { max-width: none; }
  .st-hero h1, .st-head-row h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
