* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* SVG inline icon alignment */
svg {
  vertical-align: middle;
  flex-shrink: 0;
}

:root {
  --color-operational: #22c55e;
  --color-degraded: #eab308;
  --color-partial: #fc8633;
  --color-major: #ea3e67;
  --color-unknown: #6b7280;
  --color-no-data: #d6d3cd;

  --color-operational-text: #15803d;
  --color-degraded-text: #a16207;
  --color-partial-text: #fc8633;
  --color-major-text: #ea3e67;

  --bg-primary: #f5f3ef;
  --bg-secondary: #edeae4;
  --bg-tertiary: #e8e4dd;

  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;

  --border-color: #d6d3cd;
  --border-radius: 8px;
  --color-major-bg: #fef2f2;
}

[data-theme="dark"] {
  --bg-primary: #1f2937;
  --bg-secondary: #111827;
  --bg-tertiary: #374151;

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --border-color: #374151;
  --color-no-data: #374151;
  --color-major-bg: #450a0a;

  --color-operational-text: #4ade80;
  --color-degraded-text: #facc15;
  --color-partial-text: #fb923c;
  --color-major-text: #f87171;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 30px 0 24px;
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

.theme-toggle-icon {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

[data-theme="dark"] .theme-toggle-icon {
  color: #9DA2AE;
}

.logo-text {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-department {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.logo-update {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 6px;
  transition: color 0.5s ease;
}

.logo-update.updated {
  color: #8b5cf6;
  animation: pulse-text 0.5s ease;
}

[data-theme="dark"] .logo-update.updated {
  color: #22d3ee;
  /* turkuaz */
}

@keyframes pulse-text {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* Overall Status Banner */
.overall-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 30px;
  font-size: 1.125rem;
  font-weight: 600;
}

.overall-status.operational {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
}

.overall-status.degraded {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  color: #854d0e;
}

.overall-status.partial_outage {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  color: #9a3412;
}

.overall-status.major_outage {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

[data-theme="dark"] .overall-status.operational {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-operational-text);
}

[data-theme="dark"] .overall-status.degraded {
  background: rgba(234, 179, 8, 0.12);
  color: var(--color-degraded-text);
}

[data-theme="dark"] .overall-status.partial_outage {
  background: rgba(249, 115, 22, 0.12);
  color: var(--color-partial-text);
}

[data-theme="dark"] .overall-status.major_outage {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-major-text);
}

.status-icon::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}

/* Section */
.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

/* Services List */
.services-section {
  margin-bottom: 40px;
}

.services-list {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  position: relative;
}

.service-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.service-card:last-child {
  border-bottom: none;
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.service-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-info h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.service-url {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.service-status-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.uptime-pct {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.7;
}

.service-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.operational {
  background: var(--color-operational);
}

.status-dot.degraded {
  background: var(--color-degraded);
}

.status-dot.partial_outage {
  background: var(--color-partial);
}

.status-dot.major_outage {
  background: var(--color-major);
}

.status-dot.unknown {
  background: var(--color-unknown);
}

.status-label.operational {
  color: var(--color-operational-text);
}

.status-label.degraded {
  color: var(--color-degraded-text);
}

.status-label.partial_outage {
  color: var(--color-partial-text);
}

.status-label.major_outage {
  color: var(--color-major-text);
}

.status-label.unknown {
  color: var(--color-unknown);
}

/* Uptime Section */
.uptime-section {
  margin-bottom: 6px;
}

.uptime-bar {
  display: flex;
  gap: 1px;
  height: 10px;
  margin-bottom: 2px;
}

.uptime-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  color: var(--text-muted);
}

.uptime-day {
  flex: 1;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.1s ease;
  position: relative;
}

.uptime-day:hover {
  transform: scaleY(1.1);
}

.uptime-day.operational {
  background: var(--color-operational);
}

.uptime-day.degraded {
  background: var(--color-degraded);
}

.uptime-day.partial_outage {
  background: var(--color-partial);
}

.uptime-day.major_outage {
  background: var(--color-major);
}

.uptime-day.no_data {
  background: var(--color-no-data);
}

.uptime-day .tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #334155;
  font-size: 0.8125rem;
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  text-align: left;
  min-width: 230px;
}

[data-theme="dark"] .uptime-day .tooltip {
  background: #334155;
  border-color: #475569;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.tooltip-date {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.tooltip-ok {
  color: #86efac;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-incident {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-incident:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tooltip-incident:first-of-type {
  padding-top: 0;
}

.tooltip-duration {
  color: #e5e7eb;
  font-weight: 600;
  white-space: nowrap;
}

.tooltip-icon {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.tooltip-incident.severity-degraded .tooltip-icon {
  color: #facc15;
}

.tooltip-incident.severity-partial_outage .tooltip-icon {
  color: #fb923c;
}

.tooltip-incident.severity-major_outage .tooltip-icon {
  color: #f87171;
}

.tooltip-time {
  font-size: 0.6875rem;
  font-weight: 400;
  opacity: 0.85;
}

/* Günlük incident modalı */
.day-incidents-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}

.day-incidents-modal.visible {
  display: flex;
}

.day-incidents-dialog {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.6);
  width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.day-incidents-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.day-incidents-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.day-incidents-close:hover {
  background: var(--bg-tertiary);
}

.day-incidents-body {
  padding: 10px 16px 14px;
  overflow-y: auto;
  font-size: 0.8125rem;
}

.day-incident-item {
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.day-incident-item:last-child {
  margin-bottom: 0;
}

.day-incident-item.severity-major_outage {
  background: #fff8f8;
}

.day-incident-item.severity-degraded {
  background: #fffef5;
}

.day-incident-item.severity-partial_outage {
  background: #fffcf5;
}

[data-theme="dark"] .day-incident-item.severity-major_outage {
  background: rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .day-incident-item.severity-degraded {
  background: rgba(234, 179, 8, 0.07);
}

[data-theme="dark"] .day-incident-item.severity-partial_outage {
  background: rgba(249, 115, 22, 0.07);
}

.day-incident-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.day-incident-icon {
  font-size: 0.9rem;
  font-weight: 700;
}

.day-incident-item.severity-major_outage .day-incident-icon {
  color: var(--color-major-text);
}

.day-incident-item.severity-degraded .day-incident-icon {
  color: var(--color-degraded-text);
}

.day-incident-item.severity-partial_outage .day-incident-icon {
  color: var(--color-partial-text);
}

.day-incident-duration {
  font-weight: 600;
  font-size: 0.8125rem;
}

.day-incident-item.severity-major_outage .day-incident-duration.severity-colored,
.day-incident-item.severity-major_outage .day-incident-time.severity-colored {
  color: var(--color-major-text);
}

.day-incident-item.severity-degraded .day-incident-duration.severity-colored,
.day-incident-item.severity-degraded .day-incident-time.severity-colored {
  color: var(--color-degraded-text);
}

.day-incident-item.severity-partial_outage .day-incident-duration.severity-colored,
.day-incident-item.severity-partial_outage .day-incident-time.severity-colored {
  color: var(--color-partial-text);
}

.day-incident-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.day-incident-reason {
  color: var(--text-secondary);
  font-size: 0.6875rem;
}

/* Servis başlığı tıklanabilir */
.service-name-link {
  cursor: pointer;
  transition: color 0.15s ease;
}

.service-name-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-muted);
}

/* Chart Modal (pasta grafiği) */
.chart-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}

.chart-modal.visible {
  display: flex;
}

.chart-dialog {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.6);
  width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.chart-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.chart-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.chart-close:hover {
  background: var(--bg-tertiary);
}

.chart-header strong {
  font-weight: 600;
}

.chart-title-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
}

