/* Material 3 components for the restaurant setup page.
 *
 * Built only from the --md-* tokens in app.css, so colours, shape and
 * elevation match the rest of the product. Loaded only by the pages that use
 * these classes; nothing here restyles an existing Bootstrap class.
 */

/* ---- Type scale ------------------------------------------------------- */
.m3-page {
  --m3-font: Roboto, "Segoe UI", Arial, sans-serif;
  --m3-on-secondary-container: #0d1d2a;
  --m3-inverse-surface: #2e3135;
  --m3-inverse-on-surface: #eff0f7;
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 24px;
  font-family: var(--m3-font);
}

.m3-headline-medium {
  margin: 4px 0 4px;
  font-size: 1.75rem;
  line-height: 2.25rem;
  font-weight: 400;
  color: var(--md-on-surface);
}

.m3-title-large {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.75rem;
  font-weight: 400;
  color: var(--md-on-surface);
}

.m3-title-medium {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.009em;
}

.m3-body-large {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5rem;
  letter-spacing: 0.03em;
}

.m3-body-medium {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.018em;
}

.m3-muted {
  color: var(--md-on-surface-variant);
}

.m3-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: currentColor;
}

/* ---- Page header ------------------------------------------------------ */
.m3-page-header {
  margin-bottom: 24px;
}

.m3-page-header .m3-body-large {
  max-width: 720px;
}

.m3-page-header .m3-chip-set {
  margin-top: 16px;
}

/* ---- Buttons ------------------------------------------------------------ */
.m3-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  font: 500 0.875rem/1.25rem var(--m3-font);
  letter-spacing: 0.007em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: box-shadow 150ms ease;
}

.m3-btn:hover {
  text-decoration: none;
}

/* State layer: the M3 hover/press tint, drawn over the container. */
.m3-btn::after,
.m3-icon-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
}

.m3-btn:hover::after,
.m3-icon-btn:hover::after {
  opacity: 0.08;
}

.m3-btn:active::after,
.m3-btn:focus-visible::after,
.m3-icon-btn:active::after,
.m3-icon-btn:focus-visible::after {
  opacity: 0.12;
}

.m3-btn .m3-icon {
  margin-left: -8px;
}

.m3-btn-filled {
  color: var(--md-on-primary);
  background: var(--md-primary);
}

.m3-btn-filled:hover {
  color: var(--md-on-primary);
  box-shadow: var(--md-shadow);
}

.m3-btn-tonal {
  color: var(--m3-on-secondary-container);
  background: var(--md-secondary-container);
}

.m3-btn-tonal:hover {
  color: var(--m3-on-secondary-container);
}

.m3-btn-outlined {
  color: var(--md-primary);
  background: transparent;
  border: 1px solid var(--md-outline);
}

.m3-btn-text {
  padding: 0 12px;
  color: var(--md-primary);
  background: transparent;
}

.m3-btn-text .m3-icon {
  margin-left: -4px;
}

.m3-btn-error {
  color: var(--md-error);
}

.m3-btn:disabled {
  color: rgb(25 28 32 / 38%);
  background: rgb(25 28 32 / 12%);
  border-color: transparent;
  box-shadow: none;
  cursor: default;
}

.m3-btn-text:disabled,
.m3-btn-outlined:disabled {
  background: transparent;
}

.m3-btn:disabled::after {
  display: none;
}

.m3-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--md-on-surface-variant);
  background: transparent;
  cursor: pointer;
}

.m3-icon-btn .m3-icon {
  width: 24px;
  height: 24px;
}

/* ---- Cards and the step list ----------------------------------------- */
.m3-steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.m3-step {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
}

/* The connector between two step markers. */
.m3-step::before {
  content: "";
  position: absolute;
  top: 68px;
  bottom: -12px;
  left: 19.5px;
  width: 1px;
  background: var(--md-outline-variant);
}

.m3-step:last-child::before {
  display: none;
}

.m3-step-marker {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 22px;
  border-radius: 50%;
  color: var(--md-on-primary-container);
  background: var(--md-primary-container);
  font: 500 1rem/1 var(--m3-font);
}

.m3-step.is-done .m3-step-marker {
  color: var(--md-on-primary);
  background: var(--md-primary);
}

.m3-step.is-done .m3-step-marker .m3-icon {
  width: 22px;
  height: 22px;
}

.m3-step.is-locked .m3-step-marker {
  color: rgb(25 28 32 / 38%);
  background: var(--md-surface-container);
}

