/* Base styles */
:root {
  --primary: #000b0f;
  --secondary: #ffffff;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text: #18181b;
  --text-light: #6b7280;
  --background: #fafbfc;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --gradient-start: #3b82f6;
  --gradient-end: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

.monitor-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  padding: 0 32px;
  z-index: 100;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.monitor-root {
  display: flex;
  min-height: 100vh;
  background: #fafbfc;
}

.monitor-sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #f0f0f0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-top: 56px;
  position: relative;
}

.monitor-sidebar-title {
  font-weight: 600;
  font-size: 20px;
  padding: 24px 0 16px 32px;
  letter-spacing: -0.5px;
}

.monitor-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.monitor-sidebar-item {
  padding: 8px 0 8px 32px;
  font-size: 16px;
  color: #444;
  border-radius: 20px 0 0 20px;
  margin-right: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.monitor-sidebar-item.active, .monitor-sidebar-item:hover {
  background: #f4f4f5;
  color: #18181b;
  font-weight: 500;
}

.monitor-logout-btn {
  margin: 32px 24px 24px 32px;
  padding: 10px 0;
  width: calc(100% - 56px);
  background: #fff0f0;
  color: #dc2626;
  border: 1px solid #ffe4e6;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border 0.15s;
  box-shadow: 0 1px 2px rgba(220,38,38,0.04);
  position: absolute;
  bottom: 0;
  left: 0;
}

.monitor-logout-btn:hover, .monitor-logout-btn:focus {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  outline: none;
}

.monitor-main {
  flex: 1;
  padding: 72px 32px 32px 32px;
  background: #fafbfc;
  min-width: 0;
}

.monitor-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.monitor-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: #18181b;
}

.monitor-controls {
  display: flex;
  margin-bottom: 24px;
}

.monitor-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.monitor-search-input {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  width: 260px;
  background: #fff;
  color: #18181b;
  transition: border 0.2s;
  height: 38px;
  box-sizing: border-box;
}

.monitor-search-input:focus {
  outline: none;
  border: 1.5px solid #18181b;
}

.monitor-search-btn, .monitor-add-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #18181b;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border 0.15s;
  white-space: nowrap;
}

.monitor-search-btn:hover, .monitor-add-btn:hover {
  background: #18181b;
  color: #fff;
  border: 1px solid #18181b;
}

.monitor-add-btn {
  margin-left: 4px;
}

.monitor-sort-group {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.monitor-sort-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #888;
  border-radius: 8px;
  padding: 6px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border 0.15s;
  white-space: nowrap;
}

.monitor-sort-btn.active, .monitor-sort-btn:hover {
  background: #18181b;
  color: #fff;
  border: 1px solid #18181b;
}

.monitor-table-panel {
  margin-top: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(16,30,54,0.04);
  padding: 20px 20px 16px 20px;
}

.monitor-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

.monitor-table th, .monitor-table td {
  padding: 10px 8px;
  text-align: left;
  font-size: 15px;
}

.monitor-table th {
  color: #888;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
}

.monitor-table td {
  color: #222;
  border-bottom: 1px solid #f6f6f6;
}

.monitor-table tr:last-child td {
  border-bottom: none;
}

.theme-mode-icon-monitor {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 24px;
  height: 24px;
  z-index: 101;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
}

.theme-mode-icon-monitor {
  background-image: url('/images/dark-mode-icon.png');
}

.theme-mode-icon-monitor:hover {
  opacity: 0.8;
}

.error-container {
  margin-bottom: 24px;
}

.error-message {
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.monitor-refresh-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #18181b;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border 0.15s;
}

.monitor-refresh-button:hover {
  background: #18181b;
  color: #fff;
  border: 1px solid #18181b;
}

.refresh-icon {
  font-size: 18px;
  line-height: 1;
}

.monitor-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.monitor-metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 1px 4px rgba(16,30,54,0.04);
}

.monitor-metric-card.wide {
  grid-column: 1 / -1;
}


.monitor-metric-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.monitor-metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.monitor-chart-placeholder {
  height: 200px;
  background: var(--background);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.875rem;
}

.monitor-time-range-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  background: var(--card-bg);
  color: var(--text);
  transition: all 0.2s;
  height: 38px;
  min-width: 160px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.monitor-time-range-select:hover {
  border-color: var(--text);
}

.monitor-time-range-select:focus {
  outline: none;
}

.monitor-time-range-select option {
  padding: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
}