.chart-title-period {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: auto;
  margin-right: 8px;
  white-space: nowrap;
}

.chart-stat-row.clickable {
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 0 -6px;
  transition: background 0.15s ease;
}

.chart-stat-row.clickable:hover {
  background: var(--bg-tertiary);
}

/* Check kayıtları detay görünümü */
.chart-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.chart-back-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.chart-back-btn:hover {
  background: var(--bg-tertiary);
}

.chart-detail-title {
  font-size: 0.8125rem;
  font-weight: 600;
}

.chart-detail-count {
  font-weight: 400;
  color: var(--text-muted);
}

.chart-detail-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  text-align: center;
}

.chart-checks-list {
  max-height: 50vh;
  overflow-y: auto;
}

.chart-checks-date {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 0 8px;
  margin-bottom: 4px;
}

.chart-checks-group {
  position: relative;
  margin-left: 14px;
  padding-left: 24px;
  margin-bottom: 24px;
}

.chart-checks-group::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 12px;
  width: 1px;
  background: var(--border-color);
  opacity: 0.5;
}

.chart-checks-date:first-child {
  padding-top: 4px;
}

.chart-checks-date-count {
  font-weight: 400;
  margin-left: 4px;
  opacity: 0.7;
}

.chart-check-item {
  display: flex;
  align-items: center;
  position: relative;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.8125rem;
}

