/* ASM Portal styles */
:root {
  --bg: #f6f3ee; --panel: #fff; --ink: #1f1d1a; --muted: #6b665e; --line: #e4ded4;
  --accent: #b5462a; --processing: #c27c0e; --way: #2f62c4; --delivered: #2e8540;
  --issue: #c93c2b; --cancelled: #9a948a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513; --panel: #201e1b; --ink: #f1ede6; --muted: #a39d93; --line: #34312c;
    --accent: #e0714f; --processing: #e3a440; --way: #6f9bf0; --delivered: #5fbf72;
    --issue: #f0705f; --cancelled: #8a847a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
h1 { font-family: Georgia, serif; font-weight: 400; font-size: 30px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.inline { display: inline; margin: 0; }

/* buttons and inputs */
.btn { display: inline-block; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; }
.btn.danger { color: var(--issue); }
input { font: inherit; font-size: 16px; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label input { margin-top: 5px; }
.alert { background: #fdecea; color: #8a2416; border-radius: 10px; padding: 10px 14px; margin: 14px 0; font-size: 14px; }
.alert.ok { background: #e8f4ea; color: #1e5c2b; }

/* login */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-box { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px; }
.auth-box form { margin: 18px 0 10px; }
.logo { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 16px; border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--accent) 50%, transparent 50%), repeating-linear-gradient(45deg, var(--accent) 0 3px, transparent 3px 7px); }
.logo.small { width: 22px; height: 22px; border-radius: 7px; margin: 0; display: inline-block; vertical-align: middle; }

/* top bar + page */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; flex-wrap: wrap;
  gap: 10px; align-items: center; justify-content: space-between; }
.brand { font-weight: 600; display: flex; gap: 10px; align-items: center; }
.who { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
.page-head p { margin: 0; }
.refresh { display: flex; gap: 10px; align-items: center; }

/* store / my switch */
.switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 16px; max-width: 100%; }
.switch a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted); padding: 8px 16px; border-radius: 999px; white-space: nowrap; }
.switch a.on { background: var(--ink); color: var(--bg); }

/* status boxes */
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.box { text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: block; }
.box:hover { border-color: var(--muted); }
.box.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.box-label { display: block; font-size: 13px; color: var(--muted); }
.box-num { display: block; font-family: Georgia, serif; font-size: 30px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--cancelled); }
.dot.processing { background: var(--processing); }
.dot.way { background: var(--way); }
.dot.delivered { background: var(--delivered); }
.dot.issue { background: var(--issue); }
.status { white-space: nowrap; font-weight: 500; }

/* cards + tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.card h2 { margin-bottom: 12px; }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.search { display: flex; gap: 8px; margin: 0; }
.search input { width: 300px; max-width: 100%; }
table.orders { width: 100%; border-collapse: collapse; }
.orders th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.orders td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.orders tr:last-child td { border-bottom: 0; }
.order-link { font-weight: 600; }
.orders td[data-label="Placed"], .orders td[data-label="Order"] { white-space: nowrap; }
.num { text-align: right; }
td.me { font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* tracking panel */
.track-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.track h2 { font-family: Georgia, serif; font-weight: 400; font-size: 24px; }
.track h2 .status { font-family: system-ui, sans-serif; font-size: 15px; margin-left: 8px; }
.steps { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; --c: var(--delivered); }
.steps.processing { --c: var(--processing); }
.steps.way { --c: var(--way); }
.steps.issue { --c: var(--issue); }
.steps.cancelled { --c: var(--cancelled); }
.steps li { border-top: 3px solid var(--line); padding-top: 8px; }
.steps li b, .steps li span { display: block; }
.steps li.done { border-top-color: var(--c); }
.steps li:not(.done) b { color: var(--muted); }
.facts { border-collapse: collapse; margin-bottom: 16px; }
.facts td { padding: 5px 16px 5px 0; vertical-align: top; }
.facts td:first-child { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* admin */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.form-row label { margin: 0; }
details summary { list-style: none; display: inline-block; }
details summary::-webkit-details-marker { display: none; }
.mini { margin: 10px 0 0; min-width: 220px; }
.mini label { margin-bottom: 6px; }

/* phones */
@media (max-width: 1000px) { .hide-mid { display: none; } }
@media (max-width: 760px) {
  .orders thead { display: none; }
  .orders, .orders tbody, .orders tr, .orders td { display: block; width: 100%; }
  .orders tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
  .orders td { border: 0; padding: 3px 0; text-align: left; }
  .orders td::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .orders td.hide-mid { display: none; }
  .switch { display: flex; }
  .switch a { flex: 1; text-align: center; padding: 8px 6px; font-size: 13px; }
  .search { width: 100%; }
  .search input { width: 100%; }
}
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }
