/**
 * Wizard üst bar — stepper + özet şeridi
 */

.case-readonly-banner {
  margin: 0;
  padding: var(--space-2) var(--space-5);
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border-bottom: 1px solid var(--color-warning-border);
}

.case-workspace--readonly [data-action="upload-slot"],
.case-workspace--readonly [data-action="replace-slot-document"],
.case-workspace--readonly [data-action="clear-slot-document"],
.case-workspace--readonly [data-action="add-optional-slot"],
.case-workspace--readonly [data-action="add-custom-slot"],
.case-workspace--readonly [data-action="submit-evrim"],
.case-workspace--readonly [data-action="submit-tobb"],
.case-workspace--readonly .case-doc-slot-file-input {
  display: none !important;
}

.case-workspace--readonly [data-action="gtip-tariff-batch"],
.case-workspace--readonly [data-action="gtip-refresh-gv"],
.case-workspace--readonly [data-action="gtip-export-legislation"],
.case-workspace--readonly [data-action="gtip-discover"],
.case-workspace--readonly [data-action="add-product-line"],
.case-workspace--readonly [data-action="delete-product-line"],
.case-workspace--readonly [data-action="gtip-tax-edit"],
.case-workspace--readonly [data-action="gtip-tax-approve"],
.case-workspace--readonly [data-action="gtip-tax-cancel"],
.case-workspace--readonly [data-action="gtip-tax-revoke"],
.case-workspace--readonly [data-action="gtip-gv-approve"],
.case-workspace--readonly [data-action="gtip-gv-revoke"],
.case-workspace--readonly [data-action="gtip-gv-reset"],
.case-workspace--readonly [data-action="gtip-apply-gv-suggestion"],
.case-workspace--readonly [data-action="gtip-select-alt"] {
  pointer-events: none;
  opacity: 0.55;
  cursor: not-allowed;
}

.case-workspace--readonly .declaration-editor input,
.case-workspace--readonly .declaration-editor textarea,
.case-workspace--readonly .declaration-editor select,
.case-workspace--readonly .case-operator input,
.case-workspace--readonly .case-operator textarea,
.case-workspace--readonly .case-operator select,
.case-workspace--readonly .case-operator .new-case-picker-field,
.case-workspace--readonly .case-operator [data-action="operator-open-fx-modal"],
.case-workspace--readonly .case-operator [data-action="open-kbf-form"] {
  pointer-events: none;
  opacity: 0.85;
}

.case-wizard-header {
  flex-shrink: 0;
  background: var(--color-workspace);
  border-bottom: 1px solid var(--color-border-light);
}

.case-wizard-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5) var(--space-4);
}

.case-wizard-stepper {
  flex: 1;
  min-width: 0;
}

