/* Global CSS variables (colors, radius, shadows, spacing) */
/*
  GFX Access-Point Stylesheet
  ---------------------------------
  Guide des sections:
  1) Variables globales et utilitaires
  2) Topbar (entête) et branding
  3) Fil d'ariane (breadcrumb)
  4) Composants Panel (cartes)
  5) Tables + wrappers + badges + compteurs
  6) Cartes/Highlights/Map
  7) Formulaires, modales, alerts, boutons
  8) Mise en page Station/Session
  9) Responsive (≥/≤ breakpoints)
  10) Listes: Stations & Sessions (desktop/mobile)
*/

/* Global CSS variables (colors, radius, shadows, spacing) */
:root {
  --surface: #ffffff;
  --surface-alt: #f6f8fb;
  --surface-dark: #101728;
  --border: rgba(15, 23, 42, 0.08);
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --accent: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-md: 0 18px 35px -25px rgba(15, 23, 42, 0.45);
  --shadow-sm: 0 10px 26px -18px rgba(15, 23, 42, 0.3);
  --sticky-header-offset: 64px;
}

/* Global box‑sizing and base styles */
* {
  box-sizing: border-box;
}

/* Base page background and typography */
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--surface-alt);
  color: var(--text-main);
}

/* Utility: force-hide element */
.hidden {
  display: none !important;
}

/* Utility: visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Top navigation bar (header) */
.topbar {
  height: 64px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Right side actions in the topbar (Help/Logout) */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logout button variant used in mobile */
.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logout-button .logout-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.logout-button .logout-label {
  line-height: 1;
}

/* Generic circular icon button */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.icon-button .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Brand (logo + title) inside the topbar */
.topbar .brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.topbar .brand span {
  color: var(--text-muted);
}

.topbar .brand:hover,
.topbar .brand:focus,
.topbar .brand:active,
.topbar .brand:visited {
  color: var(--text-main);
  text-decoration: none;
}

.topbar .brand:hover span,
.topbar .brand:focus span,
.topbar .brand:active span,
.topbar .brand:visited span {
  color: var(--text-muted);
}

.topbar .brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  margin-right: 12px;
}



/* Ghost button (neutral outline) */
.ghost-button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 500;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.ghost-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Breadcrumb navigation bar */
.breadcrumb-nav {
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  position: sticky;
  top: var(--sticky-header-offset);
  z-index: 19;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px -16px rgba(15, 23, 42, 0.45);
}

/* Breadcrumb: list container */
.breadcrumb-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Breadcrumb: list items */
.breadcrumb-nav li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Breadcrumb: separator » between items */
.breadcrumb-nav li+li::before {
  content: "›";
  color: var(--text-muted);
}

/* Breadcrumb: generic link style */
.breadcrumb-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

/* Breadcrumb: home link (icon + label) */
.breadcrumb-nav .breadcrumb-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: inherit;
  line-height: 1;
  gap: 8px;
  transition: color 0.2s ease;
  text-decoration: none;
}

