@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #07060c;
  --bg-2: #0c0a16;
  --panel: #14101f;
  --panel-2: #1e1830;
  --panel-3: #2a2140;
  --text: #f2eefc;
  --muted: #a398c4;
  --accent: #ff2d55;
  --accent-2: #ff5c7a;
  --blue: #3d7bff;
  --blue-2: #5b96ff;
  --accent-glow: rgba(255,45,85,.35);
  --blue-glow: rgba(61,123,255,.35);
  --danger: #ff3b4e;
  --ok: #2fe39b;
  --border: rgba(255,255,255,.1);
  --radius: 16px;
  --display: 'Rajdhani', 'Inter', sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(255,45,85,.22), transparent 60%),
    radial-gradient(1000px 600px at 100% 10%, rgba(61,123,255,.2), transparent 55%),
    radial-gradient(800px 500px at 50% 110%, rgba(255,45,85,.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.empty-state { text-align: center; padding: 50px 28px; }
.empty-icon { font-size: 40px; color: var(--muted); opacity: .5; margin-bottom: 16px; display: block; }
.lector-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-glow); color: var(--accent-2);
  padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 16px;
}
h1 i, h3 i { color: var(--accent-2); margin-right: 8px; }
label i { color: var(--muted); margin-right: 5px; width: 14px; }
.login-logo {
  width: 84px; height: 84px; border-radius: 20px; margin-bottom: 18px;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px rgba(255,255,255,.05), 0 16px 36px -10px var(--accent-glow);
}
.lector-logo-img { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 10px; box-shadow: 0 0 0 2px var(--accent), 0 0 16px var(--accent-glow); }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); margin-right: 6px; }
.stat-row { display: flex; gap: 14px; margin-top: 22px; }
.stat { flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px 10px; text-align: center; }
.stat i { color: var(--accent-2); font-size: 18px; margin-bottom: 6px; display: block; }
.stat div { font-family: var(--display); font-size: 20px; font-weight: 700; }
.stat span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .button { margin-top: 0; }
.button.secondary { background: var(--panel-2); color: var(--text); box-shadow: none; }
.button.secondary:hover { background: var(--panel-3); box-shadow: none; transform: none; }

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.tile {
  background: linear-gradient(165deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 32px -20px rgba(0,0,0,.6);
  transition: transform .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 20px 36px -16px rgba(255,45,85,.25); }
.tile-img {
  width: 100%; aspect-ratio: 16/10;
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-img i { font-size: 30px; color: var(--muted); opacity: .5; }
.tile-body { padding: 12px 14px 14px; }
.tile-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { margin-bottom: 10px; }
.badge-ok, .badge-draft {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .3px;
}
.badge-ok { background: rgba(47,227,155,.12); color: var(--ok); }
.badge-draft { background: rgba(163,152,196,.15); color: var(--muted); }
.tile-actions { display: flex; gap: 6px; }
.icon-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.icon-btn.send { color: #5865F2; border-color: rgba(88,101,242,.4); }
.icon-btn.send:hover { background: rgba(88,101,242,.15); }

dialog#modal-normativa {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--panel), var(--bg-2));
  color: var(--text);
  padding: 30px;
  width: 92%; max-width: 560px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.8);
}
dialog#modal-normativa::backdrop { background: rgba(5,3,10,.7); backdrop-filter: blur(4px); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.search-results { margin-top: 12px; max-height: 280px; overflow-y: auto; }
.search-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
}
.search-row:hover { background: var(--panel-2); }
.search-row img { width: 30px; height: 30px; border-radius: 50%; }
.search-row span { flex: 1; font-size: 14px; }
.search-row .icon-btn { width: 28px; height: 28px; color: var(--accent-2); }

