:root {
  --bg: #0c0f14;
  --bg-card: #141a22;
  --bg-elevated: #1a222d;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaed;
  --muted: #8b939e;
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.15);
  --danger: #f87171;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  line-height: 1.5;
}

.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #0891b2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #042f2e;
}
.sidebar-brand small { display: block; color: var(--muted); font-size: 0.75rem; }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sidebar-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover { color: var(--text); background: var(--bg-elevated); }
.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.muted { color: var(--muted); font-size: 0.85rem; }

.main {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1100px;
}
.main--auth {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  min-height: 100vh;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.subtitle { color: var(--muted); margin: 0 0 2rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #042f2e;
}
.btn-primary:hover { opacity: 0.92; }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.btn-ghost.small { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.btn-danger { background: rgba(248, 113, 113, 0.2); color: var(--danger); }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input[type="text"],
input[type="url"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
textarea { min-height: 100px; font-family: var(--mono); font-size: 0.8rem; }

.hint { font-size: 0.8rem; color: var(--muted); margin: -0.5rem 0 1rem; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: rgba(255,255,255,0.02); }
a { color: var(--accent); }
a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-ok { background: rgba(45, 212, 191, 0.2); color: var(--accent); }
.badge-fail { background: rgba(248, 113, 113, 0.2); color: var(--danger); }

.flash-stack { margin-bottom: 1.5rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.flash--success { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(45,212,191,0.3); }
.flash--error { background: rgba(248,113,113,0.15); color: var(--danger); }

.auth-card {
  width: 100%;
  padding: 2rem;
}
.auth-card h1 { text-align: center; }
.auth-card .logo-mark { margin: 0 auto 1rem; }

.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.8rem;
}

kbd {
  background: var(--bg-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
