/* Brand tokens -- warm monochrome-graphic identity (near-black ink, warm
   paper-white, one shared beige accent). Deliberately quiet/neutral so it
   never competes with the data-driven color coding elsewhere in this file
   (status badges -- overcapacity/arrived/special/danger/warning -- and the
   dining/lounge chart category colors in analytics): those stay as their
   own literal semantic colors throughout, untouched by these tokens.
   Values are RGB/HSL-derived and WCAG-checked, not eyeballed -- don't
   adjust without doing the same verification.

   NAMU is always this light ("day") palette -- fixed per-restaurant
   identity now, not a response to the viewer's OS dark-mode setting (that
   OS-driven toggle existed briefly but was replaced by this at the
   explicit request that follows: NAMU = day, ANJU = night, always,
   regardless of the visitor's own light/dark preference). */
:root {
  --bg: #faf7f1;
  --panel: #ffffff;
  --border: #d5cab6;
  --text: #2a241c;
  --muted: #6e665a;
  --accent: #2a241c;
  --accent-hover: #504b45;
  --accent-ink: #ffffff;
}

/* ANJU is always this dark ("night") palette, swapped in by the restaurant
   switcher (web/restaurant.js) setting data-restaurant="anju" on <html> --
   fixed per-restaurant identity, same as NAMU's fixed light palette above,
   not an OS-driven light/dark toggle. Sampled pixel-for-pixel from ANJU's
   real brand mark, not eyeballed -- see the "Anju Color Tokens" reference
   published during the multi-restaurant design phase (that reference also
   defined a light ANJU variant; this app only ever uses ANJU's dark one).
   The [data-restaurant="anju"] attribute selector always outranks the bare
   :root rules above regardless of source order. */
