/* fichas-tv — layout de la app sobre el design system de 1950foto (ds.css).
   Tema carbón, celeste como única voz de marca, Fraunces 900 en titulares/cifras. */

.hidden { display: none !important; }
.error { color: var(--rojo); min-height: 1.2em; margin: .5rem 0 0; font-size: 13px; }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--superficie); border: 1px solid var(--borde);
  border-radius: 14px; padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.login-card h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 900; font-size: 26px; }
.login-card .input { text-align: center; }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 22px; background: var(--superficie); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 5; }
.brand { font-family: 'Fraunces', Georgia, serif; font-weight: 900; font-size: 16px; color: var(--texto); }
.brand span { color: var(--acento); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- layout de 3 columnas ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr 1.1fr; gap: 1px; background: var(--borde); min-height: calc(100vh - 55px); }
.col { background: var(--fondo); padding: 18px 16px; overflow-y: auto; }
.col > h2 { font-family: 'Fraunces', Georgia, serif; font-weight: 900; font-size: 15px; margin: 0 0 14px; }
.subcap { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-sec); }

/* ---------- listas (clubes / personas) ---------- */
.list { display: flex; flex-direction: column; gap: 6px; }
.item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px;
  cursor: pointer; transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.item:hover { border-color: var(--acento); transform: translateY(-1px); background: #171C21; }
.item.active { border-color: var(--acento); background: #171C21; }
.item .name { flex: 1; font-size: 14px; }
.item .jersey { color: var(--texto-sec); font-size: 12px; min-width: 1.5em; text-align: center; font-family: 'Fraunces', Georgia, serif; font-weight: 900; }
.item .crest { width: 22px; height: 22px; object-fit: contain; }

.kits-badge { font-size: 11px; color: var(--texto-sec); background: var(--superficie-alt); border-radius: 20px; padding: 1px 8px; }
.kits-badge.ok { background: var(--acento); color: var(--acento-ink); font-weight: 600; }

/* puntos de estado */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--borde-fuerte); flex: none; }
.dot.done { background: var(--verde); }
.dot.approved { background: var(--acento); }
.dot.error { background: var(--rojo); }
.dot.pending, .dot.swapping, .dot.removing { background: var(--acento-hover); }