.m3-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-md);
  background: var(--md-surface-bright);
}

.m3-step.is-locked .m3-card {
  background: var(--md-surface-container-low);
}

.m3-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.m3-card-head .m3-body-medium {
  margin-top: 4px;
}

.m3-step.is-locked .m3-card-head {
  margin-bottom: 0;
}

.m3-subhead {
  margin: 28px 0 12px;
  color: var(--md-primary);
  font: 500 0.875rem/1.25rem var(--m3-font);
  letter-spacing: 0.007em;
}

.m3-subhead:first-child {
  margin-top: 0;
}

.m3-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

/* ---- Field grid ------------------------------------------------------- */
.m3-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px 16px;
}

.m3-span-12 { grid-column: span 12; }
.m3-span-8 { grid-column: span 8; }
.m3-span-6 { grid-column: span 6; }
.m3-span-4 { grid-column: span 4; }
.m3-span-3 { grid-column: span 3; }

@media (max-width: 760px) {
  .m3-grid > * {
    grid-column: span 12;
  }
}

/* ---- Outlined text field --------------------------------------------- */
.m3-field {
  position: relative;
  min-width: 0;
  --m3-field-bg: var(--md-surface-bright);
}

.m3-field-input {
  display: block;
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 0 16px;
  color: var(--md-on-surface);
  background: transparent;
  border: 1px solid var(--md-outline);
  border-radius: 4px;
  outline: none;
  caret-color: var(--md-primary);
  font: 400 1rem/1.5rem var(--m3-font);
  letter-spacing: 0.03em;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.m3-field-input::placeholder {
  color: transparent;
}

.m3-field-input:hover {
  border-color: var(--md-on-surface);
}

/* 2px focus border drawn inside, so the text never shifts. */
.m3-field-input:focus {
  border-color: var(--md-primary);
  box-shadow: inset 0 0 0 1px var(--md-primary);
}

.m3-field-input[readonly] {
  text-overflow: ellipsis;
  font-family: var(--critical-font);
  font-size: 0.9rem;
}

.m3-field-label {
  position: absolute;
  top: 16px;
  left: 12px;
  max-width: calc(100% - 24px);
  padding: 0 4px;
  overflow: hidden;
  color: var(--md-on-surface-variant);
  background: var(--m3-field-bg);
  font: 400 1rem/1.5rem var(--m3-font);
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: top 150ms ease, font-size 150ms ease, line-height 150ms ease, color 150ms ease;
}

.m3-field-input:focus ~ .m3-field-label,
.m3-field-input:not(:placeholder-shown) ~ .m3-field-label,
.m3-field.is-static .m3-field-label {
  top: -8px;
  font-size: 0.75rem;
  line-height: 1rem;
}

.m3-field-input:-webkit-autofill ~ .m3-field-label {
  top: -8px;
  font-size: 0.75rem;
  line-height: 1rem;
}

.m3-field-input:focus ~ .m3-field-label {
  color: var(--md-primary);
}

.m3-field-support {
  margin: 4px 16px 0;
  color: var(--md-on-surface-variant);
  font: 400 0.75rem/1rem var(--m3-font);
  letter-spacing: 0.033em;
}

.m3-field.is-error .m3-field-input {
  border-color: var(--md-error);
}

.m3-field.is-error .m3-field-input:focus {
  box-shadow: inset 0 0 0 1px var(--md-error);
}

.m3-field.is-error .m3-field-label,
.m3-field.is-error .m3-field-support {
  color: var(--md-error);
}

.m3-field.has-trailing .m3-field-input {
  padding-right: 56px;
}

.m3-field-trailing {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* ---- Segmented button (single select) --------------------------------- */
.m3-segmented {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* The legend sits in the grid gap above the row, like a floated label, so
   the segments line up with the text fields next to them. */
.m3-segmented legend {
  position: absolute;
  top: -19px;
  left: 4px;
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  color: var(--md-on-surface-variant);
  font: 500 0.75rem/1rem var(--m3-font);
  letter-spacing: 0.04em;
}

.m3-segmented-row {
  display: flex;
}

.m3-segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.m3-segmented label {
  position: relative;
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  margin: 0 0 0 -1px;
  padding: 0 12px;
  border: 1px solid var(--md-outline);
  color: var(--md-on-surface);
  font: 500 0.875rem/1.25rem var(--m3-font);
  letter-spacing: 0.007em;
  cursor: pointer;
}

.m3-segmented label:first-of-type {
  margin-left: 0;
  border-radius: 28px 0 0 28px;
}

.m3-segmented label:last-of-type {
  border-radius: 0 28px 28px 0;
}

.m3-segmented label .m3-icon {
  display: none;
}

.m3-segmented input:checked + label {
  color: var(--m3-on-secondary-container);
  background: var(--md-secondary-container);
}

.m3-segmented input:checked + label .m3-icon {
  display: inline-block;
}

.m3-segmented input:focus-visible + label {
  z-index: 1;
  outline: 3px solid rgb(0 99 154 / 28%);
  outline-offset: 2px;
}

.m3-segmented.is-error label {
  border-color: var(--md-error);
}

.m3-segmented .m3-field-support {
  margin-top: 4px;
}

.m3-segmented.is-error .m3-field-support {
  color: var(--md-error);
}

/* ---- Chips -------------------------------------------------------------- */
.m3-chip-set {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px 0 8px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 8px;
  color: var(--md-on-surface-variant);
  background: var(--md-surface-bright);
  font: 500 0.875rem/1.25rem var(--m3-font);
  letter-spacing: 0.007em;
  white-space: nowrap;
}

.m3-chip.is-done {
  color: #0a3a20;
  background: var(--md-success-container);
  border-color: transparent;
}

.m3-chip.is-error {
  color: #410002;
  background: var(--md-error-container);
  border-color: transparent;
}

.m3-chip.is-next {
  color: var(--md-on-primary-container);
  background: var(--md-primary-container);
  border-color: transparent;
}

/* ---- Banners ------------------------------------------------------------ */
.m3-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--md-radius-md);
  font: 400 0.875rem/1.25rem var(--m3-font);
  letter-spacing: 0.018em;
}

.m3-banner .m3-icon {
  width: 20px;
  height: 20px;
}

.m3-banner.is-error {
  color: #410002;
  background: var(--md-error-container);
}

.m3-banner.is-success {
  color: #07391f;
  background: var(--md-success-container);
}

.m3-banner.is-info {
  color: var(--md-on-primary-container);
  background: var(--md-primary-container);
}

/* ---- Lists (read-only details) --------------------------------------- */
.m3-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.m3-list-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--md-outline-variant);
}

