/* 3 Sigma — control panel. Uses the shop's tokens and fonts from styles.css. */
body.admin { background: #f4f2ec; font-size: 15px; }
.admin h1, .admin h2 { font-family: var(--serif); letter-spacing: -.01em; }
.a-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.a-btn { min-height: 40px; padding: 0 16px; font-size: 14.5px; border-radius: 8px; gap: 8px; }
.a-danger { color: var(--bad); border-color: var(--bad); }
.a-danger:hover { background: var(--bad); color: #fff; }
.a-muted { color: var(--muted); margin: 0 0 12px; }
.a-note { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
.a-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-text); font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.a-warn { color: var(--bad); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.a-code { font-size: 12.5px; color: var(--muted); }
small.a-code { display: block; margin-top: 2px; }

/* layout */
.a-layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.a-side { background: var(--dark); color: var(--on-dark); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-top: 4px solid var(--gold); }
.a-brand { padding: 22px 20px 20px; display: grid; gap: 6px; border-bottom: 1px solid var(--dark-line); }
.a-brand span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-muted); }
.a-side ul { list-style: none; margin: 0; padding: 12px 10px; display: grid; gap: 2px; }
.a-side nav a, .a-side-foot a, .a-side-foot button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--on-dark); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.a-side nav a:hover, .a-side-foot a:hover, .a-side-foot button:hover { background: var(--dark-2); }
.a-side nav a[aria-current="page"] { background: var(--dark-2); box-shadow: inset 3px 0 0 var(--gold); color: #fff; font-weight: 600; }
.a-count { margin-left: auto; background: var(--gold); color: #111; font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; }
.a-side-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--dark-line); color: var(--on-dark-muted); }
.a-main-col { min-width: 0; display: flex; flex-direction: column; }
.a-top { display: flex; align-items: center; gap: 14px; padding: 22px 32px 6px; flex-wrap: wrap; }
.a-top h1 { font-size: 28px; margin: 0; flex: 1; min-width: 200px; }
.a-top h1 small { font-family: var(--sans); font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.a-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.a-menu { display: none; }
.a-main { padding: 16px 32px 32px; flex: 1; outline: 0; }
.a-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 32px 24px; font-size: 13px; color: var(--muted); }
.a-foot .powered, .a-login .powered { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* cards */
.a-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.a-card h2 { font-size: 18px; margin: 0 0 14px; }
.a-card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.a-card-h h2 { margin: 0; }
.a-card-h a { font-size: 14px; }
.a-flush { padding: 0; overflow: hidden; }
.a-stack { display: grid; gap: 16px; align-content: start; }
.a-grid2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.a-order { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }

/* tiles */
.a-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.a-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; text-decoration: none; display: grid; gap: 4px; transition: border-color .15s; }
.a-tile:hover { border-color: var(--ink); }
.a-tile-l { font-size: 13.5px; color: var(--muted); }
.a-tile-v { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.15; }
.a-tile-s { font-size: 13px; color: var(--muted); }

/* lists */
.a-todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.a-todo a { display: block; padding: 10px 12px; margin: 0 -12px; border-radius: 8px; text-decoration: none; }
.a-todo a:hover { background: var(--gold-soft); }
.a-top5 { margin: 0; padding: 0; list-style: none; counter-reset: t; }
.a-top5 li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.a-top5 li:first-child { border-top: 0; }
.a-top5 small { display: block; color: var(--muted); font-size: 12.5px; }
.a-top5 li > span:last-child { white-space: nowrap; font-weight: 600; }

