*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e2e8f0;
  --muted: #8892a0;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

.overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  font-size: 2rem;
  color: var(--green);
  margin-bottom: 12px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.login-card h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 28px; }

.login-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }

.login-card label {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
  display: block;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}
input:focus { border-color: var(--blue); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--text); border-color: #4a5060; }
.btn-ghost.danger:hover { color: var(--red); border-color: var(--red); }

.btn-edit {
  background: rgba(59,130,246,0.12);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-edit:hover { background: rgba(59,130,246,0.22); }

.btn-delete {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-delete:hover { background: rgba(239,68,68,0.2); }

.error-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
}

header { border-bottom: 1px solid var(--border); padding: 24px 0; margin-bottom: 32px; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

header h1 { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.logo-icon { color: var(--green); font-size: 0.9rem; }
.subtitle  { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 18px; }

.add-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.field label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.add-form .btn-primary { width: auto; padding: 10px 24px; }

.table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.badge {
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  font-size: 0.75rem;
  padding: 2px 9px;
  margin-left: 8px;
  font-weight: 500;
}

#sites-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

#sites-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}

#sites-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(42,45,58,0.6);
  vertical-align: middle;
}

#sites-table tbody tr:last-child td { border-bottom: none; }
#sites-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.td-name { font-weight: 600; }
.td-url a { color: var(--muted); text-decoration: none; font-size: 0.82rem; }
.td-url a:hover { color: var(--blue); }
.td-date { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.td-actions { display: flex; gap: 8px; }
.col-actions { text-align: right; }

.table-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 0.9rem; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  margin: 20px;
}

.modal h2 { font-size: 1.1rem; margin-bottom: 20px; }
.modal .field { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-actions .btn-primary { width: auto; }

@media (max-width: 600px) {
  .add-form { flex-direction: column; }
  .add-form .btn-primary { width: 100%; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}
