/* Admin: calm and dense, readable on a phone in the kitchen */
body.admin { background: #f8f3f2; }
.admin-main { padding: 28px 0 72px; }
.admin h1 { font-size: clamp(1.6rem, 3vw, 2rem); }
.admin h2 { font-size: 1.25rem; }
.admin h3 { font-size: 1.1rem; }
.admin h2.h3 { font-size: 1.1rem; }
.admin .top { box-shadow: 0 1px 0 var(--ink-line); }

/* Section tabs: pills on the dark bar */
#tabs { gap: 4px; }
#tabs a { padding: 7px 13px; border-radius: 999px; font-size: .92rem; transition: background-color var(--fast), color var(--fast); }
#tabs a::after { display: none; }
#tabs a:hover { background: var(--ink-3); color: #fff; }
#tabs a[aria-current] { background: var(--blush); color: var(--ink); }
#tabs a[aria-current] .badge { background: var(--rose); color: #fff; }
.badge { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--rose); color: #fff; font-size: .75rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; animation: pop 300ms var(--ease) both; }

#banners .alert { box-shadow: var(--shadow-sm); }
#banners .alert a { font-weight: 700; }

/* Sign-in and password boxes */
.auth-box {
  max-width: 440px; margin: 48px auto; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--rose);
  border-radius: var(--radius-lg); padding: clamp(22px, 5vw, 34px); box-shadow: var(--shadow); animation: rise 600ms var(--ease) both;
}
.auth-box .btn[type="submit"] { width: 100%; }
.forgot { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.forgot summary { cursor: pointer; color: var(--rose); font-weight: 600; list-style-position: outside; border-radius: 4px; }
.forgot summary:hover { color: var(--rose-dark); }
.forgot form { margin-top: 14px; animation: fade 300ms var(--ease-soft) both; }

/* Requests: list on the left, the open request on the right */
.split { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.list-pane { position: sticky; top: calc(var(--header-h) + 12px); }
.list-tools { display: grid; gap: 8px; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: #fff; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; border: 0; border-radius: 999px; background: transparent; font: 700 .86rem var(--sans); padding: 7px 10px; cursor: pointer; color: var(--text);
  transition: background-color var(--fast), color var(--fast);
}
.seg button:hover { background: var(--blush-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--blush); }
.req-list {
  list-style: none; margin: 0; padding: 0; max-height: 72vh; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm);
}
.req-list li { border-bottom: 1px solid var(--line); }
.req-list li:last-child { border-bottom: 0; }
.req-list li.muted { padding: 28px 16px; text-align: center; }
.req-row { position: relative; display: grid; gap: 3px; padding: 12px 14px; text-decoration: none; color: var(--text); transition: background-color var(--fast); }
.req-row:hover { background: var(--blush-2); color: var(--text); text-decoration: none; }
.req-row:focus-visible { outline-offset: -3px; }
.req-row.active { background: var(--blush); }
.req-row.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink); }
.req-row.unread { box-shadow: 4px 0 0 var(--rose) inset; font-weight: 600; }
.req-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.req-sub { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; font-weight: 400; }

.pill { display: inline-block; font: 700 .72rem/1.5 var(--sans); letter-spacing: .02em; padding: 2px 9px; border-radius: 999px; background: #eee3e4; color: var(--text); white-space: nowrap; vertical-align: middle; }
.pill.s-new { background: #b31d47; color: #fff; }
.pill.s-available, .pill.s-quoted { background: #fdf0d3; color: #6b4500; }
.pill.s-invoiced { background: #fde4c8; color: #6b3100; }
.pill.s-confirmed, .pill.s-baking { background: #dff1e5; color: #1f5a33; }
.pill.s-ready { background: #1f6b3a; color: #fff; }
.pill.s-declined, .pill.s-cancelled, .pill.s-expired { background: #e5e5e5; color: #444; }
.pill.i-paid { background: #dff1e5; color: #1f5a33; }
.pill.i-open { background: #fde4c8; color: #6b3100; }

.detail-pane { min-width: 0; animation: fade 300ms var(--ease-soft) both; }
.detail-pane > .muted:only-child {
  padding: 56px 20px; text-align: center; border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .5);
}
.detail-head h1 { margin-bottom: 4px; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.btn.danger { color: var(--error); border-color: var(--error); background: transparent; box-shadow: none; }
.btn.danger:hover { background: #fdeef0; color: var(--error); }
.box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; min-width: 0; box-shadow: var(--shadow-sm); }
.box > h2:first-child, .box > h3:first-child { margin-top: 0; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 5px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
.photos a { border-radius: 10px; transition: transform var(--fast) var(--ease); }
.photos a:hover { transform: translateY(-2px); }
.photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row input, .row select { width: auto; flex: 1 1 160px; }
.q-line { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; margin-bottom: 8px; }
.inv { border-top: 1px dashed var(--line-strong); padding-top: 10px; margin-top: 10px; }
.inv:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.inv p { margin: 0 0 6px; }
.thread { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.thread li { padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread .who { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 3px; white-space: normal; }
.thread .m-in { background: #f2eeee; border-bottom-left-radius: 4px; }
.thread .m-out { background: var(--blush-2); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.thread .m-note { background: transparent; border: 1px dashed var(--line-strong); font-size: .9rem; color: var(--muted); }
.thread li.muted { padding: 16px; text-align: center; background: transparent; }
.box textarea { min-height: 96px; margin-bottom: 8px; }

/* Bake schedule */
.sched-day { margin-bottom: 22px; }
.sched-day h2 { border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.sched-day.today h2 { color: var(--rose); border-color: var(--rose); }
.sched-day.late h2 { color: var(--error); }
.sched-day ul { list-style: none; padding: 0; margin: 0; }
.sched-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px; margin-bottom: 8px; box-shadow: var(--shadow-sm);
  transition: border-color var(--fast), transform var(--fast) var(--ease);
}
.sched-item:hover { border-color: var(--line-strong); transform: translateX(2px); }

/* Menu editor */
.menu-admin { list-style: none; padding: 0; margin: 0; }
.menu-admin li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.menu-admin li:last-child { border-bottom: 0; }
.menu-admin details summary { cursor: pointer; color: var(--rose); font-size: .9rem; font-weight: 600; margin: 4px 0 0 30px; border-radius: 4px; }
.menu-admin details summary:hover { color: var(--rose-dark); }
.menu-admin details[open] summary { margin-bottom: 6px; }
.menu-admin form { margin-top: 10px; padding: 14px; background: var(--blush-2); border-radius: var(--radius); }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; margin-bottom: 10px; }
.grid4 label, .grid2 label { font-size: .9rem; }
.grid4 input, .grid4 select { margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.staff-list, .blocked { list-style: none; padding: 0; margin: 0 0 12px; }
.staff-list li, .blocked li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.narrow-box { max-width: 480px; }
.admin input, .admin select, .admin textarea { min-height: 44px; }

@media (max-width: 860px) {
  .split, .cols2, .grid2 { grid-template-columns: 1fr; }
  .list-pane { position: static; }
  .req-list { max-height: 40vh; }
  .sched-item { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
  .q-line { grid-template-columns: 1fr 90px; }
  .q-line .q-del { grid-column: 1 / -1; justify-self: start; }
  .facts { grid-template-columns: 1fr; }
}
