/* Pet Point: deep teal brand, sunflower accent, system fonts only (no web fonts to download). */
:root {
  --bg: #f3f6f5; --surface: #ffffff; --ink: #172220; --muted: #5d6d69; --line: #dbe4e1;
  --brand: #0e5a57; --brand-2: #0b4846; --on-brand: #ffffff; --accent: #ffd166; --on-accent: #3b2a00;
  --ok: #1d7a46; --bad: #b4262b; --chip: #e7eeec;
  --s-new: #1f5fbf; --s-in_progress: #a8630a; --s-completed: #1d7a46; --s-cancelled: #6b6f73;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1716; --surface: #172220; --ink: #e5eeeb; --muted: #9fb2ad; --line: #2a3936;
    --brand: #3fb0a8; --brand-2: #57c3bb; --on-brand: #06201e; --accent: #ffd166; --on-accent: #3b2a00;
    --ok: #4cc27f; --bad: #ff7b7f; --chip: #22302d;
    --s-new: #6aa4ff; --s-in_progress: #f0b24a; --s-completed: #4cc27f; --s-cancelled: #a2a7ab;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
main { display: block; min-height: calc(100vh - 150px); padding-block: 18px 40px; min-width: 0; }
a { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; }
h1 { font-size: clamp(1.35rem, 4.5vw, 1.9rem); line-height: 1.25; margin: 0 0 12px; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 18px 0 6px; }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* header */
.top { background: var(--brand); color: var(--on-brand); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: .2px; }
.paw { width: 28px; height: 28px; fill: var(--accent); }
.top-nav { display: flex; align-items: center; gap: 6px; }
.top-nav a { color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.top-nav a:hover { background: rgba(255,255,255,.12); }
.cart-link { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.cart-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.count { background: var(--accent); color: var(--on-accent); border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: .8rem; padding: 0 6px; }
.lang { font-size: .9rem; opacity: .95; }

/* controls */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand); border-radius: 10px; padding: 9px 16px; min-height: 44px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--chip); }
.btn.big { width: 100%; min-height: 52px; font-size: 1.05rem; margin-top: 8px; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: default; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }
.linkish { background: none; border: 0; color: inherit; cursor: pointer; padding: 10px 8px; text-decoration: underline; }

