/**
 * Unified app UI — CRM-style spacing, typography, forms, tables, tabs, and modal content.
 * Loaded site-wide after site.css. Does not change universal modal overlay animation (modal-fx).
 *
 * Form contract (drawers/modals): label above + left-aligned; desktop fields use --ui-field-width-*
 * tokens (not 100% width); mobile ≤640px may use full width. See .cursor/rules/unified-form-drawer-layout.mdc
 */

/* ---------- Design tokens (extend :root from site.css) ---------- */
:root {
  --ui-space-xs: 0.35rem;
  --ui-space-sm: 0.5rem;
  --ui-space-md: 0.75rem;
  --ui-space-lg: 1rem;
  --ui-space-xl: 1.25rem;
  --ui-space-2xl: 1.5rem;
  --ui-radius: 8px;
  --ui-radius-lg: 12px;
  --ui-label-size: 0.8125rem;
  --ui-label-weight: 600;
  --ui-section-label-size: 0.72rem;
  --ui-table-head-bg: var(--slate-50, #f8fafc);
  --ui-table-head-color: var(--slate-600, #475569);
  --ui-table-row-hover: var(--slate-50, #f8fafc);
  --ui-tab-active-color: var(--color-primary, #2563eb);
  --ui-chip-bg: var(--slate-100, #f1f5f9);
  --ui-chip-border: var(--slate-200, #e2e8f0);
  --ui-modal-head-border: var(--slate-200, #e2e8f0);
  --ui-form-gap: 0.9rem;
  --ui-field-width-xs: 5.5rem;
  --ui-field-width-sm: 8.5rem;
  --ui-field-width-md: 14rem;
  --ui-field-width-lg: 20rem;
  --ui-field-width-date: 11rem;
  --ui-field-width-select: 16rem;
}

/* ---------- Buttons (flat primary; soft secondary like CRM modals) ---------- */
.btn {
  background: var(--color-primary);
  background-image: none;
  border-radius: var(--ui-radius);
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  box-shadow: none;
}
.btn:hover {
  background: var(--color-primary-hover);
  filter: none;
  box-shadow: none;
}
.btn-secondary {
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-700, #334155);
  border: 1px solid var(--slate-200, #e2e8f0);
}
.btn-secondary:hover {
  background: var(--slate-200, #e2e8f0);
  color: var(--slate-800, #1e293b);
  box-shadow: none;
}
/* Variants must beat the flat primary .btn rule above (same specificity + later). */
.btn.btn-danger {
  background: var(--error-red, #b91c1c);
  color: #fff;
  border: 1px solid var(--error-red, #b91c1c);
}
.btn.btn-danger:hover {
  background: #991b1b;
  color: #fff;
  border-color: #991b1b;
  filter: none;
  box-shadow: none;
}
.btn.btn-remove,
.btn.btn-remove-type {
  background: transparent;
  color: var(--slate-600, #475569);
  border: 1px solid transparent;
  min-height: 2rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: none;
}
.btn.btn-remove:hover,
.btn.btn-remove-type:hover {
  color: var(--error-red, #b91c1c);
  background: var(--error-bg, #fef2f2);
  border-color: var(--slate-200, #e2e8f0);
  filter: none;
  box-shadow: none;
}

/* ---------- Page titles & section headings ---------- */
.page-title-row h1,
.page-title-row h2,
.page-sidebar-layout-title,
.admin-content > h1:first-child,
.admin-content > h2:first-child {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--slate-900, #0f172a);
}
.section-card h2,
.section-card h3,
.ui-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: var(--ui-space-md);
}
.ui-section-label,
.section-card .ui-section-label,
.modal-card .ui-section-label {
  display: block;
  font-size: var(--ui-section-label-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500, #64748b);
  margin: 0 0 var(--ui-space-sm);
}

/* ---------- Cards & panels ---------- */
.section-card,
section.section-card {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  box-shadow: var(--shadow-sm);
  padding: var(--ui-space-xl) var(--ui-space-2xl);
}
form.section-card,
.section-card:has(form) {
  background: var(--color-surface, #fff);
  border-color: var(--slate-200, #e2e8f0);
}

/* ---------- Tabs: underline active (CRM / newsletter style) ---------- */
.core-page-tabs {
  gap: 0.25rem;
  margin-bottom: var(--ui-space-lg);
  padding-bottom: 0;
  border-bottom: 1px solid var(--slate-200, #e2e8f0);
}
.core-page-tabs .btn,
.core-page-tabs a {
  background: none !important;
  color: var(--slate-600, #475569) !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
}
.core-page-tabs .btn:hover,
.core-page-tabs a:hover {
  color: var(--slate-900, #0f172a) !important;
  background: none !important;
  box-shadow: none !important;
}
.core-page-tabs-current {
  background: none !important;
  color: var(--slate-900, #0f172a) !important;
  border-bottom-color: var(--ui-tab-active-color) !important;
  border-radius: 0 !important;
}
nav.core-subsubnav,
.core-subsubnav {
  border-bottom: 1px solid var(--slate-200, #e2e8f0);
  padding-bottom: 0;
}
.core-subsubnav-link,
.core-subsubnav-dropdown-trigger {
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 0.55rem 0.65rem;
  min-height: 44px;
  color: var(--slate-600, #475569);
}
.core-subsubnav-link.core-subsubnav-current,
.core-subsubnav-dropdown-trigger.core-subsubnav-current {
  background: none;
  color: var(--slate-900, #0f172a);
  border-bottom-color: var(--ui-tab-active-color);
  font-weight: 600;
}
a.core-subsubnav-link:hover,
.core-subsubnav-dropdown-trigger:hover {
  background: none;
  color: var(--slate-900, #0f172a);
}
.page-sidebar-layout-nav-item,
.page-sidebar-layout-nav-tab,
a.page-sidebar-layout-nav-item {
  border-radius: var(--ui-radius);
}
.page-sidebar-layout[data-layout="classic"] .page-sidebar-layout-nav-item.is-active,
.page-sidebar-layout[data-layout="classic"] .page-sidebar-layout-nav-tab.is-active,
.page-sidebar-layout[data-layout="classic"] a.page-sidebar-layout-nav-item.is-active {
  background: none;
  color: var(--slate-900, #0f172a);
  border-bottom: 2px solid var(--ui-tab-active-color);
  border-radius: 0;
  font-weight: 600;
}

/* ---------- Tables & lists ---------- */
table.data,
table.data-table,
.data-table {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  box-shadow: none;
  overflow: hidden;
}
table.data th,
table.data td,
.data-table th,
.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
  font-size: 0.9rem;
}
table.data th,
.data-table th,
.data-table thead th {
  background: var(--ui-table-head-bg);
  color: var(--ui-table-head-color);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: none;
  letter-spacing: normal;
}
table.data tbody tr:hover,
.data-table tbody tr:hover {
  background: var(--ui-table-row-hover);
}
tr[data-href]:hover,
table.data tbody tr[data-href]:hover,
.data-table tbody tr[data-href]:hover,
.data-table tbody tr.super-dash-table-row-clickable:hover {
  background: var(--slate-100, #f1f5f9) !important;
}
.ui-data-chip,
table.data .ui-data-chip,
.data-table .ui-data-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.08rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--ui-chip-border);
  background: var(--ui-chip-bg);
  font-size: 0.8125rem;
  color: var(--slate-700, #334155);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-table-row-actions {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  width: 1%;
  vertical-align: middle;
}
table.data td.ui-table-row-actions,
table.data th.ui-table-row-actions,
.data-table td.ui-table-row-actions,
.data-table th.ui-table-row-actions {
  vertical-align: middle;
}
.ui-table-row-actions .btn,
.ui-table-row-actions .btn-sm {
  flex: 0 0 auto;
  width: auto;
}
.ui-table-row-actions .btn-sm {
  min-height: 30px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8125rem;
}

/* Forms list (Admin → Forms) */
.form-list-table .form-list-row {
  cursor: pointer;
}
.form-list-validity-col,
.form-list-actions-col,
.form-list-delete-col {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
}
.form-list-questions-col {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.form-list-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
}
.form-list-row-preview {
  flex-shrink: 0;
}
.admin-form-preview-modal {
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: var(--z-modal, 3000);
}
.admin-form-preview-card {
  width: min(920px, 96vw);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  margin: 0;
}
.admin-form-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.admin-form-preview-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}
.admin-form-preview-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.admin-form-preview-frame {
  display: block;
  width: 100%;
  height: min(72vh, 720px);
  border: 0;
  background: #fff;
}
.form-list-validity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-500, #64748b);
  background: var(--slate-100, #f1f5f9);
}
.form-list-validity.is-valid {
  color: #166534;
  background: #dcfce7;
}
.form-list-validity.is-invalid {
  color: #991b1b;
  background: #fee2e2;
}
.form-list-row-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm, 6px);
  color: var(--slate-500, #64748b);
  text-decoration: none;
}
.form-list-row-delete:hover {
  color: #b91c1c;
  background: var(--slate-100, #f1f5f9);
}
.form-list-row-delete svg {
  display: block;
}

/* Admin → Forms list: CRM-style compact density; header sits outside scroll card */
.module-list-page .admin-content.module-list-content > .reg-hub-list-header.module-list-page-header {
  margin-bottom: 0.35rem;
}
.module-list-page .admin-forms-list-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}
.module-list-page .admin-forms-list-title-row .module-list-page-title {
  margin: 0;
}
.module-list-page .admin-forms-list-card.section-card {
  padding: 0.45rem 0.7rem 0.55rem;
  margin-bottom: 0.65rem;
}
.module-list-page .admin-forms-list-card.section-card.module-list-viewport {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.module-list-page .admin-forms-list-card.admin-forms-list-card--empty {
  padding: 0;
}
.module-list-page .admin-forms-list-card .table-wrap.nl-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}
.module-list-page .admin-forms-list-card .form-list-table {
  margin: 0;
  box-shadow: none;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.module-list-page .admin-forms-list-card .form-list-table thead th {
  top: 0;
  background: var(--slate-50, #f8fafc);
  color: var(--slate-600, #475569);
  text-transform: none;
  letter-spacing: normal;
  border-bottom: 1px solid var(--slate-200, #e2e8f0);
}
.module-list-page .admin-forms-list-card .form-list-table td {
  vertical-align: top;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
  color: var(--slate-700, #334155);
}
.module-list-page .admin-forms-list-card .form-list-table tbody tr:hover {
  background: var(--slate-50, #f8fafc);
}
.module-list-page .admin-forms-list-card .form-list-table tbody td:first-child {
  font-weight: 600;
  color: var(--slate-900, #0f172a);
}
.module-list-page #super-form-convert.admin-forms-list-card h2 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: none;
  padding-bottom: 0;
}
.module-list-page #super-form-convert .admin-forms-list-intro {
  margin: 0 0 0.3rem;
  font-size: 0.8125rem;
}

/* ---------- Forms: label above field, generous spacing ---------- */
.form-compact,
.modal-card form,
.cal-modal-content form,
.super-list-options-modal-body form {
  background: var(--color-surface, #fff);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius-lg);
  padding: var(--ui-space-lg) var(--ui-space-xl);
  gap: var(--ui-form-gap) var(--ui-space-2xl);
}
/* Inside modal-card, body forms are not a second nested card */
.modal-card > .form-compact,
.modal-card > form.form-compact {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.form-compact .form-row,
.modal-card .form-compact .form-row,
.cal-modal-content .form-compact .form-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--ui-space-xs);
  min-height: 0;
  margin-bottom: 0;
}
/* Calendar / schedule gear fieldset: label + toggles on one row (not stacked like normal forms) */
.form-compact .sg-item-form-gear-fieldset .schedule-grid-gear-row.sg-item-form-gear-row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
}
.form-compact .sg-item-form-gear-fieldset .schedule-grid-gear-row.sg-item-form-gear-row > .sg-gear-row-label {
  flex: 0 0 auto;
  min-width: 6.5rem;
  max-width: 12rem;
}
.form-compact .sg-item-form-gear-fieldset .schedule-grid-gear-row.sg-item-form-gear-row > .sg-gear-row-control {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  min-width: 0;
}
.form-compact .sg-item-form-gear-fieldset .sg-gear-control-cluster,
.form-compact .sg-item-form-gear-fieldset .sg-gear-switch-group {
  flex-wrap: nowrap;
}
.form-compact .form-row label:first-child,
.form-compact .form-row .form-label,
.modal-card .form-compact .form-row label:first-child,
.modal-card .form-compact .form-row > .form-label {
  margin: 0;
  padding: 0;
  font-size: var(--ui-label-size);
  font-weight: var(--ui-label-weight);
  color: var(--slate-700, #334155);
}
input.form-input,
select.form-input,
textarea.form-input,
input.form-control:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
select.form-control,
textarea.form-control,
.form-compact .form-row > input,
.form-compact .form-row > select,
.form-compact .form-row > textarea {
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--form-input-border, var(--slate-300, #cbd5e1));
  border-radius: var(--ui-radius);
  font-size: 1rem;
  box-shadow: none;
}
textarea.form-input,
textarea.form-control,
.form-compact .form-row > textarea {
  min-height: 5.5rem;
}
.form-compact .form-row-full,
.modal-card .form-compact .form-row-full {
  grid-column: 1 / -1;
}

/* ---------- Core field sizing: fit content on desktop, full width on mobile ---------- */
@media (min-width: 641px) {
  .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="number"],
  .modal-card .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="number"],
  .cal-modal-content .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="number"] {
    width: auto;
    max-width: min(100%, var(--ui-field-width-sm));
  }
  .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="date"],
  .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="time"],
  .modal-card .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="date"],
  .modal-card .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="time"],
  .cal-modal-content .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="date"] {
    width: auto;
    max-width: min(100%, var(--ui-field-width-date));
  }
  .form-compact:not(.form-compact--full-width-fields) .form-row > select,
  .modal-card .form-compact:not(.form-compact--full-width-fields) .form-row > select,
  .cal-modal-content .form-compact:not(.form-compact--full-width-fields) .form-row > select {
    width: auto;
    max-width: min(100%, var(--ui-field-width-select));
  }
  .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="text"],
  .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="email"],
  .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="tel"],
  .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="url"],
  .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="search"],
  .modal-card .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="text"],
  .modal-card .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="email"],
  .cal-modal-content .form-compact:not(.form-compact--full-width-fields) .form-row > input[type="text"] {
    width: auto;
    max-width: min(100%, var(--ui-field-width-md));
  }
  .form-compact:not(.form-compact--full-width-fields) .form-row > textarea,
  .modal-card .form-compact:not(.form-compact--full-width-fields) .form-row > textarea,
  .cal-modal-content .form-compact:not(.form-compact--full-width-fields) .form-row > textarea,
  .form-compact .form-row.form-row-wide > input,
  .form-compact .form-row.form-row-wide > select,
  .form-compact .form-row.form-row-wide > textarea {
    width: 100%;
    max-width: 100%;
  }
}
@media (max-width: 640px) {
  .form-compact .form-row > input,
  .form-compact .form-row > select,
  .form-compact .form-row > textarea,
  .modal-card .form-compact .form-row > input,
  .modal-card .form-compact .form-row > select,
  .modal-card .form-compact .form-row > textarea {
    width: 100%;
    max-width: 100%;
  }
}

/* ---------- Drawer / sidebar forms: label above, left-aligned (core pattern) ---------- */
.modal-drawer-body .form-compact,
.modal-drawer-body .vehicle-edit-form,
.modal-drawer-panel > .form-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ui-form-gap);
  max-width: none;
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.modal-drawer-body .form-compact .form-row,
.modal-drawer-body .vehicle-edit-form .form-row,
.modal-drawer-body .vehicle-edit-form .form-row-full {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ui-space-xs);
  margin-bottom: 0;
  min-height: 0;
  grid-template-columns: unset;
}
.modal-drawer-body .form-compact .form-row label:first-child,
.modal-drawer-body .form-compact .form-row .form-label,
.modal-drawer-body .vehicle-edit-form .form-row label:first-child,
.modal-drawer-body .vehicle-edit-form .form-row .form-label {
  text-align: left;
  width: auto;
  align-self: stretch;
  padding-right: 0;
}
.modal-drawer-body .form-compact .form-row:has(.form-checkbox),
.modal-drawer-body .vehicle-edit-form .form-row:has(.form-checkbox) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-sm);
}

/* Toggle switch rows: keep horizontal pill layout inside label-above column forms */
.form-compact .form-row.core-switch-row,
.modal-card .form-compact .form-row.core-switch-row,
.admin-content > .form-compact:not(.form-compact--label-left) .form-row.core-switch-row,
.section-card > .form-compact:not(.form-compact--label-left) .form-row.core-switch-row {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--ui-space-sm);
}
.form-compact .form-row.core-switch-row > label.core-switch,
.form-compact .form-row.core-switch-row > label:first-child.core-switch {
  flex: 0 0 2.625rem;
  width: 2.625rem;
  min-width: 2.625rem;
  max-width: 2.625rem;
  height: 1.5rem;
  align-self: center;
}
.modal-drawer-body .vehicle-edit-form .form-row .form-checkbox {
  grid-column: unset;
  justify-self: auto;
  width: auto;
}
.modal-drawer-body .section-card.form-compact,
.modal-drawer-body .vehicle-inline-edit-wrap {
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: none;
  background: transparent;
}

/* Full-page compact forms: keep 2-col grid but stack label above in each cell */
@media (min-width: 641px) {
  .admin-content > .form-compact:not(.form-compact--label-left),
  .section-card > .form-compact:not(.form-compact--label-left) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-content > .form-compact:not(.form-compact--label-left) .form-row,
  .section-card > .form-compact:not(.form-compact--label-left) .form-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Modal content (shell / modal-fx unchanged) ---------- */
.modal-card {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  box-shadow: var(--shadow-md);
  padding: 0;
  overflow: hidden;
}
.modal-card:not(:has(.modal-card-head)):not(:has(h2)):not(:has(h3)) {
  padding: var(--ui-space-xl);
}
.modal-card > h2,
.modal-card > h3,
.modal-card .modal-card-title,
.modal-card-head h2,
.modal-card-head h3 {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900, #0f172a);
  border-bottom: 1px solid var(--ui-modal-head-border);
}
.modal-card > h2,
.modal-card > h3,
.modal-card > .modal-intro,
.modal-card > form,
.modal-card > .form-compact,
.modal-card-body,
.modal-card > .modal-card-body,
.modal-card > p,
.modal-card > label,
.modal-card > div:not(.form-actions):not(.modal-actions):not(.modal-card-foot):not(.modal-card-head):not([class$="-modal-actions"]) {
  padding-left: var(--ui-space-xl);
  padding-right: var(--ui-space-xl);
}
.modal-card > input:not([type="hidden"]),
.modal-card > select,
.modal-card > textarea {
  margin-left: var(--ui-space-xl);
  margin-right: var(--ui-space-xl);
  width: calc(100% - 2 * var(--ui-space-xl));
  max-width: calc(100% - 2 * var(--ui-space-xl));
  box-sizing: border-box;
}
.modal-card > h2 + p,
.modal-card > h3 + p,
.modal-card > h2 + .modal-intro,
.modal-card > h3 + .modal-intro,
.modal-card > h2 + label,
.modal-card > h3 + label,
.modal-card > h2 + input,
.modal-card > h3 + input,
.modal-card > h2 + select,
.modal-card > h3 + select,
.modal-card > h2 + textarea,
.modal-card > h3 + textarea,
.modal-card > :first-child:not(h2):not(h3):not(.modal-card-title):not(.modal-card-head):not(.form-actions):not(.modal-actions):not(.modal-card-foot):not([class$="-modal-actions"]) {
  padding-top: var(--ui-space-lg);
}
.modal-card > form,
.modal-card > .form-compact,
.modal-card-body,
.modal-card > .modal-card-body {
  padding-top: var(--ui-space-lg);
  padding-bottom: var(--ui-space-lg);
}
.modal-card > h2 + form,
.modal-card > h3 + form,
.modal-card > .modal-card-title + form,
.modal-card > h2 + .form-compact,
.modal-card > h3 + .form-compact {
  padding-top: var(--ui-space-lg);
}
.modal-card > h2:last-child,
.modal-card > h3:last-child {
  padding-bottom: var(--ui-space-lg);
}
/* Subsection headings inside modal body — not the direct-child dialog title (h2/h3). */
.modal-card > .modal-card-body h3,
.modal-card > form h3,
.modal-card > .form-compact h3,
.modal-card > h3 ~ h3 {
  border-bottom: none;
  padding: var(--ui-space-md) var(--ui-space-xl) var(--ui-space-xs);
  font-size: 0.95rem;
}
.modal-card > *:last-child:not(.modal-card-foot):not(.modal-card-head) {
  padding-bottom: var(--ui-space-xl);
}
.modal-card .form-actions,
.modal-card .modal-actions,
.modal-card-foot,
.modal-card > [class$="-modal-actions"] {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-sm);
  align-items: center;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-top: 1px solid var(--slate-100, #f1f5f9);
  margin-top: 0;
}
.modal-card .form-actions .btn,
.modal-card .modal-actions .btn,
.modal-card-foot .btn,
.modal-card > [class$="-modal-actions"] .btn {
  margin: 0;
}
.modal-intro {
  margin: 0 0 var(--ui-space-lg);
  color: var(--slate-600, #475569);
  font-size: 0.9375rem;
}

/* Super Form modal content (super_form.css loads after this file on form pages) */
.super-form-modal-overlay .super-form-modal {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
}
.super-form-card {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  background: var(--color-surface, #fff);
  padding: var(--ui-space-xl);
}
.super-form-view .super-form-cell-label {
  font-size: var(--ui-label-size);
  font-weight: var(--ui-label-weight);
  color: var(--slate-700, #334155);
}
.super-form-view .super-form-cell-input,
.super-form-view .super-form-cell-select,
.super-form-view .super-form-cell-textarea {
  border-width: 1px;
  border-radius: var(--ui-radius);
  min-height: 44px;
  box-shadow: none;
}

/* ---------- Super Dash modals (Wave 1: match modal-card structure) ---------- */
.super-dash-modal-overlay .super-dash-modal,
.super-dash-edit-list-modal-overlay .super-dash-edit-list-modal {
  background: var(--color-surface, #fff);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0;
  max-height: min(90vh, 52rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.super-dash-modal.super-dash-modal--wide {
  max-width: min(100%, 42rem);
  width: 100%;
}
.super-dash-modal > h3,
.super-dash-modal-header h3,
.super-dash-edit-list-modal-header h3 {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900, #0f172a);
  border-bottom: 1px solid var(--ui-modal-head-border);
}
.super-dash-add-widget-header {
  padding: 0;
  border-bottom: 1px solid var(--ui-modal-head-border);
}
.super-dash-add-widget-header h3 {
  margin: 0;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900, #0f172a);
  border-bottom: none;
}
.super-dash-widget-settings-modal-header {
  border-bottom: 1px solid var(--ui-modal-head-border);
}
.super-dash-widget-settings-modal-header h3 {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900, #0f172a);
  border-bottom: none;
}
.super-dash-add-widget-header-primary {
  padding: var(--ui-space-lg) var(--ui-space-xl) var(--ui-space-sm);
}
.super-dash-add-widget-header-actions {
  padding: 0 var(--ui-space-xl) var(--ui-space-md);
}
.super-dash-modal > h3 + * {
  padding-top: var(--ui-space-md);
}
.super-dash-add-widget-body,
.super-dash-widget-settings-modal-body,
.super-dash-modal > p,
.super-dash-modal > .super-dash-configure-tabs-desc,
.super-dash-modal > .super-dash-configure-tabs-list,
.super-dash-modal > .super-dash-configure-tabs-add,
.super-dash-modal > .super-dash-widget-color-grid,
.super-dash-modal > .super-dash-component-modal-section {
  padding-left: var(--ui-space-xl);
  padding-right: var(--ui-space-xl);
}
.super-dash-add-widget-body {
  padding-top: var(--ui-space-md);
  padding-bottom: var(--ui-space-lg);
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.super-dash-widget-settings-modal-body {
  padding-top: var(--ui-space-lg);
  padding-bottom: var(--ui-space-lg);
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  border: none;
  background: transparent;
}
.super-dash-widget-settings-modal-body.form-compact {
  gap: var(--ui-form-gap);
}
.super-dash-widget-settings-form .form-row:not(.super-dash-settings-boolean) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--ui-space-xs);
}
.super-dash-widget-settings-form .form-row:not(.super-dash-settings-boolean) label:first-child,
.super-dash-widget-settings-form .form-row:not(.super-dash-settings-boolean) > .form-label {
  font-size: var(--ui-label-size);
  font-weight: var(--ui-label-weight);
  color: var(--slate-700, #334155);
}
.super-dash-modal-actions,
.super-dash-widget-settings-modal-actions {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-top: 1px solid var(--slate-100, #f1f5f9);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-sm);
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}
.super-dash-modal-fieldset {
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius);
  padding: var(--ui-space-md) var(--ui-space-lg);
  margin: 0 var(--ui-space-xl) var(--ui-space-md);
}
.super-dash-modal-fieldset legend {
  font-size: var(--ui-section-label-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500, #64748b);
  padding: 0 0.25rem;
}
.super-dash-edit-list-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-md);
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-bottom: 1px solid var(--ui-modal-head-border);
}
.super-dash-edit-list-modal-header h3 {
  padding: 0;
  border-bottom: none;
}
.super-dash-edit-list-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
}
.tasks-widget .super-dash-modal.tasks-widget-modal-panel {
  padding: 0;
  overflow: hidden;
}
.tasks-widget .super-dash-modal.tasks-widget-modal-panel > .tasks-widget-modal-header-bar {
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-bottom: 1px solid var(--ui-modal-head-border);
}
.tasks-widget .super-dash-modal.tasks-widget-modal-panel > .tasks-widget-add-form,
.tasks-widget .super-dash-modal.tasks-widget-modal-panel > .tasks-widget-edit-body {
  padding: var(--ui-space-lg) var(--ui-space-xl);
  overflow: auto;
}
.tasks-widget .super-dash-modal.tasks-widget-modal-panel .form-row {
  flex-direction: column;
  align-items: stretch;
  gap: var(--ui-space-xs);
}
.tasks-widget .super-dash-modal.tasks-widget-modal-panel .form-row label:first-child {
  font-size: var(--ui-label-size);
  font-weight: var(--ui-label-weight);
}

/* Super List options modal (also styled in super_form.css on list pages) */
.super-list-options-modal-content {
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--shadow-md);
}
.super-list-options-modal-body {
  padding: var(--ui-space-lg) var(--ui-space-xl);
}
.super-list-options-modal-body .form-compact {
  border: none;
  padding: 0;
  background: transparent;
}
.super-list-options-modal-actions {
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-top: 1px solid var(--slate-100, #f1f5f9);
}

/* Lang insert / module email modals */
.lang-insert-modal-overlay .lang-insert-modal,
.lang-insert-modal-overlay .modal-card {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  padding: 0;
  overflow: hidden;
}
.lang-insert-modal-overlay h3,
.lang-insert-modal-overlay .modal-card > h3 {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-bottom: 1px solid var(--ui-modal-head-border);
}
.lang-insert-modal-overlay .form-compact,
.lang-insert-modal-overlay form {
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border: none;
  background: transparent;
}

/* Access / menu order modals (sectioned shell: padding 0 on container, spacing on head/body/foot) */
.access-modal-overlay .access-modal,
.access-modal-overlay .modal-card,
.me-menu-order-modal-overlay .me-menu-order-modal,
.me-subnav-order-modal-overlay .me-subnav-order-modal {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  background: var(--color-surface, #fff);
  box-shadow: var(--shadow-md);
  padding: 0;
  overflow: hidden;
  max-width: 20rem;
  width: 90%;
}
.access-modal-overlay .access-modal {
  max-width: 25rem;
}
.access-modal-overlay .access-modal > h3,
.access-modal-overlay .access-modal > h4,
.access-modal-overlay .modal-card > h3,
.access-modal-overlay .modal-card > h4,
.me-menu-order-modal-overlay .me-menu-order-modal > h3,
.me-subnav-order-modal-overlay .me-subnav-order-modal > h3 {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900, #0f172a);
  border-bottom: 1px solid var(--ui-modal-head-border);
}
.access-modal-overlay .access-modal > p,
.access-modal-overlay .modal-card > p,
.me-menu-order-modal-overlay .me-menu-order-modal > p,
.me-subnav-order-modal-overlay .me-subnav-order-modal > p {
  margin: 0 0 var(--ui-space-lg);
  font-size: 0.9375rem;
  color: var(--slate-600, #475569);
}
.access-modal-overlay .access-modal > p,
.access-modal-overlay .access-modal > label,
.access-modal-overlay .access-modal > div:not(.access-modal-actions),
.access-modal-overlay .modal-card > p,
.access-modal-overlay .modal-card > label,
.access-modal-overlay .modal-card > .modal-intro,
.me-menu-order-modal-overlay .me-menu-order-modal > p,
.me-menu-order-modal-overlay .me-menu-order-modal > label,
.me-subnav-order-modal-overlay .me-subnav-order-modal > p,
.me-subnav-order-modal-overlay .me-subnav-order-modal > label {
  padding-left: var(--ui-space-xl);
  padding-right: var(--ui-space-xl);
}
.access-modal-overlay .access-modal > h3 ~ p,
.access-modal-overlay .access-modal > h4 ~ p,
.access-modal-overlay .access-modal > h3 ~ label,
.access-modal-overlay .access-modal > h4 ~ label,
.access-modal-overlay .access-modal > h3 ~ div:not(.access-modal-actions),
.access-modal-overlay .access-modal > h4 ~ div:not(.access-modal-actions),
.me-menu-order-modal-overlay .me-menu-order-modal > h3 ~ p,
.me-menu-order-modal-overlay .me-menu-order-modal > h3 ~ label,
.me-subnav-order-modal-overlay .me-subnav-order-modal > h3 ~ p,
.me-subnav-order-modal-overlay .me-subnav-order-modal > h3 ~ label,
.access-modal-overlay .access-modal > :first-child:not(h3):not(h4):not(.access-modal-actions),
.me-menu-order-modal-overlay .me-menu-order-modal > :first-child:not(h3):not(.me-menu-order-modal-actions),
.me-subnav-order-modal-overlay .me-subnav-order-modal > :first-child:not(h3):not(.me-subnav-order-modal-actions) {
  padding-top: var(--ui-space-lg);
}
.access-modal-overlay .access-modal > input:not([type="hidden"]),
.access-modal-overlay .access-modal > select,
.access-modal-overlay .access-modal > textarea,
.me-menu-order-modal-overlay .me-menu-order-modal > input:not([type="hidden"]),
.me-subnav-order-modal-overlay .me-subnav-order-modal > input:not([type="hidden"]) {
  display: block;
  margin: 0 var(--ui-space-xl) var(--ui-space-lg);
  width: calc(100% - 2 * var(--ui-space-xl));
  max-width: calc(100% - 2 * var(--ui-space-xl));
  box-sizing: border-box;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--form-input-border, var(--slate-300, #cbd5e1));
  border-radius: var(--ui-radius);
  font-size: 1rem;
}
.access-modal-overlay .access-modal > label,
.me-menu-order-modal-overlay .me-menu-order-modal > label,
.me-subnav-order-modal-overlay .me-subnav-order-modal > label {
  display: block;
  margin-bottom: var(--ui-space-xs);
  font-size: var(--ui-label-size);
  font-weight: var(--ui-label-weight);
  color: var(--slate-700, #334155);
}
.access-modal-overlay .access-modal-actions,
.me-menu-order-modal-overlay .me-menu-order-modal-actions,
.me-subnav-order-modal-overlay .me-subnav-order-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-sm);
  justify-content: flex-end;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-top: 1px solid var(--slate-100, #f1f5f9);
}
.access-modal-overlay .access-modal-actions .btn,
.me-menu-order-modal-overlay .me-menu-order-modal-actions .btn,
.me-subnav-order-modal-overlay .me-subnav-order-modal-actions .btn {
  margin: 0;
}

/* Planning schedule modals */
.planning-modal-overlay .planning-modal {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  background: var(--color-surface, #fff);
  box-shadow: var(--shadow-md);
  padding: 0;
  overflow: hidden;
}
.planning-modal-overlay .planning-modal h3,
.planning-modal-overlay .planning-modal-title {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-bottom: 1px solid var(--ui-modal-head-border);
  font-size: 1.05rem;
  font-weight: 700;
}
.planning-modal-overlay .planning-modal-body,
.planning-modal-overlay .planning-modal form {
  padding: var(--ui-space-lg) var(--ui-space-xl);
}
.planning-modal-overlay .planning-modal-actions {
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-top: 1px solid var(--slate-100, #f1f5f9);
}

/* Bug report modals (super-dash variant) */
.bug-report-modal-overlay .super-dash-modal,
.bug-report-modal-overlay .modal-card {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  padding: 0;
  overflow: hidden;
}
.bug-report-modal-overlay .form-compact {
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border: none;
  background: transparent;
}

/* Calendar / task detail modals + meeting drawer (content only) */
#core-cal-task-form-modal .core-cal-event-form-body,
#core-cal-event-form-modal .core-cal-event-form-body,
#core-cal-meeting-form-drawer .core-cal-event-form-body {
  background: var(--color-surface, #fff);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius-lg);
  padding: var(--ui-space-lg) var(--ui-space-xl);
}
.cal-modal-content {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  padding: var(--ui-space-xl);
}
.cal-modal-content form {
  border: none;
  padding: 0;
  background: transparent;
}

/* ---------- Meeting detail: inner content (panel shell unchanged) ---------- */
.meeting-detail-panel .meeting-detail-body {
  background: var(--color-surface, #fff);
}
.meeting-detail-panel .meeting-detail-tasks-column {
  background: var(--slate-50, #f8fafc);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius);
  box-shadow: none;
}
.meeting-detail-content h3,
.meeting-detail-tasks-column h3,
.meeting-attendees-heading-row h3,
.meeting-detail-attendees-heading-row h3 {
  font-size: var(--ui-section-label-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500, #64748b);
  margin: var(--ui-space-lg) 0 var(--ui-space-sm);
}
.meeting-detail-content h3:first-child {
  margin-top: 0;
}
.meeting-detail-scheduling-notify-actions,
.meeting-detail-room-above-attendees,
.meeting-detail-panel .meeting-inline-task-detail-desc,
.meeting-task-row {
  border-radius: var(--ui-radius);
  border: 1px solid var(--slate-200, #e2e8f0);
  background: var(--color-surface, #fff);
}
.meeting-detail-main .meeting-detail-edit-fields.form-compact {
  background: var(--color-surface, #fff);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius-lg);
  padding: var(--ui-space-lg) var(--ui-space-xl);
}
.meeting-detail-main .meeting-detail-edit-fields.form-compact .form-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--ui-space-xs);
}
.meeting-detail-main .meeting-detail-edit-fields.form-compact .form-row label:first-child {
  font-size: var(--ui-label-size);
  font-weight: var(--ui-label-weight);
}
.meeting-detail-add-task-form.form-compact {
  background: var(--color-surface, #fff);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius-lg);
  padding: var(--ui-space-lg);
}
.meeting-create-attendee-chip {
  border-radius: 999px;
  background: var(--ui-chip-bg);
  border-color: var(--ui-chip-border);
}
.meeting-discussion-list input[type="text"],
.meeting-discussion-list textarea,
.meeting-detail-request-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--form-input-border, var(--slate-300, #cbd5e1));
  border-radius: var(--ui-radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--form-field-bg, var(--color-surface, #fff));
  box-sizing: border-box;
}
.meeting-discussion-list textarea,
.meeting-detail-request-form textarea {
  min-height: 5rem;
  resize: vertical;
}

/* ---------- Contact detail & task modals (content inside universal shell) ---------- */
.contact-detail-side .section-card,
.contact-touch-section-form.form-compact {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  background: var(--color-surface, #fff);
  padding: var(--ui-space-lg) var(--ui-space-xl);
}
.contact-detail-side .form-compact .form-row {
  flex-direction: column;
  align-items: stretch;
  gap: var(--ui-space-xs);
}
.core-task-detail-modal .form-compact,
.core-notification-detail-modal .modal-card form {
  background: var(--color-surface, #fff);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius-lg);
}

.core-list-record-drawer-panel {
  max-width: min(100vw, 28rem);
}
.super-list-table tbody tr.super-list-row-active,
.vehicles-list tbody tr.vehicle-row-active,
.coordinators-list tbody tr.coord-row-active,
.kitchen-entity-row.kitchen-list-row-active {
  background: var(--blue-50, #eff6ff);
}
.modal-drawer-body .super-form-inline-wrap,
.modal-drawer-body .super-list-inline-form-inner {
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
  max-width: none;
}
.modal-drawer-body .super-form-inline-close,
.modal-drawer-body .super-form-inline-actions,
.modal-drawer-body .vehicle-inline-edit-actions,
.modal-drawer-body .coord-edit-close-btn {
  display: none;
}
.modal-drawer-body .super-form-inline-wrap > h3:first-child,
.modal-drawer-body .super-form-inline-wrap > p:first-of-type {
  display: none;
}

/* Form builder element modals — modal-card content structure */
.element-edit-modal.modal-overlay .element-edit-modal-content,
#element-edit-modal .element-edit-modal-content,
#add-element-modal .element-edit-modal-content {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--slate-200, #e2e8f0);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 40rem);
}
.element-edit-modal .element-edit-modal-content > h3,
#element-edit-modal h3,
#add-element-modal h3 {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-bottom: 1px solid var(--ui-modal-head-border);
  font-size: 1.05rem;
  font-weight: 700;
}
#element-edit-modal-body,
#add-element-modal-body,
.element-edit-modal .element-edit-modal-body {
  padding: var(--ui-space-lg) var(--ui-space-xl);
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.element-edit-modal .element-edit-modal-actions,
#element-edit-modal .form-actions,
#add-element-modal .form-actions {
  margin: 0;
  padding: var(--ui-space-lg) var(--ui-space-xl);
  border-top: 1px solid var(--slate-100, #f1f5f9);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-sm);
}

/* ---------- Reports & admin toolbars ---------- */
.admin-users-table.data-table thead th,
.core-tasks-table thead th {
  background: var(--ui-table-head-bg);
  color: var(--ui-table-head-color);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}
.table-wrap {
  margin-top: var(--ui-space-lg);
}
.admin-content .table-toolbar,
.list-toolbar,
.ui-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-md);
  margin-bottom: var(--ui-space-md);
}
.admin-content .table-toolbar input[type="search"],
.list-toolbar input[type="search"],
.ui-list-toolbar input[type="search"] {
  min-height: 40px;
  min-width: 12rem;
  border-radius: var(--ui-radius);
  border: 1px solid var(--slate-300, #cbd5e1);
  padding: 0.35rem 0.65rem;
}

/* ---------- Compact list pages (CRM-style density under subsubnav) ---------- */
.admin-layout.module-list-page .admin-content.module-list-content.admin-content--with-subsubnav {
  padding-top: 0.35rem;
  padding-bottom: 0.65rem;
}
.admin-layout:not(.module-list-page) .admin-content.admin-content--with-subsubnav {
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}
.module-list-page .core-page-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0;
  margin-bottom: var(--ui-space-sm);
  padding-bottom: 0;
}
.ui-list-toolbar,
.form-compact.ui-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--ui-space-md) var(--ui-space-lg);
  margin-bottom: var(--ui-space-sm);
  padding: 0.5rem 0.65rem;
  background: var(--slate-50, #f8fafc);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius);
  box-shadow: none;
}
.ui-list-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.ui-list-toolbar-field label,
.ui-list-toolbar-field .form-cell-label {
  font-size: var(--ui-label-size);
  font-weight: var(--ui-label-weight);
  color: var(--slate-700, #334155);
  margin: 0;
}
.ui-list-toolbar-field select,
.ui-list-toolbar-field .form-input {
  min-height: 38px;
  width: var(--ui-field-width-select);
  max-width: 100%;
}
.ui-list-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--ui-space-sm);
  margin-left: auto;
}
.ui-list-toolbar .btn {
  min-height: 38px;
}
.module-list-page .module-list-viewport {
  flex: 1 1 auto;
  min-height: 0;
}
/* Plain viewport wrappers (e.g. SIS): scroll the whole block */
.module-list-page .module-list-viewport:not(.section-card) {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* Card list panels: keep toolbar visible; scroll table region only */
.module-list-page .section-card.module-list-viewport {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
/* Legacy markup: table is direct child of the card — scroll the card */
.module-list-page .section-card.module-list-viewport:has(> table) {
  display: block;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.module-list-page .section-card.module-list-viewport > .module-list-page-header,
.module-list-page .section-card.module-list-viewport > .super-list-header,
.module-list-page .section-card.module-list-viewport > .ui-list-toolbar,
.module-list-page .section-card.module-list-viewport > .reg-hub-list-header {
  flex-shrink: 0;
}
.module-list-page .section-card.module-list-viewport > .table-wrap,
.module-list-page .section-card.module-list-viewport > .core-dt-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* Fill remaining viewport below header/toolbars; scroll inside .module-list-scroll children */
.module-list-page .admin-content.module-list-content > .module-list-body-fill,
.module-list-page .admin-content.module-list-content > .module-list-viewport,
.module-list-page .admin-content.module-list-content > .section-card.module-list-viewport {
  flex: 1 1 auto;
  min-height: 0;
}
.module-list-page .module-list-body-fill {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.module-list-page .module-list-panel-fill {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.module-list-page .module-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* Sticky column headers while scrolling list bodies */
.module-list-page .module-list-scroll thead th,
.module-list-page .module-list-viewport thead th,
.module-list-page .module-list-body-fill.module-list-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--slate-50, #f8fafc);
  box-shadow: 0 1px 0 var(--color-border-light, #e2e8f0);
}
/* Super List: column titles + optional filter row */
.module-list-page .super-list-table thead tr:first-child th {
  top: 0;
  z-index: 3;
}
.module-list-page .super-list-table .super-list-filter-row th {
  top: var(--module-list-thead-row-height, 2.125rem);
  z-index: 2;
}
/* Direct-table cards (vehicles, contacts, admin forms): sticky in-card toolbar */
.module-list-page .section-card.module-list-viewport:has(> .module-list-page-header):has(> table) > .module-list-page-header,
.module-list-page .section-card.module-list-viewport:has(> .super-list-header):has(> table) > .super-list-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--color-surface, #fff);
  box-shadow: 0 1px 0 var(--color-border-light, #e2e8f0);
}
.module-list-page .section-card.module-list-viewport:has(> .module-list-page-header):has(> table) > table thead th,
.module-list-page .section-card.module-list-viewport:has(> .module-list-page-header) > .form-list-table thead th {
  top: var(--module-list-sticky-toolbar-height, 3.75rem);
  z-index: 2;
}
.module-list-page .module-list-columns[hidden] {
  display: none !important;
}
.module-list-page .module-list-columns {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: var(--ui-space-md, 1rem);
  align-items: stretch;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.module-list-page .module-list-columns > * {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.module-list-page .module-list-columns--2 {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 960px) {
  .module-list-page .module-list-columns--2 {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.module-list-page .module-list-viewport .data-table {
  margin: 0;
}
.module-list-page .data-table th,
.module-list-page .data-table td,
.module-list-page .module-list-viewport table.data th,
.module-list-page .module-list-viewport table.data td,
.module-list-page .module-list-viewport table th,
.module-list-page .module-list-viewport table td {
  padding: 0.25rem 0.45rem;
  font-size: 0.875rem;
  vertical-align: middle;
  line-height: 1.25;
}
.module-list-page .module-list-viewport table.data th {
  font-size: 0.8125rem;
}
/* List tables: fixed layout so icon columns keep width; text columns truncate instead of overlapping */
.module-list-page .nl-data-table,
.module-list-page .reg-hub-data-table.nl-data-table {
  table-layout: fixed;
  width: 100%;
}
.module-list-page .nl-data-table td:not(.nl-row-actions):not(.nl-list-icons):not(.reg-hub-row-actions):not(.core-dt-td-actions):not(.ui-table-row-actions):not([class*="-row-actions"]),
.module-list-page .nl-data-table th:not(:empty) {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.module-list-page .nl-data-table td:has(ul),
.module-list-page .nl-data-table td:has(.reg-status-phase-list),
.module-list-page .nl-data-table td:has(.me-task-assigned-list),
.module-list-page .nl-data-table td.me-task-assigned-cell {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}
.module-list-page .nl-data-table td.nl-row-actions,
.module-list-page .nl-data-table td.nl-list-icons,
.module-list-page .nl-data-table td.reg-hub-row-actions,
.module-list-page .nl-data-table td[class*="-row-actions"],
.module-list-page .nl-data-table td.core-dt-td-actions,
.module-list-page .nl-data-table td.ui-table-row-actions,
.module-list-page .nl-data-table th:empty:last-child,
.module-list-page .nl-data-table th[aria-label]:last-child {
  overflow: visible;
  text-overflow: clip;
  min-width: 5.5rem;
}
@media (max-width: 900px) {
  .module-list-page .nl-data-table td.nl-row-actions,
  .module-list-page .nl-data-table td.nl-list-icons,
  .module-list-page .nl-data-table td.reg-hub-row-actions,
  .module-list-page .nl-data-table td[class*="-row-actions"],
  .module-list-page .nl-data-table td.core-dt-td-actions {
    min-width: 6rem;
    padding-left: 0.35rem;
  }
}
/* Compact controls in list/table inline edit (more rows visible; not full 44px form targets) */
.module-list-page .module-list-viewport table td select,
.module-list-page .module-list-viewport table td input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.module-list-page .module-list-viewport table td textarea,
.module-list-page .module-list-viewport table th select,
.module-list-page .module-list-viewport table th input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.module-list-page .data-table select.form-input,
.module-list-page .data-table input.form-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.module-list-page .data-table textarea.form-input,
.module-list-page .data-table select,
.module-list-page .data-table input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.module-list-page .data-table textarea,
.module-list-page .super-list-table .super-list-filter-row input,
.module-list-page .super-list-table .super-list-filter-row select {
  min-height: 2rem;
  height: 2rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.875rem;
  line-height: 1.25;
  box-sizing: border-box;
  border: 1px solid var(--form-input-border, var(--slate-300));
  border-radius: var(--radius-sm, var(--radius));
  background: var(--form-field-bg, var(--color-surface, #fff));
  max-width: 100%;
}
.module-list-page .module-list-viewport table td textarea,
.module-list-page .data-table textarea {
  min-height: 2.5rem;
  height: auto;
}
.module-list-page .module-list-viewport table td input[type="checkbox"],
.module-list-page .module-list-viewport table td input[type="radio"],
.module-list-page .data-table input[type="checkbox"],
.module-list-page .data-table input[type="radio"] {
  min-height: 1rem;
  width: 1rem;
  height: 1rem;
  margin: 0;
  vertical-align: middle;
}
.module-list-page .super-list-table td.super-list-cell-editable {
  min-height: 1.75rem;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}
.module-list-page--in-sidebar .module-list-viewport table td select,
.module-list-page--in-sidebar .module-list-viewport table td input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.module-list-page--in-sidebar .module-list-viewport table td textarea,
.module-list-page--in-sidebar .data-table select,
.module-list-page--in-sidebar .data-table input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.module-list-page--in-sidebar .data-table textarea {
  min-height: 2rem;
  height: 2rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.875rem;
}
@media (max-width: 640px) {
  .module-list-page .module-list-viewport table td select,
  .module-list-page .module-list-viewport table td input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .module-list-page .data-table select,
  .module-list-page .data-table input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    min-height: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
  }
}
.module-list-page .module-list-viewport table td select:focus,
.module-list-page .module-list-viewport table td input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.module-list-page .module-list-viewport table td textarea:focus,
.module-list-page .data-table select:focus,
.module-list-page .data-table input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.module-list-page .data-table textarea:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.module-list-page .ui-section-block {
  margin-bottom: var(--ui-space-lg);
}
/* Toolbar form-compact must not inherit card padding from global form-compact rules */
.form-compact.ui-list-toolbar .form-row {
  display: contents;
}
.form-compact.ui-list-toolbar {
  grid-template-columns: unset;
}
.page-sidebar-layout-main .module-list-page--in-sidebar {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* ---------- Module list page header (title + actions in one row) ---------- */
.module-list-page-header,
.super-list-header.module-list-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-sm) var(--ui-space-md);
  margin-bottom: var(--ui-space-md);
}
.module-list-page-title,
.super-list-header .module-list-page-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text, var(--slate-900, #0f172a));
}
.module-list-page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-sm);
  margin-left: auto;
}

/* ---------- Core empty-list invitation (centered icon + title + hint + add CTA) ---------- */
.core-empty-state-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 12rem;
}
.core-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 3rem 1rem;
  color: var(--color-text-muted, var(--slate-500, #64748b));
  flex: 1 1 auto;
}
.core-empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--color-surface-elevated, var(--slate-100, #f1f5f9));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
}
.core-empty-state-title {
  font-weight: 700;
  color: var(--color-text, var(--slate-700, #334155));
  font-size: 1rem;
}
.core-empty-state-hint {
  font-size: 0.875rem;
  max-width: 24rem;
  line-height: 1.45;
}
.core-empty-state-action {
  margin-top: 0.25rem;
}
.super-dash-freestyle-whiteboard > .core-empty-state-wrap {
  position: absolute;
  inset: 0;
  min-height: 0;
  pointer-events: none;
}
.super-dash-freestyle-whiteboard > .core-empty-state-wrap .core-empty-state-action {
  pointer-events: auto;
}
.ui-list-search-expand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}
.ui-list-search-expand-toggle {
  min-height: 38px;
  min-width: 38px;
  padding: 0.35rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ui-list-search-expand-input {
  box-sizing: border-box;
  width: 0;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
  border-width: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-width 0.2s ease, width 0.2s ease, opacity 0.15s ease, padding 0.2s ease, border-width 0.15s ease;
}
.ui-list-search-expand.is-open .ui-list-search-expand-input {
  width: min(14rem, 42vw);
  max-width: min(14rem, 42vw);
  min-width: 9rem;
  min-height: 44px;
  opacity: 1;
  padding: 0.45rem 0.65rem;
  border-width: 1px;
  pointer-events: auto;
}
.section-card > .module-list-page-header:first-child {
  margin-top: calc(-1 * var(--ui-space-xs, 0.25rem));
}
.module-list-page .admin-content.module-list-content:not([style*="padding"]) {
  padding-top: 0.65rem;
  padding-bottom: 0.75rem;
}
.module-list-page .section-card.module-list-viewport > .table-wrap:first-child,
.module-list-page .section-card.module-list-viewport > .module-list-page-header + .table-wrap {
  margin-top: 0;
}
.super-list-gear-btn {
  min-height: 38px;
  min-width: 38px;
  padding: 0.35rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.module-list-page-header-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}
.module-list-page-subtabs {
  margin: 0;
}
.module-list-page-subtabs .core-subsubnav-inner {
  gap: 0.5rem;
}
.hospitality-inline-add-form {
  margin-bottom: var(--ui-space-md);
  padding: var(--ui-space-lg);
  background: var(--slate-50, #f8fafc);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius-lg);
}
/* Compact single-row add (toggle from header button) */
.list-inline-add-row {
  display: none;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem 0.75rem;
  margin-bottom: var(--ui-space-md);
  padding: 0.45rem 0.65rem;
  background: var(--slate-50, #f8fafc);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius, 8px);
}
.list-inline-add-row.is-open {
  display: flex;
}
.list-inline-add-row label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-700, #334155);
  margin: 0;
}
.list-inline-add-row input,
.list-inline-add-row select {
  min-height: 2rem;
  height: 2rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.875rem;
  border: 1px solid var(--form-input-border, var(--slate-300));
  border-radius: var(--radius-sm, var(--radius));
  box-sizing: border-box;
  background: var(--form-field-bg, #fff);
}
.list-inline-add-row .btn {
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
}
.list-inline-add-status {
  font-size: 0.8125rem;
  color: var(--slate-600, #475569);
  align-self: center;
}
.list-inline-add-status.error {
  color: var(--color-error, #b91c1c);
}
/* Kitchen items/meals list rows + drawer detail */
.kitchen-entity-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--slate-200, #e2e8f0); border-radius: var(--ui-radius, 8px); background: var(--color-surface, #fff); min-height: 2rem; }
.kitchen-entity-list > li { margin: 0; padding: 0; border-bottom: 1px solid var(--slate-200, #e2e8f0); }
.kitchen-entity-list > li:last-child { border-bottom: none; }
.kitchen-entity-row { padding: 0.4rem 0.75rem; cursor: pointer; min-height: 2.25rem; display: flex; align-items: center; font-size: 0.9375rem; }
.kitchen-entity-row:hover { background: var(--slate-50, #f8fafc); }
.kitchen-entity-row.kitchen-list-row-active { background: var(--blue-50, #eff6ff); font-weight: 600; }
.kitchen-detail-inner { font-size: 0.9375rem; }
.kitchen-detail-inner h4, .kitchen-detail-inner h5 { margin: 0 0 0.5rem; font-size: 1rem; }
.kitchen-detail-meta { color: var(--slate-600, #475569); margin-bottom: 0.75rem; }
.kitchen-detail-loading { color: var(--slate-500, #64748b); margin: 0; }
.kitchen-detail-actions { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--slate-200, #e2e8f0); }
.modal-drawer-body .item-edit-ingredients table,
.modal-drawer-body .item-detail-ingredients table { width: 100%; border-collapse: collapse; }
.modal-drawer-body .item-edit-ingredients th,
.modal-drawer-body .item-edit-ingredients td,
.modal-drawer-body .item-detail-ingredients th,
.modal-drawer-body .item-detail-ingredients td { padding: 0.2rem 0.35rem; text-align: left; border-bottom: 1px solid var(--slate-100, #f1f5f9); vertical-align: middle; }
.modal-drawer-body .item-edit-ingredients .ing-select,
.modal-drawer-body .item-edit-ingredients .meas-select,
.modal-drawer-body .item-edit-ingredients .qty-input { min-height: 2rem; height: 2rem; padding: 0.1rem 0.35rem; font-size: 0.875rem; box-sizing: border-box; }
.modal-drawer-body .item-edit-ingredients .qty-input { width: 3.5rem; min-width: 3rem; }
.modal-drawer-body .item-edit-ingredients .ing-select { min-width: 10rem; max-width: 100%; }
.modal-drawer-body .item-edit-ingredients .meas-select { min-width: 4rem; max-width: 5.5rem; }
.modal-drawer-body .meal-detail-ingredients table { width: 100%; border-collapse: collapse; }
.modal-drawer-body .meal-detail-ingredients th,
.modal-drawer-body .meal-detail-ingredients td { padding: 0.25rem 0.4rem; text-align: left; border-bottom: 1px solid var(--slate-100, #f1f5f9); }
.modal-drawer-body .meal-items-manage .item-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.modal-drawer-body .meal-items-manage select { flex: 1; max-width: 16rem; min-height: 2rem; height: 2rem; padding: 0.1rem 0.35rem; font-size: 0.875rem; }
.modal-drawer-body .meal-items-manage .btn-remove { padding: 0.2rem 0.45rem; font-size: 0.8125rem; min-height: 2rem; }
.modal-drawer-body .kitchen-detail-inner .btn.btn-small { min-height: 2rem; padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.modal-drawer-body .kitchen-detail-inner .btn.btn-secondary,
.modal-drawer-body .kitchen-detail-inner .btn.btn-secondary.btn-small {
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-800, #1e293b);
  border: 1px solid var(--slate-300, #cbd5e1);
  font-weight: 600;
}
.modal-drawer-body .kitchen-detail-inner .btn.btn-secondary:hover,
.modal-drawer-body .kitchen-detail-inner .btn.btn-secondary.btn-small:hover {
  background: var(--slate-200, #e2e8f0);
  color: var(--slate-900, #0f172a);
}
.modal-drawer-body .kitchen-meal-edit.form-compact .form-row { margin-bottom: 0.5rem; align-items: center; }
.modal-drawer-body .kitchen-meal-edit.form-compact label { font-weight: 500; font-size: 0.875rem; }
.modal-drawer-body .kitchen-meal-edit .form-input { min-height: 2rem; height: 2rem; padding: 0.1rem 0.5rem; font-size: 0.875rem; max-width: 100%; }
.modal-drawer-body .kitchen-meal-edit textarea.form-input { height: auto; min-height: 2.5rem; }
.modal-drawer-body .meal-item-row { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.modal-drawer-body .meal-item-row-name { flex: 1; min-width: 6rem; font-size: 0.9375rem; }
.modal-drawer-body .meal-item-edit-panel { margin: 0.5rem 0 0.75rem; padding: 0.75rem 0 0; border-top: 1px solid var(--slate-200, #e2e8f0); }
.modal-drawer-body .meal-items-manage .list-inline-add-row { margin-top: 0.5rem; }
.modal-drawer-body .kitchen-detail-actions .btn.btn-danger { width: 100%; max-width: 14rem; }

/* Kitchen meal edit: label left of input on one row (compact, less wasted space) */
.modal-drawer-body .kitchen-meal-edit--inline.form-compact .form-row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  align-items: center;
  gap: 0 0.6rem;
  margin-bottom: 0.4rem;
}
.modal-drawer-body .kitchen-meal-edit--inline.form-compact .form-row label:first-child {
  text-align: left;
  align-self: center;
}
.modal-drawer-body .kitchen-meal-edit--inline.form-compact .form-row > .form-input { width: 100%; }
@media (max-width: 640px) {
  .modal-drawer-body .kitchen-meal-edit--inline.form-compact .form-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* Kitchen icon-only actions (add +, edit pencil, delete trash) */
.modal-drawer-body .kitchen-icon-btn {
  background: none;
  border: none;
  color: var(--slate-500, #64748b);
  padding: 0.3rem;
  cursor: pointer;
  border-radius: 0.3rem;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  min-width: 2rem;
}
.modal-drawer-body .kitchen-icon-btn:hover { color: var(--primary, #2563eb); background: var(--slate-100, #f1f5f9); }
.modal-drawer-body .kitchen-icon-btn.kitchen-icon-btn--danger:hover { color: #b91c1c; }
.modal-drawer-body .kitchen-icon-btn svg { display: block; }

/* Kitchen combined Meals + Items page: two scrollable columns filling the viewport */
.kitchen-meals-items-columns .kitchen-list-col {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kitchen-meals-items-columns .kitchen-list-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0.85rem;
}
.kitchen-meals-items-columns .kitchen-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}
.kitchen-meals-items-columns .kitchen-col-title { margin: 0; font-size: 1.1rem; line-height: 1.2; }
.kitchen-meals-items-columns .kitchen-icon-btn {
  background: none;
  border: none;
  color: var(--slate-500, #64748b);
  padding: 0.3rem;
  cursor: pointer;
  border-radius: 0.3rem;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kitchen-meals-items-columns .kitchen-icon-btn:hover { color: var(--primary, #2563eb); background: var(--slate-100, #f1f5f9); }
.kitchen-meals-items-columns .kitchen-icon-btn svg { display: block; }
.kitchen-meals-items-columns .list-inline-add-row { flex-shrink: 0; }
.kitchen-meals-items-columns .kitchen-col-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius, 8px);
  background: var(--color-surface, #fff);
}
.kitchen-meals-items-columns .kitchen-col-scroll .kitchen-entity-list { border: none; border-radius: 0; }

/* Meals column: name | stacked items | price */
.kitchen-meals-table { width: 100%; border-collapse: collapse; }
.kitchen-meals-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
  vertical-align: top;
  font-size: 0.9rem;
}
.kitchen-meals-table tr:last-child td { border-bottom: none; }
.kitchen-meals-table tr.kitchen-meal-row { cursor: pointer; }
.kitchen-meals-table tr.kitchen-meal-row:hover { background: var(--slate-50, #f8fafc); }
.kitchen-meals-table tr.kitchen-meal-row.kitchen-list-row-active { background: var(--blue-50, #eff6ff); }
.kitchen-meal-name-cell { font-weight: 600; color: var(--slate-900, #0f172a); white-space: nowrap; }
.kitchen-meal-items-cell { color: var(--slate-600, #475569); }
.kitchen-meal-item-line { display: block; font-size: 0.85rem; line-height: 1.35; }
.kitchen-meal-price-cell { text-align: right; white-space: nowrap; color: var(--slate-700, #334155); }
.kitchen-meal-purchase { color: var(--slate-500, #64748b); }
.items-list-wrap,
.meals-list-wrap { margin-top: 0; }
.section-card > .hospitality-inline-add-form:first-of-type {
  margin-top: 0;
}

/* ---------- Kitchen meal planning (compact CRM-style grid) ---------- */
.kitchen-plan-page .plan-status {
  min-height: 1.25rem;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  color: var(--slate-600, #475569);
}
.kitchen-plan-page .plan-status.is-error { color: var(--error-red, #b91c1c); }
.kitchen-plan-page .plan-section {
  margin-top: var(--ui-space-md);
  padding-top: var(--ui-space-sm);
  border-top: 1px solid var(--slate-200, #e2e8f0);
}
.kitchen-plan-page .plan-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.kitchen-plan-page .ui-section-label {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--slate-600, #475569);
}
.kitchen-plan-page .plan-calendar-wrap {
  overflow-x: auto;
  margin-top: 0;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius, 8px);
  background: var(--color-surface, #fff);
  box-shadow: none;
}
.kitchen-plan-page .plan-calendar {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.kitchen-plan-page .plan-calendar th,
.kitchen-plan-page .plan-calendar td {
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--slate-200, #e2e8f0);
  vertical-align: top;
}
.module-list-page .module-list-viewport .plan-calendar td {
  vertical-align: top;
}
.kitchen-plan-page .plan-calendar thead th {
  background: var(--slate-50, #f8fafc);
  font-weight: 600;
  color: var(--slate-700, #334155);
  text-align: center;
  white-space: nowrap;
}
.kitchen-plan-page .plan-calendar th.plan-meal-type-col {
  min-width: 5.5rem;
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--slate-50, #f8fafc);
  box-shadow: 1px 0 0 var(--slate-200, #e2e8f0);
}
.kitchen-plan-page .plan-calendar td.plan-meal-type-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  box-shadow: 1px 0 0 var(--slate-200, #e2e8f0);
}
.kitchen-plan-page .plan-calendar td.plan-meal-type-cell--breakfast { background: #fffbeb; color: #92400e; }
.kitchen-plan-page .plan-calendar td.plan-meal-type-cell--lunch { background: #eff6ff; color: #1e40af; }
.kitchen-plan-page .plan-calendar td.plan-meal-type-cell--dinner { background: #f5f3ff; color: #5b21b6; }
.kitchen-plan-page .plan-calendar th.plan-day-col + th.plan-day-col,
.kitchen-plan-page .plan-calendar td.plan-day-cell + td.plan-day-cell {
  border-left: 2px solid var(--slate-300, #cbd5e1);
}
.kitchen-plan-page .plan-day-head-main { display: block; font-size: 0.8125rem; font-weight: 600; }
.kitchen-plan-page .plan-day-head-sub { display: block; font-size: 0.6875rem; font-weight: 500; color: var(--slate-500, #64748b); margin-top: 0.1rem; }
.kitchen-plan-page .plan-day-cell { min-width: 8.75rem; max-width: 11rem; background: #fff; }
.kitchen-plan-page .plan-day-cell.is-empty { background: var(--slate-50, #f8fafc); }
.kitchen-plan-page .plan-slot { display: flex; flex-direction: column; gap: 0.3rem; }
.kitchen-plan-page .plan-slot select,
.kitchen-plan-page .plan-slot input[type="number"] {
  min-height: 2rem;
  height: 2rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  border: 1px solid var(--slate-300, #cbd5e1);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-surface, #fff);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.kitchen-plan-page .plan-slot-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.2rem;
}
.kitchen-plan-page .plan-metric {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0;
  min-width: 0;
}
.kitchen-plan-page .plan-metric > span {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-500, #64748b);
  line-height: 1;
}
.kitchen-plan-page .plan-metric input {
  width: 100%;
  min-width: 0;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.kitchen-plan-page .plan-metric input::-webkit-outer-spin-button,
.kitchen-plan-page .plan-metric input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
  appearance: none;
}
.kitchen-plan-page .plan-metric input::-moz-number-spin-button {
  display: none;
}
.kitchen-plan-page .plan-slot-cost-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.25rem;
  flex-wrap: wrap;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-700, #334155);
  line-height: 1.3;
}
.kitchen-plan-page .plan-slot-cost-chip .cost-under { color: var(--green-600, #059669); }
.kitchen-plan-page .plan-slot-cost-chip .cost-over { color: var(--red-600, #dc2626); }
.kitchen-plan-page .plan-slot-items-details {
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  background: var(--slate-50, #f8fafc);
  padding: 0.15rem 0.35rem;
}
.kitchen-plan-page .plan-slot-items-details[hidden] { display: none !important; }
.kitchen-plan-page .plan-slot-items-summary {
  cursor: pointer;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--slate-600, #475569);
  list-style: none;
}
.kitchen-plan-page .plan-slot-items-summary::-webkit-details-marker { display: none; }
.kitchen-plan-page .plan-slot-items { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.25rem; }
.kitchen-plan-page .plan-slot-items select.plan-item-select {
  min-height: 1.85rem;
  height: 1.85rem;
  font-size: 0.75rem;
  padding: 0.05rem 0.3rem;
}
.kitchen-plan-page .plan-summary-table.data-table { margin: 0; font-size: 0.8125rem; }
.kitchen-plan-page .plan-summary-table .text-left { text-align: left; }
.kitchen-plan-page .plan-summary-table .cost-under { color: var(--green-600, #059669); }
.kitchen-plan-page .plan-summary-table .cost-over { color: var(--red-600, #dc2626); }
.kitchen-plan-page .plan-summary-table tr.plan-summary-subtotal td { background: var(--slate-50, #f8fafc); font-weight: 600; }
.kitchen-plan-page .plan-summary-table tr.plan-summary-grand td { background: var(--slate-100, #f1f5f9); }
.kitchen-plan-page .plan-ingredients-panel,
.kitchen-plan-page .plan-shopping-panel {
  margin-top: var(--ui-space-md);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--ui-radius, 8px);
  background: var(--color-surface, #fff);
}
.kitchen-plan-page .plan-shopping-panel { background: var(--slate-50, #f8fafc); }
.kitchen-plan-page .plan-panel-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.kitchen-plan-page .plan-grand-total { font-size: 1rem; font-weight: 700; margin: 0.65rem 0 0; color: var(--slate-800, #1e293b); }
@media (max-width: 640px) {
  .kitchen-plan-page .plan-day-cell { min-width: 7.5rem; }
  .kitchen-plan-page .plan-slot-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.res-list-filters-bar .module-list-page-header {
  margin-bottom: var(--ui-space-sm);
}
.res-list-filters-bar .res-list-filters-form {
  margin-top: 0;
}

/* ---------- Widget / maintenance modals ---------- */
.maintenance-assign-modal .modal-card,
.community-post-edit-overlay .modal-card,
.facilities-settings-confirm-modal .modal-card {
  max-width: min(100%, 36rem);
}

/* ---------- Registration status table ---------- */
.reg-status-table-wrap {
  width: 100%;
  max-width: none;
  overflow-x: auto;
}
.section-card.reg-status-table-wrap {
  padding: var(--ui-space-lg) var(--ui-space-xl);
}
.reg-status-table .reg-status-progress {
  min-width: 18rem;
}
.reg-status-empty {
  padding: 0.75rem;
  color: var(--slate-500, #64748b);
}
.reg-status-empty--error {
  color: var(--error-red, #dc2626);
}
.reg-status-phase-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.reg-status-phase-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
}
.reg-status-phase-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.reg-status-phase-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  min-width: 0;
  flex: 1 1 12rem;
}
.reg-status-phase-title {
  font-weight: 500;
}
.reg-status-phase-status {
  font-size: 0.875rem;
}
.reg-status-phase--pending .reg-status-phase-status {
  color: var(--amber-600, #d97706);
}
.reg-status-phase--done .reg-status-phase-status {
  color: var(--green-600, #16a34a);
}
.reg-status-phase-votes {
  font-size: 0.8125rem;
  color: var(--slate-600, #475569);
}
.reg-status-phase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}
.reg-status-actions .btn {
  white-space: normal;
  text-align: left;
}
@media (max-width: 640px) {
  .reg-status-phase-row {
    flex-direction: column;
    align-items: stretch;
  }
  .reg-status-phase-actions .btn {
    flex: 1 1 auto;
  }
}
.reg-status-phase-row--clickable {
  cursor: pointer;
  border-radius: var(--ui-radius-sm, 6px);
  margin: 0 -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
.reg-status-phase-row--clickable:hover {
  background: var(--slate-50, #f8fafc);
}
.reg-status-phase-row--clickable:focus-visible {
  outline: 2px solid var(--focus-border, var(--blue-500, #3b82f6));
  outline-offset: 1px;
}
.reg-status-phase-row--active {
  background: var(--blue-50, #eff6ff);
}
.reg-status-phase-detail-contact {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-800, #1e293b);
}
.reg-status-phase-detail-phase-title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--slate-700, #334155);
}
.reg-status-phase-detail-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--slate-200, #e2e8f0);
}
.reg-status-phase-detail-section-meta {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--slate-500, #64748b);
}
.reg-status-phase-detail-status {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}
.reg-status-phase-detail-meta {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--slate-500, #64748b);
}
.reg-status-phase-detail-fields {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.reg-status-phase-detail-field dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-700, #334155);
}
.reg-status-phase-detail-field dd {
  margin: 0.15rem 0 0;
  font-size: 0.9375rem;
  color: var(--slate-800, #1e293b);
  word-break: break-word;
}
.reg-status-phase-detail-empty,
.reg-status-phase-detail-loading {
  margin: 0;
  font-size: 0.875rem;
  color: var(--slate-500, #64748b);
}
.reg-status-phase-detail-block {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--slate-200, #e2e8f0);
}
.reg-status-phase-detail-heading {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.reg-status-phase-detail-ref {
  margin-bottom: 0.75rem;
}
.reg-status-phase-detail-ref-email {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  color: var(--slate-600, #475569);
}
.reg-status-phase-detail-actions {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--slate-200, #e2e8f0);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Registration Processing matrix */
.reg-processing-toolbar {
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.reg-processing-toolbar--compact .ui-list-toolbar-field {
  flex: 0 0 auto;
  min-width: 0;
}
.reg-processing-toolbar--compact .ui-list-toolbar-field label {
  font-size: 0.8125rem;
  margin-bottom: 0.2rem;
}
.reg-processing-field-workflow select { min-width: 9.5rem; max-width: 14rem; width: auto; }
.reg-processing-field-search input { min-width: 7rem; max-width: 11rem; width: auto; }
.reg-processing-field-active select { min-width: 5.5rem; max-width: 8rem; width: auto; }
.reg-processing-field-pagesize select { min-width: 4.5rem; max-width: 6rem; width: auto; }
.reg-processing-school-field select { min-width: 7rem; max-width: 11rem; width: auto; }
.reg-processing-process-locked {
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-700, #334155);
  white-space: nowrap;
  flex: 0 0 auto;
}
.reg-processing-toolbar .ui-list-toolbar-actions {
  margin-left: auto;
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .reg-processing-toolbar { flex-wrap: wrap; }
}
.reg-processing-table-wrap {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.reg-processing-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.reg-processing-table {
  min-width: 100%;
  font-size: 0.875rem;
}
.reg-processing-table th,
.reg-processing-table td {
  white-space: nowrap;
  vertical-align: middle;
}
.reg-processing-th {
  cursor: pointer;
  user-select: none;
}
.reg-processing-th-phase {
  text-align: center;
  min-width: 2.5rem;
}
.reg-processing-td-phase {
  text-align: center;
  padding: 0.35rem 0.5rem;
}
.reg-processing-td-name {
  font-weight: 600;
  min-width: 8rem;
}
.reg-processing-phase-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  border-radius: 4px;
  cursor: pointer;
}
.reg-processing-phase-cell:hover,
.reg-processing-phase-cell:focus-visible {
  outline: 2px solid var(--focus-border, #3b82f6);
  outline-offset: 1px;
}
.reg-processing-phase-cell--active {
  outline: 2px solid var(--focus-border, #3b82f6);
}
.reg-processing-state-complete .reg-processing-phase-sym {
  color: var(--green-600, #16a34a);
  font-weight: 700;
}
.reg-processing-state-waiting_applicant .reg-processing-phase-sym {
  color: var(--amber-600, #d97706);
}
.reg-processing-state-waiting_registrar .reg-processing-phase-sym {
  color: var(--blue-600, #2563eb);
}
.reg-processing-row--stale {
  background: rgba(251, 191, 36, 0.12);
}
.reg-processing-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--slate-500, #64748b);
}
.reg-processing-empty--error {
  color: var(--red-600, #dc2626);
}
.reg-processing-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.reg-processing-pagination-info {
  margin-right: auto;
  font-size: 0.875rem;
  color: var(--slate-600, #475569);
}
.reg-processing-meta {
  font-size: 0.8125rem;
  color: var(--slate-500, #64748b);
  margin-bottom: 0.5rem;
}
.reg-processing-columns-card {
  max-width: 28rem;
  width: calc(100% - 2rem);
  max-height: min(85vh, 32rem);
  overflow: auto;
}
.reg-processing-columns-group {
  border: none;
  margin: 0 0 1rem;
  padding: 0;
}
.reg-processing-columns-group legend {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}
.reg-processing-columns-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
  font-size: 0.875rem;
}
.reg-processing-school-field select[multiple] {
  min-height: 44px;
}

/* ---------- Mobile: edge-to-edge framed list panels ---------- */
@media (max-width: 900px) {
  /* Remove outer gutter around section-card / crm-app frames */
  .admin-layout.module-list-page,
  .admin-layout.module-list-page .admin-content {
    --page-content-width: 100%;
    --page-content-padding-x: 0;
    --page-content-margin-x: 0;
  }
  .admin-content:has(> .section-card.module-list-viewport),
  .admin-content:has(> .crm-app),
  .admin-content:has(> .module-list-body-fill),
  .admin-content:has(> .module-list-viewport:not(.section-card)),
  .page-sidebar-layout-content:has(.section-card.module-list-viewport),
  .page-sidebar-layout-content:has(.crm-app),
  .page-sidebar-layout-content:has(.module-list-page),
  [data-page-sidebar-layout] .page-sidebar-layout-content > .admin-layout > .admin-content:has(.section-card.module-list-viewport),
  [data-page-sidebar-layout] .page-sidebar-layout-content > .admin-layout > .admin-content:has(.crm-app) {
    --page-content-padding-x: 0;
    --page-content-padding-y: 0;
    --page-content-margin-x: 0;
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0 !important;
  }
  .page-sidebar-layout-main:has(.section-card.module-list-viewport),
  .page-sidebar-layout-main:has(.crm-app),
  .page-sidebar-layout-main:has(.module-list-page),
  .page-sidebar-layout[data-layout="classic"] .page-sidebar-layout-main:has(.crm-app),
  .page-sidebar-layout[data-layout="sidebar"] .page-sidebar-layout-main:has(.crm-app),
  .page-sidebar-layout[data-layout-pref="sidebar"] .page-sidebar-layout-main:has(.crm-app) {
    padding: 0 !important;
  }

  /* Frame flush to screen edges; keep inner padding */
  .section-card.module-list-viewport,
  .module-list-page .section-card.module-list-viewport,
  .crm-app {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 0;
  }

  /* Flash / banner rows above the frame keep a readable inset */
  .admin-content:has(> .section-card.module-list-viewport) > .success,
  .admin-content:has(> .section-card.module-list-viewport) > .error,
  .admin-content:has(> .section-card.module-list-viewport) > p.success,
  .admin-content:has(> .section-card.module-list-viewport) > p.error,
  .admin-content:has(> .crm-app) > .success,
  .admin-content:has(> .crm-app) > .error,
  .admin-content:has(> .crm-app) > p.success,
  .admin-content:has(> .crm-app) > p.error,
  .admin-content:has(> .crm-app) > .section-card:not(.module-list-viewport) {
    margin-left: clamp(0.75rem, 2vw, 1.25rem);
    margin-right: clamp(0.75rem, 2vw, 1.25rem);
  }

  /* Moderate feed: title on first row; From/To dates side-by-side on the row below */
  .module-list-page-header:has(.feed-list-filters) {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .module-list-page-header:has(.feed-list-filters) .module-list-page-title {
    width: 100%;
  }
  .module-list-page-header:has(.feed-list-filters) .module-list-page-header-actions {
    margin-left: 0;
    width: 100%;
  }
  .feed-list-actions-wrap {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }
  .feed-list-filters {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
  }
  .feed-list-filter-field {
    flex-direction: row;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    gap: 0.35rem;
  }
  .feed-list-filter-field label {
    flex-shrink: 0;
  }
  .feed-list-filter-field input[type="date"] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    font-size: 0.875rem;
  }
  .feed-list-search {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .feed-list-actions-wrap .ui-list-search-expand.is-open .ui-list-search-expand-input {
    width: min(14rem, 42vw);
    max-width: min(14rem, 42vw);
    min-width: 9rem;
  }

  /* List header actions: wrap instead of clipping on small screens */
  .module-list-page-header,
  .reg-hub-list-header.module-list-page-header,
  .super-list-header.module-list-page-header {
    gap: 0.5rem;
  }
  .module-list-page-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
