/* Estilo visual de tutopress.co: Poppins, azul #0181ff, marino #0a0a36.
   --primary y --accent los redefine /theme.css con los colores de Ajustes. */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap;
  src: url(../fonts/Poppins-Regular.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap;
  src: url(../fonts/Poppins-Medium.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap;
  src: url(../fonts/Poppins-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap;
  src: url(../fonts/Poppins-Bold.woff2) format("woff2"); }

:root {
  --primary: #0a0a36;
  --accent: #0181ff;
  --text: #212529;
  --text-soft: #495057;
  --muted: #6c757d;
  --line: #e6e9ed;
  --surface: #ffffff;
  --page: #f6f7f8;
  --soft: #eef1f4;
  --ok-bg: #e8f5ec;
  --ok-text: #14532d;
  --bad-bg: #fdecec;
  --bad-text: #7f1d1d;
  --warn-bg: #fdf4e0;
  --warn-text: #713f12;
  --linkedin: #0a66c2;
  --radius: 8px;
  --control: 40px;
  --shadow: 0 1px 3px rgb(16 24 40 / 8%);
  --shadow-strong: 0 2px 10px rgb(16 24 40 / 12%);
  --gutter: clamp(16px, 4vw, 32px);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 15px/1.55 var(--font); letter-spacing: -.1px; }
body.centered { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
h1, h2 { color: var(--text); font-weight: 600; letter-spacing: -.4px; }
h1 { margin: 0 0 .4rem; font-size: 1.6rem; line-height: 1.2; }
h2 { margin: 2rem 0 .75rem; font-size: 1.1rem; line-height: 1.3; letter-spacing: -.2px; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); }
code { font: 400 .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; }
small { display: block; margin-top: .25rem; color: var(--muted); font-size: .78rem; font-weight: 400; }
.muted { color: var(--muted); font-size: .9rem; }
.text-error { color: var(--bad-text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; height: var(--control);
  padding: 0 .95rem; border: 1px solid #d5dae0; border-radius: var(--radius); background: var(--surface);
  color: var(--text-soft); font: 500 .85rem/1 var(--font); letter-spacing: -.1px; white-space: nowrap;
  text-decoration: none; cursor: pointer; transition: border-color .15s, background-color .15s, filter .15s; }
.btn:hover { border-color: #aeb6bf; background: #fbfbfc; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent); border-color: transparent; filter: brightness(.93); }
.btn-linkedin { background: var(--linkedin); border-color: transparent; color: #fff; font-weight: 600; }
.btn-linkedin:hover { background: #004182; border-color: transparent; }
.btn-danger { border-color: #e3b0b0; color: #b91c1c; }
.btn-danger:hover { background: var(--bad-bg); border-color: #b91c1c; }
.btn-small { height: 32px; padding: 0 .7rem; font-size: .78rem; }

/* Formularios */
input, select, textarea { width: 100%; height: var(--control); padding: 0 .7rem; border: 1px solid #d5dae0;
  border-radius: var(--radius); background: #fff; color: var(--text); font: 400 .9rem/1.4 var(--font); letter-spacing: -.1px; }
textarea { height: auto; padding: .55rem .7rem; }
input[type="color"] { padding: 3px; }
input[type="file"] { height: auto; padding: .4rem; font-size: .82rem; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; flex: none; margin: 0; accent-color: var(--accent); }
label { display: block; font-weight: 500; font-size: .85rem; }
label > input:not([type="checkbox"], [type="radio"]), label > select, label > textarea { margin-top: .3rem; }
label.check { display: flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 400; }
.stack { display: grid; gap: 1rem; }
.form { max-width: 620px; }
.form .btn { justify-self: start; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.25rem 0; }
.actions form { display: flex; align-items: center; gap: .75rem; margin: 0; }
.search { display: flex; gap: .5rem; width: 100%; max-width: 480px; margin-bottom: 1.25rem; }
.hero .search { margin: 1.5rem auto 0; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-strong); padding: 1.75rem; }
.narrow { width: 100%; max-width: 380px; }

.alert { margin: 0 0 1rem; padding: .6rem .85rem; border-radius: var(--radius); font-size: .87rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok-text); }
.alert-error { background: var(--bad-bg); color: var(--bad-text); }
.alert-warning { background: var(--warn-bg); color: var(--warn-text); }

/* Parte pública */
.site-header { background: var(--surface); box-shadow: var(--shadow); }
.site-header .brand { display: flex; max-width: 1040px; margin: 0 auto; padding: .75rem var(--gutter); }
.brand { align-items: center; gap: .6rem; color: var(--text); font: 700 1.1rem/1.2 var(--font); letter-spacing: -.5px; text-decoration: none; }
.admin-header .brand { display: inline-flex; }
.brand img { display: block; max-height: 28px; max-width: 170px; width: auto; }
.login-logo { display: block; max-height: 40px; max-width: 100%; margin-bottom: .75rem; }
.hero { max-width: 620px; margin: 0 auto; padding: clamp(3rem, 12vh, 6rem) 16px; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.2rem); }

.status { font-size: .86rem; }
.status-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; max-width: 1040px;
  margin: 0 auto; padding: .5rem var(--gutter); }
.status-title { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.status-icon { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: currentcolor; font-size: .68rem; font-weight: 700; line-height: 1; }
.status-icon span { color: #fff; }
.status-valid { background: var(--ok-bg); color: var(--ok-text); }
.status-revoked { background: var(--bad-bg); color: var(--bad-text); }
.status-expired { background: var(--warn-bg); color: var(--warn-text); }
.status-deleted { background: var(--soft); color: var(--text); }

.verify { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start; max-width: 1040px; margin: 0 auto; padding: 2rem var(--gutter) 3rem; }
.eyebrow { margin: 0 0 .25rem; color: var(--text-soft); font-size: .82rem; font-weight: 500; }
.recipient { margin-bottom: .2rem; font-size: clamp(1.7rem, 4.5vw, 2.1rem); font-weight: 700; letter-spacing: -.6px; overflow-wrap: anywhere; }
.course { margin: 0 0 .6rem; font-size: 1.05rem; font-weight: 600; line-height: 1.3; letter-spacing: -.2px; }
.verify-main > p { color: var(--text-soft); font-size: .9rem; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.tags li { padding: .15rem .6rem; border-radius: 999px; background: var(--soft); color: var(--text-soft); font-size: .76rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem 1.5rem; margin: 1.25rem 0 0; }
.facts dt, .tech dt { color: var(--muted); font-size: .74rem; }
.facts dd, .tech dd { margin: 0; font-size: .88rem; font-weight: 500; overflow-wrap: anywhere; }
.thumbnail { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-strong); }
.tech { display: grid; gap: .7rem; margin: 1rem 0 0; }
.tech dd { font-weight: 400; }
.hash { display: block; margin-bottom: .4rem; font-size: .7rem; word-break: break-all; color: var(--muted); }

/* Panel */
.admin-header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.75rem;
  padding: .55rem max(var(--gutter), calc((100% - 1120px) / 2 + var(--gutter)));
  background: var(--surface); box-shadow: var(--shadow); }
.admin-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; flex: 1; }
.admin-header nav a { color: var(--text-soft); text-decoration: none; font-size: .85rem; font-weight: 500; }
.admin-header nav a:hover { color: var(--accent); }
.admin-header form { margin: 0; }
.admin { max-width: 1120px; margin: 0 auto; padding: 1.5rem var(--gutter) 3rem; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.title-row h1 { margin: 0; overflow-wrap: anywhere; }
.stats { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; padding: 0; list-style: none; }
.stats li { min-width: 120px; padding: .55rem .85rem; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--muted); font-size: .76rem; }
.stats strong { display: block; color: var(--text); font-size: 1.3rem; font-weight: 600; line-height: 1.25; letter-spacing: -.4px; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: .74rem; white-space: nowrap; }
th, td { padding: .5rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
td code { white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-error { background: var(--bad-bg); }
.row-warning { background: var(--warn-bg); }
.badge { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .74rem; white-space: nowrap; }
.badge-valid { background: var(--ok-bg); color: var(--ok-text); }
.badge-revoked { background: var(--bad-bg); color: var(--bad-text); }
.badge-expired { background: var(--warn-bg); color: var(--warn-text); }
.badge-deleted { background: var(--soft); color: var(--text); }
.progress { margin: 1rem 0; padding: .85rem 1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.progress p { margin: 0 0 .4rem; font-size: .87rem; }
progress { width: 100%; height: 10px; accent-color: var(--accent); }
.current-image { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .6rem .75rem;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.current-image img { max-height: 56px; max-width: 200px; }
.access { display: grid; gap: .5rem; margin: 0; padding: .9rem 1rem; border: 0; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); }
.access legend { float: left; width: 100%; margin-bottom: .2rem; font-size: .87rem; font-weight: 600; }
.access .muted, .access .alert { margin: .25rem 0 0; }
.access-list { display: grid; gap: .5rem; margin-top: .25rem; }
.access:has(input[value="all"]:checked) .access-list { display: none; }
.danger-zone { max-width: 620px; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

@media (max-width: 800px) {
  .verify { grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; }
  .verify .actions .btn { flex: 1 1 auto; }
  .admin-header { justify-content: space-between; }
  .admin-header nav { flex: 1 0 100%; order: 3; }
}
