.dfs-history-primary {
  width: 100%;
}

.dfs-entry-history-main {
  width: 100%;
  margin: 0;
  padding: 0 32px 80px;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .dfs-entry-history-main {
    padding: 0 24px 60px;
  }
}

@media (max-width: 600px) {
  .dfs-entry-history-main {
    padding: 0 18px 40px;
  }
}

@media (min-width: 1600px) {
  .dfs-entry-history-main {
    padding-left: 56px;
    padding-right: 56px;
  }
}

.dfs-entry-history-main .ranking-flex-display {
  padding: 0;
}

.dfs-history-hero {
  background: linear-gradient(135deg, rgba(12, 17, 44, 0.95), rgba(21, 61, 111, 0.9));
  border-radius: 16px;
  margin-bottom: 32px;
  padding: 48px 32px;
  color: #fff;
}

.dfs-history-hero .page-title {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.dfs-history-hero .page-subtitle {
  font-size: 1.1rem;
  max-width: 720px;
}


.dfs-history-layout {
  gap: clamp(20px, 2vw, 32px);
}

.filters-column {
  flex: 0 0 clamp(260px, 28vw, 360px);
  width: clamp(260px, 28vw, 360px);
  max-width: 100%;
}

.dfs-upload-panel .topflight-contest-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 12px;
  padding: 36px 24px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  background: rgba(12, 17, 44, 0.35);
  color: #f2f4ff;
  font-weight: 600;
  border-radius: 18px;
  cursor: pointer;
  min-height: 160px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dfs-upload-panel .topflight-contest-dropzone strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.dfs-upload-panel .topflight-contest-dropzone span {
  font-weight: 400;
  opacity: 0.85;
}

.dfs-upload-panel .topflight-contest-dropzone.is-dragover {
  border-color: #2fb5ff;
  background: rgba(47, 181, 255, 0.16);
  transform: translateY(-2px);
}

.dfs-upload-panel .topflight-contest-dropzone:focus-visible {
  outline: 3px solid #2fb5ff;
  outline-offset: 4px;
}

.dfs-history-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dfs-history-log {
  margin-top: 16px;
  list-style: none;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.9rem;
}

.dfs-history-log li {
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.dfs-history-log li.success {
  border-left: 3px solid #37d67a;
}

.dfs-history-log li.error {
  border-left: 3px solid #ff6b6b;
}

.dfs-history-results {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  position: relative;
  max-width: 100%;
}

@media (min-width: 768px) and (max-width: 1200px) {
  .dfs-history-layout {
    flex-direction: column !important;
  }

  .filters-column,
  .dfs-history-results {
    width: 100%;
    max-width: 100%;
  }
}

@media (min-width: 1201px) {
  .dfs-history-layout {
    flex-direction: row !important;
    align-items: flex-start !important;
  }
}

.filters-column .filter-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
}

.filters-column .filter-input.is-invalid {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.25);
}

.dfs-history-results.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 26, 0.55);
  border-radius: 16px;
  z-index: 10;
}

.dfs-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.dfs-summary-card {
  background: rgba(12, 17, 44, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 16px 24px rgba(4, 9, 24, 0.35);
}

.dfs-summary-card .label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.dfs-summary-card .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f5f7ff;
}

.dfs-summary-card.is-positive .value {
  color: #37d67a;
}

.dfs-summary-card.is-negative .value {
  color: #ff6b6b;
}

.dfs-table-panel {
  background: rgba(10, 13, 28, 0.9);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 32px;
  box-shadow: 0 18px 36px rgba(3, 7, 20, 0.45);
}

.dfs-table-panel .panel-header {
  padding: 20px 24px 0;
}

.panel-header__row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.dfs-table-panel .panel-header h2 {
  font-size: 1.5rem;
  margin: 0;
  color: #f5f7ff;
}

.dfs-tool-update-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(74, 106, 255, 0.85), rgba(115, 79, 255, 0.85));
  color: #f5f7ff;
  border: 1px solid rgba(120, 145, 255, 0.55);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dfs-tool-update-button:focus,
.dfs-tool-update-button:hover {
  color: #f5f7ff;
  box-shadow: 0 8px 24px rgba(72, 119, 255, 0.45);
  transform: translateY(-1px);
}

.dfs-tool-update-button:focus {
  outline: 2px solid rgba(140, 177, 255, 0.65);
  outline-offset: 2px;
}

.dfs-bulk-tool-modal__content {
  background: radial-gradient(circle at top, rgba(24, 30, 68, 0.95), rgba(11, 13, 29, 0.98));
  border-radius: 18px;
  border: 1px solid rgba(133, 150, 255, 0.25);
  box-shadow: 0 24px 60px rgba(5, 10, 35, 0.55);
}

.dfs-bulk-tool-modal .modal-header,
.dfs-bulk-tool-modal .modal-footer {
  border-color: rgba(120, 135, 198, 0.25);
}

.dfs-bulk-tool-modal .modal-title {
  color: #f5f7ff;
  font-weight: 600;
}

.dfs-bulk-tool-modal .modal-body {
  padding: 24px;
}

.dfs-bulk-tool-modal .form-group label {
  color: #cdd4ff;
  font-weight: 600;
  margin-bottom: 8px;
}

.dfs-bulk-tool-modal .form-control,
.dfs-bulk-tool-modal .form-control:focus {
  background-color: rgba(12, 16, 36, 0.95);
  border: 1px solid rgba(104, 129, 255, 0.35);
  color: #f5f7ff;
  box-shadow: none;
}

