/* Shared control sizing. Keep compact table tools distinct from page actions. */
:root {
  --control-height: 38px;
  --control-height-primary: 42px;
  --control-height-compact: 32px;
  --control-font-size: 14px;
  --control-gap: 8px;
  --control-border: #dfe3e8;
}

.crm-shell .crm-button,
.crm-shell button,
.add-client-btn, .proj-filter-btn, .nc-btn-save, .nc-btn-cancel, .page-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--control-gap);
  min-height: var(--control-height);
  height: auto;
  max-width: 100%;
  padding: 0 16px;
  border-radius: var(--radius-control);
  font-family: var(--font-family);
  font-size: var(--control-font-size);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: normal;
  text-decoration: none;
  box-shadow: none;
  vertical-align: middle;
}

.crm-shell .crm-button:not(.secondary):not(.danger),
.crm-shell .crm-heading > .crm-button,
.crm-shell .overview-heading > .crm-button,
.add-client-btn, .nc-btn-save, .nc-btn-cancel {
  min-height: var(--control-height-primary);
  height: auto;
  padding: 0 20px;
}
.crm-shell .overview-heading > .crm-button,
.crm-shell .crm-heading > .crm-button { width: auto; min-width: 160px; }
.crm-shell .crm-actions > button,
.crm-shell .crm-actions > .crm-button { min-height: var(--control-height-primary); height: auto; }

.crm-shell .crm-filters { align-items: center; gap: 12px; }
.crm-shell .crm-filters > .crm-button,
.crm-shell .crm-filters > button { min-height: var(--control-height); height: var(--control-height); }
.crm-shell .crm-filters input:not([type=checkbox]):not([type=hidden]),
.crm-shell .crm-filters select:not(.hk-select-native),
.crm-shell .crm-field input:not([type=checkbox]):not([type=hidden]):not([type=file]),
.crm-shell .crm-field select:not(.hk-select-native),
.crm-shell .crm-field button.hk-select-trigger,
.crm-shell .crm-filters button.hk-select-trigger {
  min-height: var(--control-height);
  height: var(--control-height);
  padding: 0 12px;
  font-size: var(--control-font-size);
  line-height: 1.4;
  border-radius: var(--radius-control);
}
.crm-shell .crm-field textarea { font-size: var(--control-font-size); line-height: 1.6; }

.crm-shell .crm-work-table .crm-details-button,
.crm-shell .crm-work-table .crm-note-button,
.crm-shell .crm-table button.hk-select-trigger,
.crm-shell .crm-work-table .crm-date-label input,
.crm-shell .overview-link {
  min-height: var(--control-height-compact);
  height: var(--control-height-compact);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  border-radius: var(--radius-control);
}
.crm-shell .overview-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.crm-shell .crm-table button.hk-select-trigger { justify-content: space-between; }
.crm-shell .crm-work-table .crm-row-actions { align-items: center; gap: 8px; }
.crm-shell .crm-table td { vertical-align: middle; }
.crm-shell .range-presets button { min-height: var(--control-height-compact); padding: 0 12px; font-size: 13px; }

/* Icons retain their own footprint; never stretch an overflow/close control. */
.crm-shell .crm-button > .hk-icon,
.crm-shell button > .hk-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.proj-more-btn, .page-btn { min-width: var(--control-height); min-height: var(--control-height); padding: 0 10px; }
.crm-shell .crm-estimate-line > button { width: 40px; min-width: 0; padding: 0; }

.crm-shell button:disabled, .add-client-btn:disabled, .nc-btn-save:disabled {
  opacity: .5; cursor: not-allowed; box-shadow: none;
}
.crm-shell :is(button, a, input, select, textarea):focus-visible,
:is(.add-client-btn, .proj-filter-btn, .page-btn, .nc-btn-save, .nc-btn-cancel):focus-visible {
  outline: 2px solid #9b600b; outline-offset: 3px;
}
.crm-shell .crm-card-head { align-items: center; flex-wrap: wrap; gap: 12px; }
.crm-shell .crm-card-head h2 { margin: 0; }
.crm-shell .crm-card-head .help { margin: 6px 0 0; }
.crm-shell .crm-actions { gap: 10px; }

@media (max-width: 760px) {
  :root { --control-height-compact: 38px; }
  .crm-shell .crm-work-table .crm-details-button,
  .crm-shell .crm-work-table .crm-note-button { padding: 0 12px; }
  .crm-shell .overview-link { font-size: 13px; }
  .crm-shell .crm-heading > .crm-button,
  .crm-shell .overview-heading > .crm-button { min-width: 144px; }
  .crm-shell .overview-stat small { font-size: 12px; }
}
