/* --- Tokens (clean natural: warm-paper bg, crisp white cards, terracotta accent, warm espresso ink; accent/bg overridden in base.html) --- */
:root {
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-vintage: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --bg-deep: #f7f5f0;
  --bg-navy: #f1efe9;
  --bg-mid: #ebe8e0;
  --card: var(--card-solid);
  --card-solid: #ffffff;
  --text: #2a2620;
  --muted: #76705f;
  --border: #e6e0d5;
  --accent: #cf6326;
  --accent-2: #36312a;
  --accent-hover: #e07636;
  --ok: #1f7a4d;
  --danger: #c0392b;
  --warn: #b07d18;
  --vintage-brass: #36312a;
  --vintage-ink: #2a2620;
  --shadow: 0 4px 16px rgba(54, 49, 42, 0.08);
  --shadow-soft: 0 1px 3px rgba(54, 49, 42, 0.06);
  --panel-inset: inset 0 1px 0 #ffffff;
  --radius: 12px;
  --rise-duration: 0.4s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Base --- */
html,
body {
  min-height: 100%;
  margin: 0;
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

body {
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-deep);
  background-image: none;
  background-attachment: fixed;
}

/* Texture removed for a clean, flat surface */
body::after {
  content: none;
}

.bg-blobs {
  display: none;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

/* ── Splash keyframes ──────────────────────────────────────────────────── */
@keyframes splash-card-in {
  0%   { opacity: 0; transform: translateY(40px) scale(0.88); filter: blur(6px); }
  55%  { opacity: 1; transform: translateY(-6px) scale(1.02); filter: blur(0); }
  75%  { transform: translateY(2px) scale(0.995); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes splash-logo-in {
  0%   { opacity: 0; transform: scale(0.4) rotate(-15deg); filter: blur(4px); }
  55%  { opacity: 1; transform: scale(1.12) rotate(3deg);  filter: blur(0); }
  75%  { transform: scale(0.96) rotate(-1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes splash-name-in {
  0%   { opacity: 0; transform: translateY(16px); filter: blur(3px); }
  100% { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
@keyframes splash-name-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes splash-powered-in {
  0%   { opacity: 0; letter-spacing: 0.5em; filter: blur(2px); }
  100% { opacity: 1; letter-spacing: 0.12em; filter: blur(0); }
}
@keyframes splash-dot-pulse {
  0%, 100% { transform: scaleY(0.3); opacity: 0.3; }
  50%       { transform: scaleY(1.0); opacity: 1; }
}
@keyframes splash-ring-expand {
  0%   { transform: scale(0.7); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), visibility 0.6s ease;
}
.splash-hidden {
  opacity: 0;
  visibility: hidden;
}

/* Expanding ring behind the card */
.splash-screen::before {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: splash-ring-expand 1.1s cubic-bezier(0.22,1,0.36,1) 0.2s both;
}

.splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
  box-shadow: 0 12px 60px rgba(0,0,0,.14), 0 2px 12px rgba(0,0,0,.06);
  animation: splash-card-in 0.7s cubic-bezier(0.22,1,0.36,1) 0.05s both;
  position: relative;
}
.splash-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--border);
  animation: splash-logo-in 0.75s cubic-bezier(0.22,1,0.36,1) 0.18s both;
}
.splash-mark {
  width: 24px;
  height: 24px;
  animation: splash-logo-in 0.75s cubic-bezier(0.22,1,0.36,1) 0.18s both;
}
.splash-name {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  animation: splash-name-in 0.5s cubic-bezier(0.22,1,0.36,1) 0.4s both;
  background: linear-gradient(
    90deg,
    var(--text) 0%,
    var(--accent) 40%,
    var(--text) 60%,
    var(--text) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation:
    splash-name-in 0.5s cubic-bezier(0.22,1,0.36,1) 0.4s both,
    splash-name-shimmer 1.6s linear 0.9s 1;
}
.splash-powered {
  color: var(--muted);
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-family: var(--font-vintage);
  animation: splash-powered-in 0.7s cubic-bezier(0.22,1,0.36,1) 0.55s both;
}
/* Loading dots */
.splash-dots {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  animation: splash-name-in 0.4s ease 0.7s both;
}
.splash-dots span {
  width: 5px;
  height: 18px;
  border-radius: 3px;
  background: var(--accent);
  display: inline-block;
  animation: splash-dot-pulse 0.85s cubic-bezier(0.4,0,0.6,1) infinite;
}
.splash-dots span:nth-child(2) { animation-delay: 0.17s; }
.splash-dots span:nth-child(3) { animation-delay: 0.34s; }

/* --- Motion primitives --- */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-rise {
  animation: rise-in var(--rise-duration) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stagger-children > * {
  animation: rise-in var(--rise-duration) cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stagger-children > *:nth-child(1) {
  animation-delay: 0.04s;
}
.stagger-children > *:nth-child(2) {
  animation-delay: 0.08s;
}
.stagger-children > *:nth-child(3) {
  animation-delay: 0.12s;
}
.stagger-children > *:nth-child(4) {
  animation-delay: 0.16s;
}
.stagger-children > *:nth-child(5) {
  animation-delay: 0.2s;
}
.stagger-children > *:nth-child(6) {
  animation-delay: 0.24s;
}
.stagger-children > *:nth-child(7) {
  animation-delay: 0.28s;
}
.stagger-children > *:nth-child(8) {
  animation-delay: 0.32s;
}

/* --- Top bar (solid cream panel) --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 100;
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 65%, #000);
  box-shadow: none;
  animation: none;
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-text strong {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-muted {
  color: var(--muted);
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 0;
  border-bottom: none;
}
.nav:has(> :only-child) {
  border-bottom: none;
}

/* Clean light tabs; accent underline marks the active page */
.nav-link {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.nav-link:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent-2) 6%, transparent);
}
.nav-link-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.nav-link-active:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.nav-link-quiet {
  align-self: center;
  margin-left: 6px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-weight: 600;
}
.nav-link-quiet:hover {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card-solid));
}

/* Admin dropdown */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-dropdown-toggle {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  padding: 6px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 9999;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(54, 49, 42, 0.16);
}
.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}
.nav-dropdown-item {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 9px 12px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.nav-dropdown-item:hover {
  background: color-mix(in srgb, var(--accent-2) 7%, transparent);
  color: var(--text);
}
.nav-dropdown-item-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.main {
  margin-top: 22px;
}

/* --- Typography --- */
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2rem);
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
}

.lead {
  margin: 0 0 22px;
  font-size: 1rem;
  max-width: 62ch;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  font-family: var(--font-vintage);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-2);
  margin: 0 0 8px;
}

.text-accent {
  color: var(--accent);
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

.small-label {
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.text-link {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent);
}
.text-link:hover {
  text-decoration: none;
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.fine-print {
  font-size: 0.85rem;
  margin-top: 20px;
}

/* --- Customer theme --- */
.theme-customer .topbar {
  background: var(--card-solid);
}

.customer-header {
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-solid);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 10px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
}

.hero-sub {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  font-family: var(--font-vintage);
  font-style: italic;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

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

.menu-item {
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-solid);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.menu-item:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  box-shadow: var(--shadow-soft);
}

.menu-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.menu-item-list .menu-item-head {
  margin-bottom: 6px;
  align-items: stretch;
}
.menu-item-list .menu-item-head > div:nth-child(2) {
  flex: 1;
}

.dish-name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  display: block;
}

.dish-cat {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-vintage);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.price-tag {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-size: 1.05rem;
  font-family: var(--font-display);
}

.menu-desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}
.menu-item-list .menu-desc {
  margin: 4px 0 0;
  font-size: 0.84rem;
}

.note-card {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-deep);
}