/* Breadcrumb: home icon */
.breadcrumb-nav .breadcrumb-home-icon {
  width: 18px;
  height: 18px;
  display: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Breadcrumb: home label text */
.breadcrumb-nav .breadcrumb-home-label {
  font-weight: 500;
}

/* Breadcrumb: hover state */
.breadcrumb-nav .breadcrumb-home:hover {
  color: var(--primary);
}

/* Breadcrumb: current page label */
.breadcrumb-nav [aria-current="page"] span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Breadcrumb: link hover */
.breadcrumb-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Breadcrumb: disabled link */
.breadcrumb-nav a.disabled {
  color: var(--text-muted);
  pointer-events: none;
  cursor: default;
  text-decoration: none;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 64px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.auth-logo {
  width: 160px;
  max-width: 80%;
  height: auto;
  display: block;
  margin: 0 auto 24px;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
}

.auth-subtitle {
  color: var(--text-muted);
  margin: 0 0 32px;
}

.auth-form .form-control {
  border-radius: var(--radius-sm);
}

.primary-button {
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-weight: 600;
  padding: 12px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.dashboard-shell {
  max-width: 1440px;
  margin: 32px auto 64px;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.row {
  margin: 0;
}

.row>[class^="col-"],
.row>[class*=" col-"] {
  display: flex;
}

.row>[class^="col-"]>.panel,
.row>[class*=" col-"]>.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.row>[class^="col-"]>.panel .panel-body,
.row>[class*=" col-"]>.panel .panel-body {
  flex: 1;
}

.base-summary-table {
  margin-top: 0;
}

.base-summary-table td {
  padding: 10px 8px;
  font-size: 0.9rem;
}

.base-summary-table th:nth-child(3),
.base-summary-table td:nth-child(3) {
  border-left: none !important;
  width: 1px;
  padding: 0;
}

.credentials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.credentials-table th,
.credentials-table td {
  padding: 10px 8px;
  vertical-align: middle;
}

.credentials-table col.col-field {
  width: 28%;
}

.credentials-table col.col-value {
  width: 36%;
}

.credentials-table col.col-rover,
.credentials-table col.col-empty {
  width: 36%;
}

.base-summary-table col.col-field {
  width: 34%;
}

.base-summary-table col.col-value {
  width: 56%;
}

.base-summary-table col.col-empty {
  width: 20%;
}

.credentials-table th {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.credentials-table td {
  text-align: center;
  font-size: 0.8rem;
}


.credentials-table td:first-child,
.credentials-table th:first-child {
  text-align: left;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ntrip-credentials-table th:nth-child(3),
.ntrip-credentials-table td:nth-child(3) {
  border-left: 1px solid var(--border);
}

.ntrip-mobile-panels {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.ntrip-mobile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ntrip-mobile-card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ntrip-mobile-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.ntrip-mobile-card-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ntrip-mobile-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
}

.ntrip-mobile-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.ntrip-mobile-value {
  display: inline-flex;
  justify-self: end;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

.ntrip-mobile-value code {
  font-size: 0.95rem;
  word-break: break-word;
}

.credential-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.password-toggle {
  border: none;
  background: transparent;
  padding: 0;
  min-width: auto;
}

.password-toggle:focus {
  outline: none;
  box-shadow: none;
}

/* Panel container (cards used across pages) */
.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Panel header (title + actions) */
.panel-heading {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Panel header variant with right aligned counter */
.panel-heading-with-count {
  position: relative;
}

/* Inline actions inside panel header */
.panel-heading-with-count .panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Panel title typography */
.panel-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

/* Panel subtitle (muted description under titles) */
.panel-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Panel body wrapper (spacing and layout) */
.panel-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Generic table wrapper (scroll on small screens) */
.table-wrapper {
  padding: 0 24px 24px;
  overflow-x: auto;
}

/* Base table look & feel */
.table {
  margin: 0;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  width: 100%;
}

.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

/* Visual hover for Bootstrap .table-hover */
.table-hover tbody tr:hover td {
  background: var(--surface-alt);
}

/* Small circular pill counter used in headers */
.counter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Generic status badge (ACTIVE/INACTIVE/UNKNOWN) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Mobile-only clone of status badge within action area */
.station-status-mobile-badge {
  display: none;
}

/* Status: idle */
.status-idle {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

/* Status: active/running */
.status-running {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
}

/* Status: waiting */
.status-waiting {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

/* Status: converging */
.status-converging {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
}

/* Sessions table: first cell (title + id) */
.session-id-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* Sessions table: "Session N" title */
.session-count {
  display: block;
  font-weight: 700;
  font-size: 1.0rem;
  color: var(--text-main);
}

/* Sessions table: small code (session id) */
.session-id-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: normal;
  text-transform: none;
}

.session-id-subtitle code {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: transparent;
  padding: 0;
}

/* Inline code inside subtitles */
.panel-subtitle code {
  color: inherit;
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
}

/* Status: ended/done */
.status-ended {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
}

/* Status: inactive */
.status-inactive {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
}

/* Dashboard: small metrics grid */
.glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}

/* Dashboard: metric card */
.glance-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Dashboard: metric label */
.glance-card .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Dashboard: metric value */
.glance-card .value {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Detail page: 2+ columns responsive grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* Session detail page shell */
.session-detail-shell {
  max-width: 1280px;
  margin: 32px auto 64px;
  padding: 0 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Session detail: summary grid */
.session-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

/* Session detail: summary item */
.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Session detail: summary label */
.summary-item .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Session detail: summary value */
.summary-item .value {
  font-weight: 600;
  font-size: 1rem;
}

/* Leaflet/Map container block */
#map {
  width: 100%;
  height: 360px;
  border-radius: var(--radius-md);
}

.map-panel .panel-body {
  padding: 24px;
}

/* Responsive ≤ 768px: Session detail table becomes stacked */
@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .session-detail-page .table-wrapper {
    padding: 0 16px 16px;
    overflow: hidden;
  }

  .session-detail-page .table {
    table-layout: fixed;
  }

  .session-detail-page .table th,
  .session-detail-page .table td {
    word-break: break-word;
    white-space: normal;
    padding: 10px 18px;
    font-size: 0.85rem;

  }

  .session-detail-page .table td code {
    white-space: normal;
    word-break: break-word;
  }

  .session-detail-page .table th:first-child,
  .session-detail-page .table td:first-child {
    width: 40%;

  }

  .session-detail-page .table th:last-child,
  .session-detail-page .table td:last-child {
    width: 60%;
  }
}

/* Responsive grid for highlight cards */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

/* Highlight metric card */
.highlight-card {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

/* Label text within highlight card */
.highlight-card label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.highlight-card span {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
}

#reference-position {
  display: none;
}

/* Modal styles */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 24px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
}

.modal-title {
  font-weight: 600;
  color: var(--text-main);
}

/* Form controls base */
.form-control {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Form controls focus ring */
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

/* Generic alert base */
.alert {
  border-radius: var(--radius-sm);
  border: none;
}

/* Info alert */
.alert-info {
  background-color: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}

/* Success alert */
.alert-success {
  background-color: rgba(16, 185, 129, 0.08);
  color: var(--accent);
  border-left: 4px solid var(--accent);
}

/* Buttons base */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Primary button */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Primary hover */
.btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

/* Secondary (ghost) button */
.btn-secondary {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

/* Secondary hover */
.btn-secondary:hover {
  background-color: var(--surface-alt);
  border-color: var(--border);
}

/* Outline danger button */
.btn-outline-danger {
  border-color: var(--danger);
  color: var(--danger);
}

/* Outline danger hover */
.btn-outline-danger:hover {
  background-color: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* Button group spacing/shape overrides */
.btn-group {
  gap: 4px;
}

/* Buttons inside button groups */
.btn-group .btn {
  border-radius: var(--radius-sm);
}

/* Warning alert color theme */
.alert-warning {
  background-color: rgba(245, 158, 11, 0.08);
  color: var(--warning);
  border-left: 4px solid var(--warning);
}


/* Station detail page shell (page layout spacing) */
.station-detail-shell {
  max-width: 1280px;
  margin: 32px auto 64px;
  padding: 0 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Two-column panels grid on desktop (falls back to single column) */
.station-panels-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

/* Ensure grid children don't overflow */
.station-panels-grid>* {
  min-width: 0;
}

/* Responsive ≥ 992px: Desktop refinements */
@media (min-width: 992px) {
  .station-panels-grid {
    grid-template-columns: minmax(0, 0.48fr) minmax(0, 0.52fr);
    align-items: stretch;
  }
}

/* Responsive ≤ 992px: Tablet and below layout tweaks */
@media (max-width: 992px) {
  .topbar {
    padding: 12px 20px;
    height: auto;
    gap: 12px;
    flex-wrap: nowrap;
  }

  .topbar-actions {
    justify-content: flex-end;
    margin-left: auto;
  }

  .panel-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .panel-heading>div {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .panel-heading>div,
  .panel-heading .counter-pill,
  .panel-heading .btn {
    width: 100%;
  }

  .panel-heading .counter-pill {
    display: flex;
    justify-content: center;
  }

  .panel-heading-with-count .counter-pill {
    width: auto;
  }

  .panel-heading .btn {
    align-self: stretch;
  }

  .session-detail-page .panel-heading {
    flex-direction: row;
    align-items: center;
  }

  .session-detail-page .panel-heading>div {
    width: auto;
  }

  .session-detail-page .panel-heading .status-badge {
    width: auto;
    align-self: center;
  }
}

/* Responsive ≤ 992px: Station detail header status badge placement */
@media (max-width: 992px) {
  :root {
    --sticky-header-offset: 64px;
  }
}

@media (max-width: 992px) {
  .station-detail-page .station-detail-shell>.panel:first-of-type .panel-heading {
    position: relative;
    padding-right: 140px;
  }

  .station-detail-page .station-detail-shell>.panel:first-of-type #station-status {
    position: absolute;
    top: 22px;
    right: 24px;
    width: auto;
  }
}

/* Responsive ≤ 768px: General mobile tweaks */
@media (max-width: 768px) {

  .breadcrumb-nav .breadcrumb-home-icon {
    display: block;
  }

  .breadcrumb-nav .breadcrumb-home-label {
    display: none;
  }

  .dashboard-shell,
  .session-detail-shell,
  .station-detail-shell {
    padding: 0 16px;
    margin: 16px auto 32px;
    gap: 20px;
  }

  .panel {
    border-radius: var(--radius-md);
  }

  .panel-body {
    padding: 20px;
  }

  .panel-body.table-wrapper {
    padding: 0 16px 16px;
  }

  .table-wrapper {
    padding: 0 16px 16px;
    margin: 0 -16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 520px;
  }

  .breadcrumb-nav {
    padding: 10px 16px;
    font-size: 0.8rem;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive ≤ 576px (phones): Dashboard cards + sessions list */
@media (max-width: 576px) {
  .topbar {
    padding: 10px 16px;
  }

  .logout-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
  }

  .logout-button .logout-label {
    display: none;
  }

  body.dashboard-page .panel {
    background: transparent;
    box-shadow: none;
  }

  body.dashboard-page .panel-heading {
    margin-bottom: 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 18px 20px;
  }

  body.dashboard-page .panel-body {
    background: transparent;
  }

  body.dashboard-page #stations-table,
  body.station-detail-page #station-sessions-table {
    border: 0;
    width: 100%;
  }

  body.dashboard-page #stations-table thead,
  body.station-detail-page #station-sessions-table thead {
    display: none;
  }

  .panel-heading-with-count {
    padding-right: 96px;
  }

  .panel-heading-with-count>.counter-pill,
  .panel-heading-with-count .panel-heading-actions .counter-pill {
    position: absolute;
    top: 20px;
    right: 18px;
    width: auto;
  }

  .panel-heading-with-count .panel-heading-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .panel-heading-with-count .panel-heading-actions .counter-pill {
    margin-right: 0;
  }

  .panel-heading-with-count .panel-heading-actions .btn {
    width: 100%;
  }

  /* Center sessions pagination controls on mobile */
  body.station-detail-page #sessions-pagination {
    width: 100%;
    justify-content: center;
  }

  /* Station detail: sessions list card layout (mobile) */
  body.station-detail-page #station-sessions-table tbody tr {
    position: relative;
    background: var(--surface-alt);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 16px -14px rgba(15, 23, 42, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0 10px 12px;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }

  body.station-detail-page #station-sessions-table tbody tr.is-selected {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow:
      0 8px 20px -12px rgba(15, 23, 42, 0.35),
      0 0 0 2px rgba(148, 163, 184, 0.18);
  }

  body.station-detail-page #station-sessions-table tbody tr.is-selected td {
    background: transparent;
  }

  body.station-detail-page #station-sessions-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 0;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
  }

  body.station-detail-page #station-sessions-table tbody td::before {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    margin-right: 0;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  body.station-detail-page #station-sessions-table tbody td.session-id-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 14px 16px 10px;
    margin: 0;
    word-break: break-word;
    background: var(--surface);
  }

  body.station-detail-page #station-sessions-table tbody td.session-id-cell::before {
    content: none;
  }

  body.station-detail-page #station-sessions-table tbody td.session-start-cell,
  body.station-detail-page #station-sessions-table tbody td.session-end-cell {
    justify-content: space-between;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  }

  body.station-detail-page #station-sessions-table tbody td.session-end-cell {
    border-bottom: 0;
    padding-bottom: 14px;
  }

  body.station-detail-page #station-sessions-table tbody td.session-status-cell {
    position: absolute;
    top: 14px;
    right: 16px;
    justify-content: flex-end;
    padding: 0;
  }

  body.station-detail-page #station-sessions-table tbody td.session-status-cell::before {
    content: none;
  }

  body.station-detail-page #station-sessions-table tbody td.session-status-cell .status-badge {
    margin: 0;
  }

  body.station-detail-page .panel-heading-with-count+.panel-body.table-wrapper {
    margin-top: 16px;
  }

  .ntrip-mobile-row {
    grid-template-columns: minmax(120px, max-content) 1fr;
  }

  .ntrip-mobile-value {
    font-size: 1rem;
  }

  /* Dashboard: station list card layout (mobile) */
  body.dashboard-page #stations-table tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
  }

  body.dashboard-page #stations-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  }

  body.dashboard-page #stations-table tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  body.dashboard-page #stations-table tbody tr {
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid rgba(15, 23, 42, 0.08);
  }

  body.dashboard-page #stations-table tbody tr:first-child {
    margin-top: 16px;
  }

  body.dashboard-page #stations-table tbody td.station-name-cell {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  body.dashboard-page #stations-table tbody td.station-name-cell::before {
    display: block;
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  body.dashboard-page #stations-table tbody td.station-meta-cell {
    font-size: 0.9rem;
    color: var(--text-muted);
  }

  .station-open-btn {
    display: none;
  }

  body.dashboard-page #stations-table tbody td::before,
  body.station-detail-page #station-sessions-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 16px;
  }

  body.dashboard-page #stations-table tbody td:not([data-label])::before,
  body.station-detail-page #station-sessions-table tbody td:not([data-label])::before {
    content: none;
  }

  .panel-body.table-wrapper {
    padding: 0 0 12px;
    margin: 0;
  }

  .table-wrapper {
    margin: 0;
    padding: 0;
  }

  body.dashboard-page .table,
  body.station-detail-page .table {
    min-width: 100%;
  }

  /* Dashboard (mobile): actions column pinned in top-right of card */
  body.dashboard-page #stations-table tbody td.station-actions-cell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 0;
    border: 0;
  }

  body.station-detail-page #station-sessions-table tbody td.station-actions-cell {
    display: none;
  }

  body.dashboard-page .station-actions-group {
    width: auto;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
  }

  body.dashboard-page .station-actions-group .btn {
    flex: 0 0 auto;
  }

  body.dashboard-page #stations-table tbody td.station-status-cell {
    display: none;
  }

  body.dashboard-page .station-status-mobile-badge {
    display: inline-flex;
  }

  body.dashboard-page #stations-table tbody tr.is-selected {
    background-color: rgba(148, 163, 184, 0.16);
  }

  body.dashboard-page #stations-table tbody tr.is-selected {
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
  }

  body.dashboard-page #stations-table tbody tr.is-selected td {
    background-color: transparent;
  }

  /* Responsive: credentials table becomes cards */
  .credentials-table,
  .credentials-table tbody,
  .credentials-table tr {
    display: block;
    width: 100%;
  }

  /* Hide header and colgroup on small screens */
  .credentials-table thead,
  .credentials-table colgroup {
    display: none;
  }

  /* Card styling for each credentials row */
  .credentials-table tr {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .credentials-table tr:last-of-type {
    margin-bottom: 0;
  }

  /* Each cell becomes a block */
  .credentials-table td {
    display: block;
    padding: 0;
  }

  .credentials-table td::before {
    content: none;
  }

  /* Base-summary table: grid layout on mobile */
  .base-summary-table tr {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    column-gap: 12px;
  }

  .base-summary-table td:first-child {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-align: left;
  }

  .base-summary-table td:nth-child(2) {
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
  }

  .base-summary-table td:nth-child(3) {
    display: none;
  }

  .base-summary-table code {
    font-size: 1rem;
  }

  /* NTRIP credentials: stacked layout per row */
  .ntrip-credentials-table tr {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .ntrip-credentials-table td:first-child {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
  }

  /* NTRIP credentials: labeled blocks */
  .ntrip-credentials-table td[data-label] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
  }

  .ntrip-credentials-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
  }

  .ntrip-credentials-table td[data-label] .credential-value {
    justify-content: flex-start !important;
  }

  body.station-detail-page .ntrip-credentials-table {
    display: none;
  }

  body.station-detail-page .ntrip-mobile-panels {
    display: flex;
  }

  body.dashboard-page #stations-table tbody td.station-actions-cell::before {
    content: none;
  }

  body.dashboard-page .station-delete-btn {
    width: 45px;
    height: 45px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  body.dashboard-page .station-delete-btn span[aria-hidden="true"] {
    font-size: 1.7rem;
    line-height: 1;
  }

  body.dashboard-page #stations-table tbody tr:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
}

