﻿.tlk-page {
  --tlk-track: #dce5f5;
  --tlk-progress-start: #ef4444;
  --tlk-progress-mid: #f59e0b;
  --tlk-progress-end: #22c55e;
  --tlk-glow: rgba(34, 197, 94, 0.25);

  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 100%;
  overflow-x: hidden;
}

.tlk-page,
.tlk-page * {
  box-sizing: border-box;
}

.tlk-shell {
  border-radius: 18px;
  border: 1px solid #d9e2ec;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tlk-shell-head {
  padding: 2px 2px 16px;
}

.tlk-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.tlk-subtitle {
  margin: 0;
  color: #4a5f55;
  font-size: 14px;
}

.tlk-top-grid {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.tlk-upload-card {
  width: min(50%, 980px);
}

.tlk-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  overflow-x: hidden;
}

.tlk-card-main {
  border-color: #d8e4ff;
  background: linear-gradient(180deg, #fafdff 0%, #eef4ff 100%);
}

.tlk-card-history {
  border-color: #d5e9dd;
  background: linear-gradient(180deg, #f9fffb 0%, #effaf3 100%);
}

.tlk-history-toggle-card {
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.tlk-history-open-btn {
  height: 100%;
  min-height: 96px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

.tlk-history-open-btn i {
  width: 22px;
  height: 22px;
}

.tlk-history-open-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.tlk-upload-head {
  margin-bottom: 16px;
}

.tlk-label {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tlk-file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tlk-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tlk-btn {
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: #fff;
  color: #111;
  border-radius: 11px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

.tlk-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(15, 23, 42, 0.12);
}

.tlk-btn:active {
  transform: translateY(0);
}

.tlk-btn-primary {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border-color: #16a34a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.22);
}

.tlk-btn-upload {
  border-color: #2563eb;
  color: #ffffff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 9px 18px rgba(37, 99, 235, 0.24);
}

.tlk-btn-upload,
.tlk-btn-primary {
  min-height: 42px;
  height: 42px;
  font-size: 14px;
  line-height: 1;
  width: 152px;
  min-width: 152px;
  justify-content: center;
}

.tlk-btn-history {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
}

.tlk-btn-history i {
  width: 12px;
  height: 12px;
}

.tlk-btn-lead-manage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #d0d7e4;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
}

.tlk-btn-lead-manage i {
  width: 13px;
  height: 13px;
}

.tlk-file-name {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.tlk-upload-row-actions {
  margin-top: 16px;
}

.tlk-upload-row-actions .tlk-btn-primary {
  margin-left: 0;
}

.tlk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.tlk-status {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.tlk-status.is-error {
  color: #b91c1c;
}

.tlk-btn:disabled,
.tlk-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tlk-progress-wrap {
  margin-top: 12px;
}

.tlk-progress {
  width: 100%;
}

.tlk-progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--tlk-track);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.14);
}

.tlk-progress-bar {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background-image: linear-gradient(
    90deg,
    #dc2626 0%,
    #ef4444 10%,
    #f97316 24%,
    #f59e0b 38%,
    #facc15 52%,
    #84cc16 68%,
    #22c55e 82%,
    #16a34a 100%
  );
  background-size: calc(10000% / var(--tlk-progress-percent, 100)) 100%;
  background-position: left top;
  background-repeat: no-repeat;
  box-shadow: 0 0 16px var(--tlk-glow);
  transition:
    width 0.25s ease,
    background-size 0.24s ease,
    box-shadow 0.24s ease;
}

.tlk-progress-bar.is-success {
  position: relative;
  overflow: hidden;
  background-image: none;
  background-color: #22c55e;
  box-shadow:
    0 0 22px rgba(34, 197, 94, 0.52),
    0 0 38px rgba(34, 197, 94, 0.3),
    0 0 54px rgba(134, 239, 172, 0.22);
  animation: tlk-progress-success-pulse 0.95s ease-in-out infinite;
  will-change: transform, filter, box-shadow, background-color;
}

.tlk-progress-bar.is-success::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #86efac;
  opacity: 0.1;
  animation: tlk-progress-success-overlay 0.95s ease-in-out infinite;
  pointer-events: none;
}

.tlk-progress-text {
  margin-top: 8px;
  font-size: 13px;
  color: #2f4a3d;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tlk-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: tlk-spin 0.8s linear infinite;
}

.tlk-history-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tlk-history-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tlk-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.tlk-history-title,
.tlk-result-title {
  font-size: 18px;
}

.tlk-history-controls-row {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(260px, 1fr);
  gap: 8px;
  align-items: start;
}

#tlkHistorySearch {
  align-self: start;
}

.tlk-input {
  min-height: 42px;
  border: 2px solid #c4d4ea;
  border-radius: 12px;
  padding: 9px 11px;
  background: #fff;
  color: #111;
  min-width: 0;
  max-width: 100%;
  box-shadow: 0 3px 10px rgba(30, 64, 175, 0.08);
}

.tlk-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  outline: none;
}

