/* SCOP — TPS Geçmişi workspace */

.tps-hist-workspace {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.4rem 1.15rem 1.25rem;
  min-height: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

.tps-hist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tps-hist-breadcrumb {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text-secondary, #64748b);
}

.tps-hist-breadcrumb span {
  margin: 0 0.25rem;
  opacity: 0.7;
}

.tps-hist-heading h1 {
  margin: 0.1rem 0 0;
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.2;
  color: var(--text-primary, #0f172a);
}

.tps-hist-heading p {
  margin: 0.15rem 0 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.86rem;
  line-height: 1.3;
  max-width: 42rem;
}

.tps-hist-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tps-hist-stub-btn,
.tps-hist-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tps-hist-stub-btn svg,
.tps-hist-filter-btn svg,
.tps-hist-eye svg,
.tps-hist-info svg,
.tps-hist-search-icon svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.tps-hist-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tps-hist-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.tps-hist-select {
  min-height: 2.4rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  background: #fff;
  color: var(--text-primary, #0f172a);
  font-size: 0.88rem;
  min-width: 0;
  flex: 1 1 10rem;
}

.tps-hist-date-btn {
  flex: 1 1 14rem;
  justify-content: flex-start;
  min-width: 0;
  min-height: 2.4rem;
  text-align: left;
}

.tps-hist-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  background: #fff;
}

.tps-hist-search-icon {
  color: #94a3b8;
  display: inline-flex;
}

.tps-hist-search {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--text-primary, #0f172a);
  min-width: 0;
}

.tps-hist-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 0.85rem;
  align-items: start;
  min-width: 0;
}

@media (max-width: 1280px) {
  .tps-hist-main {
    grid-template-columns: 1fr;
  }
}

.tps-hist-list-card,
.tps-hist-panel {
  background: #fff;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.tps-hist-list-head,
.tps-hist-panel {
  padding: 0.9rem 1rem;
}

.tps-hist-list-head h2,
.tps-hist-panel h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text-primary, #0f172a);
}

.tps-hist-table-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  min-width: 0;
}

.tps-hist-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.8rem;
}

.tps-hist-table th,
.tps-hist-table td {
  padding: 0.5rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  overflow: hidden;
}

.tps-hist-table th {
  font-size: 0.68rem;
  font-weight: 650;
  color: #64748b;
  background: #f8fafc;
  white-space: normal;
  line-height: 1.25;
}

.tps-hist-table tbody tr:hover td {
  background: #f8fafc;
}

.tps-hist-table th:nth-child(1),
.tps-hist-table td:nth-child(1) {
  width: 12%;
}

.tps-hist-table th:nth-child(2),
.tps-hist-table td:nth-child(2) {
  width: 12%;
}

.tps-hist-table th:nth-child(3),
.tps-hist-table td:nth-child(3) {
  width: 20%;
}

.tps-hist-table th:nth-child(4),
.tps-hist-table td:nth-child(4) {
  width: 20%;
}

.tps-hist-table th:nth-child(5),
.tps-hist-table td:nth-child(5) {
  width: 14%;
}

.tps-hist-table th:nth-child(6),
.tps-hist-table td:nth-child(6) {
  width: 14%;
}

.tps-hist-table th:nth-child(7),
.tps-hist-table td:nth-child(7) {
  width: 8%;
}

