/* Sensible styling for Django's stock admin markup (change list, change form, delete pages)
   until each page gets its own template in later phases. Kept deliberately small. */
.module { background: var(--m-surface); border: 1px solid var(--m-border); border-radius: var(--m-radius); margin-bottom: calc(var(--m-space) * 4); overflow: hidden; }
.module h2, .module caption, .inline-group h2, .inline-heading { margin: 0; padding: calc(var(--m-space) * 2.5) calc(var(--m-space) * 4); background: var(--m-surface-2); border-bottom: 1px solid var(--m-border); font-size: var(--m-font-size-sm); font-weight: 600; color: var(--m-fg-strong); text-align: left; }
.module table { width: 100%; }
.module tr:first-child { border-top: 0; }
.inline-group { margin-bottom: calc(var(--m-space) * 4); }
.inline-group .tabular table { min-width: max(100%, 44rem); }  /* scrolls sideways on phones */
.inline-group .tabular th, .inline-group .tabular td { padding: calc(var(--m-space) * 2) calc(var(--m-space) * 2.5); font-size: var(--m-font-size-sm); vertical-align: top; }
.inline-group .tabular thead th { background: var(--m-surface-2); font-size: var(--m-font-size-xs); text-transform: uppercase; color: var(--m-fg-muted); }
.inline-group .tabular { max-width: 100%; }
.inline-group .tabular .module { overflow: visible; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }  /* the fieldset is the scroller */
.inline-group .tabular .module > h2 { position: sticky; left: 0; }  /* the title stays in view while scrolling sideways */
.cf__panel--inline { min-width: 0; }
.inline-group .add-row { padding: calc(var(--m-space) * 2) calc(var(--m-space) * 4); }
.inline-group .add-row a { font-size: var(--m-font-size-sm); font-weight: 500; }
.inline-related h3 { padding: calc(var(--m-space) * 2) calc(var(--m-space) * 4); background: var(--m-surface-2); border-top: 1px solid var(--m-border); font-size: var(--m-font-size-sm); }

/* Django's hidden inline template row (cloned by its JS when adding a row).
   !important: the row is a .module/.inline-related with its own display rules and Django's
   inlines.js toggles display inline. */
.inline-related.empty-form, tr.empty-form, .empty-form { display: none !important; }

/* Native buttons and file buttons of third-party forms look like ours (icon or not). */
button:not([class]), input[type="submit"]:not([class]), input[type="button"], input[type="reset"], input[type="submit"].default, input[type="file"]::file-selector-button {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--m-space) * 1.5);
  padding: calc(var(--m-space) * 2) calc(var(--m-space) * 3.5); min-height: 2.5rem;
  border: 1px solid var(--m-border-strong); border-radius: var(--m-radius);
  font: inherit; font-weight: 500; font-size: var(--m-font-size-sm); line-height: 1.2; white-space: nowrap;
  cursor: pointer; background: var(--m-surface); color: var(--m-fg-strong);
}
button:not([class]):hover, input[type="submit"]:not([class]):hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="file"]::file-selector-button:hover { background: var(--m-surface-3); }
input[type="submit"].default { background: var(--m-primary); border-color: var(--m-primary); color: var(--m-primary-contrast); }
input[type="submit"].default:hover { background: var(--m-primary-hover); }
input[type="file"]::file-selector-button { margin-right: calc(var(--m-space) * 2); }
