@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --fg: #111111;
  --muted: #737373;
  --line: #e5e5e5;
  --accent: #000000;
  --radius: 14px;
  --radius-sm: 10px;
  --transition: .2s ease;
  --shadow: 0 1px 3px rgba(0,0,0,.03), 0 6px 16px rgba(0,0,0,.04);
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ── TOP BAR ── */
.admin-top {
  background: linear-gradient(120deg, #0b1220 0%, #111827 60%, #0f172a 100%);
  color: #fff;
  padding: .72rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .55rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
  box-shadow: 0 8px 28px rgba(2, 6, 23, .38);
  backdrop-filter: blur(8px);
}
.admin-top__brand {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .95rem;
}
.admin-top__brand img { height: 32px; filter: brightness(10); }
.admin-top__brand span { letter-spacing: .01em; }

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: flex-end;
}
.admin-nav a {
  color: rgba(255,255,255,.84);
  padding: .42rem .68rem;
  border-radius: 9px;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
.admin-nav a:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.2); }

/* ── LAYOUT ── */
.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.admin-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  letter-spacing: -.01em;
}

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data th, table.data td {
  text-align: left;
  padding: .7rem .6rem;
  border-bottom: 1px solid var(--line);
}
table.data th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
table.data tbody tr { transition: background var(--transition); }
table.data tbody tr:hover { background: var(--bg); }

.ins-table-wrap { min-width: 0; }
.ins-table .ins-participantes-cell {
  min-width: 220px;
  max-width: 340px;
  vertical-align: top;
}
.ins-block {
  padding: .65rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  margin-bottom: .55rem;
}
.ins-block:last-child { margin-bottom: 0; }
.ins-block--titular { border-left: 3px solid #0ea5e9; }
.ins-block--acomp { border-left: 3px solid #94a3b8; }
.ins-block__tag {
  display: inline-block;
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .35rem;
}
.ins-block__name { display: block; font-size: .9rem; margin-bottom: .2rem; }
.ins-block__meta { font-size: .72rem; color: var(--muted); line-height: 1.35; }
.ins-block__nac { font-size: .78rem; margin-top: .45rem; color: #334155; }
.ins-block__nac--muted { color: var(--muted); font-style: italic; }
.ins-age { font-weight: 700; color: #0369a1; }
.ins-acomp-list {
  margin: .35rem 0 0;
  padding-left: 1.1rem;
  font-size: .8rem;
  line-height: 1.45;
}
.ins-acomp-list li { margin-bottom: .35rem; }
.ins-acomp-fnac { font-weight: 500; color: #475569; }

.accesos-table .accesos-participante strong { display: block; font-size: 0.92rem; }
.accesos-meta {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.28rem;
  line-height: 1.35;
}
.accesos-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
  background: #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 5px;
}

/* ── STATS ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .85rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.stat:hover { transform: translateY(-2px); }
.stat b { display: block; font-size: 1.5rem; letter-spacing: -.02em; }
.stat span {
  display: block;
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .35rem;
  font-weight: 500;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .85rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-dark { background: #000; color: #fff; }
.btn-dark:hover { background: #222; transform: translateY(-1px); }
.btn-light { background: #fff; color: #000; border: 2px solid #000; }
.btn-light:hover { background: #000; color: #fff; }
.btn-block { width: 100%; }

/* ── FORMS ── */
.form-row { margin-bottom: 1rem; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: .8rem;
  margin-bottom: .35rem;
  letter-spacing: .02em;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  max-width: 520px;
  padding: .6rem .85rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
.form-row textarea { min-height: 100px; resize: vertical; }

.admin-form {
  display: grid;
  gap: .25rem;
}

.admin-form .btn {
  margin-top: .35rem;
}

.form-row {
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: .8rem .85rem;
}

.form-row label {
  color: #111827;
}

.form-row input,
.form-row select,
.form-row textarea {
  border: 1.5px solid #dbe2ea;
  background: #fff;
}

.form-row input[type="file"] {
  border: 1.5px dashed #94a3b8;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  padding: .8rem .9rem;
  cursor: pointer;
}

.form-row input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  padding: .45rem .75rem;
  margin-right: .7rem;
  font-weight: 600;
  cursor: pointer;
}

.form-help {
  margin-top: .45rem;
  font-size: .76rem;
  color: #6b7280;
}

.upload-preview {
  margin-top: .75rem;
  padding: .55rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  width: fit-content;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
}

.upload-preview img {
  display: block;
  max-width: min(300px, 100%);
  border-radius: 10px;
}

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f8f8f8 0%, #fff 100%);
}
.login-card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 2.35rem 2rem;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .12);
}
.login-card img {
  height: 56px;
  margin: 0 auto 1.25rem;
  display: block;
}
.login-card h1 {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}


.login-subtitle {
  text-align: center;
  font-size: .88rem;
  color: #6b7280;
  margin: -0.8rem 0 1.2rem;
  line-height: 1.45;
}

.login-submit {
  margin-top: 1.1rem;
  padding-top: .72rem;
  padding-bottom: .72rem;
  font-size: .9rem;
}

.login-back {
  text-align: center;
  margin-top: 1.15rem;
  font-size: .85rem;
  color: #737373;
}

.login-back a {
  text-decoration: none;
  border-bottom: 1px dashed #9ca3af;
}

.login-back a:hover {
  color: #111827;
  border-bottom-color: #111827;
}

/* ── ALERTS ── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .88rem;
  font-weight: 500;
}
.alert-err { border: 2px solid #000; background: #fafafa; }
.alert-ok { border: 2px solid var(--line); background: #f9f9f9; }

@media (max-width: 640px) {
  .admin-nav { width: 100%; justify-content: flex-start; overflow-x: auto; }
  .admin-wrap { padding: 1rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
