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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --border: #222;
  --border-hover: #333;
  --text: #e5e5e5;
  --text-dim: #666;
  --text-muted: #444;
  --accent: #fff;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --radius: 12px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── LOGIN ──────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-box {
  text-align: center;
  width: 320px;
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 4px;
}

.logo-sub {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 48px;
}

#login-form {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

#login-form:focus-within {
  border-color: var(--text-dim);
}

#login-form input {
  flex: 1;
  background: var(--surface);
  border: none;
  padding: 14px 18px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

#login-form input::placeholder {
  color: var(--text-muted);
}

#login-form button {
  background: var(--surface);
  border: none;
  border-left: 1px solid var(--border);
  padding: 14px 18px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

#login-form button:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

.error {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--red);
  min-height: 20px;
}

/* ── HEADER ─────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}

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

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.header-sep {
  color: var(--text-muted);
  font-weight: 300;
}

.header-domain {
  color: var(--text-dim);
  font-size: 0.85rem;
}

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

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.server-info {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

/* ── MAIN ───────────────────────────────────── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
}

section {
  margin-bottom: 48px;
}

h2 {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

/* ── CARDS ──────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  cursor: pointer;
  display: block;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.card-placeholder {
  opacity: 0.4;
  cursor: default;
}

.card-placeholder:hover {
  transform: none;
  background: var(--surface);
  border-color: var(--border);
}

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

.card-icon {
  font-size: 1.3rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-indicator.online { background: var(--green); }
.status-indicator.offline { background: var(--red); }
.status-indicator.checking {
  background: var(--yellow);
  animation: pulse 1.5s infinite;
}

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

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.card-title:hover {
  text-decoration: underline;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.card-domain {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-bottom: 14px;
}

/* ── LOCK TOGGLE ───────────────────────────────── */
.card-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.lock-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lock-icon {
  font-size: 0.85rem;
  width: 20px;
  text-align: center;
}

.lock-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  display: inline-block;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.25s;
}

.toggle input:checked + .toggle-slider {
  background: var(--green);
}

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

/* ── MODAL ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 340px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-site {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

#modal-password {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

#modal-password:focus {
  border-color: var(--text-dim);
}

#modal-password::placeholder {
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-primary {
  background: #fff;
  color: #000;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.85;
}

/* ── FOOTER ─────────────────────────────────── */
footer {
  text-align: center;
  padding: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 600px) {
  header { padding: 16px; }
  main { padding: 24px 16px; }
  .grid { grid-template-columns: 1fr; }
  .login-box { width: 280px; padding: 0 16px; }
}