.tlk-date {
  min-width: 150px;
}

.tlk-date-picker {
  position: relative;
  min-width: 0;
}

.tlk-date-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  font-weight: 700;
}

.tlk-date-btn i {
  width: 18px;
  height: 18px;
  color: #1d4ed8;
  flex: 0 0 auto;
}

.tlk-calendar {
  position: static;
  margin-top: 8px;
  width: min(360px, 100%);
  border: 1px solid #c8d8ee;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
  z-index: 40;
  padding: 10px;
}

.tlk-calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.tlk-cal-month {
  text-align: center;
  font-size: 13px;
  color: #0f172a;
}

.tlk-cal-nav {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  border-radius: 10px;
  height: 32px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.tlk-cal-nav:hover {
  background: #eef2ff;
  border-color: #bcd0f8;
}

.tlk-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}

.tlk-cal-weekdays span {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-align: center;
  padding: 2px 0;
}

.tlk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.tlk-cal-empty {
  height: 34px;
}

.tlk-cal-day {
  border: 1px solid #d7e1f0;
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  min-height: 34px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tlk-cal-day:hover {
  background: #f0f9ff;
  border-color: #93c5fd;
}

.tlk-cal-day.is-has-runs {
  background: #e8fbe8;
  border-color: #86efac;
  color: #166534;
}

.tlk-cal-day.is-today {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.tlk-cal-day.is-selected {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.tlk-history-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tlk-empty {
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #475569;
  font-weight: 600;
  padding: 12px;
}

.tlk-result-card {
  border-color: #d9e2ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.tlk-result-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.tlk-btn-rollback {
  border-color: #f1b8bf;
  background: linear-gradient(180deg, #fff5f6 0%, #ffe4e7 100%);
  color: #9f1239;
  font-weight: 800;
  padding: 8px 12px;
}

.tlk-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.tlk-summary-item {
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #dbe5f0;
  background: linear-gradient(180deg, #ffffff 0%, #edf4fb 100%);
}

.tlk-summary-label {
  font-size: 12px;
  color: #516070;
  font-weight: 700;
}

.tlk-summary-value {
  font-size: 22px;
  font-weight: 800;
  margin-top: 2px;
  color: #0f172a;
}

.tlk-table-head {
  margin-bottom: 8px;
}

.tlk-search-input {
  width: min(520px, 100%);
}

.tlk-result-table-wrap {
  border-radius: 12px;
  border: 1px solid #d5e0ef;
  background: #fff;
  overflow: auto;
}

.tlk-result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  table-layout: fixed;
}

.tlk-result-table thead th {
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  background: #f1f6fd;
  border-bottom: 2px solid #c9d7ea;
  border-right: 2px solid #d3dfef;
  padding: 10px;
}

.tlk-result-table thead th:last-child {
  border-right: none;
}

.tlk-result-table th:nth-child(1),
.tlk-result-table td:nth-child(1) {
  width: 40%;
}

.tlk-result-table th:nth-child(2),
.tlk-result-table td:nth-child(2) {
  width: 40%;
}

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

.tlk-result-table tbody td {
  padding: 10px;
  border-bottom: 2px solid #e1e9f4;
  border-right: 2px solid #e1e9f4;
  vertical-align: top;
  font-size: 13px;
  color: #0f172a;
  text-align: center;
}

.tlk-result-table tbody tr:last-child td {
  border-bottom: none;
}

.tlk-result-table tbody td:last-child {
  border-right: none;
}

.tlk-cell-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.tlk-col-phase1 {
  background: #f6f9ff;
  border: 1px solid #c8d8ff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 5px 8px;
  font-weight: 700;
  display: inline-block;
}

.tlk-col-phase1.tlk-chip-match {
  background: #0b4ed8;
  border-color: #0b4ed8;
  color: #ffffff;
}

.tlk-col-phase2 {
  background: #edfdf3;
  border: 1px solid #b9e3c8;
  color: #166534;
  border-radius: 8px;
  padding: 5px 8px;
  font-weight: 700;
  display: inline-block;
}

.tlk-col-phase2.tlk-chip-match {
  background: #0f7f3b;
  border-color: #0f7f3b;
  color: #ffffff;
}

.tlk-col-special {
  background: #fff1f2;
  border: 1px solid #f5c2c7;
  color: #991b1b;
  border-radius: 8px;
  padding: 5px 8px;
  font-weight: 700;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.tlk-col-special[data-tlk-tooltip] {
  cursor: help;
}

.tlk-col-special.tlk-chip-match {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.tlk-table-empty {
  color: #64748b;
  text-align: center;
  font-weight: 700;
}

.tlk-history-run {
  border: 1px solid #dfe8f3;
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tlk-history-run-head {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: #516070;
  font-weight: 700;
}

.tlk-history-meta {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}

.tlk-history-delete {
  padding: 4px 8px;
  font-size: 11px;
  border-color: #d8a9a9;
  color: #8b1d1d;
  background: #fff5f5;
}

.tlk-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(15, 23, 42, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.tlk-modal-card {
  width: min(460px, 100%);
  border-radius: 14px;
  border: 1px solid #d5e0ef;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.25);
  padding: 16px;
}

.tlk-modal-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.tlk-modal-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  color: #475569;
}

.tlk-modal-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

.tlk-modal-select {
  width: 100%;
}

.tlk-modal-select.is-placeholder-selected {
  color: #94a3b8;
}

.tlk-modal-select.is-none-selected {
  color: #94a3b8;
}

.tlk-modal-select option {
  color: #0f172a;
}

.tlk-modal-select option[value="__tlk_none__"] {
  color: #94a3b8;
}

.tlk-modal-error {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
}

.tlk-modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tlk-lead-manage-modal {
  width: min(560px, 100%);
}

.tlk-rollback-modal {
  width: min(520px, 100%);
}

.tlk-rollback-warning {
  margin: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #991b1b;
  font-size: 13px;
  font-weight: 700;
}

.tlk-btn-rollback-confirm {
  border-color: #be123c;
  background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
}

.tlk-lead-manage-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.tlk-lead-manage-list {
  margin-top: 10px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #dbe5f0;
  border-radius: 12px;
  background: #f8fbff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tlk-lead-manage-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  padding: 12px;
}

.tlk-lead-manage-item {
  border: 1px solid #d8e3f2;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tlk-lead-manage-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.tlk-lead-manage-remove {
  border-color: #e7b8bf;
  background: #fff5f7;
  color: #9f1239;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 9px;
}

.tlk-hover-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483646;
  pointer-events: none;
  max-width: 360px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #0f172a;
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.35);
  white-space: normal;
}

.is-hidden {
  display: none !important;
}

@keyframes tlk-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes tlk-progress-success-pulse {
  0% {
    background-color: #22c55e;
    filter: saturate(1) brightness(0.95);
    transform: scaleY(1);
    opacity: 0.9;
    box-shadow:
      0 0 18px rgba(34, 197, 94, 0.42),
      0 0 30px rgba(34, 197, 94, 0.24),
      0 0 42px rgba(134, 239, 172, 0.16);
  }
  50% {
    background-color: #4ade80;
    filter: saturate(1.35) brightness(1.02);
    transform: scaleY(1.07);
    opacity: 1;
    box-shadow:
      0 0 24px rgba(74, 222, 128, 0.66),
      0 0 42px rgba(110, 231, 183, 0.5),
      0 0 64px rgba(74, 222, 128, 0.34);
  }
  100% {
    background-color: #22c55e;
    filter: saturate(1) brightness(0.95);
    transform: scaleY(1);
    opacity: 0.9;
    box-shadow:
      0 0 18px rgba(34, 197, 94, 0.42),
      0 0 30px rgba(34, 197, 94, 0.24),
      0 0 42px rgba(134, 239, 172, 0.16);
  }
}

@keyframes tlk-progress-success-overlay {
  0% {
    opacity: 0.05;
  }
  50% {
    opacity: 0.26;
  }
  100% {
    opacity: 0.05;
  }
}

@media (max-width: 1100px) {
  .tlk-top-grid {
    flex-direction: column;
  }

  .tlk-upload-card {
    width: 100%;
  }

  .tlk-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tlk-history-controls-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tlk-shell {
    padding: 12px;
  }

  .tlk-summary-grid {
    grid-template-columns: 1fr;
  }

  .tlk-result-table {
    min-width: 680px;
  }
}

body:has(.tlk-page) {
  overflow-x: hidden;
}

body:has(.tlk-page) .main-area,
body:has(.tlk-page) #app {
  overflow-x: hidden;
}