/* --- Success / status --- */
.success-hero {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: 36px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-solid);
  box-shadow: var(--shadow-soft);
}

.success-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 8px;
}

.order-id-line {
  font-size: 1.1rem;
  margin: 0 0 28px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.04em;
}

.status-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  overflow: hidden;
}

.status-card[data-status="pending"] {
  border-color: rgba(251, 191, 36, 0.35);
}
.status-card[data-status="accepted"],
.status-card[data-status="order_taken"],
.status-card[data-status="cooking"] {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.status-card[data-status="delivered"] {
  border-color: rgba(74, 222, 128, 0.4);
}
.status-card[data-status="denied"] {
  border-color: rgba(251, 113, 133, 0.4);
}

.status-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 1.1s linear infinite;
  flex-shrink: 0;
}

.status-card[data-status="delivered"] .status-ring,
.status-card[data-status="denied"] .status-ring {
  animation: none;
  border: 3px solid var(--ok);
  border-top-color: var(--ok);
}
.status-card[data-status="denied"] .status-ring {
  border-color: rgba(251, 113, 133, 0.5);
  border-top-color: var(--danger);
}

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

.status-body {
  text-align: left;
}
.status-label {
  margin: 0 0 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-vintage);
  color: var(--muted);
}
.status-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}
.status-hint {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.status-pulse {
  animation: status-pop 0.5s ease;
}

@keyframes status-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Centered mark inside the status ring: check when delivered, cross when cancelled */
.status-ring {
  position: relative;
}
.status-card[data-status="delivered"] .status-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 9px;
  height: 17px;
  border: solid var(--ok);
  border-width: 0 3px 3px 0;
  transform: translate(-50%, -55%) rotate(45deg);
}
.status-card[data-status="denied"] .status-ring::before,
.status-card[data-status="denied"] .status-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 3px;
  background: var(--danger);
  border-radius: 2px;
}
.status-card[data-status="denied"] .status-ring::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.status-card[data-status="denied"] .status-ring::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* After-order: clean stat tiles (replaces the old inline counts line) */
.order-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 22px 0 4px;
}
.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-deep);
}
.stat-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.stat-num.stat-pending {
  color: var(--warn);
}
.stat-num.stat-delivered {
  color: var(--ok);
}
.stat-num.stat-cancelled {
  color: var(--danger);
}
.stat-cap {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
@media (max-width: 480px) {
  .order-stats {
    gap: 6px;
  }
  .stat-chip {
    padding: 10px 4px;
  }
  .stat-num {
    font-size: 1.2rem;
  }
  .stat-cap {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }
}

/* --- Admin theme --- */
.theme-admin .topbar {
  background: var(--card-solid);
}

.login-panel {
  max-width: 440px;
  margin: 0 auto;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-solid);
  box-shadow: var(--shadow);
}