/* shop */
.hero { padding-block: 6px 4px; }
.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.search-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.search-opts select { width: auto; min-height: 40px; padding-block: 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-block: 14px 4px; scrollbar-width: thin; }
.chip { flex: none; display: inline-flex; gap: 6px; align-items: center; padding: 7px 14px; border-radius: 999px; background: var(--chip); color: var(--ink); text-decoration: none; font-size: .95rem; border: 1px solid transparent; }
.chip small { opacity: .65; font-variant-numeric: tabular-nums; }
.chip[aria-current="true"] { background: var(--brand); color: var(--on-brand); }
.meta { color: var(--muted); font-size: .92rem; margin: 10px 0; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(172px, calc(50% - 6px)), 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.ph { aspect-ratio: 1; background: #fff; display: grid; place-items: center; overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.nophoto { display: grid; place-items: center; gap: 6px; color: var(--muted); font-size: .85rem; background: var(--chip); width: 100%; height: 100%; align-content: center; }
.nophoto svg { width: 44px; height: 44px; fill: currentColor; opacity: .35; }
.card { min-width: 0; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h2 { font-size: .98rem; font-weight: 500; line-height: 1.45; margin: 0; flex: 1; overflow-wrap: anywhere; }
.buy { display: flex; flex-direction: column; gap: 8px; }
.price { font-weight: 800; font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.add { width: 100%; }
.stepper { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; border: 1px solid var(--brand); border-radius: 10px; overflow: hidden; min-height: 44px; }
.stepper button { background: var(--chip); border: 0; height: 100%; font-size: 1.25rem; cursor: pointer; color: var(--brand); }
.stepper output { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 24px; }
.pager > :first-child { justify-self: start; } .pager > :last-child { justify-self: end; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.alert { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); padding: 10px 14px; border-radius: 10px; }
.alert.ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.note { color: var(--muted); font-size: .92rem; }

/* cart */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.cart-lines { min-width: 0; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } .checkout { position: sticky; top: 76px; } }
.line { display: grid; grid-template-columns: 72px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 10px; }
.line .ph { width: 72px; border-radius: 8px; }
.line-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.line-name { overflow-wrap: anywhere; }
.line-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.line .stepper { width: 140px; }
.rm { background: none; border: 0; color: var(--bad); cursor: pointer; padding: 6px; text-decoration: underline; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 800; padding: 12px 4px; border-top: 2px solid var(--line); }
.checkout { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.checkout label { font-weight: 600; margin-top: 8px; }
.err { color: var(--bad); font-size: .9rem; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.thanks { text-align: center; max-width: 560px; margin: 20px auto; display: grid; gap: 10px; justify-items: center; }
.tick { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; font-size: 2rem; }
.order-no { font-size: 1.15rem; }
.summary { list-style: none; padding: 0; margin: 6px 0; width: 100%; text-align: start; }
.summary li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.summary .sum { font-weight: 800; border-bottom: 0; }

.foot { color: var(--muted); font-size: .88rem; padding-block: 18px; border-top: 1px solid var(--line); }

/* admin */
.admin-nav { background: var(--brand-2); }
.admin-nav .wrap { display: flex; gap: 4px; overflow-x: auto; align-items: center; }
.admin-nav a { color: var(--on-brand); text-decoration: none; padding: 10px 12px; white-space: nowrap; border-bottom: 3px solid transparent; }
.admin-nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 700; }
.admin-nav form { margin-inline-start: auto; color: var(--on-brand); }
.login { max-width: 380px; margin: 30px auto; display: grid; gap: 6px; background: var(--surface); padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); }
.filters > * { min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 12px 0; }
.filters label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.filters .grow, .inline .grow { flex: 1 1 220px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; background: var(--chip); }
tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
tr.muted td { opacity: .55; }
.thumb { width: 64px; } .thumb img, .thumb .nophoto { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; }
.thumb .nophoto span { display: none; } .thumb .nophoto svg { width: 22px; height: 22px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: var(--s-new); background: color-mix(in srgb, currentColor 13%, transparent); white-space: nowrap; }
.pill.s-in_progress { color: var(--s-in_progress); } .pill.s-completed { color: var(--s-completed); } .pill.s-cancelled { color: var(--s-cancelled); }
.order-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.order-head h1 { margin: 0; }
.status-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.status-buttons .current { background: var(--ink); border-color: var(--ink); color: var(--bg); opacity: 1; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; } @media (min-width: 860px) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .two-col .box { margin: 0; } .two-col { margin-bottom: 14px; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sel { user-select: all; font-weight: 700; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bad-text { color: var(--bad); } .ok-text { color: var(--ok); font-weight: 600; }
.toggle { width: 46px; height: 26px; border-radius: 999px; border: 0; background: var(--line); position: relative; cursor: pointer; padding: 0; }
.toggle span { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.toggle.on { background: var(--ok); } .toggle.on span { inset-inline-start: 23px; }
.product-form { display: grid; gap: 18px; } @media (min-width: 760px) { .product-form { grid-template-columns: 240px 1fr; } }
.pf-img { display: grid; gap: 10px; align-content: start; } .pf-img .ph { border: 1px solid var(--line); border-radius: var(--radius); }
.pf-fields { display: grid; gap: 6px; } .pf-fields label { font-weight: 600; margin-top: 6px; }
.cats { display: grid; gap: 10px; }
.cat-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 0; }
.cat-row label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); flex: 1 1 160px; }
.cat-row label.short { flex: 0 0 90px; } .cat-row label.check { flex: 0 0 auto; color: var(--ink); align-self: center; }
.cat-row.new { border-style: dashed; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.stack { display: grid; gap: 10px; max-width: 420px; } .stack label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.qr { margin: 12px 0; } .qr img { background: #fff; padding: 10px; border-radius: 10px; }
.admins { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; } .admins li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
