/* SAYLI store dashboard. Mobile first; tokens and buttons come from ../src/css/styles.css. */
.st-body {
  background: var(--portal-canvas);
  padding-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.st-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ink);
  color: var(--on-dark);
}

.st-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 20px;
}

.st-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.st-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #E8F0EC;
  color: var(--olive);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.st-open-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2E9E5B;
}

.st-open.is-closed {
  background: #F6E3DF;
  color: #8A2E1D;
}

.st-open.is-closed .st-open-dot {
  background: #C0442B;
}

.st-tabs {
  display: flex;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 8px;
}

.st-tabs a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  color: var(--on-dark-muted);
  font-size: 14px;
  font-weight: 600;
}

.st-tabs a.active {
  color: var(--on-dark);
  box-shadow: inset 0 -3px 0 var(--saffron);
}

.st-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--saffron);
  color: var(--ink);
  font-size: 11px;
}

.st-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.st-section {
  margin-bottom: 32px;
}

.st-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 20px;
}

.st-section h2 .num {
  font-size: 13px;
  color: var(--muted);
}

.st-empty {
  margin: 0;
  padding: 28px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
  text-align: center;
}

.st-order {
  margin-bottom: 16px;
  padding: 22px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.st-order.is-new {
  border-color: var(--saffron);
  box-shadow: inset -4px 0 0 var(--saffron);
}

.st-order header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.st-order header time {
  margin-inline-start: auto;
  font-size: 12px;
  color: var(--muted);
}

.st-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: #E8F0EC;
  color: var(--olive);
  font-size: 11.5px;
  font-weight: 700;
}

.st-chip.new {
  background: var(--saffron-soft);
  color: var(--saffron-text);
}

.st-chip.completed {
  background: var(--ink);
  color: var(--on-dark);
}

.st-chip.cancelled {
  background: #F6E3DF;
  color: #8A2E1D;
}

.st-items {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.st-items li {
  display: flex;
  gap: 10px;
  font-size: 15px;
}

.st-items li > b {
  min-width: 30px;
  color: var(--date);
}

.st-items small {
  display: block;
  font-size: 12px;
  color: var(--saffron-text);
}

.st-meta {
  margin: 0 0 10px;
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.st-meta div {
  display: flex;
  gap: 8px;
}

.st-meta dt {
  flex: 0 0 64px;
  color: var(--muted);
}

.st-meta dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.st-meta small {
  color: var(--muted);
}

.st-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-secondary);
  gap: 12px;
  flex-wrap: wrap;
}

.st-total b {
  font-size: 18px;
  color: var(--ink);
}

.st-delivery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

.st-delivery legend {
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
}

.st-delivery label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.st-delivery label:has(input:checked) {
  border-color: var(--ink);
  background: var(--bg-subtle);
}

.st-delivery input,
.st-option input {
  accent-color: var(--ink);
}

.st-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.st-actions .primary-button {
  flex: 1;
  min-height: 48px;
  font-size: 15px;
}

.st-actions .secondary-button {
  min-height: 48px;
}

.st-wait {
  flex: 1;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.st-done {
  margin: 0;
  padding: 0;
  list-style: none;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.st-done li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.st-done li:first-child {
  border-top: 0;
}

.st-done li > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-secondary);
}

.st-products {
  margin: 0;
  padding: 0;
  list-style: none;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.st-products li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.st-products li:first-child {
  border-top: 0;
}

.st-products li.is-off .st-product-name,
.st-products li.is-off .st-thumb {
  opacity: 0.45;
}

.st-thumb {
  position: relative;
  flex: 0 0 44px;
  height: 44px;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.st-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.st-product-name {
  flex: 1;
  min-width: 0;
}

.st-product-name b {
  display: block;
  font-size: 14px;
}

.st-product-name small {
  color: var(--muted);
}

.st-switch {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 14px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.15s;
}

.st-switch span {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: right 0.15s;
}

.st-switch[aria-checked="true"] {
  background: var(--olive);
}

.st-switch[aria-checked="true"] span {
  right: 23px;
}

.st-card {
  padding: 24px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.st-setting {
  display: flex;
  align-items: center;
  gap: 12px;
}

.st-setting > span {
  flex: 1;
}

.st-setting b,
.st-option b {
  display: block;
  font-size: 14px;
}

.st-setting small,
.st-option small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.st-delivery-default {
  display: grid;
  gap: 8px;
}

.st-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.st-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--bg-subtle);
}

.st-option input {
  margin-top: 3px;
}

.st-card .secondary-button {
  margin-top: 6px;
}

#st-toast {
  bottom: 24px;
}

/* Sign in, the store name in the header, and the reason box that opens in place
   when a decline or a cancel needs a reason. */
.st-store-name {
  flex: 1;
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-login {
  max-width: 460px;
  margin: 4px auto 24px;
  padding: 28px;
  border-top: 3px solid var(--saffron);
  box-shadow: var(--shadow-panel);
}

.st-login h2 {
  margin: 0 0 4px;
}

.st-login > .page-note { margin-block: 8px 24px; }
.st-section:not(.st-login) > h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--saffron); flex-shrink: 0; }
.st-section h2 .num { min-width: 26px; padding: 2px 8px; border-radius: 20px; background: var(--olive-soft); color: var(--ink); text-align: center; }
.st-tabs a { min-height: 48px; height: auto; padding: 10px 6px; }
.st-tabs a:hover { background: var(--olive); color: var(--on-dark); }
.st-open { flex-shrink: 0; min-height: 44px; height: auto; padding-block: 8px; }
.st-delivery label { min-height: 48px; }
.st-delivery { gap: 10px; margin-top: 20px; }
.st-delivery label:has(input:checked) { background: var(--olive-soft); }
.st-setting { align-items: flex-start; }
.st-setting small,
.st-option small { margin-top: 6px; font-size: 13px; line-height: 1.85; }
.st-setting .st-switch { flex-shrink: 0; }
.st-products li { padding: 16px; gap: 14px; }
.st-product-name { min-width: 0; }
.st-product-name b { line-height: 1.8; }
.st-product-name small { margin-top: 4px; }
.st-switch { flex-shrink: 0; }
.st-switch::before { content: ""; position: absolute; inset: -9px 0; }
.st-reason input { min-height: 48px; }

@media (max-width: 760px) {
  .st-header-row { padding: 14px 16px; }
  .st-main { padding: 20px 16px 36px; }
  .st-login { margin-top: 4px; padding: 24px; }
  .st-order,
  .st-card:not(.st-login) { padding: 18px; }
  .st-section { margin-bottom: 28px; }
  .st-actions .text-button { min-height: 44px; padding-inline: 10px; }
  .st-actions .primary-button { flex-basis: 180px; }
  .st-done li { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 16px; }
  .st-done li > span:nth-child(2) { grid-row: 2; grid-column: 1 / -1; white-space: normal; }
  .st-done li > b:last-child { grid-row: 3; grid-column: 1 / -1; }
  .st-reason input { font-size: 16px; }
}

.st-reason {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #e7e2d7);
}

.st-reason label {
  display: block;
  margin-bottom: 10px;
  font-size: .9rem;
  font-weight: 600;
}

.st-reason input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d8d3c7);
  border-radius: 10px;
  font: inherit;
  font-weight: 400;
}

/* Order notes keep their line breaks; the cash-change line from checkout comes first. */
.st-notes { white-space: pre-line; }