.dfs-bulk-tool-modal .form-control:focus {
  border-color: rgba(138, 160, 255, 0.65);
}

.dfs-bulk-tool-modal .btn-primary {
  background: linear-gradient(135deg, rgba(74, 106, 255, 0.95), rgba(126, 83, 255, 0.95));
  border-color: rgba(126, 144, 255, 0.85);
  font-weight: 600;
}

.dfs-bulk-tool-modal .btn-primary:hover,
.dfs-bulk-tool-modal .btn-primary:focus {
  background: linear-gradient(135deg, rgba(90, 132, 255, 1), rgba(143, 103, 255, 1));
  border-color: rgba(150, 168, 255, 0.95);
  box-shadow: 0 10px 30px rgba(74, 106, 255, 0.45);
}

.dfs-bulk-tool-modal .btn-secondary {
  background: rgba(37, 45, 83, 0.85);
  border-color: rgba(76, 94, 163, 0.65);
  color: #f5f7ff;
  font-weight: 500;
}

.dfs-bulk-tool-modal .btn-secondary:hover,
.dfs-bulk-tool-modal .btn-secondary:focus {
  background: rgba(48, 57, 106, 0.95);
  border-color: rgba(110, 130, 198, 0.8);
}

.dfs-bulk-tool-alert {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-weight: 600;
}

.dfs-bulk-tool-alert.is-error {
  background: rgba(235, 87, 87, 0.18);
  border: 1px solid rgba(255, 120, 120, 0.45);
  color: #ff9f9f;
}

.dfs-bulk-tool-alert.is-success {
  background: rgba(47, 198, 140, 0.18);
  border: 1px solid rgba(90, 235, 180, 0.45);
  color: #9dffd6;
}

.dfs-bulk-tool-empty {
  color: rgba(205, 212, 255, 0.75);
  font-size: 0.85rem;
  margin-top: 8px;
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .dfs-tool-update-button {
    width: 100%;
    justify-content: center;
  }

  .dfs-bulk-tool-modal .modal-body {
    padding: 20px;
  }
}

.dfs-table-panel .panel-body {
  padding: 16px 24px 24px;
}

.dfs-table-responsive {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dfs-table-responsive .dataTables_wrapper {
  min-width: 100%;
}

.dfs-table-responsive .dataTables_wrapper .dataTables_scroll {
  width: 100%;
}

.dfs-table-responsive .dataTables_wrapper .dataTables_scrollBody {
  overflow-x: auto !important;
}

.dfs-table-responsive .dataTables_wrapper table.dataTable {
  min-width: 720px;
}

.dfs-history-column--hidden,
table.dataTable td.dfs-history-column--hidden,
table.dataTable th.dfs-history-column--hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .dfs-table-responsive .dataTables_wrapper table.dataTable {
    min-width: 640px;
  }
}

@media (max-width: 768px) {
  .dfs-table-panel .panel-body {
    padding: 12px 16px 20px;
  }

  .dfs-table-responsive .dataTables_wrapper table.dataTable {
    min-width: 560px;
  }
}

@media (max-width: 540px) {
  .dfs-table-panel .panel-body {
    padding: 12px;
  }
}

.dfs-table-panel table.dataTable {
  width: 100% !important;
  color: #f5f7ff;
}

.dfs-table-panel table.dataTable thead th {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

.dfs-table-panel table.dataTable tbody td a {
  color: #2fb5ff;
  text-decoration: none;
}

.dfs-table-panel table.dataTable tbody td a:hover {
  text-decoration: underline;
}

.dfs-history-results .dataTables_wrapper .dataTables_paginate .paginate_button {
  background: rgba(47, 181, 255, 0.16);
  border: none;
  border-radius: 8px;
  color: #f5f7ff !important;
}

.dfs-history-results .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: rgba(55, 214, 122, 0.25);
}

@media (max-width: 980px) {
  .dfs-history-layout {
    flex-direction: column;
  }

  .dfs-history-hero {
    padding: 40px 24px;
  }

  .dfs-history-results .dataTables_wrapper .dataTables_length,
  .dfs-history-results .dataTables_wrapper .dataTables_filter {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .dfs-history-results .dataTables_wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .dfs-history-results .dataTables_wrapper .dataTables_length,
  .dfs-history-results .dataTables_wrapper .dataTables_filter,
  .dfs-history-results .dataTables_wrapper .dataTables_info,
  .dfs-history-results .dataTables_wrapper .dataTables_paginate {
    float: none;
    width: 100%;
    text-align: left;
    margin: 0;
  }

  .dfs-history-results .dataTables_wrapper .dataTables_filter label {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .dfs-history-results .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    margin: 0;
  }

  .dfs-history-results .dataTables_wrapper .dataTables_length select,
  .dfs-history-results .dataTables_wrapper .dataTables_filter input {
    min-height: 40px;
  }

  .dfs-history-results .dataTables_wrapper .dataTables_info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
  }

  .dfs-history-results .dataTables_wrapper .dataTables_paginate {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .dfs-history-results .dataTables_wrapper .dataTables_paginate .paginate_button {
    flex: 0 0 auto;
    padding: 6px 12px;
  }

  .dfs-table-panel table.dataTable thead th,
  .dfs-table-panel table.dataTable tbody td {
    font-size: 0.85rem;
    white-space: normal;
  }
}