/* ---------- camisetas de referencia ---------- */
.kits { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--borde-fuerte); }
.kits-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kits-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-sec); }
.kits-actions { display: flex; gap: 6px; align-items: center; }
.btn-ghost.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-add { background: var(--acento); color: var(--acento-ink); border: none; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-add:hover { background: var(--acento-hover); }
.kit-group { margin-top: 8px; }
.kit-group-head { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-sec); margin: 6px 0 5px; }
.kits-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.kit-card { position: relative; background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; padding: 7px; display: flex; flex-direction: column; gap: 6px; }
.kit-thumb { aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; background: var(--superficie-alt); }
.kit-thumb img { width: 100%; height: 100%; object-fit: contain; }
.kit-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.kit-del:hover { background: var(--rojo); }
.kit-meta { display: flex; flex-direction: column; line-height: 1.15; }
.kit-name { font-family: 'Fraunces', Georgia, serif; font-weight: 900; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit-year { font-size: 11px; color: var(--texto-sec); }

/* formulario agregar camiseta */
.add-form { margin-top: 12px; background: var(--superficie); border: 1px solid var(--borde-fuerte); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.af-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--texto-sec); line-height: 1.4; margin: 0; padding: 8px 10px; background: var(--superficie-alt); border-radius: 8px; border-left: 2px solid #d29922; }
.hint b { color: var(--texto); }
.af-src { display: flex; gap: 8px; flex-wrap: wrap; }
.af-src button { flex: 1; min-width: 140px; }
.af-preview { display: flex; align-items: center; gap: 10px; }
.af-preview img { width: 76px; border-radius: 8px; border: 1px solid var(--borde); object-fit: contain; background: var(--superficie-alt); max-height: 120px; }

/* galería de fotos de estudio */
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 4px; background: var(--fondo); border: 1px solid var(--borde); border-radius: 10px; }
.sg-item { padding: 0; border: 2px solid var(--borde); border-radius: 9px; overflow: hidden; background: var(--superficie-alt); cursor: pointer; display: flex; flex-direction: column; }
.sg-item:hover { border-color: var(--acento); }
.sg-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: center top; display: block; }
.sg-item span { font-size: 9px; color: var(--texto-sec); padding: 2px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* recortador + galería grande (modal) */
.fv-modal { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 100; display: grid; place-items: center; padding: 20px; }
.cropper-box { background: var(--superficie); border: 1px solid var(--borde-fuerte); border-radius: 14px; padding: 16px; width: min(720px, 96vw); max-height: 94vh; box-shadow: 0 24px 70px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 12px; }
.cropper-box.big { width: min(1000px, 96vw); }
.cropper-head { font-size: 15px; font-family: 'Fraunces', Georgia, serif; font-weight: 900; }
.cropper-head .muted { font-family: -apple-system, sans-serif; font-weight: 400; font-size: 12px; }
.cropper-main { display: flex; gap: 12px; align-items: stretch; }
.cropper-main .cropper-stage { flex: 1; min-width: 0; }
.cropper-stage { max-height: 56vh; overflow: hidden; background: var(--fondo); border-radius: 8px; }
.cropper-stage img { max-width: 100%; display: block; }
.cropper-side { width: 250px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.cs-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-sec); }
.cs-lbl .muted { text-transform: none; letter-spacing: 0; }
.cr-preview { flex: 1; background: var(--fondo); border: 1px solid var(--borde); border-radius: 8px; display: grid; place-items: center; padding: 8px; overflow: hidden; }
@media (max-width: 760px) { .cropper-main { flex-direction: column; } .cropper-side { width: 100%; } .cr-preview { min-height: 120px; } }
.cropper-tools { display: flex; align-items: center; gap: 10px; }
.cropper-tools .tool-lbl { font-size: 12px; color: var(--texto-sec); }
.cropper-tools input[type=range] { flex: 1; accent-color: var(--acento); }
.cropper-tools .tool-val { font-size: 12px; color: var(--texto); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.cropper-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cropper-ratios { display: flex; gap: 6px; flex-wrap: wrap; }
.ratio-btn { background: var(--superficie-alt); border: 1px solid var(--borde-fuerte); color: var(--texto-sec); border-radius: 7px; padding: 5px 9px; font-size: 12px; cursor: pointer; }
.ratio-btn.sel { border-color: var(--acento); color: var(--acento); }
.cropper-actions { display: flex; gap: 8px; }

/* galería grande de fotos de estudio */
.gallery-box .lg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 74vh; overflow-y: auto; padding: 4px 2px; }
.lg-item { padding: 0; border: 2px solid var(--borde); border-radius: 10px; overflow: hidden; background: var(--superficie-alt); cursor: pointer; display: flex; flex-direction: column; transition: border-color .12s, transform .12s; }
.lg-item:hover { border-color: var(--acento); transform: translateY(-2px); }
.lg-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: center top; display: block; }
.lg-item span { font-size: 12px; color: var(--texto); padding: 5px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.af-row .af-year { grid-column: span 2; max-width: 120px; }

/* ---------- encabezados de grupo en el plantel ---------- */
.group-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-sec); margin: 16px 0 8px; padding-left: 2px; }
.group-head:first-child { margin-top: 0; }

/* ---------- generación ---------- */
.work-empty { padding: 8px 0; color: var(--texto-sec); font-size: 14px; }
.work-card { display: flex; flex-direction: column; gap: 14px; }
.work-card h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 900; font-size: 20px; margin: 0; }
.mode-toggle { display: flex; gap: 6px; background: var(--superficie-alt); padding: 4px; border-radius: 10px; }
.mode-btn { flex: 1; background: transparent; border: none; color: var(--texto-sec); border-radius: 7px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.mode-btn.sel { background: var(--acento); color: var(--acento-ink); font-weight: 600; }
#work-body { display: flex; flex-direction: column; gap: 14px; }
.grp-tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; vertical-align: middle; margin-left: 8px; background: var(--superficie-alt); color: var(--texto-sec); font-family: -apple-system, sans-serif; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--texto-sec); }
.jersey-preview img { width: 120px; max-height: 200px; border-radius: 10px; border: 1px solid var(--borde); display: block; object-fit: contain; background: var(--superficie-alt); }
.jersey-preview img[src=""] { display: none; }

