/* AYN OS shared look. Every page links this, so one change here restyles the whole system. */
:root { --bg:#f4f6f9; --card:#fff; --ink:#18202b; --mute:#667085; --line:#e2e6ee; --brand:#ff6a3d; --brand-d:#e5552a; --ok:#17803d; --bad:#b42318; --warn:#b54708; --r:12px; }
@media (prefers-color-scheme: dark) { :root { --bg:#111418; --card:#1a1e25; --ink:#eef0f3; --mute:#98a2b3; --line:#2a303a; } }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.45 system-ui,"Segoe UI",Roboto,sans-serif; }
main { max-width:1480px; margin:0 auto; padding:0 clamp(12px,3vw,36px) 48px; }
.topbar { background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; margin-bottom:16px; }
.topbar .in { max-width:1480px; margin:0 auto; padding:0 clamp(12px,3vw,36px); display:flex; align-items:center; gap:6px; overflow-x:auto; }
.topbar b.logo { white-space:nowrap; color:var(--brand); font-size:18px; margin-right:12px; letter-spacing:.5px; }
.topbar a { padding:14px 12px; color:var(--mute); text-decoration:none; font-weight:600; border-bottom:3px solid transparent; white-space:nowrap; }
.topbar a:hover { color:var(--ink); } .topbar a.on { color:var(--ink); border-bottom-color:var(--brand); }
h1 { font-size:22px; margin:6px 0 14px; } h2 { font-size:16px; margin:0 0 10px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:16px; margin-bottom:14px; box-shadow:0 1px 2px rgba(16,24,40,.04); }
label { display:block; font-size:12px; font-weight:600; color:var(--mute); margin:0 0 4px; text-transform:uppercase; letter-spacing:.4px; }
input, select, textarea { width:100%; padding:10px 12px; font:inherit; color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:9px; outline:none; }
input:focus, select:focus, textarea:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(255,106,61,.18); }
/* one consistent dropdown look everywhere */
select { appearance:none; -webkit-appearance:none; padding-right:34px; cursor:pointer;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'/></svg>");
  background-repeat:no-repeat; background-position:right 12px center; }
input[list] { background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'/></svg>"); background-repeat:no-repeat; background-position:right 12px center; padding-right:34px; }
input[list]::-webkit-calendar-picker-indicator { opacity:0; position:absolute; right:0; width:34px; }
input[type=checkbox] { width:auto; accent-color:var(--brand); }
button { font:inherit; font-weight:600; padding:10px 16px; border:0; border-radius:9px; background:var(--brand); color:#fff; cursor:pointer; }
button:hover { background:var(--brand-d); } button.ghost { background:transparent; color:var(--brand); border:1px solid var(--brand); } button.grey { background:var(--line); color:var(--ink); } button.sm { padding:4px 10px; font-size:13px; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; }
table { width:100%; border-collapse:collapse; } th { text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.4px; color:var(--mute); padding:8px 10px; border-bottom:1px solid var(--line); }
td { padding:9px 10px; border-bottom:1px solid var(--line); } tbody tr:hover { background:rgba(127,127,127,.06); }
.pill { display:inline-block; padding:2px 10px; border-radius:99px; font-size:12px; font-weight:700; background:var(--line); color:var(--ink); }
.pill.green { background:rgba(23,128,61,.15); color:var(--ok); } .pill.amber { background:rgba(181,71,8,.15); color:var(--warn); } .pill.red { background:rgba(180,35,24,.15); color:var(--bad); } .pill.blue { background:rgba(0,100,210,.15); color:#0064d2; }
.pill.ret { background:rgba(124,58,237,.14); color:#6d28d9; }
.mute { color:var(--mute); font-size:13px; } .num { text-align:right; font-variant-numeric:tabular-nums; }
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:14px; }
.stat { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px; } .stat .v { font-size:22px; font-weight:700; } .stat .l { font-size:12px; color:var(--mute); text-transform:uppercase; letter-spacing:.4px; }
.tablewrap { overflow-x:auto; }
/* shared bits used by several pages */
.msg { margin-top:12px; padding:12px; border-radius:9px; display:none; font-size:14px; } .msg.ok { display:block; background:rgba(23,128,61,.12); color:var(--ok); } .msg.bad { display:block; background:rgba(180,35,24,.12); color:var(--bad); }
.tag { font-size:12px; padding:2px 8px; border-radius:99px; border:1px solid var(--line); }
.check { display:flex; align-items:center; gap:8px; margin-top:10px; } .check label { margin:0; color:var(--ink); font-size:14px; text-transform:none; letter-spacing:0; font-weight:500; }
.chips span { display:inline-block; font-size:12px; padding:1px 9px; margin:1px 4px 1px 0; border:1px solid var(--line); border-radius:99px; }
details summary { cursor:pointer; color:var(--brand); font-weight:600; }
/* segmented control (e.g. In stock / Sold / Both) */
.seg { display:inline-flex; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--card); }
.seg button { background:transparent; color:var(--mute); border-radius:0; padding:9px 16px; border-right:1px solid var(--line); } .seg button:last-child { border-right:0; }
.seg button:hover { background:rgba(127,127,127,.1); color:var(--ink); } .seg button.on { background:var(--brand); color:#fff; }
/* one dropdown popup for every select and list-input in the system (see ayn-ui.js) */
.dd { position:fixed; z-index:1000; background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:11px; box-shadow:0 10px 30px rgba(16,24,40,.18); padding:5px; overflow-y:auto; font-size:15px; }
.dd .it { padding:8px 11px; border-radius:7px; cursor:pointer; display:flex; justify-content:space-between; gap:12px; } .dd .it small { color:var(--mute); }
.dd .it:hover, .dd .it.hi { background:rgba(255,106,61,.12); } .dd .it.sel { font-weight:700; color:var(--brand); } .dd .none { padding:8px 11px; color:var(--mute); }
/* model detail panel */
.panel { background:rgba(127,127,127,.05); border-top:1px solid var(--line); padding:16px; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:10px; margin-bottom:14px; }
.tile { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 12px; } .tile .v { font-size:22px; font-weight:700; } .tile .l { font-size:11px; color:var(--mute); text-transform:uppercase; letter-spacing:.4px; }
.split { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-bottom:14px; }
.bars { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 12px; } .bars h3 { margin:0 0 8px; font-size:12px; text-transform:uppercase; letter-spacing:.4px; color:var(--mute); }
.bar { display:grid; grid-template-columns:90px 1fr 32px; align-items:center; gap:8px; font-size:13px; margin:5px 0; } .bar .t { height:8px; background:var(--line); border-radius:9px; overflow:hidden; } .bar .t i { display:block; height:100%; background:var(--brand); border-radius:9px; } .bar b { text-align:right; }
.dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; border:1px solid rgba(127,127,127,.5); vertical-align:middle; }

.bar { grid-template-columns:90px 1fr 30px 38px !important; } .bar em { font-style:normal; color:var(--mute); font-size:12px; text-align:right; }
.tile { border-left:4px solid var(--line); } .tile.t-ok { border-left-color:var(--ok); } .tile.t-blue { border-left-color:#0064d2; } .tile.t-amber { border-left-color:var(--warn); }
.tile.t-ok .v { color:var(--ok); } .seg.sm button { padding:6px 14px; font-size:13px; }
.bars { box-shadow:0 1px 2px rgba(16,24,40,.04); } .bar .t i { background:linear-gradient(90deg,#ff8a5c,var(--brand)); }
.dot { width:12px; height:12px; }
.topbar .cnt { background:var(--brand); color:#fff; font-size:12px; padding:1px 8px; border-radius:99px; margin-left:6px; }

/* layout: grids that collapse on small screens, so every page works from phone to wide desktop */
/* Grid/flex children default to min-width:auto, which refuses to shrink below their content and pushes the
   whole page wider than the screen (the sideways scrollbar). Letting them shrink keeps every page in-bounds. */
.row > *, .cols > *, .grid > *, .split > *, .stats > *, .tiles > * { min-width:0; }
.row { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.cols { display:grid; grid-template-columns:1fr; gap:16px; align-items:start; }
@media (min-width:1050px) { .cols { grid-template-columns:minmax(380px,5fr) 7fr; } .cols.even { grid-template-columns:1fr 1fr; } .cols .sticky { position:sticky; top:66px; } }
@media (max-width:760px) {
  body { font-size:16px; } h1 { font-size:20px; }
  .card { padding:13px; border-radius:10px; }
  button { min-height:44px; } button.sm { min-height:34px; }
  input, select, textarea { padding:12px; font-size:16px; }          /* 16px stops iPhones zooming into fields */
  .seg { max-width:100%; overflow-x:auto; } .seg button { padding:9px 12px; white-space:nowrap; }
  th, td { padding:8px 7px; font-size:13px; }
  .topbar a { padding:13px 10px; }
}
.tablewrap { -webkit-overflow-scrolling:touch; }

/* link that looks like a button */
a.btn { display:inline-block; font-weight:600; padding:10px 16px; border-radius:9px; text-decoration:none; background:var(--brand); color:#fff; cursor:pointer; }
a.btn.ghost { background:transparent; color:var(--brand); border:1px solid var(--brand); } a.btn.sm { padding:4px 10px; font-size:13px; }
.lblbtns { display:inline-flex; gap:8px; flex-wrap:wrap; align-items:center; }
.lblbtns button.sm, .lblbtns a.btn.sm { padding:8px 14px; font-size:14px; }

/* compact buttons that sit level with form fields, and a file picker that does not stretch */
button.cmp, a.btn.cmp { padding:8px 14px; font-size:14px; line-height:1.2; }
input[type=file] { width:auto; max-width:100%; padding:7px 10px; font-size:14px; }

/* pop-up boxes (edit a device, edit a listing link) */
.modal { position:fixed; inset:0; background:rgba(16,24,40,.5); display:flex; align-items:flex-start; justify-content:center; padding:5vh 12px; overflow:auto; z-index:60; }
.modal > .card { max-width:820px; width:100%; margin:0; }
.modal:empty { display:none; }
.esec { margin-top:14px; padding-top:10px; border-top:1px solid var(--line); } .esec h4 { margin:0 0 8px; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--mute); }
.grid2 { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px 14px; }
/* platform marks: plain coloured letters, not the companies' own logos */
.plat { display:inline-flex; align-items:center; gap:7px; font-weight:600; white-space:nowrap; } .plat i { font-style:normal; display:inline-grid; place-items:center; width:24px; height:24px; border-radius:7px; color:#fff; font-size:12px; font-weight:800; }
.plat img.pl-ic { width:20px; height:20px; border-radius:5px; flex:none; } .plat img.pl-word { height:17px; width:auto; flex:none; } .plat.p-amazon i { background:#232f3e; color:#ff9900; } .plat.p-backmarket i { background:#14b8a6; } .plat.p-ebay i { background:#e53238; } .plat.p-other i { background:#667085; }

/* a button that cannot be pressed yet looks it (all pages) */
button:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
