:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #d8dbe0;
  --text: #201f1e;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #b91c1c;
  --success: #15803d;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand { font-weight: 600; font-size: 16px; }
.topbar .session { color: var(--text-muted); font-size: 13px; display: flex; gap: 12px; align-items: center; }
.topbar form { margin: 0; }
.topbar button.link {
  background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; padding: 0;
}

.container { max-width: 960px; margin: 32px auto; padding: 0 24px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 16px; }
.subtitle { color: var(--text-muted); margin: 0 0 24px; }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--text-muted); }
.field input, .field select, .field textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  min-width: 220px;
}
.field textarea { min-height: 60px; resize: vertical; }
.field.small input { min-width: 100px; }

button, .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--accent-hover); text-decoration: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
button.secondary:hover, .btn.secondary:hover { background: #f3f4f6; }
button.danger, .btn.danger { background: #fff; color: var(--danger); border: 1px solid var(--border); }
button.danger:hover { background: #fef2f2; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: #dcfce7; color: var(--success); }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: var(--danger); }
.badge.muted { background: #f3f4f6; color: var(--text-muted); }

.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

code.clave {
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 13px;
}

.empty { color: var(--text-muted); padding: 16px 0; text-align: center; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box { width: 340px; }

.section { margin-top: 28px; }
.section-title { font-size: 13px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; }