.chart-check-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--border-color);
  opacity: 0.4;
}

.chart-check-time {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 44px;
  flex-shrink: 0;
}

.chart-check-err {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.chart-check-resp {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 8px;
  opacity: 0.8;
  flex-shrink: 0;
}

/* Bilgilendirme tooltip (Son Olaylar başlığı vb.) */
.info-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
  cursor: help;
}

.info-tooltip-icon {
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.info-tooltip-wrap:hover .info-tooltip-icon {
  opacity: 1;
}

.info-tooltip-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1E293B;
  color: #d1d5db;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  width: 280px;
  white-space: normal;
  text-transform: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  z-index: 25000;
}

.info-tooltip-content strong {
  color: #f9fafb;
}

[data-theme="dark"] .info-tooltip-content {
  background: #334155;
  border-color: #475569;
}

.info-tooltip-wrap:hover .info-tooltip-content {
  display: block;
}

/* Legend status kategori tooltip'leri */
.legend-item {
  position: relative;
  cursor: default;
}

.legend-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1E293B;
  color: #d1d5db;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  text-transform: none;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
  z-index: 25000;
}

[data-theme="dark"] .legend-tooltip {
  background: #334155;
  border-color: #475569;
}

.legend-item:hover .legend-tooltip {
  display: block;
}

.chart-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.chart-canvas-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-stats {
  flex: 1;
  min-width: 0;
}

.chart-loading {
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 20px 0;
  text-align: center;
}

.chart-stats-section {
  margin-bottom: 14px;
}

.chart-stats-section:last-child {
  margin-bottom: 0;
}

.chart-stats-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.chart-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.8125rem;
}

.chart-stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-stat-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.chart-stat-icon.severity-major_outage {
  color: var(--color-major-text);
}

.chart-stat-icon.severity-degraded {
  color: var(--color-degraded-text);
}

.chart-stat-icon.severity-partial_outage {
  color: var(--color-partial-text);
}

.chart-stat-label {
  flex: 1;
  color: var(--text-primary);
}

.chart-stat-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  width: 52px;
  text-align: right;
  flex-shrink: 0;
}

.chart-stat-pct {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  width: 44px;
  text-align: right;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .chart-dialog {
    width: 95vw;
    max-width: 420px;
  }

  .chart-body {
    flex-direction: column;
    align-items: center;
  }

  .chart-canvas-wrap {
    margin-bottom: 4px;
  }

  .chart-stats {
    width: 100%;
  }
}

.tooltip-reason {
  color: #d1d5db;
  font-size: 0.75rem;
  max-width: 280px;
  white-space: normal;
  line-height: 1.4;
}

.tooltip-status {
  color: #9ca3af;
}

/* Tooltip sağa taşmasın */
.uptime-day:nth-last-child(-n+5) .tooltip {
  left: auto;
  right: 0;
  transform: none;
}

/* Tooltip sola taşmasın */
.uptime-day:nth-child(-n+5) .tooltip {
  left: 0;
  right: auto;
  transform: none;
}

.uptime-day:hover .tooltip {
  display: block;
}