.login-form {
  margin-top: 8px;
}

.login-form .btn {
  margin-top: 14px;
}

/* --- Cards (admin orders) --- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
  padding: 18px;
  margin: 14px 0;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  box-shadow: var(--shadow-soft);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.status {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pending {
  border-color: rgba(251, 191, 36, 0.45);
  color: var(--warn);
}
.status-order_taken {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--ok);
}
.status-accepted {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--ok);
}
.status-cooking {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}
.status-delivered {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--ok);
}
.status-denied {
  border-color: rgba(251, 113, 133, 0.45);
  color: var(--danger);
}

.section {
  margin-top: 14px;
}
.section-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.note {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg-deep);
}

.items {
  padding-left: 18px;
  margin: 0;
}
.item {
  margin: 8px 0;
}
.item-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.item-note {
  margin-top: 4px;
  font-size: 0.85rem;
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form {
  margin: 0;
}

.deny-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.deny-form .field {
  margin: 0;
  min-width: 0;
}

.deny-form .field input {
  margin-top: 0;
}

.deny-item-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.orders-notify-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
  vertical-align: middle;
}

.orders-notify-dot-glow {
  animation: orders-dot-glow 1.15s ease-in-out infinite;
}

@keyframes orders-dot-glow {
  0%,
  100% {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15), 0 0 10px 2px rgba(34, 197, 94, 0.4);
    transform: scale(1);
  }
  50% {
    background: #facc15;
    box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.28), 0 0 12px 3px rgba(250, 204, 21, 0.62);
    transform: scale(1.12);
  }
}

@media (max-width: 720px) {
  .deny-form {
    grid-template-columns: 1fr;
  }
}

/* --- Buttons --- */
.btn {
  padding: 11px 18px;
  background: var(--accent);
  border: 1px solid transparent;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: none;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.05s ease;
}
.btn:hover {
  transform: none;
  background: var(--accent-hover);
  border-color: transparent;
}
.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}
.btn-primary:hover {
  border-color: transparent;
  background: var(--accent-hover);
  box-shadow: none;
}

