/* ==========================================================================
   Seven Bites Admin — styles
   Desktop: sidebar + page. Phones: the sidebar becomes a top menu row.
   No inline styles anywhere (strict CSP); bar heights are set from JS.
   ========================================================================== */

:root {
  --navy: #0a1520;
  --navy-2: #1a2734;
  --yellow: #fcd206;
  --yellow-hover: #f2c600;
  --yellow-soft: #fff4bf;
  --yellow-tint: #fffaf0;
  --gold-mark: #b07a00; /* chart bars — validated 3:1+ on white */
  --bg: #f6f3ea;
  --surface: #ffffff;
  --border: #e6e1d3;
  --border-strong: #d6cfbc;
  --text: #121a24;
  --text-2: #4a5360;
  --muted: #7d838c;
  --green: #12865a;
  --green-soft: #e3f6ec;
  --red: #d63c41;
  --red-soft: #fde8e8;
  --amber: #a15c00;
  --amber-soft: #fff1d6;
  --blue: #1f5fae;
  --blue-soft: #e5eefb;
  --shadow: 0 1px 2px rgba(18, 26, 36, 0.05), 0 6px 18px rgba(18, 26, 36, 0.07);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --brand: "Cinzel", "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: var(--navy);
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.a-muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.a-empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.a-noscript {
  padding: 24px;
  text-align: center;
}

.a-alert {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 600;
}

.a-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eeebe3;
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 700;
}

.a-coin {
  vertical-align: -3px;
}

/* ---------- buttons ---------- */

.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.a-btn:hover {
  background: var(--yellow-hover);
}

.a-btn:active {
  transform: scale(0.98);
}

.a-btn:disabled {
  background: #eceae3;
  color: var(--muted);
  cursor: not-allowed;
}

.a-btn--ghost {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
}

.a-btn--ghost:hover {
  background: var(--yellow-tint);
}

.a-btn--warn {
  color: var(--red);
}

.a-btn--danger {
  background: var(--red);
  color: #fff;
}

.a-btn--danger:hover {
  background: #bd3338;
}

.a-btn--sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.a-btn--lg {
  min-height: 52px;
  font-size: 1.02rem;
}

.a-link {
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- sign in ---------- */

.a-login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 80% 0%, rgba(252, 210, 6, 0.18), transparent 50%),
    var(--navy);
}

.a-login__card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 32px 24px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.a-login__card img {
  justify-self: center;
  height: auto;
}

.a-login__card h1 {
  font: 700 1.5rem var(--brand);
  color: var(--navy);
}

.a-login__card h1 span {
  display: block;
  font: 700 0.85rem var(--font);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--amber);
}

.a-login__card .a-btn {
  width: 100%;
}

.a-login__card label,
.a-form label {
  display: grid;
  gap: 6px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.a-login__card input,
.a-form input,
.a-search {
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 400;
}

.a-login__card input:focus,
.a-form input:focus,
.a-search:focus {
  border-color: var(--navy);
  outline: none;
  box-shadow: 0 0 0 3px var(--yellow-soft);
}

/* ---------- layout ---------- */

.a-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100dvh;
}

.a-side {
  min-width: 0; /* let the phone menu row scroll instead of widening the page */
}

.a-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100dvh;
  padding: 18px 14px;
  background: var(--navy);
  color: #fff;
}

.a-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}

.a-brand b {
  font: 700 1.05rem var(--brand);
  color: var(--yellow);
}

.a-brand span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(252, 210, 6, 0.15);
  color: var(--yellow);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.a-nav {
  display: grid;
  gap: 4px;
}

.a-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  text-decoration: none;
}

.a-nav a:hover {
  background: var(--navy-2);
  color: #fff;
}

.a-nav a[aria-current="page"] {
  background: var(--yellow);
  color: var(--navy);
}

.a-side__foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  font-size: 0.85rem;
}

.a-side__foot a {
  color: rgba(255, 255, 255, 0.75);
}