/* tables */
.a-table-wrap { overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.a-table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.a-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.a-table tbody tr:last-child td { border-bottom: 0; }
.a-table .r { text-align: right; }
.a-table tr[data-href] { cursor: pointer; }
.a-table tr[data-href]:hover td { background: #faf8f2; }
.a-card:not(.a-flush) .a-table th:first-child, .a-card:not(.a-flush) .a-table td:first-child { padding-left: 0; }
.a-card:not(.a-flush) .a-table th:last-child, .a-card:not(.a-flush) .a-table td:last-child { padding-right: 0; }
.a-empty { padding: 28px; text-align: center; color: var(--muted); }
.a-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.s-new { background: #fbe7a8; color: #5a4300; }
.s-proc { background: #dde8f7; color: #1d3e6e; }
.s-ready { background: #e7defa; color: #4a2b85; }
.s-ship { background: #d9efe9; color: #145446; }
.s-done { background: #e3eedf; color: #1f5a22; }
.s-cancel { background: #eee; color: #555; text-decoration: line-through; }
.a-thumb { width: 64px; }
.a-thumb img, .a-thumb span { display: block; width: 48px; height: 48px; object-fit: contain; background: var(--plate); border-radius: 6px; }
.a-prods td:nth-child(2) { min-width: 240px; }
.a-prods a { text-decoration: none; }
.a-prods a:hover b { text-decoration: underline; }
.a-cat { color: var(--muted); font-size: 13.5px; }
.a-money { display: inline-flex; align-items: center; gap: 6px; }
.a-money input { width: 110px; text-align: right; }
.admin input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .admin select, .admin textarea { font: inherit; font-size: 15px; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
.a-table select { width: auto; max-width: 210px; }
.admin input:focus, .admin select:focus, .admin textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }

/* toolbar */
.a-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.a-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.a-tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.a-tabs a span { color: var(--muted); font-size: 12.5px; }
.a-tabs a[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.a-tabs a[aria-selected="true"] span { color: var(--on-dark-muted); }
.a-search { display: flex; gap: 8px; flex: 1 1 340px; max-width: 620px; }
.a-search input[type="search"] { flex: 1; min-width: 0; }
.a-search select { width: auto; max-width: 220px; }
.a-hint { font-size: 13.5px; }
.a-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }

/* order detail */
.a-sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); max-width: 360px; margin-left: auto; }
.a-sum dt { color: var(--muted); }
.a-sum dd { margin: 0; text-align: right; }
.a-sum .t { font-size: 18px; font-weight: 700; color: var(--ink); padding-top: 6px; }
.a-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.a-hist { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.a-hist li { position: relative; font-size: 14.5px; }
.a-hist li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.a-hist small { display: block; color: var(--muted); font-size: 12.5px; }
.a-inline { display: flex; gap: 8px; margin-top: 16px; }
.a-inline input { flex: 1; min-width: 0; }
.a-big { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.a-links { display: grid; gap: 6px; margin: 0 0 10px; }
.a-links a { display: inline-flex; align-items: center; gap: 8px; word-break: break-all; }
.a-quote { background: var(--surface); border-left: 3px solid var(--gold); padding: 10px 12px; margin: 10px 0 0; font-style: italic; }
.a-card p { margin: 0 0 8px; }
.a-print-only { display: none; }

/* forms */
.a-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.a-full { grid-column: 1 / -1; }
.a-field { display: grid; gap: 6px; margin-bottom: 12px; }
.a-form .a-field { margin-bottom: 0; }
.a-field label { font-size: 14px; font-weight: 500; }
.a-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 40px; font-size: 14.5px; }
.a-switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.a-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.a-switch input:checked { background: var(--ok); }
.a-switch input:checked::after { left: 19px; }
.a-switch input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.a-radio { display: grid; gap: 8px; }
.a-radio label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.a-radio label:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.a-radio input { margin-top: 4px; accent-color: var(--ink); }
.a-radio small { display: block; color: var(--muted); font-size: 13px; }
.a-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.a-photos img, .a-upload { width: 120px; height: 120px; border-radius: 8px; background: var(--plate); object-fit: contain; }
.a-upload { display: grid; place-items: center; border: 1px dashed var(--line-2); background: var(--surface); cursor: pointer; color: var(--muted); font-size: 14px; position: relative; }
.a-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.a-upload:focus-within { outline: 2px solid var(--gold); }

/* login */
.a-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.a-login .a-card { width: 100%; max-width: 400px; padding: 32px; display: grid; gap: 4px; border-top: 4px solid var(--gold); }
.a-login h1 { font-size: 26px; margin: 18px 0 2px; }
.a-login .btn { border-radius: 8px; margin-top: 6px; }

.admin .toast a { color: inherit; }

@media (max-width: 1100px) {
  .a-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-grid2, .a-order { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .a-layout { grid-template-columns: 1fr; }
  .a-side { position: fixed; z-index: 70; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .a-open .a-side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .a-menu { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font: inherit; cursor: pointer; }
  .a-top { padding: 14px 16px 4px; }
  .a-top h1 { font-size: 22px; order: 3; flex-basis: 100%; }
  .a-main { padding: 12px 16px 24px; }
  .a-foot { padding: 12px 16px 20px; }
}
@media (max-width: 700px) {
  .admin input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .admin select, .admin textarea { font-size: 16px; min-height: 44px; }
  .a-btn { min-height: 44px; }
  .a-tile-v { font-size: 24px; }
  .a-form { grid-template-columns: 1fr; }
  .a-search { flex-wrap: wrap; }
  .a-search select { max-width: none; flex: 1 1 100%; order: 2; }
  .a-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; }
  .a-tabs a { flex: none; }
  /* tables become cards */
  .a-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .a-table, .a-table tbody, .a-table tr, .a-table td { display: block; width: 100%; }
  .a-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
  .a-card:not(.a-flush) .a-table tr { padding: 12px 0; }
  .a-table td { border: 0; padding: 3px 0 !important; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: right; }
  .a-table td::before { content: attr(data-l); color: var(--muted); font-size: 13px; text-align: left; }
  .a-table td:not([data-l])::before { content: none; }
  .a-table .r { text-align: right; }
  .a-prods td:nth-child(2) { display: block; text-align: left; min-width: 0; padding-right: 64px !important; }
  .a-prods td:nth-child(2)::before { content: none; }
  .a-prods .a-thumb { position: absolute; right: 16px; top: 12px; width: auto; }
  .a-table select { max-width: 60%; }
}

@media print {
  .a-side, .a-top .a-actions, .a-menu, .a-foot, .a-noprint, .skip, .toast { display: none !important; }
  .a-layout, .a-order { display: block; }
  body.admin { background: #fff; }
  .a-card { border: 0; padding: 0 0 14px; }
  .a-print-only { display: block; }
}
.a-table .r, .a-table td:last-child { white-space: nowrap; }
.a-photo { position: relative; margin: 0; }
.a-photo-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 18px; line-height: 1; }
.a-photo-x:hover { background: var(--bad); color: #fff; border-color: var(--bad); }

/* ---------- catalogue check, site content, bulk upload ---------- */
.a-todo small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.a-ok { display: flex; gap: 8px; align-items: center; color: var(--ok, #2f7a3e); margin: 0; }
.a-ok .a-ic { width: 18px; height: 18px; }
.a-err { color: var(--bad); }
.a-brands, .a-covers { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.a-brand-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.a-brand-row .a-field { margin: 0; }
.a-row-btns { display: flex; gap: 6px; }
.a-logo { position: relative; display: grid; place-items: center; width: 120px; height: 56px; border: 1px dashed var(--line-2); border-radius: 8px; background: #fff; cursor: pointer; color: var(--muted); font-size: 13px; overflow: hidden; }
.a-logo img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 6px; }
.a-logo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.a-logo:focus-within { outline: 2px solid var(--gold); }
.a-logo-sq { width: 72px; height: 72px; }
.a-covers { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.a-cover { display: grid; gap: 4px; justify-items: start; font-size: 14px; }
.a-cover small { color: var(--muted); font-size: 12.5px; }
.a-cover .link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12.5px; }
.a-upload-wide { width: 240px; height: 150px; overflow: hidden; }
.a-upload-wide img { width: 100%; height: 100%; object-fit: cover; }
.a-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14.5px; }
.a-steps code { background: var(--plate); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.a-cols { margin: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); font-size: 14px; }
.a-cols dt, .a-cols dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.a-cols dt { font-weight: 600; }
.a-isum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.a-isum span { padding: 8px 12px; border-radius: 8px; background: var(--plate); font-size: 14px; }
.a-isum .is-bad { background: #fbe9e7; color: var(--bad); }
.a-isum .is-warn { background: #fdf3dc; }
.a-imp tr.is-bad td { background: #fdf2f0; }
@media (min-width: 1101px) { .a-import { grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); } }
.a-import > *, .a-import .a-stack > * { min-width: 0; }
.a-imp td { white-space: normal; }
.a-import .a-switch span { white-space: normal; }
.a-import input[type=file] { font-size: 14px; max-width: 100%; }
@media (max-width: 700px) {
  .a-brand-row { grid-template-columns: 120px minmax(0, 1fr); }
  .a-cols { grid-template-columns: minmax(0, 1fr); }
  .a-cols dd { padding-top: 0; }
}