.btn-submit {
  margin-top: 24px;
  width: 100%;
  max-width: 360px;
  padding: 15px 24px;
  font-size: 1.02rem;
  border-radius: 11px;
  background: var(--accent);
  border: 1px solid transparent;
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: none;
}
.btn-submit:hover {
  border-color: transparent;
  background: var(--accent-hover);
  box-shadow: none;
}

.btn-ok {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.btn-bad {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}
.btn-bad:hover {
  background: color-mix(in srgb, var(--danger) 86%, #000);
}

.shimmer {
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  animation: shimmer 2.8s ease-in-out infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* --- Forms --- */
.order-form {
  margin-top: 8px;
}

.field {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}
.field input,
.field textarea,
.field select {
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
  font-family: var(--font);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Neutralize the browser autofill highlight (blue/yellow) so fields keep the
   site's clean white look even when a browser tries to autofill them. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

.field.full {
  margin-top: 0;
}

/* --- Tables / QR admin --- */
.grid-tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.table-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
  padding: 16px;
  transition: border-color 0.2s ease;
  box-shadow: var(--shadow-soft);
}
.table-card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

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

.pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.pill-ok {
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--ok);
}

.qr-wrap {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  display: flex;
  justify-content: center;
}

.qr {
  width: 180px;
  height: 180px;
  border-radius: 8px;
}

.customer-url {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.url-field {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
}

/* --- Flash --- */
.flash {
  margin: 14px 0;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 8%, var(--card-solid));
  padding: 12px 14px;
}
.flash-item {
  color: var(--danger);
  font-size: 0.92rem;
}

/* --- Customer menu photos --- */
.menu-item-photo-wrap {
  margin: -4px -4px 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  background: var(--bg-deep);
}

.menu-item-photo-wrap-small {
  width: 72px;
  min-width: 72px;
  height: 72px;
  margin: 0;
  aspect-ratio: auto;
}
.menu-item-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.menu-item:hover .menu-item-photo {
  transform: scale(1.02);
}

.menu-item .field input[type="number"] {
  max-width: 92px;
}

.qty-row {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.qty-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-deep);
}

.qty-input {
  width: 54px !important;
  text-align: center;
  padding: 7px 6px !important;
  margin: 0 !important;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-solid);
  color: var(--text);
  cursor: pointer;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}
.qty-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.addon-group {
  margin: 10px 0 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  background: color-mix(in srgb, var(--accent) 4%, var(--card-solid));
}

.addon-group legend {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 6px;
}

.addon-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  margin: 4px 0;
}

.addon-price {
  color: var(--ok);
  margin-left: auto;
}

/* Special-instructions field stays hidden until the dish is actually added,
   keeping the list clean and scannable (top-restaurant menu pattern). */
.item-note-field {
  margin-top: 10px;
  display: none;
}
.menu-item.has-qty .item-note-field {
  display: block;
  animation: rise-in 0.25s ease both;
}
.item-note-field input {
  font-size: 0.86rem;
  padding: 9px 12px !important;
}

.order-submit-bar {
  position: sticky;
  bottom: 12px;
  margin-top: 16px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-solid);
  box-shadow: var(--shadow-soft);
}

/* --- Admin menu editor --- */
.admin-menu-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

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

.admin-menu-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
}

.admin-menu-row-main {
  display: flex;
  gap: 14px;
  align-items: center;
  flex: 1;
  min-width: 200px;
}

