/* Bullet Kulture admin. Mobile first: staff add bikes from their phones in the store. */
:root {
  --ink: #141210; --text: #1d1a17; --muted: #6c655d; --line: #e5dfd5; --paper: #f6f2eb; --card: #fff;
  --red: #b3261e; --red-dark: #8f1d17; --brass: #d9a53a; --ok: #17663a; --ok-bg: #e8f3ec; --warn: #a4400f; --warn-bg: #fdf0e3;
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
body.signed-in { padding-bottom: 76px; }
a { color: inherit; }
h1, h2 { margin: 0; line-height: 1.15; }
img { display: block; max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.loading { padding: 40px 0; color: var(--muted); text-align: center; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid transparent; border-radius: 10px; font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-line { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-danger-line { background: #fff; border-color: #e7c3bf; color: var(--red); }
.btn-block { width: 100%; }

/* header + nav */
.ah { position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; }
.ah-in { display: flex; align-items: center; gap: 12px; max-width: 1100px; height: 58px; margin: 0 auto; padding: 0 16px; }
.logo { display: inline-flex; flex-direction: column; text-decoration: none; font: 700 16px/.92 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.logo span:last-child { margin-top: 3px; padding: 2px 4px 1px; background: var(--red); letter-spacing: .12em; }
.ah-tag { padding: 3px 8px; border: 1px solid #4a433b; border-radius: 6px; color: #d9d2c7; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ah-right { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 14px; }
.ah-right a { color: #d9d2c7; text-decoration: none; }
.ah-right button { padding: 8px 12px; border: 1px solid #4a433b; border-radius: 8px; background: transparent; color: #fff; font: 600 14px var(--body); cursor: pointer; }
.ah-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* phones: bottom tab bar */
.ah-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); }
.ah-nav[hidden] { display: none; }
.ah-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.ah-nav a[aria-current] { color: var(--red); }
.ah-nav .ah-add { color: var(--ink); }
@media (max-width: 559px) { .ah-right a { display: none; } }
@media (min-width: 900px) {
  body.signed-in { padding-bottom: 0; }
  .ah-nav { position: static; display: flex; gap: 4px; margin-left: 20px; padding: 0; background: none; border: 0; }
  .ah-nav a { flex-direction: row; gap: 8px; padding: 8px 12px; border-radius: 8px; color: #d9d2c7; font-size: 15px; }
  .ah-nav svg { width: 18px; height: 18px; }
  .ah-nav a:hover { color: #fff; background: #2a2520; }
  .ah-nav a[aria-current] { color: #fff; background: #2a2520; }
  .ah-nav .ah-add { color: #fff; }
}

/* layout */
.am { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font: 700 30px/1.05 var(--display); text-transform: uppercase; }
.page-head p { margin: 6px 0 0; }
.page-head .btn { flex: none; }
@media (max-width: 559px) { .page-head > .btn { display: none; } }
.back { display: inline-block; margin-bottom: 6px; color: var(--muted); font-size: 14px; text-decoration: none; }
.panel { margin-bottom: 16px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.panel h2 { margin-bottom: 14px; font: 600 18px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.panel h2.mt { margin-top: 24px; }
.notice { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: #fff7e0; color: #5c4504; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice a { font-weight: 600; }
.empty { padding: 32px 16px; background: var(--card); border: 1px dashed #cfc6b9; border-radius: 14px; color: var(--muted); text-align: center; }

/* login */
.login { max-width: 400px; margin: 40px auto; padding: 28px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.login h1 { font: 700 30px/1 var(--display); text-transform: uppercase; }
.login p { margin: 10px 0 18px; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 800px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
a.kpi:hover { border-color: var(--ink); }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi b { font: 700 34px/1.1 var(--display); }
.kpi small { color: var(--muted); font-size: 12.5px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dash-grid > * { min-width: 0; }
@media (min-width: 860px) { .dash-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } .dash-grid .panel { margin: 0; } }
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr; grid-template-areas: "label bar" ". n"; column-gap: 12px; padding: 6px 4px; border-radius: 8px; text-decoration: none; }
.bar-row:hover { background: var(--paper); }
.bar-label { grid-area: label; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { grid-area: bar; display: flex; align-self: center; height: 12px; background: #f0ebe3; border-radius: 6px; overflow: hidden; }
.bar i, .legend i { display: block; background: var(--ink); }
.bar i.sold, .legend i.sold { background: #e3a49e; }
.bar-n { grid-area: n; color: var(--muted); font-size: 12.5px; }
.bar-n b { color: var(--text); }
.legend { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend i.sold { margin-left: 12px; }
.store-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.store-split div { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: var(--paper); border-radius: 12px; font-size: 13.5px; color: var(--muted); }
.store-split b { color: var(--text); font: 600 18px/1.2 var(--display); text-transform: uppercase; }
.store-split strong { color: var(--text); }
.minis { display: grid; gap: 4px; }
.mini { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 10px; text-decoration: none; }
.mini:hover { background: var(--paper); }
.mini img, .mini .nophoto { flex: none; width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: #e9e4dc; }
.mini > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.mini b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.mini small { color: var(--muted); font-size: 12.5px; }

/* status pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.pill-available { background: var(--ok-bg); color: var(--ok); }
.pill-booked { background: #fbefd2; color: #7a5600; }
.pill-sold { background: #f9e1de; color: var(--red-dark); }

/* bike list */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar input { flex: 1 1 260px; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: 15px var(--body); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #ece6dc; border-radius: 12px; }
.seg button, .seg label span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 14px var(--body); cursor: pointer; }
.seg button span { color: inherit; opacity: .7; font-weight: 500; }
.seg button[aria-pressed] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.rows { display: grid; gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.row-main { display: flex; align-items: center; gap: 12px; flex: 1 1 320px; min-width: 0; text-decoration: none; }
.row-main img, .row-main .nophoto { flex: none; width: 96px; height: 72px; border-radius: 10px; object-fit: cover; background: #e9e4dc; }
.row-main .nophoto { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.row.is-sold .row-main img { filter: grayscale(1); opacity: .7; }
.row-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.row-text b { font-size: 15.5px; }
.row-text b small { color: var(--muted); font-weight: 500; }
.row-text > small { color: var(--muted); font-size: 13px; }
.row-text em { color: var(--warn); font-style: normal; font-weight: 600; }
.row-price { font: 600 19px/1.3 var(--display); }
.row-price small { color: var(--muted); font: 500 12.5px var(--body); }
.row-side { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1 1 260px; }
@media (min-width: 760px) { .row-side { flex: 0 0 auto; flex-direction: column; align-items: flex-end; } }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row-actions button, .row-actions a { min-height: 36px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: 600 13.5px/33px var(--body); text-decoration: none; cursor: pointer; }
.row-actions button[data-act="sold"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.row-actions button:disabled { opacity: .5; }

/* form */
.fields { display: grid; gap: 14px; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; }
.field > span em { color: var(--muted); font-style: normal; font-weight: 400; }
.field small { color: var(--muted); font-size: 12.5px; min-height: 1em; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font: 16px/1.3 var(--body); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
.panel > .field { margin-top: 14px; }
.seg-form { align-self: flex-start; }
.seg-form label { position: relative; }
.seg-form input { position: absolute; opacity: 0; }
.seg-form input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg-form input:focus-visible + span { outline: 3px solid var(--brass); }
.check { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--ok-bg); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ok); }
.check b { display: block; color: var(--ok); }
.form-error { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #fbe9e7; color: var(--red-dark); font-weight: 600; }
.savebar { position: sticky; bottom: 76px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -4px 20px rgba(20,18,16,.08); }
@media (min-width: 900px) { .savebar { bottom: 12px; } }
.save-status { margin-left: auto; color: var(--muted); font-size: 13.5px; text-align: right; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ph { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #e9e4dc; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-local img { opacity: .85; }
.ph-cover, .ph-new { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ph-new { top: auto; bottom: 42px; background: var(--brass); color: var(--ink); }
.ph-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.ph-tools button, .ph-del { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.ph-tools button:disabled { opacity: .35; cursor: default; }
.ph-del { position: absolute; top: 6px; right: 6px; border: 0; border-radius: 8px; background: var(--red); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ph-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px dashed #c9bfb1; background: #fbf9f5; color: var(--muted); cursor: pointer; }
.ph-add:hover { border-color: var(--ink); color: var(--ink); }
.ph-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ph-add span { font: 600 34px/1 var(--display); }
.ph-add small { font-weight: 600; }

/* dialog + toast */
.dlg { width: min(420px, calc(100% - 32px)); padding: 22px; border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(20,18,16,.55); }
.dlg h2 { font: 700 24px/1 var(--display); text-transform: uppercase; }
.dlg .field { margin: 14px 0 8px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 168px; z-index: 100; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--red); }
@media (min-width: 900px) { .toast { bottom: 28px; } }
