/* Web del Archivo AMC · móvil primero · estilo Crimson de los carteles */
@font-face { font-family: "Crimson Text"; src: url("fonts/CrimsonText-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Crimson Text"; src: url("fonts/CrimsonText-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --red: #9e1b28; --red-2: #b91c2c; --red-soft: #f8e7e8; --ink: #22181a; --ink-2: #5d5154; --line: #e7dfdb;
  --bg: #f7f3ef; --card: #ffffff; --ok: #1f7a4d; --warn: #9a6700;
  --serif: "Crimson Text", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px; --tap: 48px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
body.auth { padding-bottom: 24px; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
h2 { font-size: 1.3rem; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* cabecera */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--red); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 1.25rem/1 var(--serif); letter-spacing: .01em; }
.brand img { object-fit: contain; }
.top-link { color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 4px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px 24px; }

/* barra inferior */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px; color: var(--ink-2);
  text-decoration: none; font-size: .74rem; font-weight: 600; min-height: 58px; justify-content: center; }
.tabbar a.on { color: var(--red); }
.tabbar a.on svg { stroke-width: 2.4; }

/* tarjetas y textos */
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 12px; color: inherit; text-decoration: none; }
.card.stack > h2 { margin: 0; }
.card.empty, .empty { color: var(--ink-2); text-align: center; padding: 24px 16px; }
.highlight { border-color: var(--red); background: var(--red-soft); }
.page-title { font-size: 1.75rem; margin: 6px 2px 12px; }
.work-title { font-size: 1.7rem; margin: 2px 0 4px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--red); }
.lead { font-size: 1.08rem; margin: 0 0 4px; font-weight: 600; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.center { text-align: center; }
.section { font-size: 1.35rem; margin: 20px 2px 10px; }
.group { font: 700 .8rem/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 18px 4px 8px; }
.back { display: inline-block; padding: 6px 2px 10px; text-decoration: none; font-weight: 600; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 12px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.tag-concert { margin: 10px 0 0; padding: 8px 10px; background: var(--red-soft); border-radius: 10px; font-size: .92rem; }

/* avisos */
.flash { background: #fff8e6; border: 1px solid #f0d58c; color: #5c4400; border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.flash-error { background: #fdecec; border-color: #f1b5b8; color: #7d1420; }
.dot { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 10px;
  background: #fff; color: var(--red); font-size: .75rem; font-weight: 800; }
.filters .dot, .subnav .dot { background: var(--red); color: #fff; }

/* formularios */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .92rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #cfc4bf; border-radius: 12px;
  padding: 11px 12px; min-height: var(--tap); width: 100%; }
textarea { min-height: 96px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92rem; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(185,28,44,.22); border-color: var(--red-2); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
label.check input { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; accent-color: var(--red); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 16px; border-radius: 12px;
  border: 1px solid #cfc4bf; background: #fff; color: var(--ink); font: 600 1rem/1.1 var(--sans); text-decoration: none; cursor: pointer; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger { color: #a3121f; border-color: #e7a9ae; }
.btn-ghost { background: transparent; }
.btn-big { min-height: 56px; font-size: 1.08rem; width: 100%; }
.btn-wide { width: 100%; margin: 4px 0 12px; }
.copy { display: flex; gap: 8px; }
.copy input { font-size: .85rem; }

/* acceso */
.auth-card { max-width: 440px; margin: 18px auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 18px; text-align: left; }
.auth-card h1 { font-size: 1.8rem; text-align: center; }
.auth-card > .muted { text-align: center; }
.crest { display: block; margin: 0 auto 10px; object-fit: contain; }

/* buscador */
.searchbar { position: relative; }
.searchbar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.searchbar input { padding-left: 44px; font-size: 1.05rem; min-height: 52px; border-radius: 26px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; margin: 0 -14px; padding-left: 14px; padding-right: 14px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; scroll-snap-align: start; padding: 9px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.filters { margin: 8px 0 0; }
.filters summary { list-style: none; width: auto; display: inline-flex; }
.filters summary::-webkit-details-marker { display: none; }
.filter-body { margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.count { color: var(--ink-2); font-size: .9rem; margin: 10px 4px 6px; }

/* listas */
.list, .parts, .program { list-style: none; margin: 0 0 12px; padding: 0; }
.list > li, .program > li { margin: 0 0 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; color: inherit; text-decoration: none; min-height: 64px; }
a.item:active { background: #fbf7f5; }
.item-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.item-title { font-weight: 700; font-size: 1.02rem; line-height: 1.25; overflow-wrap: anywhere; }
.item-sub { color: var(--ink-2); font-size: .9rem; overflow-wrap: anywhere; }
.item-meta { color: #8a7d80; font-size: .8rem; margin-top: 2px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.list.compact .item { min-height: 52px; padding: 8px 12px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-grey { background: #efeae7; color: #6f6366; }
.badge-red { background: #fdecec; color: #a3121f; }
.badge-dark { background: var(--ink); color: #fff; }
.num { flex: none; width: 30px; height: 30px; border-radius: 15px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-weight: 800; }

/* partes */
.part { display: flex; gap: 8px; margin: 0 0 8px; }
.part-open { flex: 1; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; min-height: 60px; color: inherit; text-decoration: none; min-width: 0; }
.part-open svg { color: var(--red); }
.part-open span { display: flex; flex-direction: column; min-width: 0; }
.part-open b { overflow-wrap: anywhere; }
.part-open small { color: var(--ink-2); }
.part-dl { flex: none; width: 60px; display: grid; place-items: center; background: var(--red); color: #fff; border-radius: var(--r); }

/* conciertos */
.concert { display: flex; align-items: center; gap: 14px; }
.concert.past { opacity: .72; }
.date-box { flex: none; width: 58px; height: 62px; border-radius: 12px; background: var(--red); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1; }
.date-box b { font: 700 1.7rem/1 var(--serif); }
.date-box small { text-transform: uppercase; font-size: .72rem; font-weight: 700; letter-spacing: .06em; margin-top: 3px; }

/* cajas y escáner */
.box-head { display: flex; gap: 14px; align-items: center; }
.box-code { flex: none; min-width: 74px; padding: 14px 10px; border-radius: 12px; background: var(--ink); color: #fff; text-align: center;
  font: 700 1.3rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; }
.box-code.small { min-width: 58px; padding: 9px 6px; font-size: .95rem; }
.scanner { text-align: center; }
.viewfinder { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; margin: 0 0 12px; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.aim { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.9); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* gestión */
.subnav { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 14px; padding: 0 14px 2px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; background: #efeae7; }
.subnav a.on { background: var(--ink); color: #fff; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-decoration: none; color: inherit; }
.stat b { display: block; font: 700 2rem/1 var(--serif); }
.stat span { color: var(--ink-2); font-size: .85rem; }
.stat-hot { border-color: var(--red); background: var(--red-soft); }
.stat-hot b { color: var(--red); }
.steps { margin: 0; padding-left: 1.2em; }
.steps li { margin: 0 0 6px; }
.match { padding: 8px 10px; border-radius: 10px; font-size: .92rem; background: #efeae7; }
.match-ok { background: #e6f4ec; color: var(--ok); }
.match-instrumento, .match-parecido { background: #fff4d6; color: var(--warn); }
.match-no, .match-duplicado { background: #fdecec; color: #a3121f; }
details.user summary, details.perm summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
details.user summary::-webkit-details-marker, details.perm summary::-webkit-details-marker { display: none; }
details.user[open] summary, details.perm[open] summary { margin-bottom: 12px; }
.user-off { opacity: .7; }

@media (min-width: 700px) {
  .wrap { padding-top: 22px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .btn-wide { width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media (min-width: 700px) {
  .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 12px 0 4px; }
  .subnav { flex-wrap: wrap; overflow: visible; margin: 0 0 14px; padding: 0; }
}