.admin-menu-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-menu-thumb-placeholder {
  background: linear-gradient(135deg, #f1ede5, #faf7f2);
}

.admin-menu-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.admin-menu-sub {
  font-size: 0.88rem;
  margin-top: 2px;
}

.admin-menu-desc {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 52ch;
}

.admin-menu-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 28px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.menu-edit-form {
  max-width: 520px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
}

.addon-editor {
  margin-top: 14px;
}

.addon-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.addon-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.addon-row {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 8px;
}

.addon-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.order-live-banner {
  background: color-mix(in srgb, var(--ok) 12%, var(--card-solid));
  border-color: color-mix(in srgb, var(--ok) 35%, var(--border));
}

.reorder-row {
  margin-top: 14px;
}

@media (max-width: 720px) {
  .menu-list {
    gap: 8px;
  }
  .menu-item {
    padding: 11px 12px;
  }
  .dish-name {
    font-size: 0.96rem;
  }
  .price-tag {
    font-size: 0.95rem;
  }
  .menu-desc,
  .menu-item-list .menu-desc {
    font-size: 0.82rem;
    line-height: 1.4;
  }
  .field {
    margin-top: 8px;
  }
  .menu-item-list .menu-item-head {
    gap: 10px;
  }
  .menu-item-photo-wrap-small {
    width: 58px;
    min-width: 58px;
    height: 58px;
    border-radius: 10px;
  }
  .qty-row {
    margin-top: 6px;
  }
  .qty-btn {
    width: 30px;
    height: 30px;
    font-size: 1.05rem;
  }
  .qty-input {
    width: 44px !important;
    padding: 6px 4px !important;
  }
  .qty-label {
    font-size: 0.84rem;
  }
  .addon-row {
    grid-template-columns: 1fr;
  }
  .btn-submit {
    max-width: 100%;
    margin-top: 0;
  }
}

.back-row {
  margin: 0 0 12px;
}

.current-image-block {
  margin-top: 8px;
}

.admin-form-preview {
  max-width: 200px;
  max-height: 140px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  margin-top: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

input[type="file"] {
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 20px 0 10px;
  font-weight: 600;
  padding-left: 12px;
  border-left: 3px solid var(--accent-2);
}

.table-add-panel {
  padding: 18px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
}

.inline-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.table-name-input {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: var(--font);
}

.qr-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  justify-content: center;
}

.table-delete-form {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* --- Sales spreadsheet --- */
.sales-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.sales-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
}

.kpi {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}
.kpi-label {
  font-family: var(--font-vintage);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  min-height: 2.4em;
  display: flex;
  align-items: flex-end;
}
.kpi-value {
  font-size: 1.15rem;
  font-family: var(--font-display);
}

.sales-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
}

.sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.sales-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 10px 12px;
  background: var(--card-solid);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}

.sales-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.sales-table tbody tr:nth-child(even) td {
  background: var(--bg-deep);
}

.sales-table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 12%, var(--card-solid));
}

.sales-empty {
  text-align: center;
  padding: 24px !important;
  color: var(--muted);
}

.col-id {
  width: 56px;
}
.col-time {
  min-width: 180px;
}
.col-money,
.sales-table th.col-money {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
}
.col-note {
  max-width: 280px;
  font-size: 0.82rem;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
}

