/* Stock screen for the shop owners: larger text and big tap targets. */

.admin {
  font-size: 19px;
  padding-bottom: 96px;
}

.admin .brand {
  font-size: 1.15rem;
}

.sync {
  font-size: 0.85rem;
  color: var(--ok);
  padding-bottom: 6px;
}

.sync:empty {
  display: none;
}

.sync.waiting {
  color: var(--text-muted);
}

.demo-banner {
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-border);
  padding: 8px 16px;
  text-align: center;
  font-size: 0.9rem;
}

.center {
  text-align: center;
}

.wide {
  display: flex;
  width: 100%;
}

.btn-big {
  min-height: 60px;
  font-size: 1.15rem;
}

.btn-danger {
  background: transparent;
  color: var(--bad);
  border: 1.5px solid var(--bad);
  margin-top: 12px;
}

.admin main {
  display: grid;
  gap: 16px;
}

/* Tabs */
.admin-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-tabs button {
  min-height: 56px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
}

.admin-tabs button[aria-selected="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

#tab-stock,
#tab-shop {
  display: grid;
  gap: 12px;
}

/* Search */
.admin-search {
  position: sticky;
  top: calc(var(--header-h, 80px) + env(safe-area-inset-top, 0px));
  z-index: 5;
  background: var(--bg);
  padding: 4px 0 6px;
}

.admin-search input {
  width: 100%;
  min-height: 56px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  padding: 10px 14px;
  font-size: 1.1rem;
}

.admin-search input:focus {
  border-color: var(--brand);
  outline: none;
}

.admin .chip {
  min-height: 44px;
  font-size: 1rem;
}

/* Stock rows */
.stock-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stock-list:empty {
  display: none;
}

.stock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 4px;
  border-top: 1px solid var(--border);
}

.stock-row:first-child {
  border-top: none;
}

.stock-name {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.stock-name small {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stock-toggle {
  flex: none;
  min-width: 118px;
  min-height: 56px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  border: 2px solid transparent;
}

.stock-toggle.has {
  background: var(--ok);
  color: var(--on-ok);
}

.stock-toggle.out {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: var(--bad);
}

/* Shop tab */
.admin textarea {
  width: 100%;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  padding: 12px;
  margin-bottom: 12px;
  resize: vertical;
}

.big-switch {
  width: 100%;
  min-height: 64px;
  border-radius: 14px;
  border: 2px solid var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  margin-bottom: 10px;
}

.big-switch.on {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}

.setup summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.setup[open] summary {
  margin-bottom: 12px;
}

.setup h3 {
  margin-top: 18px;
}

.setup p,
.setup textarea {
  font-size: 0.9rem;
}

/* Add / edit sheet */
.sheet {
  width: min(560px, 100% - 24px);
  max-height: calc(100% - 24px);
  border: none;
  border-radius: 18px;
  padding: 20px;
  background: var(--surface);
  color: var(--text);
}

.sheet::backdrop {
  background: rgb(0 0 0 / 45%);
}

.field {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  border: none;
  padding: 0;
}

.field legend {
  padding: 0;
  margin-bottom: 6px;
}

.field input[type="text"] {
  min-height: 56px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  padding: 10px 14px;
  font-size: 1.1rem;
}

.form-error {
  color: var(--bad);
  font-weight: 600;
  margin-top: -8px;
}

.group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.group-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.25;
  cursor: pointer;
}

.group-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 700;
}

.group-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
  flex: none;
}

/* Toast with undo */
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--text);
  color: var(--bg);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 25%);
  z-index: 50;
}

.toast span {
  flex: 1;
  font-weight: 600;
}

.toast button {
  flex: none;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  border: none;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 800;
  cursor: pointer;
}
