:root {
  --bg: #07090c;
  --panel: #0d1117;
  --panel-2: #121821;
  --line: #1d2633;
  --text: #d7dee8;
  --muted: #7d8a9c;
  --accent: #3ef0a5;
  --accent-dim: #3ef0a522;
  --danger: #ff5c7a;
  --warn: #ffc857;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --r: 10px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background-color: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
body {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% -10%, #3ef0a514, transparent 60%), linear-gradient(transparent 40%, var(--bg));
}
a { color: var(--accent); }
.wrap { position: relative; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

header.top { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 8px; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: .5px; text-decoration: none; color: var(--text); }
.brand .logo { width: 34px; height: 34px; border: 1.5px solid var(--accent); border-radius: 8px; display: grid; place-items: center; color: var(--accent); box-shadow: 0 0 18px var(--accent-dim) inset; }
.live { font: 12px var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; background: var(--panel); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on i { background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; }
.live.off i { background: var(--danger); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #3ef0a588; } 70% { box-shadow: 0 0 0 8px #3ef0a500; } 100% { box-shadow: 0 0 0 0 #3ef0a500; } }

.hero { padding: 44px 0 26px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -1px; }
.hero h1 span { color: var(--accent); font-family: var(--mono); font-weight: 600; }
.hero p { color: var(--muted); max-width: 620px; margin: 0; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 18px 0 22px; }
.search { flex: 1 1 260px; position: relative; }
.search input { padding-left: 38px; }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 12px var(--mono); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.chip.active { color: var(--bg); background: var(--accent); border-color: var(--accent); }

input, textarea, select {
  width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px 13px; font: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea { resize: vertical; min-height: 90px; }
label { font: 12px var(--mono); color: var(--muted); display: block; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding-bottom: 60px; }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: #2c3a4d; transform: translateY(-2px); }
.card .head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.card h3 { margin: 0; font-size: 18px; }
.tag { font: 11px var(--mono); color: var(--accent); background: var(--accent-dim); border: 1px solid #3ef0a540; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.cat { font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.desc { color: #b6c0cd; white-space: pre-line; margin: 0; flex: 1; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; font: 12px var(--mono); color: var(--muted); }
.hash { font: 11px var(--mono); color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; justify-content: space-between; cursor: pointer; }
.hash code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hash:hover { border-color: var(--accent); color: var(--text); }
details.notes summary { cursor: pointer; font: 12px var(--mono); color: var(--muted); }
details.notes p { white-space: pre-line; margin: 8px 0 0; color: #b6c0cd; font-size: 14px; }

.btn {
  font: 600 14px var(--sans); border: 1px solid var(--accent); background: var(--accent); color: #04140c;
  padding: 11px 16px; border-radius: var(--r); cursor: pointer; position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: #ff5c7a55; }
.btn.small { padding: 7px 11px; font-size: 13px; }
.btn .bar { position: absolute; left: 0; top: 0; bottom: 0; background: #ffffff40; width: 0; transition: width .15s; }
.btn span { position: relative; }

.empty { text-align: center; color: var(--muted); padding: 70px 20px; border: 1px dashed var(--line); border-radius: 14px; font-family: var(--mono); grid-column: 1 / -1; }
footer { color: var(--muted); font: 12px var(--mono); text-align: center; padding: 20px 0 40px; position: relative; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(30px); opacity: 0; background: var(--panel-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: var(--r); font-size: 14px; transition: .25s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.ok { border-color: var(--accent); }
.toast.err { border-color: var(--danger); }

/* Admin */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 16px; font-size: 18px; }
.row { display: grid; grid-template-columns: 2fr 1fr 1fr 90px; gap: 12px; }
.field { margin-bottom: 14px; }
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 26px; text-align: center; color: var(--muted); cursor: pointer; transition: .2s; }
.drop.over, .drop:hover { border-color: var(--accent); color: var(--text); background: var(--accent-dim); }
.drop strong { color: var(--text); }
.progress { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 12px; display: none; }
.progress.show { display: block; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.status { font: 12px var(--mono); color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
td.mono { font: 12px var(--mono); color: var(--muted); }
.login { max-width: 380px; margin: 12vh auto; }
.hidden { display: none !important; }
@media (max-width: 720px) { .row { grid-template-columns: 1fr 1fr; } .hide-sm { display: none; } }
.actions.end { justify-content: flex-end; }
.card .meta { margin-top: auto; }

/* Tarjeta compacta */
.card { cursor: pointer; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 0 0 auto; }
.card-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

/* Modal de detalles */
html:has(dialog[open]) { overflow: hidden; }
.modal {
  width: min(660px, 94vw); max-height: 88vh; padding: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--text);
  border: 1px solid #2c3a4d; border-radius: 18px; box-shadow: 0 30px 80px #000c, 0 0 0 1px #3ef0a512 inset;
}
.modal::backdrop { background: #02040699; backdrop-filter: blur(6px); }
.modal[open] { animation: pop .2s cubic-bezier(.2,.9,.3,1.2); }
.modal[open]::backdrop { animation: fade .2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
.modal-body { position: relative; max-height: 88vh; overflow: auto; padding: 0 26px 26px; display: flex; flex-direction: column; gap: 16px; }
.modal-head { position: sticky; top: 0; z-index: 2; margin: 0 -26px; padding: 24px 26px 16px; background: linear-gradient(var(--panel-2) 80%, transparent); }
.modal-head h2 { margin: 4px 0 0; font-size: 26px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-right: 40px; }
.modal .x { position: absolute; top: 20px; right: 20px; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 15px; }
.modal .x:hover { color: var(--text); border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.stat small { display: block; font: 10px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.stat b { font: 600 14px var(--mono); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal h4 { margin: 4px 0 -8px; font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.full { margin: 0; white-space: pre-line; color: #c3ccd8; }
.modal .hash code { white-space: normal; word-break: break-all; }
.modal .dl-big { padding: 15px; font-size: 15px; position: sticky; bottom: 0; box-shadow: 0 -18px 24px var(--panel); }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } .modal-body { padding: 0 18px 18px; } .modal-head { margin: 0 -18px; padding: 20px 18px 14px; } }

/* Navegación y sección destacada */
.nav { display: flex; align-items: center; gap: 12px; }
.nav-link { font: 600 13px var(--mono); color: var(--text); text-decoration: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); transition: .2s; }
.nav-link:hover { border-color: var(--accent); color: var(--accent); }
.feature {
  display: flex; align-items: center; gap: 20px; margin: 0 0 8px; padding: 22px 24px; text-decoration: none; color: var(--text);
  border: 1px solid #3ef0a540; border-radius: 16px; transition: .2s;
  background: radial-gradient(ellipse at 0% 0%, #3ef0a51f, transparent 60%), linear-gradient(180deg, var(--panel-2), var(--panel));
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 40px #3ef0a514; }
.feature-ico { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; font-size: 26px; color: var(--accent); border: 1.5px solid var(--accent); border-radius: 12px; box-shadow: 0 0 22px var(--accent-dim) inset; }
.feature-txt { flex: 1; min-width: 0; }
.feature h2 { margin: 2px 0 4px; font-size: 20px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .feature { flex-wrap: wrap; } .feature .btn { width: 100%; } .nav-link { padding: 6px 10px; font-size: 12px; } }