/* Dashboard (desktop): styles pour le tableau des stations */
body.dashboard-page #stations-table td,
body.dashboard-page #stations-table th {
  vertical-align: middle;
}

body.dashboard-page #stations-table td code {
  /* code tags within cells */
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
}

body.dashboard-page #stations-table tbody td.station-name-cell {
  font-weight: 600;
  color: var(--text-main);
}

/* Badge de statut pour UNKNOWN (sinon texte brut) */
.status-unknown {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
}

/* Desktop hover animation for station list rows */
body.dashboard-page #stations-table tbody tr {
  transition: background-color 0.18s ease;
  /* Remove default mobile tap highlight to rely on our active state */
  -webkit-tap-highlight-color: transparent;
}

/* Make station rows clickable with visual hover/active feedback */
body.dashboard-page #stations-table tbody tr {
  cursor: pointer;
}

body.dashboard-page #stations-table tbody tr:hover {
  background-color: rgba(148, 163, 184, 0.10);
}

body.dashboard-page #stations-table tbody tr:hover td {
  background-color: rgba(148, 163, 184, 0.10);
}

body.dashboard-page #stations-table tbody tr:active {
  background-color: rgba(148, 163, 184, 0.18);
}

body.dashboard-page #stations-table tbody tr:active td {
  background-color: rgba(148, 163, 184, 0.18);
}

