/* Компоненты ProcessDesk. Классы .primary / .ghost / .danger живут в styles.css как прежние имена. */

.ghost.pd-btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--pd-text-secondary);
}
.ghost.pd-btn--ghost:hover,
.ghost.pd-btn--ghost.is-hover { background: var(--pd-bg-hover); color: var(--pd-text); }
.ghost.pd-btn--ghost:active { background: var(--pd-gray-200); color: var(--pd-text); }

.pd-btn--xs {
  height: var(--pd-control-xs);
  min-height: var(--pd-control-xs);
  padding: 0 8px;
  gap: 4px;
  font-size: var(--pd-text-xs);
  line-height: var(--pd-lh-xs);
  border-radius: var(--pd-radius-xs);
}
.pd-btn--lg {
  height: var(--pd-control-lg);
  min-height: var(--pd-control-lg);
  padding: 0 16px;
  gap: 8px;
  font-size: var(--pd-text-md);
  line-height: var(--pd-lh-md);
  border-radius: var(--pd-radius-md);
}

.pd-spin {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pd-rot 600ms linear infinite;
  flex-shrink: 0;
}
@keyframes pd-rot { to { transform: rotate(360deg); } }

.pd-select { position: relative; display: block; min-width: 0; }
.pd-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  border: 0;
}
.pd-select__face {
  width: 100%;
  height: var(--pd-control-md);
  min-height: var(--pd-control-md);
  padding: 0 8px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  border: 1px solid var(--pd-border-strong);
  border-radius: var(--pd-radius-sm);
  background: var(--pd-bg-surface);
  color: var(--pd-text);
  font: var(--pd-weight-regular) var(--pd-text-sm)/var(--pd-lh-sm) var(--pd-font-sans);
  text-align: left;
  cursor: pointer;
}
.pd-select__face:hover { border-color: var(--pd-gray-400); }
.pd-select__face:focus { outline: none; border-color: var(--pd-primary-300); box-shadow: var(--pd-focus-ring); }
.pd-select__face.is-open { border-color: var(--pd-primary-300); box-shadow: var(--pd-focus-ring); }
.pd-select__face.is-none { border-style: dashed; color: var(--pd-text-tertiary); }
.pd-select__face:disabled { background: var(--pd-gray-50); color: var(--pd-text-disabled); cursor: not-allowed; }
.pd-select__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-select__face svg { width: 16px; height: 16px; color: var(--pd-text-tertiary); flex-shrink: 0; }

.pd-menu {
  position: fixed;
  z-index: var(--pd-z-dropdown);
  min-width: 160px;
  max-width: 320px;
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--pd-bg-surface);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius-sm);
  box-shadow: var(--pd-shadow-lg);
}
.pd-menu[hidden] { display: none; }
.pd-menu__search {
  width: 100%;
  height: var(--pd-control-md);
  margin-bottom: 4px;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid var(--pd-border-strong);
  border-radius: var(--pd-radius-sm);
  font: var(--pd-text-sm)/var(--pd-lh-sm) var(--pd-font-sans);
}
.pd-menu__item {
  min-height: 32px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--pd-radius-xs);
  color: var(--pd-text);
  font-size: var(--pd-text-sm);
  line-height: var(--pd-lh-sm);
  cursor: pointer;
}
.pd-menu__item.is-on,
.pd-menu__item:hover { background: var(--pd-bg-hover); }
.pd-menu__item svg { margin-left: auto; width: 16px; height: 16px; color: var(--pd-primary-600); flex-shrink: 0; }
.pd-select.is-sm .pd-select__face { height: var(--pd-control-sm); min-height: var(--pd-control-sm); }

@media (max-width: 767px) {
  .pd-select__native {
    position: static;
    width: 100%;
    height: var(--pd-control-md);
    opacity: 1;
    pointer-events: auto;
    padding: 0 10px;
    border: 1px solid var(--pd-border-strong);
    border-radius: var(--pd-radius-sm);
    background: var(--pd-bg-surface);
    font: var(--pd-text-sm)/var(--pd-lh-sm) var(--pd-font-sans);
  }
  .pd-select__face { display: none; }
  .pd-menu { display: none !important; }
}

.pd-seg {
  display: inline-flex;
  height: var(--pd-control-md);
  padding: 2px;
  gap: 0;
  background: var(--pd-gray-100);
  border-radius: var(--pd-radius-sm);
  box-sizing: border-box;
}
.pd-seg button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--pd-radius-xs);
  background: transparent;
  color: var(--pd-text-secondary);
  font: var(--pd-weight-medium) var(--pd-text-xs)/var(--pd-lh-xs) var(--pd-font-sans);
  cursor: pointer;
}
.pd-seg button:hover { color: var(--pd-text); }
.pd-seg button.on {
  background: var(--pd-bg-surface);
  color: var(--pd-text);
  box-shadow: var(--pd-shadow-xs);
}
.pd-seg button:focus-visible { outline: none; box-shadow: var(--pd-focus-ring); }

