/* ============================================================
   Dashboard — Docker Desktop inspired
   Light, clean, neutral grays. Discrete orange accents only.
   No dramatic display typography — system clarity first.
   ============================================================ */

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: dash-fade-in 280ms ease-out both;
}

@keyframes dash-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dash-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* ============================================================
   Hero — flat, no gradient, Docker style
   ============================================================ */
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 4px;
  flex-wrap: wrap;
}

.dash-hero__lede { min-width: 0; }

.dash-hero__title {
  margin: 0 0 4px;
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--color-text);
}

.dash-hero__sub {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  max-width: 70ch;
}
.dash-hero__sub strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ============================================================
   Section title — flat
   ============================================================ */
.dash-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-section__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

/* ============================================================
   Fleet overview — flat card
   ============================================================ */
.fleet-overview {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(180px, 1fr) minmax(220px, 1.2fr);
  gap: 28px;
  align-items: stretch;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.fleet-overview__donut {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--color-border);
  padding-right: 24px;
}
.fleet-overview__legend {
  display: grid;
  gap: 0;
  min-width: 0;
  border-right: 1px solid var(--color-border);
  padding-right: 24px;
  align-self: center;
}
@media (max-width: 960px) {
  .fleet-overview {
    grid-template-columns: minmax(200px, 240px) 1fr;
  }
  .fleet-overview__legend {
    border-right: 0;
    padding-right: 0;
  }
  .activity {
    grid-column: 1 / -1;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
  }
}
@media (max-width: 720px) {
  .fleet-overview {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .fleet-overview__donut {
    border-right: 0;
    padding-right: 0;
  }
}

.donut {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}
.donut__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.donut__track {
  fill: none;
  stroke: var(--color-surface-alt);
  stroke-width: 14;
}
.donut__segment {
  fill: none;
  stroke-width: 14;
  stroke-linecap: butt;
  transition: stroke-dashoffset 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}
.donut__center-value {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.donut__center-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.legend-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.legend-row:last-of-type { border-bottom: 0; }

.legend-row__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: currentColor;
}
.legend-row__name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}
.legend-row__count {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.legend-row__share {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 4ch;
  text-align: right;
}

.legend-row--ok   { color: var(--color-success); }
.legend-row--warn { color: var(--color-warning); }
.legend-row--down { color: var(--color-danger); }

/* ============================================================
   Activity panel — last exports received
   ============================================================ */
.activity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: stretch;
  width: 100%;
}
.activity__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}
.activity__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.005em;
}
.activity__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  text-transform: lowercase;
}
.activity__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.activity__item {
  min-width: 0;
}
.activity__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  text-decoration: none;
  min-width: 0;
  transition: background-color 120ms ease;
}
.activity__row:hover {
  background: var(--color-surface-alt);
  text-decoration: none;
}
.activity__name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}
.activity__row:hover .activity__name {
  color: var(--color-primary-dark);
}
.activity__when {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex: 0 0 auto;
  line-height: 1.2;
}
.activity__date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.activity__received {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.activity__empty {
  padding: 20px 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ============================================================
   Site table — flat, light, Docker style
   ============================================================ */
.site-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.site-table {
  width: 100%;
  border-collapse: collapse;
}

.site-table thead th {
  background: var(--color-surface);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.site-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  font-size: 0.95rem;
}
.site-table tbody tr:last-child td { border-bottom: 0; }

.site-table tbody tr {
  position: relative;
  transition: background-color 100ms ease;
}
.site-table tbody tr:hover {
  background: var(--color-surface-alt);
  cursor: pointer;
}

.site-table__cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--color-gray-300);
}
.live-dot--ok   { background: var(--color-success); }
.live-dot--warn { background: var(--color-warning); }
.live-dot--down { background: var(--color-danger);  }
.live-dot--live::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.3;
  animation: dash-pulse 1.8s ease-in-out infinite;
}
.live-dot--live { color: var(--color-success); }

.site-table__name {
  display: block;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  letter-spacing: -0.005em;
  text-decoration: none;
}
.site-table__name::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.site-table tbody tr:hover .site-table__name { color: var(--color-primary-dark); text-decoration: none; }

.site-table__id {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 1px;
  letter-spacing: 0;
}

.site-table__version {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--color-surface-alt);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.site-table__version--empty {
  color: var(--color-text-muted);
  background: transparent;
  border-color: transparent;
  padding-left: 0;
}

.site-table__time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.site-table__time--muted { color: var(--color-text-muted); }

.site-table__cta {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--color-text-muted);
  background: transparent;
  font-size: 0.85rem;
  transition: background 120ms ease, color 120ms ease;
}
.site-table tbody tr:hover .site-table__cta {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

@media (max-width: 768px) {
  .site-table thead { display: none; }
  .site-table,
  .site-table tbody,
  .site-table tr,
  .site-table td { display: block; }

  .site-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
  }

  .site-table tbody td {
    padding: 0;
    border: 0;
    min-width: 0;
  }

  /* Row 1 — name (left) + CTA arrow (right) */
  .site-table tbody td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .site-table tbody td:nth-child(6) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    text-align: right !important;
  }

  /* Row 2 — état badge, full width */
  .site-table tbody td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }

  /* Rows 3-5 — meta as label : value */
  .site-table tbody td:nth-child(3),
  .site-table tbody td:nth-child(4),
  .site-table tbody td:nth-child(5) {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 0.85rem;
  }
  .site-table tbody td:nth-child(3)::before,
  .site-table tbody td:nth-child(4)::before,
  .site-table tbody td:nth-child(5)::before {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
  }
  .site-table tbody td:nth-child(3)::before { content: 'Version'; }
  .site-table tbody td:nth-child(4)::before { content: 'Dernier export'; }
  .site-table tbody td:nth-child(5)::before { content: 'Vu il y a'; }

  /* CTA visible by default on mobile (no hover affordance) */
  .site-table__cta {
    border: 1px solid var(--color-border);
    color: var(--color-primary);
  }
}

/* ============================================================
   Empty state
   ============================================================ */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: 10px;
}
.dash-empty__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
}
.dash-empty__title {
  margin: 0 0 4px;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dash-empty__msg {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  max-width: 50ch;
}

/* ============================================================
   Site alert — Docker style: subtle, less colored bg
   ============================================================ */
.site-alert {
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-warning);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--color-surface);
}
.site-alert--down { border-left-color: var(--color-danger); }

.site-alert__title {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}

.site-alert__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-alert__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.site-alert__status {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.site-alert__status--down { color: var(--color-danger);  border-color: var(--color-danger);  background: var(--color-danger-bg);  }
.site-alert__status--warn { color: var(--color-warning); border-color: var(--color-warning); background: var(--color-warning-bg); }

.site-alert__more {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}
