/* ============================================
   MECHAMARU — Design System
   Dark theme inspired by Jujutsu Kaisen
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg-primary: #0a0b10;
  --bg-secondary: #111219;
  --bg-card: rgba(20, 21, 35, 0.85);
  --bg-card-hover: rgba(30, 31, 50, 0.9);
  --bg-input: rgba(15, 16, 28, 0.8);
  --bg-sidebar: rgba(12, 13, 22, 0.95);

  --text-primary: #e8e9f0;
  --text-secondary: #8b8da3;
  --text-muted: #505270;

  --accent-cyan: #00f0ff;
  --accent-purple: #7c3aed;
  --accent-blue: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #00f0ff, #7c3aed);

  --status-up: #10b981;
  --status-down: #ef4444;
  --status-maintenance: #f59e0b;
  --status-pending: #6b7280;

  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(0, 240, 255, 0.2);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-width: 240px;
  --header-height: 60px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 240, 255, 0.06) 0%, transparent 50%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   AUTH SCREEN
   ============================================ */
.screen {
  height: 100vh;
  width: 100vw;
}

#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(124, 58, 237, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(0, 240, 255, 0.08) 0%, transparent 50%);
}

.auth-container {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.auth-logo h1 {
  font-size: 28px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab.active {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8da3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-error {
  margin-top: 12px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--status-down);
  font-size: 13px;
  display: none;
}

.auth-error.visible {
  display: block;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #000;
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-down);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   APP LAYOUT
   ============================================ */
#app-screen {
  display: flex;
  height: 100vh;
}

/* --- Sidebar --- */
#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(0, 240, 255, 0.08);
  color: var(--accent-cyan);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.user-info span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* --- Main Content --- */
#content {
  flex: 1;
  margin-left: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  padding: 32px;
}

/* --- Mobile Header --- */
#mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  z-index: 90;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.mobile-title {
  font-weight: 700;
  font-size: 16px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   DASHBOARD
   ============================================ */
.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-value.up {
  color: var(--status-up);
}

.stat-value.down {
  color: var(--status-down);
}

.stat-value.cyan {
  color: var(--accent-cyan);
}

/* Monitor List */
.monitor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.monitor-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.monitor-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.up {
  background: var(--status-up);
  box-shadow: 0 0 8px var(--status-up);
  animation: pulse-up 2s ease-in-out infinite;
}

.status-dot.down {
  background: var(--status-down);
  box-shadow: 0 0 8px var(--status-down);
  animation: pulse-down 1s ease-in-out infinite;
}

.status-dot.maintenance {
  background: var(--status-maintenance);
  box-shadow: 0 0 8px var(--status-maintenance);
}

.status-dot.pending {
  background: var(--status-pending);
}

@keyframes pulse-up {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes pulse-down {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px var(--status-down);
  }

  50% {
    opacity: 0.7;
    box-shadow: 0 0 16px var(--status-down);
  }
}

