/* Shared UI consistency and accessibility layer. */

button,
a,
summary,
input,
select,
textarea,
[tabindex] {
  -webkit-tap-highlight-color: rgba(15, 107, 90, 0.16);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
form input:focus-visible,
form select:focus-visible,
form textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: none;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.small-button,
.quiet-button,
.action-menu-item {
  line-height: 1.2;
}

.section-header .topbar-actions .primary-button,
.section-header .topbar-actions .secondary-button,
.section-header .topbar-actions .danger-button {
  min-height: 40px;
}

.small-button,
.table-actions button {
  min-height: 36px;
}

.pill,
.status-pill {
  min-height: 26px;
  border: 1px solid transparent;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.pill.active,
.status-pill.active {
  border-color: #b5ddcf;
  background: #dff5e8;
  color: #145c38;
}

.pill.planned {
  border-color: #bfd5e6;
  background: var(--blue-soft);
  color: #244f73;
}

.pill.risk {
  border-color: #e7bd91;
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.done,
.status-pill.cooldown {
  border-color: #d7dddf;
  background: #eceff1;
  color: #46535a;
}

.status-pill.available {
  border-color: #e3cc76;
  background: #fff1be;
  color: #654600;
}

.campaign-table-wrap {
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.campaign-table-wrap.is-scrollable:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.campaign-table {
  font-variant-numeric: tabular-nums;
}

.campaign-table th {
  line-height: 1.35;
  white-space: nowrap;
}

.campaign-table td {
  line-height: 1.45;
}

.campaign-table tbody tr:focus-within td {
  background: #f1f7f5;
}

.campaign-table th:last-child:empty,
.campaign-table th:last-child[aria-label="Działania"] {
  width: 1%;
  min-width: 88px;
}

.form-feedback {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #dfa2a2;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  background: var(--danger-soft);
  color: #7f2929;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.form-feedback[hidden] {
  display: none;
}

.modal-card > .form-feedback {
  margin: 16px 22px 0;
}

form [aria-invalid="true"] {
  border-color: var(--danger);
  outline: 2px solid rgba(180, 61, 61, 0.2);
  outline-offset: 1px;
}

.unsaved-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid #e6bc8d;
  border-radius: 5px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.unsaved-indicator[hidden] {
  display: none;
}

.modal-header > div:first-child {
  min-width: 0;
}

form fieldset:not(.import-mode-fieldset) {
  border-color: var(--line);
  border-radius: 7px;
}

form fieldset:not(.import-mode-fieldset) legend {
  padding: 0 6px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.inline-check,
.checkbox-line,
.region-checks label,
.checklist-fieldset label,
.release-platform-checks label {
  min-height: 36px;
  border-radius: 5px;
}

.inline-check:hover,
.checkbox-line:hover,
.region-checks label:hover,
.checklist-fieldset label:hover,
.release-platform-checks label:hover {
  background: var(--surface-soft);
}

.validation-issue,
.xbox-form-summary,
.xbox-ok {
  line-height: 1.45;
}

@media (min-width: 1800px) {
  .workspace {
    padding-right: 42px;
    padding-left: 42px;
  }

  .topbar {
    margin-right: -42px;
    margin-left: -42px;
    padding-right: 42px;
    padding-left: 42px;
  }

  .xbox-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  }
}

@media (max-width: 1100px) {
  .sidebar[aria-hidden="true"] {
    visibility: hidden;
  }

  body.mobile-nav-open .sidebar[aria-hidden="false"] {
    visibility: visible;
  }
}

@media (max-width: 760px) {
  .section-header .topbar-actions .primary-button,
  .section-header .topbar-actions .secondary-button,
  .section-header .topbar-actions .danger-button,
  .small-button,
  .table-actions button,
  .modal-actions > button,
  .action-menu-item,
  .quiet-button {
    min-height: 44px;
  }

  .modal-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .modal-header > div:first-child {
    flex: 1 1 calc(100% - 54px);
  }

  .unsaved-indicator {
    order: 3;
    margin-left: 0;
  }

  .modal-card > .form-feedback {
    margin: 14px 16px 0;
  }

  .inline-check,
  .checkbox-line,
  .region-checks label,
  .checklist-fieldset label,
  .release-platform-checks label {
    min-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .campaign-table th:first-child,
  .campaign-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    max-width: 220px;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
  }

  .campaign-table th:first-child {
    z-index: 3;
    background: #f2f6f5;
  }

  .campaign-table tbody tr:hover td:first-child,
  .campaign-table tbody tr:focus-within td:first-child {
    background: #f1f7f5;
  }
}