.shell { display: flex; min-height: 100vh; }
.sidenav {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(185deg, var(--panel), var(--bg-2));
  border-right: 1px solid var(--border);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 1px 0 0 rgba(255,45,85,.12);
}
.sidenav-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 26px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 0 0 2px var(--accent), 0 0 16px var(--accent-glow); }
.sidenav-title { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .6px; }
.sidenav-sub { color: var(--muted); font-size: 11px; letter-spacing: .5px; }
.sidenav nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidenav nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: background .15s, color .15s;
}
.sidenav nav a i { width: 16px; text-align: center; }
.sidenav nav a:hover { background: var(--panel-2); color: var(--text); }
.sidenav nav a.active {
  background: linear-gradient(100deg, rgba(255,45,85,.22), rgba(61,123,255,.14));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,45,85,.3) inset;
}
.sidenav .logout {
  color: #ff8f93;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 18px;
  display: flex; align-items: center; gap: 10px;
}
.sidenav .logout:hover { color: #ffb0b3; }
.wrap {
  flex: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px;
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidenav { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 14px 16px; }
  .sidenav-brand { border-bottom: none; margin-bottom: 0; padding: 0; }
  .sidenav nav { flex-direction: row; flex: none; }
  .sidenav .logout { border-top: none; margin: 0; padding: 0; }
  .wrap { padding: 28px 16px; }
}
.card {
  background: linear-gradient(165deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 22px;
  position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 48px -28px rgba(255,45,85,.18), 0 24px 48px -28px rgba(0,0,0,.7);
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,45,85,.5), rgba(61,123,255,.4) 60%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.login-card { max-width: 400px; margin: 100px auto; text-align: center; }
h1 { font-family: var(--display); font-size: 25px; margin: 0 0 6px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
h3 { margin: 20px 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 18px 0 7px; text-align: left; font-weight: 600; letter-spacing: .2px; }
input, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea { resize: vertical; line-height: 1.5; }
button, .button {
  display: inline-block;
  background: linear-gradient(100deg, var(--accent), #ff5c3d 55%, var(--accent));
  background-size: 200% auto;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  margin-top: 20px;
  text-decoration: none;
  box-shadow: 0 10px 26px -8px var(--accent-glow), 0 0 0 1px rgba(255,255,255,.08) inset;
  transition: transform .12s, box-shadow .15s, background-position .3s;
  text-transform: uppercase;
}
button:hover, .button:hover { box-shadow: 0 14px 30px -8px rgba(255,45,85,.55); transform: translateY(-2px); background-position: right center; }
button:active, .button:active { transform: translateY(0); }
.button.discord { background: linear-gradient(100deg, #5865F2, var(--blue-2), #5865F2); background-size: 200% auto; box-shadow: 0 10px 26px -8px var(--blue-glow); }
.button.discord:hover { box-shadow: 0 14px 30px -8px rgba(61,123,255,.55); }
.divider { color: var(--muted); font-size: 12px; margin: 18px 0 2px; text-transform: uppercase; letter-spacing: .5px; }
.chip {
  margin: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--accent); background: var(--panel-3); }
.channel-list { display: flex; flex-wrap: wrap; }
.alert {
  background: rgba(239,72,80,.1);
  border: 1px solid rgba(239,72,80,.35);
  color: #ff9196;
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert.ok { background: rgba(40,194,133,.1); border-color: rgba(40,194,133,.35); color: #6ee6b4; }
.thumb { max-width: 100%; border-radius: 12px; margin: 12px 0; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.link-danger { background: none; border: none; color: #ff9196; cursor: pointer; margin: 0; padding: 0; font-size: 13px; font-weight: 600; }

/* pagina publica de una normativa */
.lector { display: flex; min-height: 100vh; }
.lector-side {
  width: 280px;
  flex-shrink: 0;
  background: linear-gradient(185deg, var(--panel), var(--bg-2));
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.lector-side-top { padding: 28px 24px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.lector-side-scroll { padding: 18px 20px; overflow-y: auto; flex: 1; }
.lector-logo { font-weight: 800; font-size: 16px; margin-bottom: 6px; }
.lector-fecha { color: var(--muted); font-size: 13px; }
.lector-indice-titulo { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; padding: 0 4px; }
.lector-indice { display: flex; flex-direction: column; gap: 2px; }
.lector-indice a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  line-height: 1.3;
  transition: background .15s, color .15s;
}
.lector-indice a:hover { background: var(--panel-2); color: var(--text); }
.lector-main {
  flex: 1;
  max-width: 820px;
  padding: 56px 48px 100px;
}
.lector-header { margin-bottom: 8px; }
.lector-main h1 { font-size: 28px; margin-bottom: 20px; }
.lector-main .seccion-titulo { font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .3px; margin: 34px 0 14px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--accent-2); }
.lector-main .seccion-titulo:first-child { border-top: none; margin-top: 10px; }
.lector-main .contenido p { line-height: 1.75; font-size: 15.5px; color: #dde2ee; margin: 0 0 16px; }
@media (max-width: 720px) {
  .lector { flex-direction: column; }
  .lector-side { width: 100%; height: auto; position: static; }
  .lector-side-scroll { max-height: 240px; }
  .lector-main { padding: 32px 20px; }
}