.monitor-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.monitor-info .monitor-target {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.monitor-type {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  white-space: nowrap;
}

.monitor-response {
  text-align: right;
  white-space: nowrap;
}

.monitor-response .value {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.monitor-response .label {
  font-size: 11px;
  color: var(--text-secondary);
}

.monitor-uptime {
  text-align: right;
  white-space: nowrap;
}

.monitor-uptime .value {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.monitor-uptime .value.good {
  color: var(--status-up);
}

.monitor-uptime .value.warn {
  color: var(--status-maintenance);
}

.monitor-uptime .value.bad {
  color: var(--status-down);
}

.monitor-uptime .label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  margin-bottom: 20px;
  font-size: 14px;
}

/* ============================================
   MONITOR DETAIL
   ============================================ */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.detail-header .back-btn {
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.detail-header .back-btn:hover {
  color: var(--accent-cyan);
}

.detail-header .back-btn svg {
  width: 20px;
  height: 20px;
}

.detail-title {
  flex: 1;
}

.detail-title h2 {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-title .target {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.detail-actions {
  display: flex;
  gap: 8px;
}

/* Status Hero Card */
.status-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.status-hero.up { border-left: 3px solid var(--status-up); }
.status-hero.down { border-left: 3px solid var(--status-down); }
.status-hero.maintenance { border-left: 3px solid var(--status-maintenance); }
.status-hero.pending { border-left: 3px solid var(--status-pending); }

.status-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-hero-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-hero-indicator.up {
  background: var(--status-up);
  box-shadow: 0 0 14px var(--status-up);
  animation: pulse-up 2s ease-in-out infinite;
}
.status-hero-indicator.down {
  background: var(--status-down);
  box-shadow: 0 0 14px var(--status-down);
  animation: pulse-down 1s ease-in-out infinite;
}
.status-hero-indicator.maintenance { background: var(--status-maintenance); }
.status-hero-indicator.pending { background: var(--status-pending); }

.status-hero-label {
  font-size: 20px;
  font-weight: 800;
}

.status-hero-duration {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.status-hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.status-hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Info Cards Row (Domain / SSL) */
.info-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.info-card.up { border-left: 3px solid var(--status-up); }
.info-card.warn { border-left: 3px solid var(--status-maintenance); }
.info-card.down { border-left: 3px solid var(--status-down); }

.info-card-icon { font-size: 22px; margin-top: 2px; flex-shrink: 0; }

.info-card-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-card-value {
  font-size: 14px;
  font-weight: 600;
}

.info-card-sub {
  font-size: 12px;
  margin-top: 3px;
}
.info-card-sub.up { color: var(--status-up); }
.info-card-sub.warn { color: var(--status-maintenance); }
.info-card-sub.down { color: var(--status-down); }

/* Geo Panel */
.geo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.geo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
}

.geo-info {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.geo-map-container { position: relative; }
.geo-canvas { display: block; width: 100%; height: 200px; }

.geo-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--border-color);
}

.geo-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  font-size: 12px;
  gap: 12px;
  border-right: 1px solid var(--border-color);
  flex: 1 1 160px;
}

.geo-detail-item span:first-child {
  color: var(--text-muted);
  white-space: nowrap;
}

/* Chart header with range buttons */
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.chart-ranges {
  display: flex;
  gap: 4px;
}

.range-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-mono);
}

.range-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.range-btn.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Chart stats bar */
.chart-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chart-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chart-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.chart-stat-value {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Load More Button Row */
.load-more-row {
  display: flex;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid var(--border-color);
}



/* Uptime bars */
.uptime-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.uptime-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.uptime-card .period {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.uptime-card .percentage {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.uptime-card .percentage.good {
  color: var(--status-up);
}

.uptime-card .percentage.warn {
  color: var(--status-maintenance);
}

.uptime-card .percentage.bad {
  color: var(--status-down);
}

.uptime-card .avg-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.uptime-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  margin-top: 12px;
  overflow: hidden;
}

.uptime-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.uptime-bar-fill.good {
  background: var(--status-up);
}

.uptime-bar-fill.warn {
  background: var(--status-maintenance);
}

.uptime-bar-fill.bad {
  background: var(--status-down);
}

/* Response time chart */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
  position: relative;
}

.chart-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  z-index: 5;
  background: rgba(10, 12, 22, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.chart-tooltip .tt-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.chart-tooltip .tt-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-tooltip .tt-val.up { color: var(--status-up); }
.chart-tooltip .tt-val.down { color: var(--status-down); }

.chart-container h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.chart-canvas {
  width: 100%;
  height: 200px;
}

/* SSL Info Panel */
.ssl-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
}

.ssl-panel h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ssl-panel .ssl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.ssl-item .ssl-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ssl-item .ssl-value {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Check log table */
.checks-table {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
}

.checks-table h3 {
  font-size: 14px;
  font-weight: 600;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.checks-table table {
  width: 100%;
  border-collapse: collapse;
}

.checks-table th {
  padding: 10px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.checks-table td {
  padding: 10px 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.checks-table tr:last-child td {
  border-bottom: none;
}

.checks-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-up);
}

.status-badge.down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-down);
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ============================================
   FORM (Add/Edit Monitor)
   ============================================ */
.form-container {
  max-width: 600px;
}

.form-container h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.form-section {
  margin-bottom: 24px;
}

.form-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-container {
  max-width: 600px;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.settings-section p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  animation: slide-in 0.3s ease;
  max-width: 360px;
}

.toast.success {
  border-left: 3px solid var(--status-up);
}

.toast.error {
  border-left: 3px solid var(--status-down);
}

.toast.warning {
  border-left: 3px solid var(--status-maintenance);
}

.toast.info {
  border-left: 3px solid var(--accent-cyan);
}

@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============================================
   LOADING
   ============================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  #mobile-header {
    display: flex;
  }

  #content {
    margin-left: 0;
    padding: 80px 16px 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .monitor-card {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 12px 16px;
  }

  .monitor-response,
  .monitor-uptime {
    display: none;
  }

  .monitor-card .monitor-response:first-of-type {
    display: block;
  }

  .uptime-bars {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-actions {
    width: 100%;
  }

  .detail-actions .btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-container {
    margin: 16px;
    padding: 28px;
  }
}

/* Incidents list */
.incidents-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.incidents-list h3 {
  font-size: 14px;
  font-weight: 600;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.incident-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.incident-item:last-child {
  border-bottom: none;
}

.incident-cause {
  flex: 1;
  font-size: 13px;
}

.incident-duration {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.incident-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.incident-status.resolved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-up);
}

.incident-status.ongoing {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-down);
}

/* Header with actions */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   INCIDENTS TABLE (global page)
   ============================================ */
.incidents-table {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.incidents-table table {
  width: 100%;
  border-collapse: collapse;
}

.incidents-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.incidents-table td {
  padding: 12px 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.incidents-table tr:last-child td {
  border-bottom: none;
}

.incident-row {
  cursor: pointer;
  transition: var(--transition);
}

.incident-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.incident-monitor-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.incident-monitor-target {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.incident-cause-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.incident-duration {
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================
   USER MANAGEMENT (admin settings)
   ============================================ */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.user-item:hover {
  border-color: var(--border-hover);
}

.user-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.user-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-item-name {
  font-weight: 600;
  font-size: 14px;
}

.user-item-role {
  font-size: 11px;
  color: var(--text-secondary);
}

.user-item-date {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .incidents-table {
    overflow-x: auto;
  }

  .incidents-table table {
    min-width: 700px;
  }

  .user-item {
    flex-wrap: wrap;
  }
}