:root[data-restaurant="anju"] {
  --bg: #222a1a;
  --panel: #2f3a24;
  --border: #415031;
  --text: #dbd2c1;
  --muted: #aeaf90;
  --accent: #657c49;
  --accent-hover: #50623a;
  --accent-ink: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.flair-banana {
  background: linear-gradient(160deg, #fffbea 0%, #fff0b8 100%);
}

body.flair-beer_chicken {
  background: linear-gradient(160deg, #fff6ea 0%, #ffe0b8 100%);
}

body.flair-pizza {
  background: linear-gradient(160deg, #fff0ea 0%, #ffd6c2 100%);
}

body.flair-coffee {
  background: linear-gradient(160deg, #f5efe9 0%, #e3d3c4 100%);
}

body.flair-ocean {
  background: linear-gradient(160deg, #eafcff 0%, #b8ecf5 100%);
}

body.flair-watermelon {
  background: linear-gradient(160deg, #f3fff0 0%, #ffd6e0 100%);
}

.flair-decoration {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.flair-decoration span {
  position: absolute;
  font-size: 90px;
  line-height: 1;
  opacity: 0.16;
  user-select: none;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 100px;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.splash-screen.hidden {
  display: none;
}

.splash-screen:not(.hidden) ~ .spinner-overlay {
  display: none !important;
}

.splash-logo {
  width: 90px;
  animation: splash-pulse 1.2s ease-in-out infinite;
}

@keyframes splash-pulse {
  0%, 100% {
    opacity: 0.55;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

.page.wide-page {
  max-width: 1000px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.logo {
  height: 40px;
  width: auto;
  display: block;
}

@media (max-width: 600px) {
  .app-header {
    justify-content: center;
  }
}

.login-logo-wrap {
  text-align: center;
  margin-bottom: 8px;
}

.login-logo {
  height: 80px;
  width: auto;
}

/* Both logo.png (NAMU) and logo-anju.png (ANJU) are dark ink on a
   transparent background -- invisible against ANJU's always-dark page
   background otherwise. Inverting flips it to light ink, which reads
   correctly against ANJU's dark palette (each mark is a single dark color
   with no other hues to distort). Scoped to data-restaurant="anju"
   specifically, not an OS dark-mode media query -- NAMU is always the
   light palette and never needs this; .login-logo never matches here
   since login.html has no restaurant context (no data-restaurant is ever
   set there), so it stays NAMU-branded and un-inverted always. */
:root[data-restaurant="anju"] .logo,
:root[data-restaurant="anju"] .splash-logo {
  filter: invert(1);
}

.nav-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.nav-button {
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.nav-button:hover {
  background: var(--bg);
}

#searchBox {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 16px;
  color: var(--text);
}

#searchBox:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--border);
}

#searchBox::placeholder {
  color: var(--muted);
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.date-nav-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent);
  font-size: 24px;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  cursor: pointer;
}

.date-nav-btn:hover {
  background: var(--bg);
}

.date-nav-label {
  text-align: center;
  min-width: 200px;
}

.date-nav-label > div {
  font-size: 17px;
  font-weight: 600;
}

.area-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.area-tabs {
  display: flex;
  gap: 8px;
}

.print-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.print-tab-link:hover {
  background: var(--bg);
}

.area-tab {
  border: none;
  background: var(--bg);
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.area-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.gantt-split {
  display: flex;
  align-items: flex-start;
}

.gantt-labels {
  flex-shrink: 0;
  width: 100px;
}

.gantt-label-row {
  box-sizing: border-box;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 4px 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.gantt-label-row.corner {
  background: var(--bg);
}

.gantt-label-row.section-spacer {
  border: none;
  background: transparent;
  justify-content: flex-end;
  padding-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
}

.gantt-label-row .cap {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}

.gantt-scroll {
  flex: 1;
  overflow-x: auto;
  padding-bottom: 12px;
}

.gantt-timeline {
  box-sizing: border-box;
  display: grid;
}

.gantt-timeline .gantt-cell,
.gantt-timeline .res-bar {
  grid-row: 1;
}

.gantt-timeline-spacer {
  box-sizing: border-box;
}

.gantt-cell {
  box-sizing: border-box;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px;
}

.gantt-hour {
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.gantt-slot {
  cursor: pointer;
}

.gantt-slot:hover {
  background: var(--bg);
}

.hour-marker {
  border-left: 2px solid var(--muted);
}

.res-bar {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  margin: 4px 2px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.res-bar.special {
  background: #fff4dd;
  border-color: #e0a940;
  color: #8a5a00;
}

.res-bar.overcapacity {
  border-color: #e64340;
  border-width: 2px;
}

.res-bar.arrived {
  background: #e2edfb;
  border-color: #3b7dd8;
  color: #1c4a86;
}

.res-bar.do-not-move {
  filter: brightness(0.8);
}

.res-bar.arrived.overcapacity {
  border-color: #e64340;
  border-width: 2px;
}

.res-bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Corner badge rather than another prepended icon: the bar's inline content
   (icons + name + party size + phone) is already tight enough that anything
   appended there is the next thing ellipsis clips. Sits inside the bar's own
   overflow:hidden bounds so it never gets clipped itself.
   CSS-drawn solid circle rather than an emoji glyph -- the emoji rendered too
   small/low-contrast to actually notice against the bar's background; a
   filled color + white ring pops on any bar state (dining/special/arrived)
   and stays crisp at this size instead of relying on the OS's emoji font. */
.res-bar-new-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: #ff9800;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--panel), 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 3;
}

.res-popup {
  position: fixed;
  z-index: 41;
  display: none;
  flex-direction: column;
  min-width: 170px;
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.res-popup.open {
  display: flex;
}

.res-popup-btn {
  appearance: none;
  border: none;
  background: none;
  text-align: left;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.res-popup-btn:last-child {
  border-bottom: none;
}

.res-popup-btn:active {
  background: var(--bg);
}

.res-popup-btn-danger {
  color: #e64340;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 20px;
  margin: 0;
}

.header .count {
  font-size: 13px;
  color: var(--muted);
}

.admin-subheading {
  font-size: 16px;
  margin: 28px 0 16px;
}

.top-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.top-links-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 600px) {
  .top-links-right {
    justify-content: center;
  }
}

/* Every header action reuses .back-link's base styling, but as a standalone
   text link on 8 other pages that class must stay plain there -- scope the
   pill treatment to this header only. Without `white-space: nowrap`, a flex
   item's min-content width for unspaced CJK text is a single character (the
   browser can break a line between any two Han characters), so on a narrow
   viewport these links used to collapse to one-character-wide columns
   instead of wrapping as whole buttons. */
.top-links-right .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  /* Pill shape is its own non-color click affordance -- cancel the plain
     .back-link's default underline so it doesn't double up here. */
  text-decoration: none;
}

.top-links-right .back-link:hover {
  background: var(--bg);
}

@media (max-width: 480px) {
  .top-links-right .back-link {
    padding: 8px 11px;
    font-size: 12.5px;
  }
}

/* Icon-only header buttons (bell, menu toggle) -- no CJK label, so none of
   the min-content wrapping concerns above apply here. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: inherit;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover {
  background: var(--bg);
}

.icon-btn.icon-btn-active {
  background: var(--bg);
  border-color: var(--accent);
}

/* Restaurant switcher -- rendered by restaurant.js only when the current
   user actually has more than one restaurant to choose from (hidden via
   the [hidden] attribute otherwise, not display:none toggling). Same pill
   chrome as .top-links-right .back-link so it reads as one more header
   control, not a distinct form element. */
.restaurant-switcher-select {
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 30px 9px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.restaurant-switcher-select:hover {
  background-color: var(--bg);
}

@media (max-width: 480px) {
  .restaurant-switcher-select {
    padding: 8px 26px 8px 11px;
    font-size: 12.5px;
  }
}

.header-menu {
  position: relative;
}

.header-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.header-menu-panel[hidden] {
  display: none;
}

.header-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.header-menu-item:hover {
  background: var(--bg);
}

.header-menu-item-danger {
  color: #b3342c;
}

.header-menu-item-danger:hover {
  background: #fdeceb;
}

/* Print output is a physical medium -- literal light-mode hex throughout
   this section (not var() tokens) on purpose, so a printed page always
   comes out on white paper with dark ink regardless of the viewer's OS
   dark-mode preference at the moment they hit print. */
.print-sheet {
  width: 277mm;
  margin: 0 auto 24px;
  background: #fff;
  padding: 5mm 8mm;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
  page-break-after: always;
}

.print-sheet.portrait {
  width: 190mm;
}

.print-sheet:last-child {
  page-break-after: auto;
}

.print-sheet-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4mm;
  border-bottom: 2px solid #2a241c;
  padding-bottom: 2mm;
}

.print-sheet-header h2 {
  margin: 0;
  font-size: 18px;
  color: #2a241c;
}

.print-sheet-header .print-date {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.print-sheet-header .print-count {
  font-size: 12px;
  color: #777;
  margin-left: auto;
}

.print-sheet .gantt-labels {
  width: 24mm;
}

.print-sheet .gantt-scroll {
  overflow: visible;
  padding-bottom: 0;
}

.print-sheet .gantt-label-row,
.print-sheet .gantt-cell {
  font-size: 8px;
  padding: 2px 3px;
}

.print-sheet .gantt-label-row .cap {
  font-size: 7px;
}

.print-sheet .gantt-hour {
  font-size: 8px;
}

.print-sheet .res-bar {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  white-space: normal;
  line-height: 1.25;
  margin: 1px 2px;
  padding: 1px 4px;
  gap: 0;
}

.print-sheet .res-bar-name {
  font-size: 8.5px;
  overflow: hidden;
}

.print-sheet .res-bar-notes {
  font-size: 7.5px;
  font-weight: 500;
  opacity: 0.85;
  overflow: hidden;
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .print-sheet {
    box-shadow: none;
    width: auto;
    margin: 0;
  }
}

.empty {
  text-align: center;
  color: var(--muted);
  margin-top: 60px;
  font-size: 15px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--panel);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card-time {
  width: 64px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.card-main {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-weight: 600;
}

.card-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.role-select {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text);
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.card-notes {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* admin.html's user cards outgrew the generic single-row .card layout once
   role/flair selects, an email field, restaurant checkboxes, and two
   action buttons all needed to coexist -- squeezing them into one flex row
   (the generic .card behavior) let .card-main's min-width: 0 crush the
   <select> elements down to a couple of characters wide. Each group gets
   its own full-width row instead. */
.user-card {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.user-card .card-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: auto;
}

.user-card .role-select {
  margin-top: 0;
  flex: 0 1 auto;
  /* .form-page select sets width: 100% for the app's actual forms
     (login, add-user, etc.) -- these role/flair selects sit inline next
     to the username instead and must size to their own content, not
     stretch to the full card width. */
  width: auto;
}

.user-card .card-actions {
  flex-direction: row;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.btn-edit {
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-cancel {
  background: #fdecea;
  color: #e64340;
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 28px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  text-decoration: none;
}

.fab:hover {
  background: var(--accent-hover);
}

.form-page .field {
  margin-bottom: 20px;
}

.field-autocomplete {
  position: relative;
}

.phone-input-wrap {
  position: relative;
}

.phone-input-wrap input {
  padding-right: 70px;
}

.phone-search-status {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  font-size: 12px;
  pointer-events: none;
}

.phone-search-status.new-customer {
  color: var(--accent);
  font-weight: 600;
}

.client-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  max-height: 220px;
  overflow-y: auto;
}

.client-suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.client-suggestion-item:last-child {
  border-bottom: none;
}

.client-suggestion-item:hover,
.client-suggestion-item.active {
  background: var(--bg);
}

.client-suggestion-name {
  font-weight: 600;
  font-size: 14px;
}

.client-suggestion-phone {
  font-size: 12px;
  color: var(--muted);
}

.form-page label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-page input,
.form-page textarea,
.form-page select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
}

.form-page textarea {
  min-height: 80px;
  resize: vertical;
}

.form-page input:disabled,
.form-page textarea:disabled,
.task-form-panel input:disabled,
.task-form-panel textarea:disabled {
  background: var(--bg);
  color: var(--muted);
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}

.checkbox-inline input {
  width: auto;
}

.save-btn {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 8px;
}

.save-btn:hover {
  background: var(--accent-hover);
}

/* Plain text link (the "← 返回" back-nav on 8 pages) -- underlined by
   default, not just on :hover, since near-black link text next to
   near-black body text loses the "this is clickable" signal a brighter
   accent color used to provide. .top-links-right cancels this back out
   for the pill-styled header buttons that also use this class, which
   already have a border for that affordance. */
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent);
  text-decoration: underline;
  font-size: 14px;
}

.push-toggle {
  font-weight: 700;
}

/* Only rendered when there's actually something pending (see
   refreshTasksCount() in index.js, which leaves it empty at 0) — :empty
   hides it automatically so a "0" badge never sits there doing nothing. */
.tasks-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e64340;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.tasks-count-badge:empty {
  display: none;
}

.floor {
  margin-bottom: 24px;
}

.floor h2 {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 10px;
  text-transform: capitalize;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.table-card {
  border-radius: 10px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.table-card.occupied {
  background: #fdecea;
  border-color: #f6cac6;
}

.table-card .num {
  font-weight: 600;
  font-size: 16px;
}

.table-card .cap {
  font-size: 12px;
  color: var(--muted);
}

.table-card .status {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 600;
}

/* Occupied/available is a semantic availability status (like a stoplight),
   not brand decoration -- stays its own distinct red/green pair regardless
   of the brand palette, same reasoning as the up/down trend colors in
   analytics further down this file. */
.table-card.occupied .status {
  color: #e64340;
}

.table-card:not(.occupied) .status {
  color: #1a7f4f;
}

.table-card .who {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.capacity-warning {
  margin-top: 10px;
  color: #e64340;
  font-size: 13px;
  font-weight: 600;
}

.audit-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: -12px;
  margin-bottom: 20px;
}

.form-loading-note {
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: -12px;
  margin-bottom: 20px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.checkbox-item.occupied {
  background: #fdecea;
  border-color: #f6cac6;
}

.checkbox-item .who {
  flex-basis: 100%;
  font-size: 11px;
  color: #e64340;
  margin-top: 2px;
}

.checkbox-item input {
  width: auto;
}

.checkbox-item:has(input:disabled) {
  opacity: 0.5;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100;
  display: none;
}

.spinner-overlay {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: none;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Sits inside a solid accent-colored button (.save-btn, .btn-primary,
   .btn-complete) while it's saving -- must use --accent-ink, not a literal
   white, or it renders invisible (white-on-white) once dark mode flips
   --accent to near-white. */
.spinner.inline {
  width: 14px;
  height: 14px;
  border-width: 2px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  border-color: color-mix(in srgb, var(--accent-ink) 50%, transparent);
  border-top-color: var(--accent-ink);
}

/* The "dark" variant is for a spinner sitting on a light/neutral surface
   instead of inside a solid accent button (naming is legacy -- it means
   "dark spinner," not "for dark backgrounds") -- same treatment as the
   free-floating .spinner above. */
.spinner.inline.dark {
  border-color: var(--border);
  border-top-color: var(--accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tasks (任务清单) */

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tasks-header-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.tasks-header-text h1 {
  font-size: 20px;
  margin: 0;
}

.tasks-header-text .count {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* Normal-sized buttons, distinct from the full-width .save-btn used on
   dedicated single-purpose pages (form.html, admin.html) — the tasks page
   needs a compact header action plus a save/cancel pair that don't read as
   giant page-filling CTAs. */
.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-compact {
  padding: 0 14px;
  font-size: 13px;
}

.task-banner {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.task-banner-due-today {
  background: #fff3e0;
  color: #b26a00;
}

.task-banner-overdue {
  background: #fdecea;
  color: #c0392b;
}

/* Segmented filter control — one visually joined pill instead of separate
   button-chips, matching the compact-header/checklist framing rather than
   the admin-form look. Scrolls horizontally instead of wrapping if it ever
   doesn't fit. */
.task-filter-bar {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.task-filter-btn {
  flex: 1 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.task-filter-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.task-form-panel {
  background: var(--panel);
  border-radius: 10px;
  padding: 18px 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.task-form-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}

.task-form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-form-grid .field {
  margin-bottom: 0;
}

.task-form-panel label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Per-user restaurant assignment (admin.html) -- a small checkbox group,
   both in the "add user" form and inline on each existing user's card. */
.restaurant-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.restaurant-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.restaurant-checkbox input {
  margin: 0;
  cursor: pointer;
}

.task-form-panel input,
.task-form-panel textarea,
.task-form-panel select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  min-height: 44px;
  color: var(--text);
}

.task-form-panel textarea {
  min-height: 60px;
  resize: vertical;
}

/* The assignee row (an account picker plus a free-text name input, either of
   which can hold arbitrarily long content) is the one form row that pairs
   two fields — side by side on desktop, stacked below 520px. */
.task-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .task-form-row-assignee {
    grid-template-columns: 1fr;
  }
}

.task-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.task-card {
  border-left: 4px solid transparent;
  align-items: flex-start;
}

.task-card.task-due-today {
  border-left-color: #ff9800;
  background: #fffaf3;
}

.task-card.task-overdue {
  border-left-color: #e64340;
  background: #fef6f5;
}

.task-card.task-completed {
  opacity: 0.55;
}

.task-card .card-name {
  font-size: 15px;
}

.task-desc-done {
  text-decoration: line-through;
}

/* Complete/reopen, edit, and delete sit inline under the card's own metadata
   (not a separate leading column) — keeps them small and neatly aligned
   without squeezing the description on narrow screens. */
.task-card .card-actions {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.task-card .btn {
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

/* An explicit, clearly-labelled action rather than an icon-only checkbox —
   completing/reopening a task should read as unambiguous as 编辑/删除. */
.btn-complete {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-reopen {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Analytics (数据分析) */

.analytics-range-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.analytics-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.analytics-custom-range input[type="date"] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--panel);
}

.analytics-section {
  background: var(--panel);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.analytics-section h2 {
  font-size: 15px;
  margin: 0 0 10px;
}

.analytics-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.analytics-section-header h2 {
  margin: 0;
}

.analytics-inline-toggle {
  margin: 0;
  background: var(--bg);
}

.analytics-inline-toggle .task-filter-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.analytics-hint {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 12px;
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-stat-card {
  background: var(--panel);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.analytics-stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.analytics-stat-card .stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.analytics-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  min-height: 150px;
}

.analytics-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 42px;
}

.analytics-bar-track {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: flex-end;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.analytics-bar-track.narrow {
  width: 12px;
}

/* Chart series colors (this default fill, plus .dining/.lounge below) are
   data-category colors, not brand decoration -- deliberately left untouched
   by the brand palette, same as the rest of this file's status colors. */
.analytics-bar-fill {
  width: 100%;
  background: #1a7f4f;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.analytics-bar-fill.dining {
  background: #1a7f4f;
}

.analytics-bar-fill.lounge {
  background: #c17f2a;
}

/* ANJU's own three areas -- distinct data-category colors, same reasoning
   as dining/lounge above (never brand-tinted). Never shown alongside
   NAMU's dining/lounge bars in the same chart (analytics is
   restaurant-scoped), so no risk of these clashing with those. */
.analytics-bar-fill.dining_room {
  background: #2f6690;
}

.analytics-bar-fill.patio {
  background: #4f9d70;
}

.analytics-bar-fill.private_room {
  background: #7a5c99;
}

/* A period that isn't over yet (usually the current week/month, cut short by
   today) always looks like a decline next to a full prior period -- hatching
   + dimming marks it as "still filling in" rather than a real data point,
   without hiding it from the chart entirely. */
.analytics-bar-fill.incomplete {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.4) 0px,
    rgba(255, 255, 255, 0.4) 3px,
    transparent 3px,
    transparent 6px
  );
  opacity: 0.65;
}

.analytics-bar-partial-mark {
  color: #e0a940;
  font-weight: 700;
  margin-left: 1px;
}

.analytics-comparison-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.analytics-bar-group {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 110px;
}

.analytics-bar-label {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  line-height: 1.3;
  /* Labels must never overlap a neighboring bar — wrap instead of the fixed
     34px-wide overflow that used to run adjacent labels into each other. */
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.analytics-bar-sublabel {
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
}

.analytics-bar-sublabel.up {
  color: #1a7f4f;
}

.analytics-bar-sublabel.down {
  color: #e64340;
}

.analytics-bar-sublabel.flat {
  color: var(--muted);
}

.analytics-sparkline-wrap {
  margin-top: 4px;
  line-height: 0;
  color: var(--muted);
}

.analytics-sparkline-wrap.up {
  color: #1a7f4f;
}

.analytics-sparkline-wrap.down {
  color: #e64340;
}

.analytics-sparkline {
  display: block;
}

.analytics-bar-col-clickable {
  cursor: pointer;
  border-radius: 6px;
  padding: 4px;
  margin: -4px;
}

.analytics-bar-col-clickable:hover {
  background: var(--bg);
}

.analytics-bar-col-clickable.selected {
  background: var(--border);
}

.analytics-bar-col-clickable.selected .analytics-bar-label {
  color: var(--accent);
  font-weight: 700;
}

.analytics-weekday-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.analytics-weekday-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.analytics-weekday-detail-header h3 {
  margin: 0;
  font-size: 14px;
  color: var(--accent);
}

.analytics-weekday-detail-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}

.analytics-weekday-detail-subhead {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 16px 0 6px;
}

.analytics-weekday-detail-scroll {
  max-height: 220px;
  overflow-y: auto;
}

.analytics-weekday-week-label {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
}

.analytics-comparison {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.analytics-delta {
  font-weight: 700;
}

.analytics-delta.up {
  color: #1a7f4f;
}

.analytics-delta.down {
  color: #e64340;
}

.analytics-delta.flat {
  color: var(--muted);
}

.analytics-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.analytics-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.analytics-legend-item .swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.analytics-legend-item .swatch.dining {
  background: #1a7f4f;
}

.analytics-legend-item .swatch.lounge {
  background: #c17f2a;
}

.analytics-legend-item .swatch.dining_room {
  background: #2f6690;
}

.analytics-legend-item .swatch.patio {
  background: #4f9d70;
}

.analytics-legend-item .swatch.private_room {
  background: #7a5c99;
}

.analytics-table-list {
  display: flex;
  flex-direction: column;
}

.analytics-table-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.analytics-table-row:last-child {
  border-bottom: none;
}

.analytics-table-cell.name {
  width: 70px;
  flex-shrink: 0;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.analytics-table-cell.value {
  width: 48px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
  color: var(--accent);
}

.analytics-table-cell.muted {
  width: 120px;
  flex-shrink: 0;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

.analytics-occupancy-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.analytics-occupancy-fill {
  height: 100%;
  background: var(--accent);
}

/* Clients (客户管理) */

.clients-table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.clients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text);
}

.clients-table th,
.clients-table td {
  padding: 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.clients-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  background: var(--bg);
}

.clients-table tr:last-child td {
  border-bottom: none;
}

.clients-table tr:hover td {
  background: var(--bg);
}

.clients-col-notes {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.clients-col-actions .btn {
  min-height: 36px;
  padding: 0 12px;
  margin-right: 6px;
}

.clients-col-actions .btn:last-child {
  margin-right: 0;
}

.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  color: var(--accent);
}

.status-badge.status-badge-inactive {
  background: var(--border);
  color: var(--muted);
}

/* Mobile-first: drop the notes column on narrow screens rather than forcing
   horizontal scroll for a rarely-critical field -- name/phone/actions stay
   fully visible and tappable on a phone. */
@media (max-width: 480px) {
  .clients-col-notes {
    display: none;
  }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
}

.pagination span {
  font-size: 13px;
  color: var(--muted);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ICP filing footer (粤ICP备2026136094号, anjugroup.store) -- required on every
   page per mainland China hosting compliance. no-print so it never shows up
   on printed daily sheets (see the .no-print rule under @media print above).
   Deliberately literal colors, not brand tokens -- compliance text, not
   themed UI chrome, and #999 reads legibly against both NAMU's light and
   ANJU's dark backgrounds without needing a per-restaurant variant. */
.icp-footer {
  text-align: center;
  padding: 12px 0;
  font-size: 12px;
  color: #999;
}

.icp-footer a {
  color: inherit;
  text-decoration: none;
}

.icp-footer a:hover {
  text-decoration: underline;
}

.version-stamp {
  margin-top: 4px;
  font-size: 11px;
  color: #bbb;
  font-variant-numeric: tabular-nums;
}

.update-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  text-align: center;
}

.update-banner button {
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent-ink);
  color: var(--accent);
}