.tps-hist-datetime,
.tps-hist-inst,
.tps-hist-ref {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.tps-hist-date,
.tps-hist-inst-name,
.tps-hist-tps-no {
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  line-height: 1.25;
}

.tps-hist-time,
.tps-hist-inst-doc,
.tps-hist-ref-no {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.25;
}

.tps-hist-inst-name,
.tps-hist-inst-doc,
.tps-hist-tps-no,
.tps-hist-ref-no,
.tps-hist-file,
.tps-hist-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tps-hist-empty-cell {
  text-align: center;
  color: #64748b;
  padding: 2rem 1rem !important;
}

.tps-hist-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tps-hist-badge--success {
  background: #dcfce7;
  color: #166534;
}

.tps-hist-badge--danger {
  background: #ffe4e6;
  color: #be123c;
}

.tps-hist-badge--warning {
  background: #ffedd5;
  color: #c2410c;
}

.tps-hist-badge--info {
  background: #dbeafe;
  color: #1d4ed8;
}

.tps-hist-badge--muted {
  background: #f1f5f9;
  color: #475569;
}

.tps-hist-actions-cell {
  text-align: center;
}

.tps-hist-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 7px;
  background: #eff6ff;
  color: #2563eb;
  cursor: pointer;
}

.tps-hist-eye:hover {
  background: #dbeafe;
}

@media (max-width: 900px) {
  .tps-hist-table thead {
    display: none;
  }

  .tps-hist-table,
  .tps-hist-table tbody,
  .tps-hist-table tr,
  .tps-hist-table td {
    display: block;
    width: 100% !important;
  }

  .tps-hist-table tbody {
    padding: 0.5rem;
  }

  .tps-hist-table tr.tps-hist-row {
    margin-bottom: 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
  }

  .tps-hist-table tbody tr:hover td {
    background: transparent;
  }

  .tps-hist-table td {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid #f1f5f9;
  }

  .tps-hist-table td:last-child {
    border-bottom: none;
  }

  .tps-hist-table td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 650;
    color: #64748b;
  }

  .tps-hist-actions-cell {
    text-align: left;
  }

  .tps-hist-inst-name,
  .tps-hist-inst-doc,
  .tps-hist-tps-no,
  .tps-hist-ref-no,
  .tps-hist-file,
  .tps-hist-table td:nth-child(2) {
    white-space: normal;
  }
}

.tps-hist-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem 1rem;
}

.tps-hist-page-meta {
  font-size: 0.82rem;
  color: #64748b;
}

.tps-hist-page-btns {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.tps-hist-page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  cursor: pointer;
}

.tps-hist-page-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 650;
}

.tps-hist-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tps-hist-page-ellipsis {
  color: #94a3b8;
  padding: 0 0.2rem;
}

.tps-hist-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tps-hist-placeholder {
  margin-top: 0.75rem;
  min-height: 140px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.86rem;
}

.tps-hist-placeholder p {
  margin: 0;
}

.tps-hist-bars {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.tps-hist-bar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

.tps-hist-bar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.tps-hist-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tps-hist-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.tps-hist-bar-meta {
  font-size: 0.75rem;
  color: #64748b;
}

.tps-hist-avg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.tps-hist-avg-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  text-align: center;
}

.tps-hist-avg-label {
  font-size: 0.7rem;
  color: #64748b;
}

.tps-hist-avg-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.tps-hist-avg-delta {
  font-size: 0.72rem;
  font-weight: 600;
}

.tps-hist-avg-delta--down {
  color: #16a34a;
}

.tps-hist-avg-delta--up {
  color: #dc2626;
}

.tps-hist-avg-delta--flat {
  color: #64748b;
}

.tps-hist-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tps-hist-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.85rem;
  border: 1px solid #bfdbfe;
}

.tps-hist-row {
  cursor: pointer;
}

.tps-hist-row:focus {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}

/* —— İş akışı detay —— */

.tps-flow-workspace {
  gap: 1.1rem;
  padding: 1.15rem 1.5rem 1.75rem;
  min-width: 0;
  overflow-x: hidden;
}

.tps-flow-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.tps-flow-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}

.tps-flow-close:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

.tps-flow-close svg {
  width: 1rem;
  height: 1rem;
}

.tps-flow-stepper {
  list-style: none;
  margin: 0;
  padding: 1.55rem 1rem 1.45rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  background: #fff;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  min-height: 7.25rem;
}

.tps-flow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
  padding: 0 0.35rem;
}