.sales-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}
.sales-status.status-delivered {
  background: color-mix(in srgb, var(--ok) 14%, var(--card-solid));
  color: var(--ok);
}
.sales-status.status-denied {
  background: color-mix(in srgb, var(--danger) 12%, var(--card-solid));
  color: var(--danger);
}
.sales-status.status-pending {
  background: color-mix(in srgb, var(--warn) 14%, var(--card-solid));
  color: var(--warn);
}
.sales-status.status-cooking,
.sales-status.status-order_taken {
  background: color-mix(in srgb, var(--accent) 16%, var(--card-solid));
  color: color-mix(in srgb, var(--accent) 85%, #000);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.color-field input[type="color"] {
  height: 44px;
  padding: 4px;
  cursor: pointer;
}

.current-logo-row {
  margin: 12px 0;
}

.user-card {
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
}
/* Tighter vertical rhythm on admin pages (less wasted space) */
.theme-admin .lead {
  margin-bottom: 14px;
}
.theme-admin .user-card {
  padding: 13px 16px;
  margin-bottom: 12px;
}
.theme-admin .section-heading {
  margin: 14px 0 8px;
}
.theme-admin .user-card .section-heading:first-child {
  margin-top: 0;
}
.theme-admin .user-card .lead {
  margin: 0 0 4px;
}
.theme-admin .field {
  margin-top: 7px;
}
.user-form {
  max-width: 680px;
}
.user-perm-form {
  flex: 1;
  min-width: 280px;
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}
/* Compact inputs in admin add/filter grids */
.perm-grid .field input,
.perm-grid .field select {
  margin-top: 4px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 0.92rem;
}

/* Compact "Restock an item" box on the Expenses page: trim padding and keep
   its two fields tight together instead of stretching across the whole card. */
#restock-box {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 4px 12px 10px;
  margin-top: 8px;
}
#restock-box legend {
  padding: 0 6px;
  font-size: 0.82rem;
}
.restock-grid {
  grid-template-columns: repeat(2, minmax(140px, 210px));
  margin: 4px 0 0;
}
.expense-save-btn {
  margin-top: 10px;
}

/* Collapsible "Add expense" card */
.exp-add-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.exp-add-card > summary::-webkit-details-marker { display: none; }
.exp-add-summary .section-heading {
  margin: 0;
}
.exp-add-chevron {
  color: var(--muted);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}
.exp-add-card[open] .exp-add-chevron {
  transform: rotate(90deg);
}

@media (max-width: 480px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .nav {
    justify-content: center;
  }
}

/* ---- Admin order cards: tidy layout & button alignment ---- */
.order-card {
  max-width: 720px;
}

.order-card .item-main {
  align-items: baseline;
}

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

.order-card .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.order-card .check-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.order-card .actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.order-card .actions .inline-form {
  display: inline-flex;
  margin: 0;
}

.order-card .actions .btn {
  white-space: nowrap;
}

.order-card .actions .muted {
  flex-basis: 100%;
  margin: 0;
}

/* ============================================================
   Inventory  stock item cards (with restock gauge)
   ============================================================ */
.inv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Search toolbar ── */
.inv-toolbar {
  margin: 2px 0 12px;
}
.inv-search {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.inv-search:focus {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 18%, transparent);
}

/* ── Collapsible card ── */
.inv-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
  overflow: hidden;
}
.inv-level-low {
  border-left: 3px solid #e0392b;
}

/* Summary (compact clickable row) */
.inv-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.inv-summary::-webkit-details-marker { display: none; }
.inv-summary:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.inv-sum-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.inv-chevron {
  color: var(--muted);
  font-size: 0.8rem;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}
