* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  min-height: 100vh;
}
header {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky; top: 0; z-index: 100;
}
header h1 { font-size: 18px; color: #58a6ff; font-weight: 600; }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #8b949e; }
.layout { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - 57px); }
.sidebar {
  background: #161b22;
  border-right: 1px solid #30363d;
  padding: 20px 0;
  position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto;
}
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: #8b949e; text-decoration: none;
  font-size: 14px; transition: all 0.15s; border-left: 3px solid transparent;
}
.sidebar a:hover { background: rgba(88,166,255,0.05); color: #c9d1d9; }
.sidebar a.active { color: #58a6ff; border-left-color: #58a6ff; background: rgba(88,166,255,0.08); }
.sidebar .section-title {
  padding: 16px 20px 6px; font-size: 11px; font-weight: 600;
  color: #484f58; text-transform: uppercase; letter-spacing: 0.8px;
}
.main { padding: 28px; overflow-y: auto; }
.page { display: none; }
.page.active { display: block; }
h2 { font-size: 20px; color: #e6edf3; margin-bottom: 20px; font-weight: 600; }
h3 { font-size: 15px; color: #e6edf3; margin-bottom: 14px; font-weight: 600; }

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: #161b22; border: 1px solid #30363d;
  border-radius: 10px; padding: 20px;
}
.stat-value { font-size: 28px; font-weight: 700; color: #58a6ff; }
.stat-label { font-size: 12px; color: #8b949e; margin-top: 4px; }

/* Tables */
.card {
  background: #161b22; border: 1px solid #30363d;
  border-radius: 10px; margin-bottom: 20px; overflow: hidden;
}
.card-header {
  padding: 14px 20px; border-bottom: 1px solid #30363d;
  display: flex; justify-content: space-between; align-items: center;
}
.card-header h3 { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 10px 16px; text-align: left; font-size: 11px;
  font-weight: 600; color: #8b949e; text-transform: uppercase;
  letter-spacing: 0.5px; border-bottom: 1px solid #30363d;
  background: #0d1117;
}
td { padding: 10px 16px; border-bottom: 1px solid #21262d; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(88,166,255,0.03); }

/* Badges */
.badge {
  padding: 2px 8px; border-radius: 12px; font-size: 11px;
  font-weight: 600; display: inline-block;
}
.badge-blue { background: rgba(88,166,255,0.15); color: #58a6ff; }
.badge-green { background: rgba(63,185,80,0.15); color: #3fb950; }
.badge-red { background: rgba(248,81,73,0.15); color: #f85149; }
.badge-orange { background: rgba(210,153,34,0.15); color: #d29922; }
.badge-purple { background: rgba(188,140,255,0.15); color: #bc8cff; }
.badge-gray { background: rgba(139,148,158,0.15); color: #8b949e; }

/* Logs */
.log-container {
  background: #0d1117; border-radius: 8px; padding: 16px;
  font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 12px;
  max-height: 500px; overflow-y: auto; line-height: 1.6;
}
.log-entry { padding: 4px 0; border-bottom: 1px solid #21262d; }
.log-entry:last-child { border-bottom: none; }
.log-ip { color: #58a6ff; margin-right: 8px; }
.log-method { color: #3fb950; margin-right: 8px; font-weight: 600; }
.log-status-2 { color: #3fb950; }
.log-status-3 { color: #d29922; }
.log-status-4 { color: #f85149; }
.log-status-5 { color: #f85149; font-weight: 600; }
.log-path { color: #c9d1d9; margin-right: 8px; }
.log-time { color: #484f58; font-size: 11px; }
.log-ua { color: #484f58; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; display: inline-block; }

/* IP bloquées */
.ip-entry {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid #21262d;
  font-size: 13px;
}
.ip-entry:last-child { border-bottom: none; }
.ip-addr { color: #f85149; font-family: monospace; font-weight: 600; }
.ip-reason { color: #8b949e; font-size: 12px; }
.ip-expiry { color: #484f58; font-size: 11px; }

/* Buttons */
.btn {
  padding: 7px 14px; border: 1px solid #30363d; border-radius: 6px;
  background: #21262d; color: #c9d1d9; cursor: pointer;
  font-size: 13px; transition: all 0.15s; font-family: inherit;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: #30363d; border-color: #8b949e; }
.btn-danger { background: rgba(248,81,73,0.1); border-color: rgba(248,81,73,0.3); color: #f85149; }
.btn-danger:hover { background: rgba(248,81,73,0.2); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.refresh-btn { cursor: pointer; color: #8b949e; font-size: 13px; }
.refresh-btn:hover { color: #58a6ff; }
.muted { color: #484f58; font-size: 13px; padding: 20px; text-align: center; }
.empty { padding: 32px; text-align: center; color: #484f58; }

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; overflow-x: auto; padding: 0; border-right: none; border-bottom: 1px solid #30363d; }
  .sidebar .section-title { display: none; }
  .sidebar a { padding: 12px 16px; white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar a.active { border-bottom-color: #58a6ff; border-left: none; }
}