.tps-flow-step:not(:first-child)::before,
.tps-flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.15rem;
  height: 2px;
  background: #e2e8f0;
  pointer-events: none;
}

.tps-flow-step:not(:first-child)::before {
  left: 0;
  right: calc(50% + 1.3rem);
}

.tps-flow-step:not(:last-child)::after {
  left: calc(50% + 1.3rem);
  right: 0;
}

.tps-flow-step--completed:not(:last-child)::after,
.tps-flow-step--completed:not(:first-child)::before,
.tps-flow-step--current:not(:first-child)::before {
  background: #86efac;
}

.tps-flow-step-node {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  border: 2px solid #cbd5e1;
  background: #fff;
  color: #64748b;
  z-index: 1;
  flex-shrink: 0;
}

.tps-flow-step-node svg {
  width: 1rem;
  height: 1rem;
}

.tps-flow-step--completed .tps-flow-step-node {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.tps-flow-step--current .tps-flow-step-node {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.tps-flow-step-body {
  min-width: 0;
  width: 100%;
}

.tps-flow-step-title {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tps-flow-step-meta {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .tps-flow-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 0.4rem;
  }

  .tps-flow-step::before,
  .tps-flow-step::after {
    display: none;
  }
}

.tps-flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

@media (max-width: 1100px) {
  .tps-flow-grid {
    grid-template-columns: 1fr;
  }
}

.tps-flow-card {
  background: #fff;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 1.1rem 1.15rem 1.15rem;
  min-width: 0;
}

.tps-flow-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.tps-flow-card-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: #0f172a;
}

.tps-flow-card-icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tps-flow-card-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.tps-flow-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 2rem;
}

@media (max-width: 700px) {
  .tps-flow-kv-grid {
    grid-template-columns: 1fr;
  }
}

.tps-flow-kv-col {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tps-flow-field dt {
  margin: 0;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.tps-flow-field dd {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  color: #0f172a;
  line-height: 1.35;
}

.tps-flow-strong {
  font-weight: 650;
}

.tps-flow-sub {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.tps-flow-copy-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  position: relative;
  padding-right: 1.6rem;
}

.tps-flow-copy-wrap .tps-flow-icon-btn {
  position: absolute;
  top: 0;
  right: 0;
}

.tps-flow-link {
  border: none;
  background: none;
  padding: 0;
  color: #2563eb;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.tps-flow-link:hover {
  text-decoration: underline;
}

.tps-flow-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.tps-flow-icon-btn:hover {
  background: #f1f5f9;
  color: #2563eb;
}

.tps-flow-icon-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

.tps-flow-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tps-flow-tl-item {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}

.tps-flow-tl-item:last-child {
  border-bottom: none;
}

.tps-flow-tl-dot {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #fff;
  margin-top: 0.1rem;
}

.tps-flow-tl-dot svg {
  width: 0.75rem;
  height: 0.75rem;
}

.tps-flow-tl-item--completed .tps-flow-tl-dot {
  background: #16a34a;
}

.tps-flow-tl-item--current .tps-flow-tl-dot {
  background: #2563eb;
}

.tps-flow-tl-title {
  font-size: 0.86rem;
  font-weight: 650;
  color: #0f172a;
}

.tps-flow-tl-desc {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
}

.tps-flow-tl-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}

.tps-flow-doc-table-wrap {
  overflow: hidden;
  min-width: 0;
}

.tps-flow-doc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.82rem;
}

.tps-flow-doc-table th,
.tps-flow-doc-table td {
  padding: 0.55rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.tps-flow-doc-table th {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 650;
}

.tps-flow-doc-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: #0f172a;
  min-width: 0;
  max-width: 100%;
}

.tps-flow-doc-icon {
  width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
}

.tps-flow-doc-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.tps-flow-doc-actions {
  white-space: nowrap;
}

.tps-flow-doc-footer {
  margin-top: 0.75rem;
}

.tps-flow-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.86rem;
  line-height: 1.4;
}

.tps-flow-banner svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