.dropzone {
  border: 1.5px dashed var(--borde-fuerte); border-radius: 12px; padding: 20px;
  text-align: center; cursor: pointer; color: var(--texto-sec); font-size: 13px; transition: border-color .15s ease, color .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--acento); color: var(--texto); }

.preview-row { display: flex; gap: 14px; flex-wrap: wrap; }
.preview-box { flex: 1; min-width: 150px; }
.preview-box .cap { font-size: 11px; color: var(--texto-sec); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.preview-box img {
  width: 100%; border-radius: 10px; border: 1px solid var(--borde);
  background-image: linear-gradient(45deg, #232B33 25%, transparent 25%), linear-gradient(-45deg, #232B33 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #232B33 75%), linear-gradient(-45deg, transparent 75%, #232B33 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* comparación de caras (aprobar) */
.face-compare { margin: 4px 0; }
.fc-row { display: flex; gap: 10px; }
.fc-item { flex: 1; cursor: pointer; }
.fc-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--borde); display: block; }
.fc-item:hover img { border-color: var(--acento); }
.fc-item span { display: block; text-align: center; font-size: 11px; color: var(--texto-sec); margin-top: 4px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
a.download { text-decoration: none; }
.status-line { font-size: 13px; display: flex; align-items: center; gap: 8px; color: var(--texto-sec); }
.spinner { width: 14px; height: 14px; border: 2px solid var(--borde-fuerte); border-top-color: var(--acento); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- selector de fotos de estudio ---------- */
.photo-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-pick { position: relative; padding: 0; border: 2px solid var(--borde); border-radius: 9px; overflow: hidden; cursor: pointer; background: var(--superficie-alt); aspect-ratio: 3/4; transition: border-color .12s ease, transform .12s ease; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.photo-pick:hover { border-color: var(--acento-hover); transform: translateY(-2px); }
.photo-pick.sel { border-color: var(--acento); }
.photo-pick .zoom-badge { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; display: grid; place-items: center; opacity: 0; transition: opacity .12s; }
.photo-pick:hover .zoom-badge { opacity: 1; }
.photo-pick .pend { position: absolute; bottom: 0; left: 0; right: 0; font-size: 9px; text-align: center; background: rgba(210,153,34,.9); color: #201400; }

/* visor grande (lightbox) */
.lightbox { position: relative; width: min(96vw, 1100px); height: 92vh; background: var(--superficie); border: 1px solid var(--borde-fuerte); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.6); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lb-name { font-family: 'Fraunces', Georgia, serif; font-weight: 900; font-size: 16px; }
.lb-tools { display: flex; align-items: center; gap: 8px; }
.lb-count { font-size: 12px; color: var(--texto-sec); font-variant-numeric: tabular-nums; margin-right: 4px; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; background: var(--fondo); border-radius: 8px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-stage.full { align-items: flex-start; justify-content: flex-start; }
.lb-stage.full img { max-width: none; max-height: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb-nav:hover { background: var(--acento); color: var(--acento-ink); }
.lb-prev { left: 20px; } .lb-next { right: 20px; }
.upload-link { color: var(--texto-sec); font-size: 12px; cursor: pointer; align-self: center; }
.upload-link:hover { color: var(--acento); }

/* ---------- botones / badges / campos (alias sobre tokens del DS) ---------- */
button.primary, .login-card button { background: var(--acento); color: var(--acento-ink); border: none; border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 13px; cursor: pointer; }
button.primary:hover, .login-card button:hover { background: var(--acento-hover); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.secondary, button.ghost { background: transparent; color: var(--texto-sec); border: 1px solid var(--borde-fuerte); border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
button.secondary:hover, button.ghost:hover { color: var(--texto); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; background: var(--superficie-alt); color: var(--texto-sec); }
.badge.mock { background: var(--superficie-alt); color: var(--acento-hover); border: 1px solid var(--borde-fuerte); }
.badge.live { background: var(--acento); color: var(--acento-ink); font-weight: 600; }
.badge.low { background: var(--rojo); color: #fff; }

.input, .field select { background: var(--superficie-alt); color: var(--texto); border: 1px solid var(--borde-fuerte); border-radius: 8px; padding: 9px 11px; font-size: 14px; width: 100%; }

/* ---------- responsive (celular) ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .col { max-height: none; }
}