.m3-list-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.m3-list-item > .m3-icon {
  width: 24px;
  height: 24px;
  margin-top: 6px;
  color: var(--md-on-surface-variant);
}

.m3-list-text {
  flex: 1;
  min-width: 0;
}

.m3-list-overline {
  display: block;
  color: var(--md-on-surface-variant);
  font: 500 0.75rem/1rem var(--m3-font);
  letter-spacing: 0.04em;
}

.m3-list-headline {
  display: block;
  color: var(--md-on-surface);
  font: 400 1rem/1.5rem var(--m3-font);
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

.m3-list-support {
  display: block;
  color: var(--md-on-surface-variant);
  font: 400 0.875rem/1.25rem var(--m3-font);
}

.m3-list-support.is-error {
  color: var(--md-error);
}

/* ---- Expandable section ----------------------------------------------- */
.m3-expand {
  margin-top: 16px;
}

.m3-expand > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 20px;
  color: var(--md-primary);
  font: 500 0.875rem/1.25rem var(--m3-font);
  list-style: none;
  cursor: pointer;
}

.m3-expand > summary::-webkit-details-marker {
  display: none;
}

.m3-expand > summary:hover {
  background: rgb(0 99 154 / 8%);
}

.m3-expand > summary .m3-icon {
  transition: transform 150ms ease;
}

.m3-expand[open] > summary .m3-icon {
  transform: rotate(180deg);
}

.m3-expand-body {
  padding-top: 16px;
}

/* ---- Form actions ----------------------------------------------------- */
.m3-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-lg) var(--md-radius-lg) 0 0;
  background: var(--md-surface-container-low);
  box-shadow: 0 -2px 10px rgb(25 28 32 / 8%);
}

.m3-form-actions .m3-body-medium {
  margin-right: auto;
}

/* ---- Dialog (sign-in) -------------------------------------------------- */
.m3-dialog {
  width: min(1480px, 96vw);
  height: min(960px, 94vh);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--md-radius-xl);
  color: var(--md-on-surface);
  background: var(--md-surface-container-high);
  box-shadow: 0 8px 12px 6px rgb(0 0 0 / 15%), 0 4px 4px rgb(0 0 0 / 30%);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
}