/* Service Footer (metrics + last check) */
.service-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-metrics {
  display: flex;
  gap: 0;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.last-check {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.metric {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.metric:nth-child(1) {
  min-width: 10.5em;
}

.metric:nth-child(2) {
  min-width: 7em;
}

.metric:nth-child(3) {
  min-width: 7em;
}

.metric-label {
  color: var(--text-muted);
}

/* Error Alert */
.service-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: #991b1b;
}

.service-error.warning {
  background: #fefce8;
  border-color: #fde047;
  color: #854d0e;
}

[data-theme="dark"] .service-error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fecaca;
}

[data-theme="dark"] .service-error.warning {
  background: #422006;
  border-color: #854d0e;
  color: #fef08a;
}

[data-theme="dark"] .deps-header.healthy {
  background: rgba(34, 197, 94, 0.1);
  border-bottom-color: rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .deps-header.healthy .deps-title {
  color: var(--color-operational-text);
}

[data-theme="dark"] .deps-header.healthy .deps-status {
  color: var(--color-operational-text);
}

[data-theme="dark"] .deps-header.unhealthy {
  background: rgba(239, 68, 68, 0.08);
  border-bottom-color: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .deps-header.unhealthy .deps-title {
  color: var(--color-major-text);
}

[data-theme="dark"] .deps-header.unhealthy .deps-status {
  color: var(--color-major-text);
}

.error-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.error-title::before {
  content: '';
  display: inline-flex;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.error-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #fecaca;
  font-size: 0.8125rem;
  color: #b91c1c;
  word-break: break-word;
  line-height: 1.5;
}

[data-theme="dark"] .error-details {
  border-top-color: #7f1d1d;
  color: #fca5a5;
}

/* SSL Warning */
.ssl-warning {
  margin-top: 6px;
  padding: 6px 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .ssl-warning {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.25);
  color: var(--color-degraded-text);
}

/* Service Dependencies (inline) */
.service-dependencies {
  margin-top: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.deps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  font-size: 0.75rem;
}

.deps-header.healthy {
  background: rgba(34, 197, 94, 0.1);
  border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.deps-header.unhealthy {
  background: rgba(239, 68, 68, 0.06);
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}

.deps-title {
  font-weight: 600;
  color: var(--text-primary);
}

.deps-status {
  color: var(--text-secondary);
  margin-left: auto;
}

.deps-header.healthy .deps-title {
  color: var(--color-operational-text);
}

.deps-header.healthy .deps-status {
  color: var(--color-operational-text);
}

.deps-header.unhealthy .deps-title {
  color: var(--color-major-text);
}

.deps-header.unhealthy .deps-status {
  color: var(--color-major-text);
}

.deps-toggle {
  font-size: 0.625rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
}

.deps-toggle.open {
  transform: rotate(180deg);
}

.deps-items {
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
  max-height: 500px;
  opacity: 1;
}

.deps-items.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 12px;
}

.dep-inline-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
}

.dep-inline-item:last-child {
  border-bottom: none;
}

.dep-inline-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.5625rem;
  font-weight: 600;
  flex-shrink: 0;
}

.dep-inline-item.ok .dep-inline-icon {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-operational-text);
}

.dep-inline-item.error .dep-inline-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-major-text);
}

.dep-inline-name {
  flex: 1;
  font-weight: 500;
}

.dep-inline-duration {
  font-family: monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
}

.dep-inline-status {
  font-size: 0.6875rem;
  font-weight: 500;
}

.dep-inline-item.ok .dep-inline-status {
  color: var(--color-operational-text);
}

.dep-inline-item.error .dep-inline-status {
  color: var(--color-major-text);
}

