:root {
  color-scheme: light;
  --bg: #f7f2e8;
  --card: rgba(255, 252, 246, 0.96);
  --surface: #fffdf8;
  --ink: #1d1d1b;
  --muted: #5e574d;
  --accent: #b5422c;
  --accent-dark: #8f331f;
  --line: rgba(29, 29, 27, 0.12);
  --success: #e8f4e5;
  --shadow: 0 18px 45px rgba(95, 58, 24, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(247, 197, 91, 0.35), transparent 32%),
    linear-gradient(180deg, #f8f4ec 0%, var(--bg) 55%, #efe2cf 100%);
}

.page {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.card {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
}

.lead {
  margin: 0 0 1.2rem;
  color: var(--muted);
  line-height: 1.45;
}

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

.stack {
  display: grid;
  gap: 0.85rem;
}

label,
legend {
  font-weight: 700;
}

input,
select,
button {
  width: 100%;
  border-radius: 0.95rem;
  border: 1px solid var(--line);
  font: inherit;
}

input,
select,
textarea {
  padding: 0.9rem 1rem;
  background: var(--surface);
  font-size: 16px;
}

textarea {
  width: 100%;
  min-height: 7rem;
  border-radius: 0.95rem;
  border: 1px solid var(--line);
  font: inherit;
  resize: vertical;
}

input[type="file"] {
  padding: 0.7rem;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(181, 66, 44, 0.18);
  outline-offset: 2px;
}

button {
  padding: 0.95rem 1rem;
  font-weight: 700;
  min-height: 2.9rem;
  color: white;
  background: linear-gradient(180deg, #cf583f 0%, var(--accent) 100%);
  cursor: pointer;
}

button:hover {
  background: linear-gradient(180deg, #bf4d36 0%, var(--accent-dark) 100%);
}

.secondary {
  background: white;
  color: var(--ink);
}

.secondary:hover {
  background: #f4efe7;
}

.checks {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  display: grid;
  gap: 0.8rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.check input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topbar form,
.topbar button {
  width: auto;
}

.brand-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0.25rem 0 0.9rem;
}

.brand-logo {
  display: block;
  width: min(28rem, 92vw);
  max-height: 8.2rem;
  object-fit: contain;
}

.login-brand-logo-wrap {
  margin-top: 1rem;
}

.shell-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}

.logout-form,
.logout-form button {
  width: auto;
}

.tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}

.mode-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.mode-actions button {
  flex: 1 1 11rem;
  width: auto;
}

.mode-actions .active-mode {
  background: linear-gradient(180deg, #cf583f 0%, var(--accent) 100%);
  color: white;
}

.customer-order-preview {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 253, 248, 0.85);
}

.customer-order-preview .eyebrow {
  margin: 0;
}

.customer-order-preview-item {
  display: grid;
  gap: 0.45rem;
}

.customer-order-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.customer-order-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.customer-order-choice input {
  width: auto;
}

.customer-tabs {
  overflow: visible;
}

.tabs-logout-form {
  margin-left: auto;
  width: auto;
}

.tabs-logout-form .logout-mini {
  width: auto;
  min-height: 2.1rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  min-height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.reset-link {
  width: 100%;
}

.nav-link.active {
  background: linear-gradient(180deg, #cf583f 0%, var(--accent) 100%);
  color: white;
  border-color: transparent;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-link-card {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255, 253, 248, 0.85);
  color: var(--ink);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.admin-link-card:hover {
  background: #fffaf2;
}

.admin-link-card .lead {
  margin: 0;
}

.admin-section {
  position: relative;
  overflow: hidden;
}

.section-head {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 253, 248, 0.85);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 34rem;
}

.customer-ddt-table {
  min-width: 0;
  table-layout: fixed;
}

.customer-ddt-table th,
.customer-ddt-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.customer-ddt-table td small {
  line-height: 1.25;
}

.customer-order-table {
  min-width: 0;
  table-layout: fixed;
}

.customer-order-table th,
.customer-order-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.customer-order-table input,
.customer-order-table textarea {
  min-width: 0;
}

.customer-order-table th:nth-child(1),
.customer-order-table td:nth-child(1) {
  width: 34%;
}

.customer-order-table th:nth-child(2),
.customer-order-table td:nth-child(2) {
  width: 16%;
}

.customer-order-table th:nth-child(3),
.customer-order-table td:nth-child(3) {
  width: 26%;
}

.customer-order-table th:nth-child(4),
.customer-order-table td:nth-child(4) {
  width: 24%;
}

.customer-order-table textarea {
  min-height: 4.5rem;
}

.order-line-actions {
  display: grid;
  gap: 0.45rem;
}

.order-line-actions button {
  min-height: 2.35rem;
  padding: 0.55rem 0.65rem;
}

.customer-order-lines {
  display: grid;
  gap: 0.75rem;
}

.customer-order-line {
  display: grid;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgba(255, 253, 248, 0.9);
}

.customer-order-line-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.customer-order-line-text {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.customer-order-line-product,
.customer-order-line-text small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-order-line-product {
  font-size: 1rem;
}

.customer-order-line-text small {
  color: var(--muted);
  line-height: 1.25;
}

.order-items-list {
  margin: 0;
  padding-left: 1.1rem;
}

.order-builder {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgba(255, 253, 248, 0.72);
}

.delivery-pending-table {
  min-width: 0;
  table-layout: fixed;
}

.delivery-pending-table th,
.delivery-pending-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.delivery-pending-table th:nth-child(1),
.delivery-pending-table td:nth-child(1) {
  width: 38%;
}

.delivery-pending-table th:nth-child(2),
.delivery-pending-table td:nth-child(2) {
  width: 30%;
}

.delivery-pending-table th:nth-child(3),
.delivery-pending-table td:nth-child(3) {
  width: 32%;
}

.delivery-pending-table .status-form {
  display: grid;
}

th,
td {
  padding: 0.9rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: rgba(181, 66, 44, 0.08);
}

tr:last-child td {
  border-bottom: 0;
}

.inline-edit {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.delete-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.status-form {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.status-form button {
  width: auto;
  white-space: nowrap;
}

.user-edit-form {
  align-items: start;
}

.user-panels {
  display: grid;
  gap: 1rem;
}

.user-panel {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgba(255, 253, 248, 0.72);
}

.customer-email-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.customer-email-grid > div {
  display: grid;
  gap: 0.4rem;
}

.customer-email-grid.compact {
  grid-template-columns: repeat(3, minmax(9rem, 1fr));
  width: 100%;
}

.customer-inline-edit {
  align-items: stretch;
}

.customer-admin-list {
  display: grid;
  gap: 0.75rem;
}

.customer-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 1rem 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 253, 248, 0.72);
}

.customer-bulk-actions > div {
  display: grid;
  gap: 0.4rem;
  flex: 1 1 14rem;
  min-width: 0;
}

.customer-bulk-actions .danger-check {
  flex: 1 1 13rem;
}

.customer-bulk-actions button {
  flex: 0 1 14rem;
  white-space: nowrap;
}

.customer-admin-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
}

.customer-admin-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.98), rgba(255, 253, 248, 0.78));
  box-shadow: 0 12px 28px rgba(57, 39, 27, 0.08);
  overflow: hidden;
}

.customer-admin-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}

