/* Shared UI kit – copied into each service's wwwroot by scripts/sync-ui.ps1 (services stay independently deployable). */
:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f0f2f5; --text: #15181e; --muted: #6b7280; --border: #e3e6eb;
  --brand: #ffcc00; --brand-ink: #15181e; --accent: #2563eb; --ok: #16a34a; --warn: #d97706; --danger: #dc2626;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --surface: #181b21; --surface-2: #22262e; --text: #eef0f3; --muted: #9aa1ad; --border: #2c313a;
          --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
.container { max-width: 1180px; margin: 0 auto; padding: 16px; }
.topbar { position: sticky; top: 0; z-index: 500; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .container { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.2rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo b { background: var(--brand); color: var(--brand-ink); border-radius: 8px; padding: 2px 8px; }
.spacer { flex: 1; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--text); padding: 6px 10px; border-radius: 10px; }
.nav a.active, .nav a:hover { background: var(--surface-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .big { font-size: 1.3rem; font-weight: 700; }
.strike { text-decoration: line-through; color: var(--muted); font-size: .85em; }
.btn { appearance: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 10px;
       padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn:hover { filter: brightness(.97); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.blue { background: var(--accent); color: #fff; border-color: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: .85rem; } .btn.block { width: 100%; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: .95rem; }
label.check input { width: auto; }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.form .full { grid-column: 1 / -1; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.ad { background: #fff3c4; color: #8a6d00; } .badge.test { background: #e0e7ff; color: #3730a3; }
.badge.ok { background: #dcfce7; color: #166534; } .badge.warn { background: #fef3c7; color: #92400e; } .badge.danger { background: #fee2e2; color: #991b1b; }
.badge.blue { background: #dbeafe; color: #1e40af; }
.tile { width: 100%; aspect-ratio: 4/3; border-radius: 12px; display: grid; place-items: center; font-size: 2.6rem; background: var(--surface-2); overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.store-card { cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: transform .1s; }
.store-card:hover { transform: translateY(-2px); }
.product { display: flex; flex-direction: column; gap: 6px; }
.product .name { font-weight: 600; min-height: 2.6em; }
.price { font-weight: 800; }
.qty { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 2px; }
.qty button { border: 0; background: var(--brand); color: var(--brand-ink); width: 30px; height: 30px; border-radius: 8px; font-weight: 800; cursor: pointer; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.banner { min-width: 280px; padding: 22px; border-radius: var(--radius); background: linear-gradient(135deg, #ffd84d, #ffb800); color: #1a1a1a; cursor: pointer; }
.banner h3 { font-size: 1.2rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .9rem; }
.chip.active { background: var(--text); color: var(--bg); }
.list > * + * { border-top: 1px solid var(--border); }
.list > * { padding: 10px 0; }
.option { border: 2px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; }
.option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.option.disabled { opacity: .5; cursor: not-allowed; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--border); }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.map { height: 340px; border-radius: var(--radius); border: 1px solid var(--border); z-index: 1; }
.map.tall { height: 70vh; }
.stat { display: flex; flex-direction: column; } .stat .v { font-size: 1.5rem; font-weight: 800; } .stat .k { color: var(--muted); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.toast-host { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 90vw; }
.toast.error { background: var(--danger); } .toast.ok { background: var(--ok); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; display: grid; place-items: center; padding: 16px; }
.modal { position: relative; background: var(--surface); border-radius: var(--radius); padding: 20px; width: min(440px, 100%); max-height: 90vh; overflow: auto; }
.modal-x { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 40px 10px; }
.loading::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cart-fab { position: fixed; right: 16px; bottom: 16px; z-index: 600; }
.sticky { position: sticky; top: 76px; }
.layout-2 { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .layout-2 { grid-template-columns: 1fr; } .sticky { position: static; } .hide-sm { display: none; } }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); }
/* ---- date / time pickers ---- */
.picker-input { cursor: pointer; padding-right: 38px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%239aa1ad' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") no-repeat right 12px center; }
.picker-input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.picker-pop { position: absolute; z-index: 9500; width: 330px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.28); padding: 14px; }
.picker-pop.narrow { width: 300px; }
.picker-pop.sheet { position: fixed; left: 0; right: 0; bottom: 0; width: auto; border-radius: 18px 18px 0 0; max-height: 85vh; overflow: auto;
  padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.cal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-grid .wd { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-day, .slot { border: 0; background: transparent; color: var(--text); border-radius: 10px; padding: 8px 0; font: inherit; font-size: .92rem; cursor: pointer; }
.cal-day:hover:not(:disabled), .slot:hover:not(:disabled) { background: var(--surface-2); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.sel, .slot.sel { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.cal-day:disabled, .slot:disabled { opacity: .3; cursor: default; }
.slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.slots.mins { grid-template-columns: repeat(4, 1fr); }
.picker-sec { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 6px; }
.picker-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
