:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #52606d;
  --primary: #0070f3;
  --danger: #d64545;
  --ok: #00875a;
  --line: #d9e2ec;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef2f6, #f9fbfc);
}
body.nav-open {
  overflow: hidden;
}
a { color: var(--primary); text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.page-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.page-heading-actions form {
  margin: 0;
}
@media (max-width: 720px) {
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .page-heading-actions {
    width: 100%;
  }
}
.nav {
  background: #102a43;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.nav-brand {
  color: #fff;
  letter-spacing: 0.02em;
}
.nav-brand:hover {
  color: #fff;
}
.nav-toggle,
.nav-close {
  width: auto;
  min-width: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 42, 67, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 35;
}
.nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  padding: 18px;
  background: linear-gradient(180deg, #102a43, #16324f);
  color: #fff;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: -18px 0 36px rgba(16, 42, 67, 0.26);
}
body.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}
body.nav-open .nav-panel {
  transform: translateX(0);
}
.nav-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.nav-panel-user strong {
  display: block;
  font-size: 18px;
}
.nav-panel .small {
  color: rgba(255, 255, 255, 0.72);
}
.nav-links {
  display: grid;
  gap: 8px;
}
.nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
}
.nav-link.active {
  background: rgba(122, 186, 255, 0.18);
  color: #fff;
}
.nav-logout-form {
  margin-top: auto;
}
.nav-logout-form button {
  width: 100%;
}
.report-filter-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.report-filter-form button {
  width: auto;
  min-width: 100px;
}
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.report-summary-card {
  margin-bottom: 0;
}
.report-summary-card.accent {
  border-color: #8bb6e8;
  background: linear-gradient(180deg, #eef6ff, #f7fbff);
}
.report-summary-value {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(16,42,67,.06);
}
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
input, select, textarea, button {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
}
button.secondary { background: #486581; }
button.danger { background: var(--danger); }
button.ok { background: var(--ok); }
.action-button-inline {
  width: auto;
  min-width: 140px;
}
.action-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--ok);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.action-link-button:hover {
  color: #fff;
  opacity: 0.95;
}
.inline { display: flex; gap: 8px; align-items: center; }
.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.alert.error { background: #ffe3e3; color: #7d1d1d; }
.alert.success { background: #d3f9d8; color: #1b4332; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; font-size: 14px; }
th { background: #f0f4f8; }
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-bottom: 4px;
}
.table-responsive table {
  width: max-content;
  min-width: 100%;
}
.table-responsive th,
.table-responsive td {
  white-space: nowrap;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.plain-list li + li {
  margin-top: 8px;
}
.assignment-overview {
  display: grid;
  gap: 14px;
}
.assignment-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.assignment-filters {
  margin-bottom: 0;
}
.assignment-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.assignment-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.assignment-stat.mine {
  background: #eefbf3;
  border-color: #8cc7a6;
}
.assignment-stat.unassigned {
  background: #fff8e8;
  border-color: #ead38c;
}
.assignment-stat.other {
  background: #f4f7fb;
  border-color: #c6d3e0;
}
.assignment-stat-label {
  font-size: 12px;
  color: var(--muted);
}
.filter-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}
.filter-tab.active {
  border-color: #8bb6e8;
  background: #eaf4ff;
  color: #134d86;
}
.table-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.table-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.table-card-meta {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7fafc;
}
.table-card-staff {
  margin-top: 4px;
  font-weight: 700;
}
.table-card.mine {
  border-color: #8cc7a6;
  box-shadow: 0 6px 20px rgba(0, 135, 90, 0.12);
}
.table-section {
  margin-bottom: 18px;
}
.table-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.table-section-heading h2 {
  margin: 0;
  font-size: 18px;
}
.table-section-empty {
  margin-bottom: 0;
}
.table-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.table-card-actions form {
  margin: 0;
}
.table-card-actions button {
  width: auto;
}
.table-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 9px 14px;
  border: 1px solid #8bb6e8;
  border-radius: 10px;
  background: #eef6ff;
  color: #134d86;
  font-weight: 700;
}
.table-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.table-status-badge.mine {
  background: #def7e7;
  color: #166534;
}
.table-status-badge.unassigned {
  background: #fff1bf;
  color: #8a5b00;
}
.table-status-badge.other {
  background: #e7edf4;
  color: #334e68;
}
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
@media (max-width: 720px) { .menu-grid { grid-template-columns: 1fr; } }
.menu-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}
.menu-item-order-form {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.order-item-form {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.menu-item-order-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.qty-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-item-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.menu-item-qty-input {
  width: 88px !important;
  min-width: 88px;
  text-align: center;
}
.menu-item-add-button {
  width: 92px !important;
  min-width: 92px;
  align-self: stretch;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}
.menu-category-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #f9fbfd, #f2f6fa);
  margin-bottom: 12px;
}
.menu-category-title {
  margin: 0;
  font-size: 16px;
}
.menu-category-accordion > summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.menu-category-summary-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.menu-category-accordion > summary::-webkit-details-marker {
  display: none;
}
.menu-category-accordion > summary::after {
  content: "▼";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.2s ease;
  order: -1;
}
.menu-category-accordion[open] > summary::after {
  transform: rotate(180deg);
}
.menu-category-scroll {
  max-height: clamp(320px, 46vh, 460px);
  overflow-y: auto;
  padding-right: 8px;
  margin-right: -4px;
  margin-top: 10px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.menu-category-scroll::after {
  content: "";
  display: block;
  height: 2px;
}
.small { font-size: 12px; color: var(--muted); }
.assignment-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.assignment-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.assignment-panel.mine {
  border-color: #8cc7a6;
  background: #f4fbf6;
}
.assignment-panel-name {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
}
.assignment-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #def7e7;
  color: #166534;
  font-weight: 700;
}
.order-items-scroll {
  max-height: clamp(380px, 52vh, 520px);
  overflow-y: auto;
  padding-right: 8px;
  margin-right: -4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.order-items-scroll::after {
  content: "";
  display: block;
  height: 2px;
}
.order-item-card:last-child {
  margin-bottom: 0 !important;
}
.checkout-card {
  display: grid;
  gap: 18px;
}
.checkout-centered {
  width: min(100%, 680px);
  margin-left: auto;
  margin-right: auto;
}
.checkout-total-panel {
  border: 1px solid #cfe0f2;
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #102a43, #1f5f8b);
  color: #fff;
}
.checkout-total-amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0;
}
.checkout-total-amount strong {
  font-size: clamp(40px, 8vw, 64px);
  line-height: 1;
  letter-spacing: 0.02em;
}
.checkout-total-amount span {
  font-size: 20px;
  font-weight: 700;
}
.checkout-total-panel .small {
  color: rgba(255, 255, 255, 0.82);
}
.checkout-breakdown {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fbfcfe;
}
.checkout-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.checkout-breakdown-row:last-child {
  border-bottom: none;
}
.checkout-breakdown-row-total {
  background: #eef5fb;
}
.staff-rate-form {
  display: none;
}
.staff-rate-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.staff-rate-inline input {
  width: 92px;
  min-width: 92px;
  text-align: right;
}
@media (max-width: 720px) {
  .assignment-stat-grid {
    grid-template-columns: 1fr;
  }
  .report-summary-grid {
    grid-template-columns: 1fr;
  }
  .report-filter-form {
    align-items: stretch;
    flex-direction: column;
  }
  .report-filter-form button {
    width: 100%;
  }
  .assignment-panel {
    align-items: stretch;
    flex-direction: column;
  }
}