.customer-admin-select-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.35rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(255, 253, 248, 0.72);
}

.customer-admin-select-wrap input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
}

.customer-admin-summary::-webkit-details-marker {
  display: none;
}

.customer-admin-summary:hover {
  background: rgba(255, 250, 242, 0.8);
}

.customer-admin-summary-main,
.customer-admin-summary-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.customer-admin-summary-meta {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.customer-admin-summary-main {
  flex-direction: column;
  align-items: flex-start;
}

.customer-admin-summary-main strong {
  font-size: 1.05rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-admin-summary-meta .muted-text {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-admin-chevron {
  min-width: 4.8rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(181, 66, 44, 0.1);
  color: var(--accent-dark);
  font-weight: 800;
  text-align: center;
}

.customer-admin-card[open] .customer-admin-chevron {
  background: var(--accent);
  color: white;
}

.customer-admin-card[open] .customer-admin-chevron {
  font-size: 0;
}

.customer-admin-card[open] .customer-admin-chevron::after {
  content: "Chiudi";
  font-size: 0.9rem;
}

.customer-admin-detail {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
}

.customer-admin-form {
  display: grid;
  gap: 0.9rem;
}

.customer-admin-main-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(13rem, 0.7fr);
  gap: 0.75rem;
  align-items: end;
}

.customer-admin-main-grid > div {
  display: grid;
  gap: 0.4rem;
}

.customer-admin-check,
.customer-admin-reset {
  min-height: 3rem;
}

.customer-admin-actions,
.customer-admin-delete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.customer-admin-actions button,
.customer-admin-delete button {
  width: auto;
  min-width: 10rem;
}

.customer-admin-delete {
  padding: 0.8rem;
  border: 1px dashed rgba(181, 66, 44, 0.35);
  border-radius: 0.85rem;
  background: rgba(181, 66, 44, 0.06);
}

.email-settings-grid,
.email-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.email-context-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.6rem 0 0.25rem;
}

.email-settings-section {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgba(255, 253, 248, 0.55);
}

.email-sender-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-email-template-grid {
  grid-template-columns: 1fr;
}

.email-settings-grid > div,
.email-template-box {
  display: grid;
  gap: 0.5rem;
}

.email-settings-check {
  align-self: end;
  min-height: 3rem;
}

.email-template-box {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgba(255, 253, 248, 0.78);
}

.email-template-box h3 {
  margin: 0;
}

.email-template-box textarea {
  min-height: 6rem;
}

.modal-trigger {
  width: auto;
}

.payment-modal {
  width: min(92vw, 28rem);
  border: 0;
  padding: 0;
  background: transparent;
}

.order-products-modal {
  width: min(92vw, 34rem);
}

.payment-modal::backdrop {
  background: rgba(29, 29, 27, 0.42);
}

.payment-modal-card,
#payment-modal-form {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

#payment-modal-form {
  margin-top: 0.75rem;
}

