/* Relaptops owner dashboard. Same palette as the storefront, set denser for daily work. */
:root {
  --bg: #eef1f4; --surface: #ffffff; --ink: #16212e; --muted: #5b6878; --line: #d5dbe2;
  --brand: #0d5c75; --brand-ink: #ffffff; --sticker: #ffd23f; --sticker-ink: #1d1a05;
  --ok: #1d7a46; --ok-bg: #e2f3e9; --warn: #8a4b00; --warn-bg: #fdeed3; --bad: #b3261e; --bad-bg: #fbe4e2;
  --info: #0d5c75; --info-bg: #dff0f5; --idle-bg: #e7ebef;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161d; --surface: #19222c; --ink: #e8edf2; --muted: #9aa7b6; --line: #2b3744;
    --brand: #58b7d3; --brand-ink: #06202a;
    --ok: #6fd69b; --ok-bg: #173526; --warn: #f0b05a; --warn-bg: #3a2a10; --bad: #ff8a80; --bad-bg: #40201e;
    --info: #7cc9e0; --info-bg: #143540; --idle-bg: #26313d;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

.brand { font: 700 1.35rem/1 var(--display); letter-spacing: -0.02em; }
.brand-re { color: var(--brand); }
.brand small { font: 500 .8rem var(--body); color: var(--muted); margin-left: 6px; letter-spacing: 0; }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; padding: 28px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: auto 1fr; }
.bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
.shop-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--bg); }
.shop-switch button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.shop-switch button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.who { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .9rem; }
.link { border: 0; background: none; padding: 0; color: var(--brand); text-decoration: underline; }

.nav { padding: 14px 10px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.nav button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; font-weight: 500; display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.nav button[aria-current="page"] { background: var(--info-bg); color: var(--info); font-weight: 600; }
.nav .count { background: var(--sticker); color: var(--sticker-ink); border-radius: 999px; padding: 0 7px; font-size: .8rem; font-variant-numeric: tabular-nums; }

.view { padding: 22px clamp(16px, 3vw, 32px) 60px; min-width: 0; outline: none; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.head h1 { font-size: 1.7rem; letter-spacing: -0.02em; margin-right: auto; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tools input, .tools select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

.btn { border: 0; border-radius: 8px; padding: 9px 14px; font-weight: 600; background: var(--brand); color: var(--brand-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--surface); color: var(--bad); border: 1px solid var(--bad); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.wide { width: 100%; padding: 12px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 4px; }
.tile .label { color: var(--muted); font-size: .85rem; }
.tile .value { font: 700 1.6rem/1.1 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .hint { color: var(--muted); font-size: .8rem; }
.section-title { font-size: 1.1rem; margin: 20px 0 10px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td .sub { display: block; color: var(--muted); font-size: .82rem; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font: 700 1.1rem var(--display); margin-bottom: 4px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--idle-bg); }
.pill.new { background: var(--sticker); color: var(--sticker-ink); }
.pill.confirmed, .pill.shipped { background: var(--info-bg); color: var(--info); }
.pill.paid, .pill.delivered, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.cancelled, .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }

.modal { border: 0; padding: 0; width: min(620px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); border-radius: 12px; background: var(--surface); color: var(--ink); }
.modal::backdrop { background: rgba(10, 16, 24, .55); }
.modal form { padding: 22px; display: grid; gap: 14px; }
.modal h2 { font-size: 1.35rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field span { font-size: .8rem; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.field.check { display: flex; align-items: center; gap: 8px; }
.field.check input { width: auto; }
.field.check span { font-size: .95rem; color: var(--ink); }
.form-error { color: var(--bad); font-weight: 500; margin: 0; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.lines { display: grid; gap: 8px; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 110px 34px; gap: 6px; align-items: end; }
.line-row select, .line-row input { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.line-row .x { height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.detail { display: grid; gap: 4px; }
.detail .sub { color: var(--muted); }
.total-row { display: flex; justify-content: space-between; font: 700 1.2rem var(--display); font-variant-numeric: tabular-nums; }
.status-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 500; z-index: 20; max-width: calc(100vw - 32px); }
.toast.error { background: var(--bad); color: #fff; }

@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .who span { display: none; }
  .line-row { grid-template-columns: minmax(0, 1fr) 60px 90px 34px; }
}

.photo-pick { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.photo-pick img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.photo-pick .field { flex: 1 1 220px; }
td .thumb { width: 44px; height: 33px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: 8px; background: var(--bg); }