.dep-inline-error {
  font-size: 0.6875rem;
  color: var(--color-major-text);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Legend */
.legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-dot.operational {
  background: var(--color-operational);
}

.legend-dot.degraded {
  background: var(--color-degraded);
}

.legend-dot.partial_outage {
  background: var(--color-partial);
}

.legend-dot.major_outage {
  background: var(--color-major);
}

/* Collapsible Sections */
.collapsible-section {
  margin-bottom: 20px;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.2s ease;
}

.collapsible-header:hover {
  background: var(--bg-tertiary);
}

.collapsible-header .section-title {
  margin: 0;
}

.collapsible-icon {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.collapsible-icon.rotated {
  transform: rotate(180deg);
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 2000px;
  opacity: 1;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.collapsible-content .section-desc {
  margin: 12px 0 16px 0;
}

/* Incidents Section */
.incidents-section {
  margin-bottom: 40px;
}

.incidents-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
}

.incidents-search-input {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.incidents-search-input::placeholder {
  color: var(--text-muted);
}

.incidents-search-input:focus {
  border-color: var(--text-secondary);
}

.incidents-list {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.incident-day {
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
}

.incident-day:last-child {
  border-bottom: none;
}

.incident-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  user-select: none;
}

.incident-day-header:hover .incident-date {
  color: var(--text-secondary);
}

.incident-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.15s;
}

.incident-day-count {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-left: auto;
}

.incident-day-toggle {
  font-size: 0.625rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.incident-day-toggle.open {
  transform: rotate(180deg);
}

.incident-day-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.incident-day-body.open {
  max-height: 8000px;
  opacity: 1;
  padding-bottom: 14px;
}

.no-incidents {
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 2px 0 6px;
}

/* Pagination */
.incidents-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 4px;
  font-size: 0.75rem;
}

.incidents-pagination button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.incidents-pagination button:hover {
  background: var(--bg-primary);
}

.incidents-pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}

.incidents-pagination .page-info {
  color: var(--text-muted);
  min-width: 60px;
  text-align: center;
}

.incidents-pagination.days-pagination {
  padding: 0;
  flex-shrink: 0;
  margin-left: auto;
  width: 290px;
  gap: 6px;
}

.incidents-pagination.days-pagination .page-info {
  flex: 1;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: 0.6875rem;
  text-align: center;
}

/* Incident Card (flat grid row) */
.incident-card {
  display: grid;
  grid-template-columns: 105px 7px 80px 1fr auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 9px 14px;
  margin-bottom: 4px;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.incident-card:last-child {
  margin-bottom: 0;
}

.incident-card-service {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
}

.event-dot.major {
  background: var(--color-major);
}

.event-dot.degraded {
  background: var(--color-degraded);
}

.event-dot.partial {
  background: var(--color-partial);
}

.event-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.event-time::before {
  content: ' ';
}

.event-text {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.incident-card-type {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  text-align: right;
}

.incident-card-icon {
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Duplicate mobile block removed — single-row layout is in the main @media block below */

/* Severity: icon + type color */
.incident-card.severity-major_outage .incident-card-icon,
.incident-card.severity-major_outage .incident-card-type {
  color: var(--color-major-text);
}

.incident-card.severity-degraded .incident-card-icon,
.incident-card.severity-degraded .incident-card-type {
  color: var(--color-degraded-text);
}

.incident-card.severity-partial_outage .incident-card-icon,
.incident-card.severity-partial_outage .incident-card-type {
  color: var(--color-partial-text);
}

/* Severity: row background (light) */
.incident-card.severity-major_outage {
  background: #fff5f5;
}

.incident-card.severity-degraded {
  background: #fffef2;
}

.incident-card.severity-partial_outage {
  background: #fffbf2;
}

/* Severity: row background (dark) */
[data-theme="dark"] .incident-card.severity-major_outage {
  background: rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .incident-card.severity-degraded {
  background: rgba(234, 179, 8, 0.07);
}

[data-theme="dark"] .incident-card.severity-partial_outage {
  background: rgba(249, 115, 22, 0.07);
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 0 40px;
  color: var(--text-muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-brand-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-uu,
.brand-dev {
  color: #9DA4B0;
}

[data-theme="dark"] .brand-uu,
[data-theme="dark"] .brand-dev {
  color: #9DA2AE;
}

[data-theme="dark"] .footer-terminal {
  background: #9DA2AE;
}

.footer-terminal {
  width: 30px;
  height: 30px;
  background: var(--text-primary);
  border-radius: 7px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 4px 0 0 5px;
  gap: 0px;
  box-shadow: 0 2px 8px rgba(128, 128, 128, 0.35);
}

.footer-terminal .t-chevron {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--bg-primary);
  line-height: 1;
}

.footer-terminal .t-cursor {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--bg-primary);
  line-height: 1;
}

.powered-by {
  font-size: 0.6875rem;
  color: var(--text-muted);
  transition: color 0.5s ease;
}

.powered-by.updated {
  color: #8b5cf6;
  animation: pulse-text 0.5s ease;
}

[data-theme="dark"] .powered-by.updated {
  color: #22d3ee;
}

/* Loading */
.loading {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

/* HTTP Code Badge */
.http-code-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  font-family: monospace;
}

.http-code-badge.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-operational-text);
}

.http-code-badge.client-error {
  background: rgba(234, 179, 8, 0.15);
  color: var(--color-degraded-text);
}

.http-code-badge.server-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-major-text);
}

/* Dependencies Section */
.dependencies-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dependency-group {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.dependency-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.dependency-header-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.dependency-server {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dependency-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.dependency-status.healthy {
  color: var(--color-operational-text);
}

.dependency-status.unhealthy {
  color: var(--color-major-text);
}

.dependency-status.error {
  color: var(--color-major-text);
}

.dependency-items {
  padding: 12px 20px;
}

.dependency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.dependency-item:last-child {
  border-bottom: none;
}

.dep-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dep-item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

.dep-item-icon.ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-operational-text);
}

.dep-item-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-major-text);
}

