/* === RESET & BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
}

/* === HEADER === */
header {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 12px 24px;
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 20px;
  color: #58a6ff;
  letter-spacing: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user {
  color: #8b949e;
  font-size: 14px;
}

/* === MAIN === */
main {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* === CARDS === */
.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 20px 24px;
}

.card h2 {
  font-size: 16px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #21262d;
}

/* === STATUS GRID === */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 16px;
  color: #e1e4e8;
}

.stat-big {
  font-size: 28px;
  font-weight: bold;
}

.stat-highlight {
  color: #3fb950;
}

/* === STATUS BADGES === */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.status-online {
  background: #0d3117;
  color: #3fb950;
  border: 1px solid #238636;
}

.status-offline {
  background: #3d1117;
  color: #f85149;
  border: 1px solid #da3633;
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: #21262d;
  color: #e1e4e8;
  text-decoration: none;
  transition: background 0.15s;
}

.btn:hover { background: #30363d; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: #238636; border-color: #238636; color: #fff; }
.btn-primary:hover { background: #2ea043; }

.btn-danger { background: #da3633; border-color: #da3633; color: #fff; }
.btn-danger:hover { background: #f85149; }

.btn-warning { background: #d29922; border-color: #d29922; color: #fff; }
.btn-warning:hover { background: #e3b341; }

.btn-success { background: #238636; border-color: #238636; color: #fff; }
.btn-success:hover { background: #2ea043; }

.btn-outline { background: transparent; }
.btn-outline:hover { background: #21262d; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

.btn-full { width: 100%; }

.actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

/* === TABLE === */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.history-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #30363d;
  color: #8b949e;
  font-size: 12px;
  text-transform: uppercase;
}

.history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #21262d;
}

.history-table tr:hover {
  background: #1c2128;
}

.history-table code {
  background: #0d1117;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #58a6ff;
}

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: #0d3117; color: #3fb950; }
.badge-warning { background: #3d2e00; color: #d29922; }
.badge-danger { background: #3d1117; color: #f85149; }

/* === ERROR === */
.error-banner {
  margin-top: 12px;
  padding: 10px 14px;
  background: #3d1117;
  border: 1px solid #da3633;
  border-radius: 6px;
  color: #f85149;
  font-size: 13px;
}

.error-msg {
  background: #3d1117;
  border: 1px solid #da3633;
  color: #f85149;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 14px;
}

.empty-state {
  color: #8b949e;
  text-align: center;
  padding: 24px;
  font-style: italic;
}

/* === LOGIN === */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-header h1 {
  font-size: 28px;
  color: #58a6ff;
  letter-spacing: 3px;
}

.login-header p {
  color: #8b949e;
  font-size: 14px;
  margin-top: 4px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #8b949e;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 15px;
}

.form-group input:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.3s;
  z-index: 1000;
}

.toast.hidden { display: none; }
.toast-success { background: #238636; color: #fff; }
.toast-error { background: #da3633; color: #fff; }

/* === INSTALL BANNER === */
.install-banner {
  border-color: #58a6ff;
  background: #0d1117;
}

.install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

/* === NOTIFICATIONS === */
.notif-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #0d1117;
  border-radius: 6px;
  font-size: 14px;
}

.notif-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.notif-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  background: #0d1117;
  border-radius: 6px;
  transition: background 0.15s;
}

.notif-toggle:hover {
  background: #1c2128;
}

.notif-toggle input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: #30363d;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #8b949e;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.notif-toggle input:checked + .toggle-slider {
  background: #238636;
}

.notif-toggle input:checked + .toggle-slider::after {
  transform: translateX(16px);
  background: #fff;
}

.toggle-label {
  font-size: 14px;
  color: #e1e4e8;
}

/* === HERO SECTION === */
.hero-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 40px 24px 32px;
  text-align: center;
}

.hero-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

.hero-circle-green {
  background: #3fb950;
  box-shadow: 0 0 30px rgba(63, 185, 80, 0.5), 0 0 60px rgba(63, 185, 80, 0.2);
  animation: pulse-green 2s ease-in-out infinite;
}

.hero-circle-red {
  background: #f85149;
  box-shadow: 0 0 30px rgba(248, 81, 73, 0.5), 0 0 60px rgba(248, 81, 73, 0.2);
  animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 30px rgba(63, 185, 80, 0.5), 0 0 60px rgba(63, 185, 80, 0.2); }
  50% { box-shadow: 0 0 40px rgba(63, 185, 80, 0.7), 0 0 80px rgba(63, 185, 80, 0.35); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 30px rgba(248, 81, 73, 0.5), 0 0 60px rgba(248, 81, 73, 0.2); }
  50% { box-shadow: 0 0 40px rgba(248, 81, 73, 0.7), 0 0 80px rgba(248, 81, 73, 0.35); }
}

.hero-text {
  font-size: 28px;
  font-weight: 700;
  color: #e1e4e8;
  margin: 0;
}

.hero-subtext {
  font-size: 16px;
  color: #8b949e;
  margin: 0;
  min-height: 24px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.btn-hero {
  padding: 10px 24px;
  font-size: 16px;
  border-radius: 8px;
}

/* === HEALTH CARDS === */
.health-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.health-card {
  text-align: center;
}

.health-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 8px;
}

.health-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-vert { background: #3fb950; box-shadow: 0 0 8px rgba(63, 185, 80, 0.5); }
.health-orange { background: #d29922; box-shadow: 0 0 8px rgba(210, 153, 34, 0.5); }
.health-rouge { background: #f85149; box-shadow: 0 0 8px rgba(248, 81, 73, 0.5); }

.health-label {
  font-size: 18px;
  font-weight: 600;
}

.health-text-vert { color: #3fb950; }
.health-text-orange { color: #d29922; }
.health-text-rouge { color: #f85149; }

.health-reason {
  margin: 8px 0 0;
  font-size: 13px;
  color: #8b949e;
  text-align: center;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .status-grid { grid-template-columns: 1fr 1fr; }
  .actions { flex-wrap: wrap; }
  .history-table { font-size: 12px; }
  .history-table th, .history-table td { padding: 6px 8px; }
  header h1 { font-size: 16px; }
  main { padding: 0 8px; }
  .hero-card { padding: 28px 16px 24px; }
  .hero-circle { width: 80px; height: 80px; }
  .hero-text { font-size: 22px; }
  .hero-actions { flex-direction: column; gap: 8px; }
  .btn-hero { width: 100%; }
  .health-row { grid-template-columns: 1fr; }
}
