/* Shared presentation for real empty/loading/error states. Status chips and inline form errors are excluded. */
:root {
  --ui-state-ink: #294d3b;
  --ui-state-copy: #5b7062;
  --ui-state-icon: #568168;
  --ui-state-height: 180px;
}
.ui-state,
.process-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: var(--ui-state-height);
  max-width: 100%;
  padding: 30px 24px;
  text-align: center;
  color: var(--ui-state-copy);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
[data-process-results] > .process-state { --ui-state-height: 204px; }
.ui-state-icon,
.process-state > .process-empty-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  margin: 0 0 3px;
  border: 1px solid #dce9df;
  border-radius: 15px;
  background: #f0f6f1;
  color: var(--ui-state-icon);
  font-size: 27px;
  line-height: 1;
}
.ui-state-icon > svg,
.process-state > .process-empty-icon > svg { display: block; width: 28px; height: 28px; margin: 0; }
.ui-state > :is(strong,h2,h3),
.process-state > :is(strong,h2,h3) {
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 0;
  color: var(--ui-state-ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
}
.ui-state > :is(p,small),
.process-state > :is(p,small) {
  display: block;
  max-width: 570px;
  margin: 0;
  color: var(--ui-state-copy);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.85;
}
.ui-state > :is(.btn,.button),
.process-state > :is(.btn,.button) { align-self: center; margin: 5px 0 0; }
.ui-state-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 5px; }
.ui-state.is-error,
.process-state.is-error { color: #925342; background: #fffbf8; }
.ui-state.is-error > .ui-state-icon,
.process-state.is-error > .ui-state-icon { background: #fff2ea; color: #9b5a45; border-color: #ecd7ca; }
.ui-state.is-error > :is(strong,h2,h3),
.process-state.is-error > :is(strong,h2,h3) { color: #854733; }
.ui-state.is-error > :is(p,small),
.process-state.is-error > :is(p,small) { color: #8f6353; }
.ui-state.is-denied > .ui-state-icon { background: #faf6e9; border-color: #e9dfbd; color: #8c7137; }
.ui-state-loading-mark { animation: ui-state-turn .9s linear infinite; transform-origin: 50% 50%; }
@keyframes ui-state-turn { to { transform: rotate(360deg); } }

/* These selectors refer to content containers, never table cells or table rows themselves. */
.empty:not(td):not(th):not(tr):not(svg),
.portal-empty,
.workspace-empty,
.asset-work-empty,
.discussion-empty,
.fa-empty,
.inventory-empty,
.hm-empty,
.rb-empty,
.hot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: var(--ui-state-height);
  max-width: 100%;
  padding: 28px 22px;
  text-align: center;
  color: var(--ui-state-copy);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
:is(.empty,.portal-empty,.workspace-empty,.asset-work-empty,.discussion-empty,.fa-empty,.inventory-empty,.hm-empty,.rb-empty,.hot-empty) > :is(strong,h2,h3) {
  max-width: 620px;
  margin: 0;
  color: var(--ui-state-ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
}
:is(.empty,.portal-empty,.workspace-empty,.asset-work-empty,.discussion-empty,.fa-empty,.inventory-empty,.hm-empty,.rb-empty,.hot-empty) > :is(p,small) {
  max-width: 570px;
  margin: 0;
  color: var(--ui-state-copy);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.85;
}
:is(.empty,.portal-empty,.inventory-empty,.asset-work-empty) > svg { display: block; flex: 0 0 auto; width: 35px; height: 35px; margin: 0 0 2px; color: #73977e; }
:is(.empty,.portal-empty,.workspace-empty,.asset-work-empty,.discussion-empty,.fa-empty,.inventory-empty,.hm-empty,.rb-empty,.hot-empty) > :is(.btn,.button) { margin-top: 5px; align-self: center; }
.workspace-empty > span,
.hm-empty-mark { display: grid; place-items: center; flex: 0 0 auto; margin: 0 0 3px; }

.portal-state,
.state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-width: 0;
  min-height: var(--ui-state-height);
  padding: 28px 22px;
  text-align: center;
  overflow-wrap: anywhere;
}
.portal-state > strong,
.state-card > :is(h2,h3,strong) { max-width: 620px; margin: 0; font-size: 17px; font-weight: 600; line-height: 1.55; }
.portal-state > :is(span,p),
.state-card > p { max-width: 570px; margin: 0; font-size: 14px; font-weight: 500; line-height: 1.85; }
.portal-state.denied { border-color: #e5dbbd; background: #fffbef; color: #7d652e; }
.portal-state.denied strong { color: #775d24; }
.portal-state.error strong { color: #914f3e; }
.portal-state.loading strong { color: #3d6952; }
.state-card > :is(.button,.btn) { margin: 4px 0 0; }
.state-card .spinner { margin: 0 0 3px; }

/* Local panel states have a smaller rhythm and do not turn into a second page-sized blank area. */
.workspace-news-grid .workspace-empty { --ui-state-height: 150px; padding: 24px 18px; }
.workspace-data-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 128px;
  padding: 22px 18px;
  text-align: center;
  color: var(--ui-state-copy);
}
.workspace-data-state > span { display: grid; place-items: center; color: #74947b; }
.workspace-data-state strong { margin: 0 0 6px; color: var(--ui-state-ink); font-size: 16px; font-weight: 600; line-height: 1.5; }
.workspace-data-state p { max-width: 450px; margin: 0; color: var(--ui-state-copy); font-size: 14px; line-height: 1.8; }
.workspace-data-state.error strong { color: #92533e; }
.workspace-other-content .workspace-data-state { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 82px; padding: 14px 0; text-align: left; }
.workspace-other-content .workspace-data-state strong { font-size: 15px; }
.workspace-other-content .workspace-data-state p { font-size: 13px; }
.sa-empty,
.sa-loading,
.pf-empty,
.supplier-management-empty,
.ha-day-empty { min-height: 136px; padding: 23px 18px; text-align: center; color: var(--ui-state-copy); font-size: 14px; line-height: 1.8; }
:is(.pf-empty,.ha-day-empty) > strong { display: block; margin: 0 0 8px; color: var(--ui-state-ink); font-size: 17px; font-weight: 600; }
:is(.pf-empty,.ha-day-empty) > p { margin: 0; color: var(--ui-state-copy); font-size: 14px; line-height: 1.8; }
.ha-day-empty > span { display: block; margin: 0 0 9px; color: #6f9276; }
.supplier-contact-empty,
.supplier-contacts-empty,
.supplier-profile-file-empty { min-height: 90px; padding: 18px; color: var(--ui-state-copy); font-size: 14px; line-height: 1.8; text-align: center; }
.supplier-contact-empty strong { display: block; margin-bottom: 8px; color: var(--ui-state-ink); font-size: 16px; font-weight: 600; }
.supplier-contact-empty p { margin: 0; font-size: 14px; line-height: 1.8; }
.modal-loading,
.forum-admin-loading,
.ha-loading { display: flex; align-items: center; justify-content: center; min-height: 150px; padding: 26px 20px; text-align: center; color: var(--ui-state-copy); font-size: 15px; line-height: 1.8; }
.ha-empty { min-height: 124px; padding: 25px 18px; color: var(--ui-state-copy); text-align: center; font-size: 14px; line-height: 1.85; }
td > :is(.empty,.inventory-empty,.sa-empty) { --ui-state-height: 136px; min-height: 136px; padding: 25px 18px; }
.discussion-empty .forum-error { color: #975341; }

@media (max-width: 600px) {
  [data-process-results] > .process-state { --ui-state-height: 196px; padding: 27px 19px; }
  .process-state > p { max-width: 32ch; }
  .ui-state,
  .portal-state,
  .state-card { padding: 26px 19px; }
  :is(.empty,.portal-empty,.asset-work-empty,.discussion-empty,.fa-empty,.inventory-empty,.hm-empty,.rb-empty,.hot-empty):not(td):not(th):not(tr) { padding: 26px 18px; }
  .workspace-news-grid .workspace-empty { padding: 22px 17px; }
  .workspace-data-state { padding: 21px 17px; }
  .table-scroll td[colspan] > :is(.empty,.inventory-empty,.sa-empty),
  .ha-table-scroll td[colspan] > .ha-empty {
    position: sticky;
    left: 0;
    width: min(100%, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
  }
}
@media (prefers-reduced-motion: reduce) { .ui-state-loading-mark { animation: none; } }