.case-wizard-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.case-workspace-repeat,
.case-workspace-assign,
.case-workspace-share,
.case-workspace .case-workspace-close {
  min-height: 2.25rem;
  border-radius: var(--radius-md);
  font-size: var(--fs-12);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.case-workspace-repeat {
  padding: 0 var(--space-3);
  border: 1px dashed light-dark(#94a3b8, var(--color-border-strong));
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.case-workspace-assign,
.case-workspace-share {
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
}

.case-workspace-assign:hover,
.case-workspace-share:hover {
  border-color: light-dark(#94a3b8, var(--color-border-strong));
  background: var(--color-surface-muted);
}

.case-workspace-repeat:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.case-workspace .case-workspace-close {
  width: auto;
  gap: var(--space-1-5);
  padding: 0 var(--space-3);
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}

.case-workspace .case-workspace-close:hover {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
}

.case-wizard-steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.case-wizard-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  text-align: center;
}

.case-wizard-step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
}

.case-wizard-step-btn:hover:not(:disabled) .case-wizard-step-label {
  color: light-dark(var(--color-brand-hover), var(--color-cyan-text));
}

.case-wizard-step-btn:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

.case-wizard-step-btn:disabled {
  cursor: default;
}

.case-wizard-step--locked .case-wizard-step-btn {
  cursor: not-allowed;
}

.case-wizard-step-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: var(--fs-13);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  flex-shrink: 0;
  z-index: 1;
}

.case-wizard-step-marker--done {
  background: var(--color-success-solid);
  color: var(--color-on-brand);
}

.case-wizard-step-marker--done svg {
  width: 1rem;
  height: 1rem;
}

.case-wizard-step-marker--active {
  background: var(--color-action-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.case-wizard-step-marker--pending {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-light);
}

.case-wizard-step-label {
  margin-top: var(--space-2);
  font-size: var(--fs-12);
  line-height: 1.25;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  max-width: 7rem;
}

.case-wizard-step--active .case-wizard-step-label {
  color: light-dark(var(--color-brand-primary), var(--color-info-text));
  font-weight: var(--font-weight-semibold);
}

.case-wizard-step--done .case-wizard-step-label {
  color: var(--color-text-muted);
}

.case-wizard-step-connector {
  position: absolute;
  top: 1rem;
  left: calc(50% + 1rem);
  width: calc(100% - 2rem);
  height: 2px;
  transform: translateY(-50%);
  z-index: 0;
}

.case-wizard-step-connector--done {
  background: #22c55e;
}

.case-wizard-step-connector--active {
  background: linear-gradient(90deg, var(--color-action-primary) 0%, var(--color-surface-muted) 100%);
}

.case-wizard-step-connector--pending {
  background: var(--color-surface-muted);
}

.case-wizard-summary {
  display: flex;
  flex-wrap: wrap; /* a narrow workspace puts the facts on a second row instead of scrolling sideways */
  row-gap: var(--space-3);
  align-items: stretch;
  margin: 0 var(--space-5) var(--space-4);
  padding: var(--space-4) 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.case-wizard-summary-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
  padding: 0 var(--space-4);
  min-width: 7.5rem;
  flex: 1 0 auto;
}

.case-wizard-summary-label {
  font-size: var(--fs-12);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.case-wizard-summary-value {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  font-size: var(--fs-13);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  line-height: 1.3;
  white-space: nowrap;
}

.case-wizard-summary-value--transport {
  color: light-dark(var(--color-brand-primary), var(--color-info-text));
}

.case-wizard-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.case-wizard-summary-icon svg {
  width: 100%;
  height: 100%;
}

.case-wizard-summary-icon--transport {
  color: light-dark(var(--color-brand-primary), var(--color-info-text));
}

.case-wizard-summary-icon--transport .new-case-transport-img {
  opacity: var(--icon-active-opacity);
}

.case-wizard-summary-icon--transport svg {
  width: 1.125rem;
  height: 1.125rem;
}

.case-wizard-summary-divider {
  align-self: stretch;
  width: 1px;
  background: var(--color-border-light);
  flex-shrink: 0;
}

.case-workspace .case-workspace-close {
  flex-shrink: 0;
}

.case-workspace .case-detail-header,
.case-workspace .case-detail-tabs {
  display: none;
}

.case-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-shrink: 0;
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

.case-wizard-nav-secondary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  min-width: 0;
}

.case-wizard-nav-country-groups {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  min-height: 2.5rem;
}

.case-wizard-nav-country-groups-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  color: var(--color-text-muted);
}

.case-wizard-nav-country-groups-icon svg {
  width: 100%;
  height: 100%;
}

.case-wizard-nav-mevzuat {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  min-height: 2.5rem;
  border: none;
  border-radius: var(--radius-md, 8px);
  background: #c62828;
  color: #fff;
  font-weight: var(--fw-semibold);
  padding: 0 var(--space-3);
  cursor: pointer;
}

.case-wizard-nav-mevzuat:hover {
  background: #b71c1c;
}

.case-wizard-nav-mevzuat:focus-visible {
  outline: 2px solid var(--color-danger-border);
  outline-offset: 2px;
}

.case-wizard-nav-mevzuat-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  color: inherit;
}

.case-wizard-nav-mevzuat-icon svg {
  width: 100%;
  height: 100%;
}

.case-wizard-nav-tps {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  min-height: 2.5rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface-muted);
  color: var(--color-text-primary);
  font-weight: var(--fw-semibold);
  padding: 0 var(--space-3);
  cursor: pointer;
}

.case-wizard-nav-tps:hover {
  background: var(--color-info-bg);
}

.case-wizard-nav-tps:focus-visible {
  outline: 2px solid light-dark(#94a3b8, var(--color-border-strong));
  outline-offset: 2px;
}

.case-wizard-nav-tps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  background: #0f172a;
  color: #fff;
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  line-height: 1;
}

.case-wizard-nav-tps-badge--pending {
  background: var(--color-action-primary);
  min-width: 1.35rem;
}

/* Something needs attention / every needed document has an application (same tones as the React badge). */
.case-wizard-nav-tps-badge--attention {
  color: var(--color-danger-text);
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
}

.case-wizard-nav-tps-badge--done {
  color: var(--color-success-text);
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
}

.case-decl-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.case-wizard-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-left: auto;
  flex-shrink: 0;
}

.case-wizard-nav-prev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3.25rem;
  padding: 0 var(--space-6);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: var(--fs-16);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.case-wizard-nav-prev:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

.case-wizard-nav-prev:active {
  background: var(--color-surface-muted);
}

