/* ============================================
   ACTIVITY LIST SCREEN
   Frosted glass overlay — mirrors .alerts-screen / .devices-screen
   for visual coherence across list views.
   ============================================ */

.activity-screen {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: rgba(247, 247, 245, 0.88);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-radius: var(--frame-radius);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow: hidden;
}

.activity-screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Header ---- */

.activity-header {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-top: max(30px, env(safe-area-inset-top, 0px));
  padding: 0 var(--side-padding);
}

.activity-back {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: none;
  border-radius: 6px;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.activity-back:hover {
  background: rgba(0, 0, 0, 0.05);
}

.activity-header-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  color: #1A1A1A;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}

/* ---- Scrollable content ---- */

.activity-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px var(--side-padding) 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  -webkit-overflow-scrolling: touch;
}

/* Empêche le flex de « écraser » KPIs / chips / groupes quand la liste dépasse la hauteur */
.activity-content > * {
  flex-shrink: 0;
}

.activity-content::-webkit-scrollbar {
  display: none;
}

/* ---- KPI cards (same glass language as alert-card) ---- */

.activity-kpis {
  display: flex;
  gap: 10px;
}

.activity-kpi {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-left-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-kpi::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 60%);
  opacity: 0.3;
  pointer-events: none;
}

.activity-kpi-value {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.4px;
}

.activity-kpi--red .activity-kpi-value { color: var(--red-accent); }
.activity-kpi--orange .activity-kpi-value { color: var(--yellow-accent); }
.activity-kpi--green .activity-kpi-value { color: var(--green-accent); }

.activity-kpi-label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: rgba(26, 26, 26, 0.55);
}

/* ---- Filter chips ---- */

.activity-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--side-padding));
  padding: 6px var(--side-padding) 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.activity-chips::-webkit-scrollbar {
  display: none;
}

.activity-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  color: #1A1A1A;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.activity-chip:hover {
  background: rgba(255, 255, 255, 0.78);
}

.activity-chip.active {
  background: #1A1A1A;
  color: #FFFFFF;
  border-color: transparent;
}

/* ---- Group (Unread / Earlier today / This week…) ---- */

.activity-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-group-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: #1A1A1A;
  line-height: normal;
  letter-spacing: -0.1px;
}

/* ---- Activity card — glass card matching alert-card ---- */

.activity-card {
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-left-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.activity-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 60%);
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.activity-card:hover {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .activity-kpi,
  .activity-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
}

.activity-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.activity-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.activity-card-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.activity-card-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.activity-card--red .activity-card-icon    { color: var(--red-accent); }
.activity-card--orange .activity-card-icon { color: var(--yellow-accent); }
.activity-card--green .activity-card-icon  { color: var(--green-accent); }

.activity-card-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  color: #1A1A1A;
  line-height: 22px;
}

.activity-card-time {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px;
  color: rgba(26, 26, 26, 0.5);
  line-height: 18px;
  margin-top: 3px;
  white-space: nowrap;
}

.activity-card-desc {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 13px;
  color: rgba(26, 26, 26, 0.55);
  line-height: 18px;
}

.activity-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.activity-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 18px;
  background: transparent;
  color: #1A1A1A;
  border: 1px solid #1A1A1A;
  border-radius: 30px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.activity-action-btn:hover {
  background: #1A1A1A;
  color: #FFFFFF;
}

.activity-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  color: #1A1A1A;
}
