/* ------------------------------------------------------------------------- */
/* Shared UI polish: forms, tables, focus, small screens.                     */
/*                                                                            */
/* Colour-neutral on purpose. Nothing here sets a palette colour; the only    */
/* colours come from the brand kit's own tokens (--gooo-accent, --gooo-danger) */
/* or from currentColor, so any theme that keeps those tokens works. Loaded   */
/* after app.css (assets/app.js), so equal-specificity rules here win.        */
/* ------------------------------------------------------------------------- */

/* Visible keyboard focus. The Tailwick field classes carry `focus:outline-none`
   and rely on a 1px border change, which is easy to miss. */
.gooo-shell a:focus-visible,
.gooo-shell button:focus-visible,
.gooo-shell summary:focus-visible,
.gooo-shell .form-input:focus-visible,
.gooo-shell .form-select:focus-visible,
.gooo-shell .form-file:focus-visible,
.gooo-shell textarea:focus-visible,
.gooo-shell input[type="checkbox"]:focus-visible,
.gooo-shell input[type="radio"]:focus-visible {
  outline: 2px solid var(--gooo-accent);
  outline-offset: 2px;
}

/* Required marker. Symfony puts `required` on the label; the asterisk is
   decoration, the input itself already carries the `required` attribute. */
.gooo-shell label.required::after {
  content: " *";
  color: var(--gooo-danger);
}

/* Invalid fields. The shared field class contains `dark:disabled:border-zink-500`,
   which the app.css `[class*="border-zink-500"]` rule matches with !important and
   so repainted every error border back to neutral. */
.gooo-shell .form-input[aria-invalid="true"],
.gooo-shell .form-select[aria-invalid="true"],
.gooo-shell .form-file[aria-invalid="true"],
.gooo-shell input[type="checkbox"][aria-invalid="true"],
.gooo-shell input[type="radio"][aria-invalid="true"] {
  border-color: var(--gooo-danger) !important;
}

/* Disabled controls look and behave disabled. */
.gooo-shell .btn:disabled,
.gooo-shell .btn[aria-disabled="true"],
.gooo-shell button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.gooo-shell .form-input:disabled,
.gooo-shell .form-select:disabled,
.gooo-shell input:disabled + label {
  cursor: not-allowed;
}

/* Comfortable touch targets for checkboxes and radios on coarse pointers. */
@media (pointer: coarse) {
  .gooo-shell input[type="checkbox"],
  .gooo-shell input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Tables: wide tables scroll inside their wrapper. app.css set `overflow:
   hidden` on the wrapper for its rounded corners, which clipped the right-hand
   columns (Actions) on narrow screens instead of scrolling. */
.overflow-x-auto:has(> table) {
  overflow-x: auto;
  overflow-y: hidden;
}
table th,
table td {
  vertical-align: middle;
}
table th {
  text-align: start;
  white-space: nowrap;
}

/* Empty state: a lone full-width cell is the "nothing here" row. */
tbody tr > td[colspan]:only-child {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
  text-align: center;
  opacity: 0.8;
}
table tbody tr:hover > td[colspan]:only-child {
  background-color: transparent;
}

/* Modal dialogs opened by the modal-form controller. Tailwind's preflight zeroes
   the native <dialog> margin, which pinned it to the top-left corner. */
dialog.gooo-modal {
  margin: auto;
  width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  color: inherit;
}
.gooo-shell .btn.gooo-btn-outline,
dialog.gooo-modal .btn.gooo-btn-outline {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  opacity: 0.8;
}