details[open] .inv-chevron { transform: rotate(90deg); }
.inv-sum-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.inv-sum-bar {
  width: 54px;
  height: 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--border) 45%, #fff);
  overflow: hidden;
}
.inv-sum-bar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: #2faa5a;
}
.inv-level-mid .inv-sum-bar-fill { background: #e6a017; }
.inv-level-low .inv-sum-bar-fill { background: #e0392b; }
.inv-sum-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2faa5a;
  min-width: 34px;
  text-align: right;
}
.inv-level-mid .inv-sum-pct { color: #b9790a; }
.inv-level-low .inv-sum-pct { color: #b42318; }
/* When the card is expanded the vertical gauge shows the %, so hide the
   compact horizontal bar and % in the summary to avoid duplication. */
.inv-card[open] .inv-sum-bar,
.inv-card[open] .inv-sum-pct { display: none; }

/* Narrow inputs for numeric-only fields (quantities, amounts) */
.field-narrow input { width: 130px; max-width: 100%; }
.inv-fields .field-narrow { flex: 0 0 auto; }

/* Expanded detail */
.inv-detail {
  display: flex;
  gap: 16px;
  padding: 6px 14px 14px;
  border-top: 1px solid var(--border);
}

/* ── Vertical restock gauge ── */
.inv-gauge {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 38px;
}
.inv-gauge-track {
  position: relative;
  flex: 1 1 auto;
  width: 14px;
  min-height: 86px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--border) 45%, #fff);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.inv-gauge-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  border-radius: 9px;
  transition: height 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
  background: #2faa5a;
}
.inv-gauge-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.inv-gauge-pct small {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.7;
}
/* Level-driven colours: gauge fill, badge accent & left edge */
.inv-level-good .inv-gauge-fill { background: #2faa5a; }
.inv-level-mid  .inv-gauge-fill { background: #e6a017; }
.inv-level-low  .inv-gauge-fill { background: #e0392b; }
.inv-level-mid  .inv-gauge-pct  { color: #b9790a; }
.inv-level-low  .inv-gauge-pct  { color: #b42318; }
.inv-level-low  { border-left: 3px solid #e0392b; }

/* ── Card main column ── */
.inv-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.inv-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  margin: 0;
}
.inv-remove-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.inv-remove-btn:hover {
  background: rgba(224, 57, 43, 0.12);
  color: #e0392b;
}
.inv-name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-badge-low {
  background: #fde2e1;
  color: #b42318;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}
.inv-onhand-num {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  white-space: nowrap;
}
.inv-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.inv-alert-note {
  font-size: 0.8rem;
  margin: 0 34px 4px 0;
}
.inv-controls {
  display: flex;
  flex-direction: column;
}
.inv-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 11px 0;
}
.inv-form + .inv-form {
  border-top: 1px dashed var(--border);
}
.inv-form:last-child {
  padding-bottom: 0;
}
.inv-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.inv-fields .field {
  flex: 1 1 140px;
  margin: 0;
  font-size: 0.82rem;
}
/* Keep narrow numeric fields sized to their input so the row stays aligned
   and doesn't leave an empty gap after the field. */
.inv-fields .field-narrow {
  flex: 0 0 auto;
}
/* Compact inputs on the inventory page */
.inv-fields .field input {
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.inv-form > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.inv-no-results {
  padding: 14px 4px;
}

/* Add-stock + correction row: each input sits right next to its own button. */
.inv-adjust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 26px;
  padding: 11px 0 0;
  border-top: 1px dashed var(--border);
}
.inv-adjust-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
}
.inv-adjust-form .field {
  margin: 0;
  font-size: 0.82rem;
}
.inv-adjust-form .field input {
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.inv-correct-btn {
  background: var(--bg-mid);
  color: var(--text);
  border: 1px solid var(--border);
}
.inv-correct-btn:hover {
  background: color-mix(in srgb, #e0392b 10%, var(--bg-mid));
  border-color: #e0392b;
  color: #b42318;
}

@media (max-width: 560px) {
  .inv-gauge {
    display: none;
  }
  .inv-form {
    align-items: stretch;
  }
  .inv-form > .btn {
    width: 100%;
  }
  .inv-adjust-form {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── Ghost / secondary button ── */
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #fff);
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   Low-stock alert ball (nav dropdown)
   ============================================================ */
.low-ball {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 5px;
  border-radius: 50%;
  background: #e5484d;
  flex-shrink: 0;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.7);
  animation: low-pulse 1.6s infinite;
}
.low-ball-toggle {
  position: relative;
  top: 0;
}
@keyframes low-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}
/* Count pill shown next to "Inventory" inside the open menu */
.low-ball-item {
  width: auto;
  height: auto;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 20px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  margin-left: 0;
}
/* The ball "shifts" from the Admin toggle into the menu once it's open */
.nav-dropdown.open .low-ball-toggle {
  display: none;
}
.nav-dropdown-item:has(.low-ball-item) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ============================================================
   Expenses  record rows
   ============================================================ */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exp-row {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--card-solid);
  padding: 12px 16px;
}
.exp-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.exp-amount {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.exp-cat-tag {
  background: var(--bg-mid);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.exp-row-meta {
  margin-top: 5px;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
}
.exp-row-meta > span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--border);
}
