/* Admin of the package demos; builds on demo.css. */
body.admin { background: #f7f1e6; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- login */
.admin-login { max-width: 420px; margin: 40px auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.admin-login h1 { font-size: 1.6rem; margin: 6px 0 0; }
.admin-login label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.login-demo { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--sun-soft); font-weight: 600; }

/* ---- shell */
.admin-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-head h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0; }
.admin-kicker { margin: 0 0 2px; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 700; color: var(--red-dark); }
.admin-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-sandbox { margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--sun-soft); border: 1px solid #f1d98e; }
.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 22px; align-items: start; }
.admin-tabs { position: sticky; top: 60px; display: flex; flex-direction: column; gap: 4px; background: var(--ink); border-radius: 16px; padding: 10px; }
.admin-tabs a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; color: #e9dcc6; text-decoration: none; font-weight: 600; }
.admin-tabs a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.admin-tabs a[aria-current="page"] { background: var(--sun); color: var(--ink); }
.badge { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.75rem; text-align: center; line-height: 22px; }
.admin-tabs a[aria-current="page"] .badge { background: var(--ink); }
.admin-body { min-width: 0; }
.admin-flash { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.admin-flash.ok { background: #e2f2e7; color: #1f5c39; }
.admin-flash.error { background: #fbe4df; color: #8f2a17; }
.admin-panel { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-tabs { position: static; flex-direction: row; flex-wrap: wrap; }
  .admin-tabs a { white-space: nowrap; padding: 8px 10px; }
}

.admin-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.admin-card h2 { font-size: 1.2rem; }
.admin-card > p:last-child { margin-bottom: 0; }
.admin-note { margin: 0; color: var(--muted); }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.admin-actions.sticky { position: sticky; top: 52px; z-index: 5; background: #fff; padding: 8px 0; margin: 0 0 8px; }
.admin-panel > .admin-actions.sticky { background: #f7f1e6; }
.admin-grid { display: grid; gap: 18px; }
.admin-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .admin-grid.two { grid-template-columns: 1fr; } }
.admin-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.9rem; }
.admin-field.inline { flex-direction: row; align-items: center; gap: 8px; }
.admin-field.inline select { width: auto; min-height: 36px; padding: 4px 8px; }
.icon-btn { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 1.1rem; cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: #fbe4df; border-color: #f2b8aa; }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--red-dark); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.toggle input { width: 20px; height: 20px; }

/* ---- products */
.product-group { margin-top: 18px; }
.product-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 3px solid var(--sun); padding-bottom: 6px; margin-bottom: 4px; }
.product-group-head h3 { margin: 0; }
.product-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
body.tier-plus .product-row { grid-template-columns: 1fr auto; }
.product-row.is-sold-out .product-fields input { color: #a8998a; }
.product-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.product-line { display: flex; gap: 8px; }
.product-line > input { flex: 1; min-width: 0; font-weight: 700; }
.euro-prefix { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.price-input { width: 90px; text-align: right; }
.product-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.product-side .toggle { font-size: 0.85rem; white-space: nowrap; }
.product-extras { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.allergen-box summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); }
.allergen-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 0 2px; }
.allergen-check { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; }
.photo-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 88px; }
.photo-cell img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--sun-soft); }
.photo-empty { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 10px; background: #f1e7d4; font-size: 0.75rem; color: var(--muted); }
.photo-cell .btn-small { min-height: 30px; padding: 0 12px; font-size: 0.8rem; }
.photo-preview { width: 100%; max-width: 520px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--sun-soft); }
@media (max-width: 620px) {
  .product-row { grid-template-columns: 1fr; }
  body.tier-plus .product-row { grid-template-columns: 1fr; }
  .photo-cell { flex-direction: row; width: auto; }
  .product-side { flex-direction: row; align-items: center; justify-content: space-between; }
}
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; gap: 8px; align-items: center; }
.cat-row input { flex: 1; }

/* ---- reviews */
.review-edit-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.review-edit { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; align-items: end; padding-top: 12px; border-top: 1px dashed var(--line); }
@media (max-width: 620px) { .review-edit { grid-template-columns: 1fr auto; } .review-edit .wide { grid-column: 1 / -1; grid-row: 2; } }
.google-list { display: flex; flex-direction: column; }
.google-row { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line); }
.google-row p { margin: 0 0 4px; }
.google-meta { color: var(--muted); font-size: 0.9rem; }

