/* Paleta y tipografía de marca Perenne (design/marca en el repo). */
:root {
  --bg: #0b0d12; /* Ink */
  --panel: #14161d;
  --panel-2: #1b1e28;
  --border: #2a2e3a;
  --text: #f2f4f8; /* Cloud */
  --text-dim: #8b93a7; /* Slate */
  --accent: #6d5af7; /* Violeta Perenne */
  --accent-2: #25e5c4; /* Aqua Pulse */
  --danger: #ff5c5c;
  --ok: #25e5c4;
  --warn: #f5a623;
  --radius: 12px;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
}
header .brand { height: 44px; width: auto; display: block; }
header .tag { color: var(--text-dim); font-size: 13px; flex: 1; }
header .header-right { display: flex; align-items: center; gap: 12px; }
header .header-right button { padding: 7px 12px; font-size: 13px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.01em; }

main { max-width: 980px; margin: 0 auto; padding: 28px; }

.grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 860px) { .grid.two { grid-template-columns: 380px 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h2 { margin-top: 0; font-size: 16px; }

label { display: block; font-size: 13px; color: var(--text-dim); margin: 12px 0 4px; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
}
textarea { resize: vertical; min-height: 60px; }

.checks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.checks label {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  margin: 0;
}
.checks input { accent-color: var(--accent); }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: white;
}
button.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button + button { margin-left: 8px; }

.series-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  background: var(--panel);
}
.series-item .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.series-item h3 { margin: 0 0 4px; font-size: 15px; }
.meta { color: var(--text-dim); font-size: 13px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; margin-right: 6px; background: var(--panel-2); border: 1px solid var(--border); }
.pill.active { color: var(--ok); border-color: var(--ok); }
.pill.paused { color: var(--text-dim); }

.videos { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; display: none; }
.videos.open { display: block; }
.video-row { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.video-row:last-child { border-bottom: none; }
.status { font-weight: 600; }
.status-done { color: var(--ok); }
.status-partial { color: var(--warn); }
.status-unpublished { color: var(--accent-2); }
.status-failed { color: var(--danger); }
.status-publishing, .status-rendering, .status-scripting { color: var(--warn); }

.empty { color: var(--text-dim); text-align: center; padding: 30px 0; }
.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 12px 16px; border-radius: 8px; font-size: 13px; max-width: 320px;
}

/* Login / registro */
.auth-body { display: flex; }
.auth-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
}
.auth-logo { height: 42px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { text-align: center; margin-top: 0; margin-bottom: 18px; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }
.auth-switch { text-align: center; color: var(--text-dim); font-size: 13px; margin-bottom: 0; }
.auth-switch a { color: var(--accent-2); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* Admin: estado del servidor */
.status-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.status-dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
.status-dot.ok { background: var(--ok); }
.status-dot.bad { background: var(--danger); }
.status-hint { color: var(--text-dim); font-size: 13px; }

/* Tarjetas de "Tus redes conectadas" */
.conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.conn-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.conn-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.conn-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border-radius: 8px; font-size: 14px; flex-shrink: 0;
}
.conn-name { font-weight: 600; font-size: 14px; flex: 1; }
.conn-badge { margin: 0; font-size: 10.5px; }
.conn-label { color: var(--text-dim); font-size: 12.5px; margin-bottom: 12px; word-break: break-all; }
.conn-actions { display: flex; gap: 10px; }
.conn-edit, .conn-delete, .conn-connect-btn {
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.conn-edit { color: var(--accent-2); }
.conn-delete { color: var(--danger); }
.conn-connect-btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: white;
  padding: 9px 0;
  border-radius: 8px;
}
