/**
 * DMR75 — Historique des QSO (charte flat #0f4a7b)
 */

body.page-template-templateshistorique-php .bs-menu-full,
body.page-template-templateshistorique-php .header-bottom {
  position: relative;
  z-index: 200;
}

body.page-template-templateshistorique-php .navbar-wp nav .sm,
body.page-template-templateshistorique-php .navbar-wp nav .sm-clean ul {
  z-index: 201;
}

body.page-template-templateshistorique-php main#content {
  padding-top: 0.5rem !important;
  padding-bottom: 2rem !important;
}

.dmr-historique-page {
  --dmr-acc: #0f4a7b;
  --dmr-acc-2: #071f33;
  --dmr-border: #b8d4ea;
  --dmr-surface: #ffffff;
  --dmr-surface-alt: #f0f7ff;
  --dmr-text: #4c4c4c;
  --dmr-muted: #6e6e6e;
  --dmr-success: #166534;
  --dmr-error: #991b1b;
  color: var(--dmr-text);
}

body.dark .dmr-historique-page,
html.theme-dark .dmr-historique-page {
  --dmr-border: #2a4059;
  --dmr-surface: #111d2e;
  --dmr-surface-alt: #0a1628;
  --dmr-text: #a8b6c6;
  --dmr-muted: #7a8fa3;
}

/* —— Chrome —— */
.dmr-historique-page .dmr-historique-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--dmr-surface-alt);
  border: 1px solid var(--dmr-border);
  border-bottom: 3px solid var(--dmr-acc);
}

.dmr-historique-page .dmr-historique-chrome__brand {
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dmr-acc);
  text-decoration: none;
}

.dmr-historique-page .dmr-historique-chrome__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8125rem;
}

.dmr-historique-page .dmr-historique-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--dmr-acc);
}

.dmr-historique-page .dmr-historique-updated {
  color: var(--dmr-muted);
  font-variant-numeric: tabular-nums;
}

.dmr-historique-page .dmr-historique-chrome__divider {
  width: 1px;
  height: 1rem;
  background: var(--dmr-border);
}

.dmr-historique-page .dmr-historique-chrome__link {
  font-weight: 600;
  color: var(--dmr-acc);
  text-decoration: none;
}

.dmr-historique-page .dmr-historique-chrome__link:hover {
  text-decoration: underline;
}

.dmr-historique-page .dmr-historique-lead {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--dmr-muted);
}

/* —— Panel —— */
.dmr-historique-page .dmr-historique-panel {
  border: 1px solid var(--dmr-border);
  background: var(--dmr-surface);
  padding: 0.75rem;
}

.dmr-historique-page .dmr-historique-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.dmr-historique-page .dmr-historique-search-wrap {
  flex: 1 1 220px;
  min-width: 0;
}

.dmr-historique-page .dmr-historique-search {
  width: 100%;
  font-size: 0.8125rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--dmr-border);
  border-radius: 0;
  background: var(--dmr-surface-alt);
  color: var(--dmr-text);
}

.dmr-historique-page .dmr-historique-search:focus {
  outline: 2px solid var(--dmr-acc);
  outline-offset: 1px;
}

.dmr-historique-page .dmr-historique-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border: 1px solid var(--dmr-acc);
  border-radius: 0;
  background: var(--dmr-acc);
  color: #fff;
  cursor: pointer;
}

.dmr-historique-page .dmr-historique-btn:hover:not(:disabled) {
  background: #0284c7;
  border-color: #0284c7;
}

.dmr-historique-page .dmr-historique-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dmr-historique-page .dmr-historique-btn--secondary {
  background: var(--dmr-surface-alt);
  color: var(--dmr-acc);
}

.dmr-historique-page .dmr-historique-btn--secondary:hover:not(:disabled) {
  background: #dbeafe;
}

.dmr-historique-page .dmr-historique-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.dmr-historique-page .dmr-historique-check input {
  accent-color: var(--dmr-acc);
}

/* —— Status —— */
.dmr-historique-page .dmr-historique-status {
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  color: var(--dmr-muted);
}

.dmr-historique-page .dmr-historique-status.is-error {
  color: var(--dmr-error);
}

.dmr-historique-page .dmr-historique-status.is-ok {
  color: var(--dmr-success);
}

.dmr-historique-page .dmr-historique-progress {
  height: 6px;
  margin-top: 0.45rem;
  background: var(--dmr-border);
  overflow: hidden;
}