.payment-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.payment-modal-head h2 {
  margin: 0;
}

.modal-close {
  width: auto;
}

.inline-edit input {
  min-width: 12rem;
}

.inline-edit button {
  width: auto;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
}

.customer-pill {
  min-width: 0;
  font-size: 0.74rem;
  padding: 0.22rem 0.5rem;
  letter-spacing: 0.02em;
}

.customer-payment-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0;
}

.customer-payment-summary span {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  font-size: 0.9rem;
}

.customer-payment-list {
  display: grid;
  gap: 0.85rem;
}

.customer-payment-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(255, 253, 248, 0.92);
}

.customer-payment-card-head,
.customer-payment-card-body {
  display: grid;
  gap: 0.55rem;
}

.customer-payment-card-head {
  grid-template-columns: minmax(6.2rem, 1fr) minmax(5.4rem, 0.9fr) auto auto;
  align-items: center;
}

.customer-payment-card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  color: var(--muted);
}

.customer-payment-label {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-payment-link {
  width: auto;
  min-height: 2.2rem;
  padding: 0.45rem 0.7rem;
}

.pill.ok {
  background: #e4f4e2;
  color: #244b1d;
}

.pill.warn {
  background: #fff0d8;
  color: #8a4b00;
}

.pill.neutral {
  background: #ece8e1;
  color: #554e45;
}

.status-done {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #e4f4e2;
  color: #244b1d;
  font-weight: 700;
}

.danger {
  background: linear-gradient(180deg, #8e2a23 0%, #6f1815 100%);
}

.danger:hover {
  background: linear-gradient(180deg, #7b211b 0%, #57110f 100%);
}

.danger-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.danger-check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.filter-actions {
  display: grid;
  gap: 0.6rem;
  align-content: end;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.flash {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(85, 123, 63, 0.18);
  background: var(--success);
  color: #23451f;
  font-weight: 600;
}

.flash.error {
  border-color: rgba(142, 42, 35, 0.22);
  background: #fde8e6;
  color: #6f1815;
}

.signature-pad {
  width: 100%;
  max-width: 100%;
  min-height: 11rem;
  border: 2px dashed rgba(181, 66, 44, 0.35);
  border-radius: 1rem;
  background: transparent;
  touch-action: none;
}

.signature-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.signature-actions button {
  width: auto;
  min-width: 14rem;
}

@media (max-width: 560px) {
  .page {
    padding: 0.8rem 0.8rem 1.5rem;
  }

  h1 {
    font-size: clamp(1.45rem, 7.2vw, 1.95rem);
  }

  h2 {
    font-size: 1.05rem;
  }

  .lead {
    margin-bottom: 0.95rem;
  }

  .card {
    padding: 1rem;
    border-radius: 1.2rem;
    backdrop-filter: none;
    box-shadow: 0 10px 24px rgba(95, 58, 24, 0.1);
  }

  .brand-logo-wrap {
    margin: 0 0 0.65rem;
  }

  .brand-logo {
    width: min(20rem, 92vw);
    max-height: 5.8rem;
  }

  input,
  select,
  textarea,
  button {
    border-radius: 0.7rem;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar form,
  .topbar button,
  .logout-form,
  .logout-form button {
    width: 100%;
  }

  .shell-top {
    flex-direction: column;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .customer-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
    gap: 0.55rem;
  }

  .nav-link {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 0.74rem 0.9rem;
    font-size: 0.95rem;
  }

  .customer-tabs .tabs-logout-form,
  .customer-tabs .tabs-logout-form button {
    width: 100%;
    flex: 0 0 auto;
  }

  .customer-tabs .nav-link {
    width: 100%;
    min-height: 2.6rem;
    padding: 0.65rem 0.5rem;
    white-space: normal;
    text-align: center;
    font-size: 0.88rem;
  }

  .customer-tabs .tabs-logout-form {
    margin-left: 0;
  }

  th,
  td {
    padding: 0.72rem 0.66rem;
    font-size: 0.92rem;
  }

  .status-form {
    display: grid;
    width: 100%;
  }

  .status-form button,
  .modal-trigger {
    width: 100%;
  }

  .customer-table-wrap {
    overflow-x: hidden;
    border: 0;
    background: transparent;
  }

  .customer-payment-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .customer-payment-summary span {
    border-radius: 0.7rem;
    font-size: 0.82rem;
    padding: 0.5rem;
  }

  .customer-payment-card {
    padding: 0.65rem;
    gap: 0.45rem;
  }

  .customer-payment-card-head {
    grid-template-columns: minmax(4.8rem, 1fr) minmax(4.6rem, 0.9fr) auto;
    gap: 0.45rem;
  }

  .customer-payment-link {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 2.1rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.84rem;
  }

  .customer-payment-label {
    font-size: 0.68rem;
  }

  .customer-payment-card-head strong {
    font-size: 0.92rem;
  }

  .customer-payment-card-body {
    gap: 0.25rem 0.55rem;
    font-size: 0.82rem;
  }

  .customer-ddt-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
  }

  .customer-ddt-table thead {
    display: none;
  }

  .customer-ddt-table,
  .customer-ddt-table tbody,
  .customer-ddt-table tr,
  .customer-ddt-table td {
    display: block;
    width: 100%;
  }

  .customer-ddt-table tr {
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: rgba(255, 253, 248, 0.92);
  }

  .customer-ddt-table td {
    padding: 0.42rem 0;
    border-bottom: 0;
    font-size: 0.95rem;
    vertical-align: top;
  }

  .customer-ddt-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .customer-ddt-table td[colspan]::before {
    content: "";
    display: none;
  }

  .customer-ddt-table .order-items-list {
    padding-left: 1rem;
  }

  .customer-order-wrap {
    overflow-x: hidden;
    border: 0;
    background: transparent;
  }

  .order-builder {
    padding: 0.75rem;
    gap: 0.65rem;
    border-radius: 0.7rem;
  }

  .customer-order-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
  }

  .customer-order-table thead {
    display: none;
  }

  .customer-order-table,
  .customer-order-table tbody,
  .customer-order-table tr,
  .customer-order-table td {
    display: block;
    width: 100%;
  }

  .customer-order-table tr {
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: rgba(255, 253, 248, 0.9);
  }

  .customer-order-table td {
    padding: 0.35rem 0;
    font-size: 0.95rem;
  }

  .customer-order-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.18rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .customer-order-table td[colspan]::before {
    content: "";
    display: none;
  }

  .order-line-actions {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .customer-order-line {
    padding: 0.7rem;
  }

  .customer-order-line-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
  }

  .customer-order-line-text {
    gap: 0.35rem;
  }

  .customer-order-line-product,
  .customer-order-line-text small {
    font-size: 0.92rem;
  }

  .order-line-actions button {
    min-height: 2.3rem;
    padding: 0.48rem 0.45rem;
    font-size: 0.84rem;
  }

  .delivery-pending-wrap {
    overflow-x: hidden;
  }

  .delivery-pending-table {
    width: 100%;
    min-width: 0;
  }

  .delivery-pending-table th,
  .delivery-pending-table td {
    padding: 0.56rem 0.42rem;
    font-size: 0.82rem;
  }

  .delivery-pending-table th:nth-child(1),
  .delivery-pending-table td:nth-child(1) {
    width: 34%;
  }

  .delivery-pending-table th:nth-child(2),
  .delivery-pending-table td:nth-child(2) {
    width: 30%;
  }

  .delivery-pending-table th:nth-child(3),
  .delivery-pending-table td:nth-child(3) {
    width: 36%;
  }

  .delivery-pending-table .status-form {
    gap: 0.35rem;
  }

  .delivery-pending-table .nav-link,
  .delivery-pending-table button {
    min-height: 2.25rem;
    padding: 0.48rem 0.3rem;
    font-size: 0.78rem;
    white-space: normal;
  }

  .payment-modal {
    width: min(96vw, 30rem);
  }

  .payment-modal-head {
    align-items: flex-start;
  }

  .pill {
    font-size: 0.78rem;
    min-width: 3.7rem;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-links {
    grid-template-columns: 1fr;
  }

  .customer-email-grid,
  .customer-email-grid.compact {
    grid-template-columns: 1fr;
  }

  .customer-bulk-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-bulk-actions button {
    width: 100%;
    flex-basis: auto;
  }

  .customer-admin-actions,
  .customer-admin-delete {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-admin-summary {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .customer-admin-summary-meta {
    justify-content: flex-start;
  }

  .customer-admin-summary-meta {
    flex-wrap: wrap;
  }

  .customer-admin-summary-meta .muted-text {
    max-width: 100%;
    white-space: normal;
  }

  .customer-admin-main-grid {
    grid-template-columns: 1fr;
  }

  .customer-admin-actions button,
  .customer-admin-delete button {
    width: 100%;
  }

  .email-settings-grid,
  .email-template-grid,
  .email-sender-grid {
    grid-template-columns: 1fr;
  }

  .email-settings-section {
    padding: 0.75rem;
  }

  .email-template-box {
    padding: 0.75rem;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .customer-filter-grid {
    grid-template-columns: 1fr;
  }

  .customer-filter-grid .filter-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: stretch;
  }

  .inline-edit {
    flex-direction: column;
    align-items: stretch;
  }

  .delete-form {
    flex-direction: column;
    align-items: stretch;
  }

  .signature-actions {
    flex-direction: column;
  }

  .signature-actions button {
    width: 100%;
    min-width: 0;
  }

  table {
    min-width: 24rem;
  }
}
