/* Laptop Finder owner interface: light, readable, large touch targets, mobile first. */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1c2326;
  --muted: #56636a;
  --line: #dbe1e5;
  --accent: #0b6e4f;
  --accent-dark: #08573e;
  --accent-soft: #e6f3ee;
  --warn: #8a5300;
  --warn-soft: #fff4dc;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --info: #1d5f8a;
  --info-soft: #e8f2f9;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* Top bar and navigation */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; }
.user { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--muted); }
.user form { margin: 0; }
.link-button { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 8px 0; text-decoration: underline; }
.nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a, .nav span { flex: none; padding: 10px 14px; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 600; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--accent); color: #fff; }
.nav span { color: #9aa5ab; font-weight: 500; }

main { padding: 20px 0 48px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.crumbs { margin: 0 0 8px; }
.crumbs a { text-decoration: none; font-weight: 600; }

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); display: block; }
.stat .label { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.stat .value { font-size: 1.7rem; font-weight: 800; line-height: 1.2; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 0.9rem; }
.stat.attention { border-color: var(--warn); background: var(--warn-soft); }
.stat.alert { border-color: var(--danger); background: var(--danger-soft); }
a.stat:hover { border-color: var(--accent); }

/* Lists of orders */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.row-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; color: var(--text); }
.row-link:hover .row-title { color: var(--accent); }
.row-plain { padding: 12px 0; }
.row-title { font-weight: 700; }
.row-sub { color: var(--muted); font-size: 0.92rem; }
.row-right { text-align: right; white-space: nowrap; }
.empty { color: var(--muted); padding: 8px 0; margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-head a { font-weight: 600; font-size: 0.95rem; }

/* Status pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.pill-awaiting { background: var(--warn-soft); color: var(--warn); }
.pill-paid, .pill-delivered, .pill-allocated { background: var(--accent-soft); color: var(--accent-dark); }
.pill-review, .pill-failed { background: var(--danger-soft); color: var(--danger); }
.pill-expired, .pill-cancelled, .pill-refunded, .pill-not_started, .pill-pending, .pill-no_address { background: #eef1f3; color: var(--muted); }
.pill-collected, .pill-sent { background: var(--info-soft); color: var(--info); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 22px; border-radius: 10px; border: 2px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button-outline { background: var(--card); color: var(--accent); }
.button-outline:hover { background: var(--accent-soft); color: var(--accent-dark); }
.button-danger { background: var(--card); color: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.button-small { min-height: 42px; padding: 8px 16px; font-size: 0.95rem; }
.actions { display: grid; gap: 10px; grid-template-columns: 1fr; }
.actions form { margin: 0; }
.actions .button { width: 100%; }

/* Messages */
.message { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-weight: 600; }
.message.success { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #9fceb3; }
.message.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #e0a39b; }
.message.warning { background: var(--warn-soft); color: var(--warn); border: 1px solid #e3c27a; }

/* Order detail */
.order-top { display: flex; gap: 14px; align-items: center; }
.order-top img { width: 96px; height: 72px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.big-price { font-size: 1.6rem; font-weight: 800; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; position: relative; }
.steps .dot { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #e3e8eb; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; }
.steps li.done .dot { background: var(--accent); color: #fff; }
.steps .step-name { font-weight: 700; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.inline-form input { min-height: 42px; }

/* Forms */
.form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.field input, .field select, .field textarea, .search input, .inline-form input { font: inherit; padding: 12px; border: 1px solid #b9c3c9; border-radius: 10px; background: #fff; color: var(--text); width: 100%; }
.field input:focus, .field textarea:focus, .search input:focus { outline: 3px solid #9fceb3; border-color: var(--accent); }
.field small { color: var(--muted); }
.field .error { color: var(--danger); font-weight: 600; }
.field-error input { border-color: var(--danger); }

/* Filters on the orders list */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.filters a { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.filters a.active { background: var(--text); border-color: var(--text); color: #fff; }
.filters .count { font-weight: 400; opacity: 0.75; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.search { display: flex; gap: 8px; margin-bottom: 16px; }

/* Login */
.login-card { max-width: 420px; margin: 48px auto; }

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .actions { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  h1 { font-size: 1.9rem; }
}
@media (min-width: 980px) {
  .order-layout { grid-template-columns: 1.4fr 1fr; align-items: start; }
}

/* Laptops, finders, payouts */
.thumb-row { display: flex; gap: 12px; align-items: center; }
.thumb { width: 64px; height: 48px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; flex: none; }
.thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: var(--muted); }
.pill-l-available { background: var(--accent-soft); color: var(--accent-dark); }
.pill-l-reserved { background: var(--warn-soft); color: var(--warn); }
.pill-l-coming_soon { background: #fff4d6; color: #7a5200; }
.pill-l-sold { background: var(--info-soft); color: var(--info); }
.pill-l-hidden { background: #eef1f3; color: var(--muted); }
.photo-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.photo-row img { width: 120px; height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.photo-actions { display: grid; gap: 8px; flex: 1; }
.photo-actions form { margin: 0; }
.photo-actions input[type=file] { font-size: 0.85rem; max-width: 100%; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check-row input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.entry-row { font-weight: 400; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
h3 { font-size: 1.05rem; margin: 16px 0 8px; }
details summary { cursor: pointer; padding: 6px 0; }
.hero-preview { width: 100%; max-width: 420px; aspect-ratio: 3 / 2; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.check-group { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-group legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.cat-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; }
.cat-row legend { font-weight: 700; padding: 0 6px; }
.hero-preview-cutout { background: #0e6b47; }
.cat-preview { width: 160px; height: 160px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