.dmr-historique-page .dmr-historique-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--dmr-acc), #0284c7);
  animation: dmr-historique-load 2s ease-out forwards;
}

@keyframes dmr-historique-load {
  to { width: 100%; }
}

/* —— Table —— */
.dmr-historique-page .dmr-historique-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dmr-historique-page .tables {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.dmr-historique-page .tables thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.5rem 0.45rem;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--dmr-acc);
  background: var(--dmr-surface-alt);
  border-bottom: 2px solid var(--dmr-acc);
}

.dmr-historique-page .tables tbody td {
  padding: 0.35rem 0.45rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--dmr-border);
}

.dmr-historique-page .tgflag {
  width: 1.35em;
  max-height: 0.9em;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.dmr-historique-page .slotbox,
.dmr-historique-page .tgbox {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  border: 1px solid var(--dmr-border);
  background: var(--dmr-surface-alt);
  color: var(--dmr-acc);
}

.dmr-historique-page .badge.dept {
  display: inline-block;
  padding: 0.05rem 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--dmr-acc);
  color: #fff;
}

.dmr-historique-page .alink {
  cursor: pointer;
  font-weight: 600;
  color: var(--dmr-acc);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dmr-historique-page .alink:hover {
  color: #0284c7;
}

.dmr-historique-page .delaybox,
.dmr-historique-page .online {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dmr-historique-page .online {
  color: var(--dmr-error);
}

.dmr-historique-page .ellipsis {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dmr-historique-page .tdDate,
.dmr-historique-page .tdTime,
.dmr-historique-page .dmrid {
  font-size: 0.6875rem;
  color: var(--dmr-muted);
  font-variant-numeric: tabular-nums;
}

.dmr-historique-page .center {
  text-align: center;
}

/* Row states */
.dmr-historique-page .trrow {
  background: var(--dmr-surface);
  color: var(--dmr-text);
}

.dmr-historique-page .trrow:nth-child(even) {
  background: var(--dmr-surface-alt);
}

.dmr-historique-page .trrow:hover {
  background: #e0f2fe;
}

.dmr-historique-page .trptt {
  background: var(--dmr-surface-alt);
  color: var(--dmr-muted);
}

.dmr-historique-page .trptt:hover {
  background: var(--dmr-surface);
  color: var(--dmr-text);
}

.dmr-historique-page .tronline {
  background: #fee2e2 !important;
  color: #991b1b !important;
  font-weight: 700;
}

.dmr-historique-page .tghighlite {
  background: #dbeafe !important;
  font-weight: 700;
}

.dmr-historique-page .tgGreen {
  background: #dcfce7;
}

.dmr-historique-page .darker {
  opacity: 0.85;
}

.dmr-historique-page .dmr-historique-load-more-wrap {
  margin: 1rem 0 0;
  text-align: center;
}

/* —— Modal —— */
.dmr-historique-page .dmr-historique-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  background: rgba(7, 31, 51, 0.55);
}

.dmr-historique-page .dmr-historique-modal[hidden] {
  display: none !important;
}

.dmr-historique-page .dmr-historique-modal__dialog {
  width: min(960px, 100%);
  border: 1px solid var(--dmr-border);
  background: var(--dmr-surface);
  box-shadow: 0 12px 40px rgba(7, 31, 51, 0.2);
}

.dmr-historique-page .dmr-historique-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--dmr-surface-alt);
  border-bottom: 2px solid var(--dmr-acc);
}

.dmr-historique-page .dmr-historique-modal__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--dmr-acc);
}

.dmr-historique-page .dmr-historique-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  color: var(--dmr-text);
}

.dmr-historique-page .dmr-historique-modal__body {
  max-height: 70vh;
  overflow: auto;
}

.dmr-historique-page .dmr-historique-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.dmr-historique-page .dmr-historique-modal-table th {
  position: sticky;
  top: 0;
  padding: 0.45rem 0.55rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--dmr-surface-alt);
  border-bottom: 1px solid var(--dmr-border);
  color: var(--dmr-acc);
}

.dmr-historique-page .dmr-historique-modal-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--dmr-border);
}

@media (max-width: 900px) {
  .dmr-historique-page .col-hide-sm {
    display: none;
  }

  .dmr-historique-page .ellipsis {
    max-width: 8rem;
  }
}