/* Sessions table (desktop): clickable rows with hover/active feedback */
body.station-detail-page #station-sessions-table tbody tr {
  transition: background-color 0.18s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body.station-detail-page #station-sessions-table tbody tr:hover {
  background-color: rgba(148, 163, 184, 0.10);
}

body.station-detail-page #station-sessions-table tbody tr:hover td {
  background-color: rgba(148, 163, 184, 0.10);
}

body.station-detail-page #station-sessions-table tbody tr:active {
  background-color: rgba(148, 163, 184, 0.18);
}

body.station-detail-page #station-sessions-table tbody tr:active td {
  background-color: rgba(148, 163, 184, 0.18);
}

/* Mobile: ensure uniform press feedback on card-like rows */
@media (max-width: 576px) {
  body.dashboard-page #stations-table tbody tr:active td,
  body.station-detail-page #station-sessions-table tbody tr:active td {
    background-color: transparent !important;
  }
  /* Hover is not meaningful on mobile; keep uniform background if it triggers */
  body.dashboard-page #stations-table tbody tr:hover td,
  body.station-detail-page #station-sessions-table tbody tr:hover td {
    background-color: transparent;
  }
}

/* Harmonisation du bloc pagination/refresh si présent */
#stations-page-label {
  color: var(--text-muted);
}

/* Inline group wrapper for action buttons */
.station-actions-group {
  display: inline-flex;
}

.station-actions-group .btn {
  border-width: 1px;
  font-weight: 500;
}

.station-actions-group .btn+.btn {
  margin-left: -1px;
}

/* Wrapper to allow tooltip on disabled delete button */
.disabled-delete-wrapper {
  display: inline-flex;
}
.disabled-delete-wrapper > .btn {
  pointer-events: none; /* route clicks to wrapper for mobile tooltip */
}

/* Desktop: ensure delete button isn't flush-cut on the edge */
@media (min-width: 577px) {
  body.dashboard-page #stations-table tbody td.station-actions-cell {
    padding-right: 16px; /* room for full outline on the right */
  }
  body.dashboard-page #stations-table tbody td.station-actions-cell .station-delete-btn {
    border-radius: var(--radius-sm);
  }
}