.m3-dialog[open] {
  display: flex;
  flex-direction: column;
}

.m3-dialog::backdrop {
  background: rgb(0 0 0 / 32%);
}

.m3-dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px 12px 12px;
}

.m3-dialog-title {
  margin: 0;
  font: 400 1.5rem/2rem Roboto, "Segoe UI", Arial, sans-serif;
}

.m3-dialog-head .m3-body-medium {
  margin-left: auto;
}

.m3-dialog-body {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 16px;
  overflow: hidden;
  border-radius: 16px;
  background: #1e1e1e;
}

.m3-dialog-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.m3-dialog-frame[hidden] {
  display: none;
}

.m3-dialog-status {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: 24px;
  color: var(--md-on-surface);
  background: var(--md-surface-bright);
  text-align: center;
}

.m3-dialog-status[hidden] {
  display: none;
}

.m3-dialog-status p {
  max-width: 560px;
}

.m3-dialog-status.is-success p { color: var(--md-success); }
.m3-dialog-status.is-warning p { color: #6d4c00; }
.m3-dialog-status.is-danger p { color: var(--md-error); }

.m3-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
}

.m3-dialog-actions .m3-body-medium {
  margin-right: auto;
}

.m3-progress {
  width: 48px;
  height: 48px;
  border: 4px solid var(--md-primary-container);
  border-top-color: var(--md-primary);
  border-radius: 50%;
  animation: m3-spin 900ms linear infinite;
}

.m3-progress[hidden] {
  display: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .m3-progress {
    animation-duration: 3s;
  }
}

@media (max-width: 760px) {
  .m3-dialog {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  .m3-dialog-body {
    margin: 0;
    border-radius: 0;
  }
  .m3-step {
    grid-template-columns: minmax(0, 1fr);
  }
  .m3-step::before,
  .m3-step-marker {
    display: none;
  }
}

/* ---- Snackbar ------------------------------------------------------------ */
.m3-snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 2000;
  min-width: 288px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 4px;
  color: var(--m3-inverse-on-surface, #eff0f7);
  background: var(--m3-inverse-surface, #2e3135);
  box-shadow: var(--md-shadow-raised);
  font: 400 0.875rem/1.25rem Roboto, "Segoe UI", Arial, sans-serif;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}

.m3-snackbar.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---- Address field: suggestions and the found address ----------------- */
.m3-address {
  position: relative;
}

.m3-menu {
  position: absolute;
  top: 60px;
  right: 0;
  left: 0;
  z-index: 30;
  max-height: 320px;
  margin: 0;
  padding: 8px 0;
  overflow: auto;
  list-style: none;
  border-radius: 4px;
  background: var(--md-surface-container);
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 2px 6px 2px rgb(0 0 0 / 15%);
}

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

.m3-menu-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  padding: 8px 16px;
  color: var(--md-on-surface);
  font: 400 1rem/1.5rem var(--m3-font);
  cursor: pointer;
}

.m3-menu-item:hover,
.m3-menu-item.is-active {
  background: rgb(25 28 32 / 8%);
}

.m3-menu-item-secondary {
  color: var(--md-on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.m3-address-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--md-radius-md);
  font: 400 0.875rem/1.25rem var(--m3-font);
}

.m3-address-result[hidden] {
  display: none;
}

.m3-address-result.is-ok {
  color: #07391f;
  background: var(--md-success-container);
}

.m3-address-result.is-confirm {
  color: #261900;
  background: var(--md-warning-container);
}

.m3-address-result.is-error {
  color: #410002;
  background: var(--md-error-container);
}

.m3-address-result-icon .m3-icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.m3-address-result-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.m3-address-result-text strong {
  font-size: 1rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.m3-address-result-text a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: underline;
}

.m3-address-result-text a[hidden] {
  display: none;
}

.m3-address-result .m3-checkbox {
  grid-column: 1 / -1;
}

.m3-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  font: 500 0.875rem/1.25rem var(--m3-font);
  cursor: pointer;
}

.m3-checkbox[hidden] {
  display: none;
}

.m3-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--md-primary);
}

/* A thin indeterminate line under the field while the lookup runs. */
.m3-address .m3-field::after {
  content: "";
  position: absolute;
  top: 54px;
  right: 1px;
  left: 1px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, var(--md-primary), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
}

