/* Shared workspace controls. Keep this after module styles so text-field rules
   cannot turn checkboxes into full-width inputs. */
body :is(.page, dialog) input:is([type="checkbox"], [type="radio"]) {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px;
  padding: 0 !important;
  margin: 3px 0 0 !important;
  flex: 0 0 18px;
  display: inline-block;
  vertical-align: middle;
  accent-color: var(--green, #383c1a);
}
body :is(.page, dialog) label:has(> input:is([type="checkbox"], [type="radio"])) {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px;
  line-height: 1.5;
  cursor: pointer;
}
body :is(.dashboard, #page-imports, dialog) button:not([class]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #d7d9cb;
  border-radius: 999px;
  background: #f2f3e9;
  color: #383c1a;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
  cursor: pointer;
}
body :is(.dashboard, #page-imports, dialog) button:not([class]):hover {background: #e6e8d7;}
body :is(.page, dialog) button:disabled {cursor: wait; opacity: .6;}
body :is(.page, dialog) :is(.actions, .dialog-actions, .row-actions, .p-toolbar) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
body :is(.page, dialog) :is(.actions, .dialog-actions, .row-actions, .p-toolbar) > :is(button, a) {
  margin: 0;
  width: auto;
}
body :is(.page, dialog) .actions > label {margin: 0; min-width: 0;}
body dialog {max-height: calc(100dvh - 32px); overflow-y: auto;}
body #core-dialog {width: min(900px, calc(100vw - 32px)); box-sizing: border-box;}
body #core-dialog .dialog-header {display: flex; align-items: center; justify-content: space-between; gap: 20px;}
body #core-dialog .dialog-header h2 {margin: 0;}
body #core-dialog .dialog-header button {flex-shrink: 0;}
body #core-dialog .dialog-actions {margin-top: 20px;}
body #core-dialog .p-grid {grid-template-columns: repeat(2, minmax(0, 1fr));}
body #core-dialog label > :is(input:not([type="checkbox"]), select) {display: block; margin-top: 8px;}
body #core-dialog #core-error:not(:empty) {padding: 12px; background: #f2f3e9; border-radius: 8px;}
@media(max-width: 600px) {
  body #core-dialog .p-grid {grid-template-columns: 1fr;}
  body :is(.page, dialog) .actions > label {flex: 1 1 180px;}
}

/* Preserve intentionally hidden dashboard controls and native hidden attributes. */
body .ws-dashboard .actions {display: none;}
body :is(.page, dialog) [hidden] {display: none !important;}