/* ---- orders */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-label { color: var(--muted); font-size: 0.88rem; }
.tile-value { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.delta { font-size: 0.82rem; font-weight: 700; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red-dark); }
.delta .muted { font-weight: 400; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.orders-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.segmented { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.segmented button { border: 0; background: none; padding: 6px 16px; border-radius: 999px; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.limit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); }
.limit-input { width: 70px; min-height: 36px; padding: 4px 8px; }
.order-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.order-col { background: #efe5d3; border-radius: 16px; padding: 12px; min-height: 140px; }
.order-col h3 { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; margin: 0 0 10px; }
.order-col .count { min-width: 26px; padding: 0 8px; border-radius: 999px; background: #fff; text-align: center; font-size: 0.85rem; }
.order-col.status-new h3 { color: var(--red-dark); }
.order-card { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(43, 29, 20, 0.08); border-left: 4px solid var(--line); }
.status-new .order-card { border-left-color: var(--red); }
.status-busy .order-card { border-left-color: var(--sun); }
.status-ready .order-card { border-left-color: var(--green); }
.order-card.is-own { box-shadow: 0 0 0 2px var(--sun); }
.order-card header { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.order-card header strong { font-size: 1.15rem; }
.order-card .own { padding: 0 8px; border-radius: 999px; background: var(--sun); font-size: 0.72rem; font-weight: 800; }
.order-card ul { margin: 6px 0; padding-left: 18px; font-size: 0.92rem; }
.order-who { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.order-note { margin: 0 0 6px; padding: 4px 8px; border-radius: 8px; background: #fff4cf; font-size: 0.85rem; }
.order-card footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.order-total { font-weight: 800; margin-right: auto; }
.order-card .btn-small { min-height: 32px; padding: 0 12px; font-size: 0.85rem; }
@media (max-width: 1100px) { .order-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .order-board { grid-template-columns: 1fr; } }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-card .admin-table { display: block; overflow-x: auto; }

/* ---- requests */
.request-card { border-top: 1px dashed var(--line); padding: 14px 0 4px; }
.request-card header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.request-card p { margin: 6px 0; }
.request-when { font-weight: 700; }
.chip-status { padding: 1px 10px; border-radius: 999px; background: #f1e7d4; font-size: 0.78rem; font-weight: 700; }
.status-new .chip-status { background: #fbe4df; color: var(--red-dark); }
.status-answered .chip-status { background: #e2f2e7; color: var(--green); }

/* ---- hours */
.hours-list { display: flex; flex-direction: column; gap: 8px; }
.hours-row { display: grid; grid-template-columns: 150px 120px auto 120px; gap: 10px; align-items: center; }
.hours-row input[type="time"] { min-height: 40px; padding: 6px 8px; }
.hours-row input:disabled { opacity: 0.45; }
.ex-list { display: flex; flex-direction: column; gap: 8px; }
.ex-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ex-row input[type="date"] { width: 170px; }
.ex-row select { width: 150px; }
.ex-row input[type="time"] { width: 120px; }
.ex-row input:not([type]) { flex: 1; min-width: 160px; }
@media (max-width: 560px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row .toggle { grid-column: 1 / -1; } .hours-row > span { display: none; } }

/* ---- charts: one hue, thin columns with rounded tops, recessive grid */
.col-chart { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 180px auto; column-gap: 8px; }
.col-grid { grid-row: 1; grid-column: 1; display: flex; flex-direction: column; justify-content: space-between; font-size: 0.75rem; color: var(--muted); text-align: right; transform: translateY(-0.5em); }
.col-bars { grid-row: 1; grid-column: 2; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid #d9ccb3;
  background: linear-gradient(to bottom, #efe6d6 1px, transparent 1px) 0 0 / 100% 50%; }
.col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.col-bar { width: 100%; max-width: 24px; background: #e8a796; border-radius: 4px 4px 0 0; transition: background 0.12s; }
.col-bar.accent { background: var(--red); }
.col:hover .col-bar, .col:focus-visible .col-bar { background: var(--red-dark); }
/* display:none while hidden, so the tooltips never widen the page on small screens */
.col::after { content: attr(data-tip); display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: #fff;
  font-size: 0.78rem; padding: 4px 8px; border-radius: 6px; pointer-events: none; z-index: 3; }
.col:hover::after, .col:focus-visible::after { display: block; }
.col:first-child::after { left: 0; transform: none; }
.col:last-child::after { left: auto; right: 0; transform: none; }
.col-axis { grid-row: 2; grid-column: 2; display: flex; gap: 2px; font-size: 0.72rem; color: var(--muted); padding-top: 4px; }
.col-axis span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.chart-table { margin-top: 10px; font-size: 0.85rem; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 0.9rem; }
.hbar-label { overflow-wrap: anywhere; }
.hbar-track { height: 14px; }
.hbar { display: block; height: 100%; background: var(--red); border-radius: 0 4px 4px 0; }
.hbar-value { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.report { margin: 0; padding: 14px; background: #f6efe2; border-radius: 12px; white-space: pre-wrap; font: 0.92rem/1.6 var(--font); }
.analytics-actions { margin-top: 0; justify-content: space-between; }