.m3-address.m3-address-busy .m3-field::after {
  opacity: 1;
  animation: m3-address-busy 1.1s linear infinite;
}

@keyframes m3-address-busy {
  from { background-position: -50% 0; }
  to { background-position: 150% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .m3-address.m3-address-busy .m3-field::after {
    animation-duration: 3s;
  }
}

/* ===== Shared page building blocks (every page loads this file) ========== */

/* Navigation drawer icons are Material Symbols now. */
.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  flex: 0 0 24px;
}

.nav-icon .m3-icon {
  width: 24px;
  height: 24px;
}

/* Tables, dashboards and lists use the full content width. */
.m3-page.m3-page-wide {
  max-width: none;
}

.m3-page-header .m3-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.m3-section {
  margin-top: 24px;
}

/* ---- Data table --------------------------------------------------------- */
.m3-table-wrap {
  overflow: auto;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-md);
  background: var(--md-surface-bright);
}

.m3-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 0.875rem/1.25rem var(--m3-font, Roboto, "Segoe UI", Arial, sans-serif);
  color: var(--md-on-surface);
}

.m3-table th {
  height: 56px;
  padding: 0 16px;
  color: var(--md-on-surface-variant);
  background: var(--md-surface-container-low);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--md-outline-variant);
}

.m3-table td {
  height: 52px;
  padding: 8px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--md-outline-variant);
}

.m3-table tbody tr:last-child td {
  border-bottom: 0;
}

.m3-table tbody tr:hover {
  background: rgb(25 28 32 / 4%);
}

.m3-table .is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.m3-table-empty {
  padding: 32px 16px;
  color: var(--md-on-surface-variant);
  text-align: center;
}

/* ---- Extra chip tones ---------------------------------------------------- */
.m3-chip.is-warning {
  color: #261900;
  background: var(--md-warning-container);
  border-color: transparent;
}

.m3-chip.is-neutral {
  color: var(--md-on-surface-variant);
  background: var(--md-surface-container);
  border-color: transparent;
}

.m3-chip.is-small {
  height: 24px;
  padding: 0 8px 0 4px;
  gap: 4px;
  font-size: 0.75rem;
}

.m3-chip.is-small .m3-icon {
  width: 16px;
  height: 16px;
}

/* ---- Stat tiles (filled cards) -------------------------------------------- */
.m3-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.m3-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--md-radius-md);
  background: var(--md-surface-container-low);
}

.m3-stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--md-on-surface-variant);
  font: 500 0.8125rem/1.25rem var(--m3-font, Roboto, "Segoe UI", Arial, sans-serif);
}

.m3-stat-value {
  color: var(--md-on-surface);
  font: 400 2rem/2.5rem var(--m3-font, Roboto, "Segoe UI", Arial, sans-serif);
}

.m3-stat.is-warning { background: var(--md-warning-container); }
.m3-stat.is-error { background: var(--md-error-container); }
.m3-stat.is-success { background: var(--md-success-container); }

/* ---- Toolbar (filters above a table) ------------------------------------- */
.m3-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.m3-toolbar .m3-field {
  min-width: 180px;
}

/* Compact fields for toolbars and table rows. */
.m3-field.is-dense .m3-field-input {
  height: 40px;
}

.m3-field.is-dense .m3-field-label {
  top: 8px;
}

.m3-field.is-dense .m3-field-input:focus ~ .m3-field-label,
.m3-field.is-dense .m3-field-input:not(:placeholder-shown) ~ .m3-field-label,
.m3-field.is-dense.is-static .m3-field-label {
  top: -8px;
}

/* Choice cards: radio options shown as outlined cards (e.g. delivery package). */
.m3-choice-list {
  display: grid;
  gap: 8px;
}

.m3-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  padding: 12px 16px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-md);
  cursor: pointer;
}

.m3-choice:hover {
  background: rgb(25 28 32 / 4%);
}

.m3-choice input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--md-primary);
}

.m3-choice:has(input:checked) {
  border-color: var(--md-primary);
  background: rgb(0 99 154 / 6%);
}

.m3-choice-title {
  font: 500 1rem/1.5rem var(--m3-font, Roboto, "Segoe UI", Arial, sans-serif);
}

.m3-choice-text {
  grid-column: 2;
  color: var(--md-on-surface-variant);
  font: 400 0.875rem/1.25rem var(--m3-font, Roboto, "Segoe UI", Arial, sans-serif);
}
