.monitoring {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;

  &__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  &__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
  }

  &__status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;

    &--connected {
      color: #22c55e;
    }

    &--disconnected {
      color: #ef4444;
    }
  }

  &__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
  }

  &__tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--theme-elevation-150, #e5e7eb);
    margin-bottom: 20px;
  }

  &__tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--theme-elevation-500, #6b7280);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;

    &:hover {
      color: var(--theme-text, #111827);
    }

    &--active {
      color: var(--theme-text, #111827);
      border-bottom-color: var(--theme-elevation-800, #3b82f6);
      font-weight: 500;
    }
  }

  &__content {
    min-height: 400px;
  }

  &__loading {
    padding: 40px;
    text-align: center;
    color: var(--theme-elevation-500);
  }

  &__empty {
    text-align: center;
    color: var(--theme-elevation-500);
    padding: 20px;
  }

  // Grid layout for health gauges
  &__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
  }

  &__chart-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    grid-column: 1 / -1;
  }

  // Gauge Widget
  &__gauge {
    background: var(--theme-elevation-50, #f9fafb);
    border: 1px solid var(--theme-elevation-150, #e5e7eb);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
  }

  &__gauge-label {
    font-size: 12px;
    color: var(--theme-elevation-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
  }

  &__gauge-bar {
    height: 6px;
    background: var(--theme-elevation-100, #f3f4f6);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
  }

  &__gauge-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
  }

  &__gauge-value {
    font-size: 24px;
    font-weight: 700;
  }

  // Chart
  &__chart {
    background: var(--theme-elevation-50, #f9fafb);
    border: 1px solid var(--theme-elevation-150, #e5e7eb);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
  }

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

  &__chart-label {
    font-size: 12px;
    color: var(--theme-elevation-500);
    font-weight: 500;
  }

  &__chart-value {
    font-size: 14px;
    font-weight: 600;
  }

  &__chart-svg {
    flex: 1;
    width: 100%;
  }

  // Services
  &__services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
  }

  &__service-card {
    background: var(--theme-elevation-50, #f9fafb);
    border: 1px solid var(--theme-elevation-150, #e5e7eb);
    border-radius: 8px;
    padding: 16px;
  }

  &__service-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }

  &__service-name {
    font-weight: 500;
    font-size: 14px;
  }

  &__service-details {
    font-size: 11px;
    color: var(--theme-elevation-500);
    overflow: auto;
    max-height: 200px;
    margin: 0;
  }

  // Status Badge
  &__status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  // Period Selector
  &__period-selector {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
  }

  &__period-btn {
    padding: 6px 12px;
    border: 1px solid var(--theme-elevation-150, #e5e7eb);
    background: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;

    &--active {
      background: var(--theme-elevation-800, #3b82f6);
      color: white;
      border-color: transparent;
    }
  }

  // KPI Cards
  &__kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  &__kpi {
    background: var(--theme-elevation-50, #f9fafb);
    border: 1px solid var(--theme-elevation-150, #e5e7eb);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
  }

  &__kpi-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
  }

  &__kpi-label {
    display: block;
    font-size: 11px;
    color: var(--theme-elevation-500);
    margin-top: 4px;
  }

  // Alerts
  &__alerts-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
  }

  // Logs
  &__logs-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  // Shared form elements
  &__select,
  &__input {
    padding: 6px 10px;
    border: 1px solid var(--theme-elevation-150, #e5e7eb);
    border-radius: 4px;
    font-size: 13px;
    background: var(--theme-input-bg, white);
    color: var(--theme-text, #111827);
  }

  &__input {
    min-width: 200px;
  }

  &__link {
    color: var(--theme-elevation-800, #3b82f6);
    font-size: 13px;
    text-decoration: none;
    margin-left: auto;

    &:hover {
      text-decoration: underline;
    }
  }

  // Table
  &__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;

    th,
    td {
      padding: 8px 12px;
      text-align: left;
      border-bottom: 1px solid var(--theme-elevation-150, #e5e7eb);
    }

    th {
      font-weight: 600;
      color: var(--theme-elevation-500);
      font-size: 11px;
      text-transform: uppercase;
    }
  }

  &__row--unack {
    background: rgba(239, 68, 68, 0.05);
  }

  &__row--clickable {
    cursor: pointer;

    &:hover {
      background: var(--theme-elevation-50);
    }
  }

  &__json {
    font-size: 11px;
    background: var(--theme-elevation-50);
    padding: 8px;
    border-radius: 4px;
    overflow: auto;
    max-height: 200px;
    margin: 0;
  }

  &__badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--theme-elevation-100);
    color: var(--theme-elevation-600);
  }

  // Buttons
  &__btn {
    padding: 6px 12px;
    border: 1px solid var(--theme-elevation-150, #e5e7eb);
    background: var(--theme-elevation-50, #f9fafb);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;

    &:hover {
      background: var(--theme-elevation-100);
    }

    &--sm {
      padding: 4px 8px;
      font-size: 11px;
    }
  }

  // Pagination
  &__pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    font-size: 13px;

    button {
      padding: 6px 12px;
      border: 1px solid var(--theme-elevation-150);
      background: none;
      border-radius: 4px;
      cursor: pointer;

      &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }
    }
  }
}