.a-side__foot p {
  display: grid;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.a-side__foot small {
  color: rgba(255, 255, 255, 0.55);
  overflow-wrap: anywhere;
}

.a-main {
  padding: 24px 28px 48px;
  min-width: 0;
}

.a-main:focus {
  outline: none;
}

.a-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.a-head h1 {
  font-size: 1.6rem;
  font-weight: 800;
}

.a-intro {
  max-width: 760px;
  margin: -8px 0 18px;
}

.a-sub {
  margin: 22px 0 10px;
  font-size: 0.95rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.a-card {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.a-card h2 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.a-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.a-scroll {
  padding: 0;
  overflow-x: auto;
}

/* ---------- dashboard ---------- */

.a-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.a-pill.is-open {
  background: var(--green-soft);
  color: var(--green);
}

.a-pill.is-closed {
  background: var(--red-soft);
  color: var(--red);
}

.a-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.a-tile {
  display: grid;
  gap: 2px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 400;
  text-decoration: none;
}

a.a-tile:hover {
  box-shadow: 0 0 0 2px var(--yellow), var(--shadow);
}

.a-tile span {
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
}

.a-tile strong {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.a-tile small {
  color: var(--muted);
  font-size: 0.78rem;
}

/* one-series bar chart: thin bars, 4px rounded tops on the baseline, gaps */
.a-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 220px;
  padding-top: 28px;
  border-bottom: 1px solid var(--border);
}

.a-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  border-radius: 6px;
}

.a-bar:hover,
.a-bar:focus-visible {
  background: var(--yellow-tint);
}

.a-bar__fill {
  width: min(48px, 60%);
  height: max(2px, var(--h, 0%));
  max-height: calc(100% - 26px);
  border-radius: 4px 4px 0 0;
  background: var(--gold-mark);
}

.a-bar small {
  color: var(--text-2);
  font-size: 0.75rem;
}

.a-bar.is-today small {
  color: var(--text);
  font-weight: 800;
}

.a-tip {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- tables ---------- */

.a-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.a-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.78rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.a-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.a-table td small {
  display: block;
  color: var(--muted);
}

.a-card > .a-table {
  margin-top: 12px;
}

/* ---------- team ---------- */

.a-people {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.a-person {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.a-person.is-off {
  opacity: 0.65;
}

.a-person__who {
  display: grid;
  min-width: 0;
}

.a-person__who small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.a-person__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.a-person__btns {
  display: flex;
  gap: 8px;
}

.a-role {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.a-role--admin {
  background: var(--navy);
  color: var(--yellow);
}

.a-role--kitchen {
  background: var(--amber-soft);
  color: var(--amber);
}

.a-role--rider {
  background: var(--blue-soft);
  color: var(--blue);
}

.a-role--no {
  background: #eeebe3;
  color: var(--text);
}

/* ---------- orders ---------- */

.a-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.a-search {
  width: min(360px, 100%);
}

.a-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.a-chips button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ebe6d8;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
}

.a-chips button[aria-selected="true"] {
  background: var(--navy);
  color: var(--yellow);
}

.a-orders {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.a-order {
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.a-order.is-open {
  box-shadow: 0 0 0 2px var(--navy), var(--shadow);
}

.a-order__row {
  display: grid;
  grid-template-columns: minmax(150px, auto) auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
}

.a-status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #eeebe3;
}

.a-status--placed,
.a-status--confirmed {
  background: var(--yellow-soft);
  color: var(--amber);
}

.a-status--preparing {
  background: var(--amber-soft);
  color: var(--amber);
}

.a-status--out-for-delivery {
  background: var(--blue-soft);
  color: var(--blue);
}

.a-status--delivered {
  background: var(--green-soft);
  color: var(--green);
}

.a-status--cancelled {
  background: var(--red-soft);
  color: var(--red);
}

.a-order__more {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.a-lines {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-block: 1px dashed var(--border-strong);
  list-style: none;
}

.a-lines li {
  display: flex;
  gap: 8px;
}

.a-lines span {
  margin-left: auto;
  font-weight: 600;
}

.a-lines small {
  color: var(--text-2);
}

.a-dl {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.a-dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}

.a-dl dt {
  color: var(--muted);
  font-weight: 600;
}

.a-dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.a-order__more .a-btn {
  justify-self: start;
}

/* ---------- shop ---------- */

.a-store {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left: 6px solid var(--green);
}

.a-store.is-closed {
  border-left-color: var(--red);
}

.a-form--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.a-form--inline label {
  flex: 1;
  min-width: 240px;
}

/* ---------- activity ---------- */

.a-log {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.a-log li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.a-log time {
  color: var(--muted);
  font-size: 0.8rem;
}

.a-log p {
  overflow-wrap: anywhere;
}

/* ---------- dialogs & forms ---------- */

.a-dialog {
  width: min(480px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.a-dialog::backdrop {
  background: rgba(10, 21, 32, 0.6);
}

.a-form {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.a-form h2 {
  font-size: 1.2rem;
}

.a-form label small,
.a-check small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.a-roles {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
}

.a-roles legend {
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.a-check {
  display: flex !important;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
}

.a-check:has(input:checked) {
  border-color: var(--navy);
  background: var(--yellow-tint);
}

.a-check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin-top: 2px;
  accent-color: var(--navy);
}

.a-form__btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.a-form__btns--one {
  grid-template-columns: 1fr;
}

.a-steps {
  display: grid;
  gap: 6px;
  padding-left: 20px;
}

.a-big {
  font-size: 1.4rem;
}

/* ---------- toasts ---------- */

.a-toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
}

.a-toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.a-toast.is-error {
  background: var(--red);
}

/* ---------- tablets & phones ---------- */

@media (max-width: 900px) {
  .a-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .a-side {
    position: static;
    height: auto;
    gap: 10px;
    padding: 12px 16px;
  }

  .a-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .a-nav a {
    flex-shrink: 0;
    min-height: 40px;
    white-space: nowrap;
  }

  .a-side__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 0;
  }

  .a-side__foot p {
    display: none;
  }

  .a-main {
    padding: 18px 16px 40px;
  }

  .a-person {
    grid-template-columns: 1fr;
  }

  .a-order__row {
    grid-template-columns: 1fr auto;
  }

  .a-order__row > :nth-child(3),
  .a-order__row > :nth-child(4) {
    grid-column: 1 / -1;
  }

  .a-dl div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .a-log li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