.pd-chip {
  display: inline-flex;
  align-items: center;
  height: var(--pd-chip-h);
  padding: 0 6px;
  border-radius: var(--pd-radius-xs);
  font: var(--pd-weight-medium) var(--pd-text-2xs)/var(--pd-lh-2xs) var(--pd-font-sans);
  background: var(--pd-gray-100);
  color: var(--pd-text-secondary);
}
.pd-chip--succ { background: var(--pd-success-bg); color: var(--pd-success-fg); }
.pd-chip--warn { background: var(--pd-warning-bg); color: var(--pd-warning-fg); }
.pd-chip--dang { background: var(--pd-danger-bg); color: var(--pd-danger-fg); }
.pd-chip--info { background: var(--pd-info-bg); color: var(--pd-info-fg); }
.pd-chip--x { height: 24px; padding-right: 2px; gap: 2px; }
.pd-chip--x button {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pd-chip--x button svg { width: 12px; height: 12px; }
.pd-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--pd-radius-full);
  background: var(--pd-gray-100);
  color: var(--pd-text-secondary);
  font: var(--pd-weight-medium) var(--pd-text-2xs)/var(--pd-lh-2xs) var(--pd-font-sans);
}
.pd-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--pd-gray-300); }
.pd-status--succ { background: var(--pd-success-bg); color: var(--pd-success-fg); }
.pd-status--succ i { background: var(--pd-success-fg); }
.pd-status--warn { background: var(--pd-warning-bg); color: var(--pd-warning-fg); }
.pd-status--warn i { background: var(--pd-warning-fg); }
.pd-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--pd-gray-300); }
.pd-dot--ok { background: var(--pd-success-fg); }
.pd-dot--warn { background: var(--pd-warning-fg); }
.pd-dot--bad { background: var(--pd-danger-fg); }
.pd-avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--pd-text-on-primary);
  font-weight: var(--pd-weight-semibold);
  font-size: var(--pd-text-2xs);
  line-height: 1;
}
.pd-avatar.is-20 { width: 20px; height: 20px; }
.pd-avatar.is-24 { width: 24px; height: 24px; }
.pd-avatar.is-28 { width: 28px; height: 28px; font-size: var(--pd-text-xs); }
.pd-avatar.is-32 { width: 32px; height: 32px; font-size: var(--pd-text-xs); }
.pd-avatar.is-pending { background: var(--pd-gray-100); color: var(--pd-text-secondary); }
.pd-avatar.is-co { background: var(--pd-gray-100); color: var(--pd-text); border: 1px dashed var(--pd-border-strong); }
.pd-avatar svg { width: 14px; height: 14px; }
.pd-field-help { display: block; margin-top: 4px; font-size: var(--pd-text-xs); line-height: var(--pd-lh-xs); color: var(--pd-text-secondary); }
.pd-field-help.is-error { color: var(--pd-danger-fg); }
.pd-tab-n {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--pd-radius-full);
  background: var(--pd-gray-100);
  color: var(--pd-text-secondary);
  font-size: var(--pd-text-2xs);
  line-height: 16px;
  text-align: center;
}
.pd-tip {
  position: fixed;
  z-index: var(--pd-z-tooltip);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  padding: 6px 8px;
  border-radius: var(--pd-radius-sm);
  background: var(--pd-gray-900);
  color: var(--pd-text-on-primary);
  font: var(--pd-weight-regular) var(--pd-text-xs)/var(--pd-lh-xs) var(--pd-font-sans);
  pointer-events: none;
}
.pd-tip[hidden] { display: none; }
.pd-tip.is-inline { position: static; }
.pd-tip kbd {
  font-family: var(--pd-font-mono);
  font-size: 11px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
}
.pd-cap { margin: 0; color: var(--pd-text-tertiary); font-size: var(--pd-text-xs); line-height: var(--pd-lh-xs); }
.pd-showcase .cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pd-matrix {
  display: grid;
  grid-template-columns: 88px repeat(6, max-content);
  gap: 8px 10px;
  align-items: center;
  font-size: var(--pd-text-xs);
  color: var(--pd-text-secondary);
}
.pd-seg button.is-hover { color: var(--pd-text); }
.pd-seg button:disabled { opacity: .5; cursor: not-allowed; }

.pd-empty {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 16px 10vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.pd-empty__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--pd-gray-100);
  color: var(--pd-text-tertiary);
  display: grid;
  place-items: center;
}
.pd-empty__icon svg { width: 40px; height: 40px; }
.pd-empty h1 {
  margin: 0;
  color: var(--pd-text);
  font-size: var(--pd-text-lg);
  line-height: var(--pd-lh-lg);
  font-weight: var(--pd-weight-semibold);
}
.pd-empty p {
  margin: -12px 0 0;
  color: var(--pd-text-secondary);
  font-size: var(--pd-text-sm);
  line-height: var(--pd-lh-sm);
}

.pd-check, .pd-switch { display: inline-flex; align-items: center; gap: 8px; }
.pd-check input, .pd-switch input { appearance: none; margin: 0; }
.pd-check input {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--pd-border-strong);
  border-radius: var(--pd-radius-xs);
  background: var(--pd-bg-surface);
}
.pd-check input:checked {
  background: var(--pd-primary-600);
  border-color: var(--pd-primary-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}
.pd-switch input {
  width: 28px;
  height: 16px;
  border-radius: var(--pd-radius-full);
  background: var(--pd-gray-300);
  position: relative;
}
.pd-switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pd-gray-0);
}
.pd-switch input:checked { background: var(--pd-primary-600); }
.pd-switch input:checked::after { left: 14px; }

.pd-showcase { padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 28px; }
.pd-showcase h2 { margin: 0 0 8px; }
.pd-showcase .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ostov-dialog-card.is-m { width: min(560px, 100%); }
.ostov-dialog-card.is-l { width: min(720px, 100%); }

.works-tabs {
  display: inline-flex;
  height: var(--pd-control-md);
  padding: 2px;
  background: var(--pd-gray-100);
  border-radius: var(--pd-radius-sm);
  gap: 0;
}
.works-tabs .ghost {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  box-shadow: none;
  background: transparent;
  border-radius: var(--pd-radius-xs);
  font-size: var(--pd-text-xs);
  line-height: var(--pd-lh-xs);
}
.works-tabs .ghost.on {
  background: var(--pd-bg-surface);
  color: var(--pd-text);
  box-shadow: var(--pd-shadow-xs);
}