.dep-item-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.dep-item-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dep-item-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dep-item-duration {
  font-family: monospace;
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
}

.dep-item-error {
  color: var(--color-major-text);
  font-size: 0.75rem;
  max-width: 200px;
  text-align: right;
}

.dependency-footer {
  padding: 12px 20px;
  background: var(--bg-secondary);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 16px;
  }

  /* --- Sorun 2: Service card tek satır, sola/sağa yaslı --- */
  .service-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .service-info {
    min-width: 0;
    overflow: hidden;
    flex: 1;
  }

  .service-info h3 {
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .service-url {
    display: inline-block;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    font-size: 0.6875rem;
  }

  .service-status-group {
    flex-shrink: 0;
    gap: 6px;
  }

  .uptime-pct {
    font-size: 0.625rem;
  }

  .service-status {
    font-size: 0.75rem;
    gap: 3px;
  }

  .service-metrics {
    gap: 0;
    font-size: 0.625rem;
  }

  .metric:nth-child(1) {
    min-width: 9.5em;
  }

  .metric:nth-child(2) {
    min-width: 6.5em;
  }

  .metric:nth-child(3) {
    min-width: 6.5em;
  }

  .service-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .last-check {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
    font-size: 0.625rem;
  }

  .legend {
    gap: 12px;
  }

  .uptime-bar {
    height: 24px;
  }

  /* --- Sorun 1: Arama + tarih barı tek satırda --- */
  .incidents-toolbar {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 10px 14px;
  }

  .incidents-search-input {
    flex: 1 1 0;
    min-width: 80px;
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .incidents-pagination.days-pagination {
    width: auto;
    flex-shrink: 0;
    margin-left: 0;
    margin-right: 0;
    gap: 2px;
  }

  .incidents-pagination.days-pagination .page-info {
    font-size: 0.6rem;
    min-width: 120px;
    text-align: center;
  }

  .incidents-pagination.days-pagination button {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .incident-day {
    padding: 0 14px;
  }

  /* --- Sorun 3: Olay kartı tek satır layout --- */
  .incident-card {
    grid-template-columns: 80px 6px 68px 1fr auto;
    grid-template-rows: auto;
    row-gap: 0;
    column-gap: 5px;
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .incident-card-service {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.75rem;
    margin-bottom: 0;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .event-dot {
    grid-row: 1;
    grid-column: 2;
    align-self: center;
  }

  .event-time {
    grid-row: 1;
    grid-column: 3;
    font-size: 0.625rem;
  }

  .event-text {
    grid-row: 1;
    grid-column: 4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    font-size: 0.625rem;
  }

  .incident-card-type {
    grid-row: 1;
    grid-column: 5;
    font-size: 0.625rem;
    text-align: right;
    white-space: nowrap;
  }

  .incident-card-icon {
    display: none;
  }

  .dependency-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .dep-item-metrics {
    flex-wrap: wrap;
  }

  .dep-item-error {
    max-width: 100%;
    text-align: left;
  }

  .day-incidents-dialog {
    width: 95vw;
  }
}