/* Admin panel: same tokens as the store, denser layout. */

.admin { background: var(--surface); font-size: 1rem; }
.admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px;
  padding: 14px var(--gutter); background: var(--ink); color: #EDE6D8;
}
.admin-bar .wordmark { font-size: 1.375rem; color: #fff; }
.admin-bar .wordmark span { font-family: var(--sans); font-size: .75rem; letter-spacing: .1em; margin-inline-start: .4em; color: #A9B7B9; }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; order: 3; width: 100%; }
.admin-nav a { padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; font-size: .9375rem; }
.admin-nav a:hover { background: rgba(255, 255, 255, .08); }
.admin-nav a[aria-current] { background: rgba(255, 255, 255, .14); color: #fff; }
.admin-tools { display: flex; align-items: center; gap: 16px; margin-inline-start: auto; font-size: .9375rem; }
.admin-tools a { text-decoration: none; }
.admin-tools .text-link { color: inherit; text-decoration-color: rgba(255, 255, 255, .3); }
@media (min-width: 860px) { .admin-nav { order: 0; width: auto; } }

.admin-main { max-width: 1120px; margin: 0 auto; padding: 32px var(--gutter) 80px; }
.admin-title { font-family: var(--wordmark); font-weight: 400; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; margin-bottom: 20px; }
.admin-flash { max-width: 1120px; margin: 20px auto 0; padding: 12px 16px; background: #E3EFE8; color: var(--ok); border-radius: var(--r-sm); width: calc(100% - 2 * var(--gutter)); }
.admin-flash.is-error { background: #F6E6E2; color: var(--danger); }

.panel { background: #fff; border: 1px solid #E1E5E8; border-radius: 4px; padding: 24px; margin-bottom: 20px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head .admin-title { margin-bottom: 0; }
.panel-title { font-size: 1.125rem; font-weight: 500; margin-bottom: 14px; }
.panel-head .panel-title { margin-bottom: 0; }
.panel input:not([type="radio"]):not([type="checkbox"]):not([type="file"]), .panel select, .panel textarea { background: #fff; }

.stats { display: grid; gap: 16px; margin-bottom: 20px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { display: grid; gap: 4px; background: #fff; border: 1px solid #E1E5E8; border-radius: 4px; padding: 20px 24px; text-decoration: none; color: var(--muted); font-size: .9375rem; }
a.stat:hover { border-color: var(--gold); }
.stat-n { font-size: 1.75rem; font-weight: 500; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: start; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid #E8EBED; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 500; }
.table .thumb { width: 44px; height: 64px; object-fit: cover; }
.is-hidden-row { opacity: .55; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; background: #EEF0F2; font-size: .8125rem; white-space: nowrap; }
.badge.is-ok, .badge.status-delivered { background: #E3EFE8; color: var(--ok); }
.badge.is-bad, .badge.status-cancelled { background: #F6E6E2; color: var(--danger); }
.badge.is-warn, .badge.status-new { background: #F5EEDD; color: var(--gold-deep); }
.badge.status-confirmed, .badge.status-shipped { background: #E4ECF0; color: #2D4A57; }

.plain-list { display: grid; gap: 8px; }
.admin-filters { display: grid; gap: 0 16px; align-items: end; margin-bottom: 20px; }
@media (min-width: 700px) { .admin-filters { grid-template-columns: 1fr 220px auto; } .admin-filters .btn { margin-bottom: 18px; } }
.admin-cols { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .admin-cols { grid-template-columns: 1.2fr 1fr; } }

.stack { display: grid; gap: 4px; }
.bi, .grid-fields { display: grid; gap: 0 20px; }
@media (min-width: 760px) { .bi { grid-template-columns: 1fr 1fr; } .grid-fields { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.narrow-field { max-width: 200px; margin-top: 12px; }
.photo-fields { display: grid; gap: 20px; }
@media (min-width: 760px) { .photo-fields { grid-template-columns: 1fr 1fr; } }
.photo-field img { width: 120px; height: 176px; object-fit: cover; background: var(--surface); border: 1px solid #E1E5E8; }
.form-actions { position: sticky; bottom: 0; padding: 16px 0; background: linear-gradient(to top, var(--surface) 70%, transparent); }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
code { font-size: .875rem; background: #EEF0F2; padding: 2px 6px; border-radius: 3px; word-break: break-all; }

.admin-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); padding: clamp(28px, 5vw, 44px); border-radius: 4px; display: grid; gap: 16px; }
.auth-card .wordmark { font-size: 1.75rem; }
.auth-title { font-family: var(--wordmark); font-weight: 400; font-size: 2.25rem; line-height: 1.1; }
.auth-card fieldset { margin-bottom: 16px; }

/* Admin uses the same gold primary button as the shop. */
.btn-solid { background: var(--gold-deep); color: #fff; }
.btn-solid:hover { background: #6F5630; }
.admin-bar .wordmark { font-family: "Bodoni Moda", var(--wordmark); font-weight: 700; letter-spacing: .14em; }
.nav-badge { display: inline-block; min-width: 18px; height: 18px; margin-inline-start: 6px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: var(--ink); font-size: .6875rem; line-height: 18px; text-align: center; font-weight: 500; }
.order-alert {
  position: fixed; z-index: 80; inset-inline-end: 16px; bottom: 16px; max-width: 340px;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 12px 36px rgba(0, 0, 0, .25);
  display: grid; gap: 6px; animation: toast-in .3s var(--ease);
}
.order-alert[hidden] { display: none; }
.order-alert strong { color: var(--gold); font-weight: 500; }
.order-alert a { color: #fff; }
.order-alert button { justify-self: end; background: none; border: 0; color: #CFC6B4; cursor: pointer; padding: 0; font-size: .875rem; }
.inline-form { display: inline; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.row-actions .text-link { font-size: .875rem; padding: 0; }
.msg-body { white-space: pre-wrap; max-width: 60ch; }
.is-unread td:first-child { font-weight: 500; }
.check-grid { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ok-text { color: var(--ok); }
.bad-text { color: var(--danger); }

/* Orders: waiting for WhatsApp too long, WhatsApp quick actions, history */
.is-overdue td { background: #FBF1E6; }
.badge.status-awaiting_wa { background: #E3F2EA; color: #1F7A4D; }
.badge.status-returned { background: #EEF0F2; color: var(--muted); }
.wa-actions { display: grid; gap: 10px; }
@media (min-width: 760px) { .wa-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wa-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.wa-action .btn { min-height: 42px; padding: 0 16px; }
.btn-wa { background: #1F7A4D; color: #fff; border-color: #1F7A4D; }
.btn-wa:hover { background: #17603C; }
.btn-wa .icon { width: 18px; height: 18px; }
[data-wa-next].is-ready .text-link { background: var(--tint); padding: 6px 10px; border-radius: 6px; text-decoration: none; }
.history li { font-size: .9375rem; }

/* Two-step sign-in */
.qr { width: 216px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.qr img, .qr canvas { display: block; }
.backup-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.setup-steps { padding-inline-start: 20px; display: grid; gap: 6px; list-style: decimal; }

.feature-hint { margin: -4px 0 6px 28px; }
[dir="rtl"] .feature-hint { margin: -4px 28px 6px 0; }
.env-status { min-height: 48px; display: flex; align-items: center; }

.thumb-916 { display: block; width: 45px; height: 80px; object-fit: cover; border-radius: 6px; background: var(--surface); }
.thumb-916.is-empty { display: grid; place-items: center; font-size: .625rem; color: var(--muted); text-align: center; }

/* Scent quiz: note icons and the icon picker. */
.note-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); color: var(--gold-deep); }
.note-icon svg, .note-icon-img { width: 26px; height: 26px; display: block; }
.note-icon-img { background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 8px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--gold-deep); }
.icon-pick svg { width: 30px; height: 30px; }
.icon-pick input:checked + span { border-color: var(--gold-deep); background: #F4ECDD; box-shadow: inset 0 0 0 1px var(--gold-deep); }
.icon-pick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.input-xs { width: 80px; }
details.panel > summary { cursor: pointer; margin-bottom: 0; }
details.panel[open] > summary { margin-bottom: 14px; }
.nowrap { white-space: nowrap; }
.guides details { border-top: 1px solid #E8EBED; padding: 12px 0; }
.guides summary { cursor: pointer; font-weight: 500; }
.guides ol { margin: 12px 0 4px; padding-inline-start: 22px; display: grid; gap: 8px; line-height: 1.7; }
.guides code { background: var(--surface); padding: 1px 6px; border-radius: 4px; font-size: .875em; word-break: break-all; }

/* ---------- Reports ---------- */
.report-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 6px; }
.report-filters .field { margin: 0; }
.report-filters select, .report-filters input[type="date"] { width: auto; min-height: 42px; }
.report-dates { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.report-dates[hidden] { display: none; }
.report-short { margin-top: 14px; }
.report-short-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.report-short-head .panel-title { margin: 0; }
.report-sentences { margin: 14px 0 10px; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 1rem; line-height: 1.5; }
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid #E1E5E8; border-radius: 10px; padding: 16px 18px; }
.stat-label { font-size: .8125rem; color: var(--muted); }
.stat-value { font-size: 1.625rem; font-weight: 500; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
/* One series: one colour. Thin bars, rounded at the top, 2px apart, on a quiet baseline. */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 220px; padding-top: 8px; border-bottom: 1px solid #D5D9DC; }
.bar-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; outline: none; }
.bar { display: block; width: 100%; max-width: 28px; margin-inline: auto; background: var(--gold-deep); border-radius: 4px 4px 0 0; }
.bar-col:hover .bar, .bar-col:focus-visible .bar { background: #6F5630; }
.bar-col::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 3;
  white-space: nowrap; background: #232323; color: #fff; font-size: .75rem; padding: 5px 9px; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.bar-col:hover::after, .bar-col:focus-visible::after { opacity: 1; }
.bar-col:first-child::after { left: 0; transform: none; }
.bar-col:last-child::after { left: auto; right: 0; transform: none; }
.bars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 6px; }
.bars-table { margin-top: 12px; }
.bars-table summary { cursor: pointer; font-size: .875rem; color: var(--gold-deep); }
.report-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.report-grid .panel { margin: 0; }

/* Tabs (Reviews & messages) */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid #E1E5E8; margin: 8px 0 18px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold-deep); }

/* Fonts panel (Settings) */
.font-grid { display: grid; gap: 18px 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.font-sample { margin: 10px 0 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 1.0625rem; line-height: 1.35; }
.font-sample.is-head { font-size: 2rem; line-height: 1.1; }
.font-sample.is-name { font-size: 1.375rem; letter-spacing: .02em; }
.font-grid > .field { margin: 0; }
.font-weight-pick { max-width: 280px; }

/* Order page: edit boxes, notes, archive */
.edit-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.edit-box > summary { cursor: pointer; font-weight: 500; color: var(--gold-deep); }
.edit-box[open] > summary { margin-bottom: 14px; }
.edit-items td { vertical-align: middle; }
.note-list { margin-top: 16px; }
.note-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.note-meta { display: flex; gap: 12px; align-items: center; font-size: .8125rem; color: var(--muted); margin: 0 0 4px; }
.note-body { margin: 0; white-space: normal; }
.archived-note { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; background: #FBF7EF; }
.archived-note p { margin: 0; }
.panel.danger-zone { margin-top: 24px; border-top: 0; }