.case-wizard-nav-prev-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
}

.case-wizard-nav-prev-icon svg {
  width: 100%;
  height: 100%;
}

.case-wizard-nav-next {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3.25rem;
  padding: 0 var(--space-8);
  border: none;
  border-radius: var(--radius-lg);
  background: var(--color-action-primary);
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-16);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  transition: background 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.case-wizard-nav-next:hover {
  background: var(--color-action-hover);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.34);
}

.case-wizard-nav-next:active {
  transform: translateY(1px);
}

.case-wizard-nav-next-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
}

.case-wizard-nav-next-icon svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  .case-wizard-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .case-wizard-nav-actions {
    width: 100%;
    margin-left: 0;
    flex-direction: column-reverse;
  }

  .case-wizard-nav-prev,
  .case-wizard-nav-next {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .case-wizard-step-label {
    font-size: var(--fs-12);
    max-width: 4.25rem;
  }

  .case-wizard-summary-item {
    min-width: 6.5rem;
    padding: 0 var(--space-3);
  }
}

@media (max-width: 900px) {
  .case-wizard-header-top {
    flex-wrap: wrap;
  }

  .case-wizard-stepper {
    order: 1;
    width: 100%;
  }

  .case-wizard-header-actions {
    order: 0;
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .case-workspace-repeat,
  .case-workspace .case-workspace-close {
    padding-inline: var(--space-2);
    font-size: var(--fs-12);
  }
}

/* ── Paylaşılan kullanıcı listesi (unshare) ──────────────────────── */

.case-shared-section {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  flex-wrap: wrap;
}

.case-shared-label {
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.case-shared-users {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.case-shared-user {
  display: inline-flex;
  align-items: center;
  gap: var(--space-0-5);
  padding: var(--space-0-5) var(--space-1);
  padding-right: var(--space-0-5);
  background: var(--color-surface-muted);
  border-radius: var(--radius-xs);
  font-size: var(--fs-12);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.case-shared-user-name {
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-unshare-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.12s, background 0.12s;
}

.case-unshare-btn:hover {
  color: var(--color-danger-text);
  background: var(--color-danger-bg);
}

.case-unshare-btn svg {
  width: 0.75rem;
  height: 0.75rem;
}

.case-unshare-self-btn {
  font-size: var(--fs-12) !important;
  padding: var(--space-0-5) var(--space-2) !important;
  border-color: var(--color-danger-border) !important;
  color: var(--color-danger-text) !important;
  white-space: nowrap;
}

.case-unshare-self-btn:hover {
  background: var(--color-danger-bg) !important;
  border-color: light-dark(#f87171, var(--color-danger-border)) !important;
  color: var(--color-danger-text) !important;
}

.case-shared-section--manager {
  gap: var(--space-2);
}

.case-share-flow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  max-width: 18rem;
}

.case-share-from,
.case-share-to {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 7.5rem;
}

.case-share-arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.case-unshare-all-btn {
  font-size: var(--fs-12) !important;
  padding: var(--space-0-5) var(--space-2) !important;
  border: 1px solid var(--color-danger-border) !important;
  background: var(--color-surface) !important;
  color: var(--color-danger-text) !important;
  white-space: nowrap;
}

.case-unshare-all-btn:hover {
  background: var(--color-danger-bg) !important;
  border-color: light-dark(#f87171, var(--color-danger-border)) !important;
  color: var(--color-danger-text) !important;
}

/* Belge değişti, GTİP kararı bekleniyor (ithalat): her sekmede, sarı uyarı şeridi + karar düğmesi */
.case-gtip-decision-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.case-gtip-decision-banner-btn {
  flex-shrink: 0;
}

/* Kalem bazında GTİP kararı penceresi (belge değişti, gölge arama sonucu) */
.gtip-decision-dialog {
  width: min(640px, 100%);
}

.gtip-decision-dialog .scop-app-dialog-body {
  padding-left: var(--space-5);
}

.gtip-decision-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.gtip-decision-row {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
}

.gtip-decision-row[data-required="true"] {
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}

.gtip-decision-row-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.gtip-decision-desc {
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
}

.gtip-decision-kind {
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
  color: var(--color-text-secondary);
}

.gtip-decision-codes {
  margin-top: var(--space-1);
  font-size: var(--fs-13);
  color: var(--color-text-secondary);
}

.gtip-decision-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
  font-size: var(--fs-13);
  color: var(--color-text-primary);
}

.gtip-decision-option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  cursor: pointer;
}

.gtip-decision-error {
  margin: var(--space-3) 0 0;
  font-size: var(--fs-13);
  color: var(--color-danger-text);
}
