/* Modelista Fit · Biblioteca — paleta vinho futurista */
:root {
  --v950: #0d0306; --v900: #14050a; --v850: #1c0710; --v800: #250a15; --v700: #3b0d1f; --v600: #5c1228; --v500: #7d1a37;
  --v400: #a3244a; --neon: #ff3d6e; --neon2: #ff7a9c; --rose: #ffb3c6; --gold: #f2c3a7;
  --ink: #f8e9ee; --muted: #c08f9f; --faint: #8a5f6d;
  --line: rgba(255, 140, 175, .16); --line2: rgba(255, 140, 175, .30);
  --glass: linear-gradient(160deg, rgba(92, 18, 40, .55), rgba(28, 7, 16, .72));
  --ok: #5fe0a5; --err: #ff6b7f; --warn: #ffc46b;
  --r: 18px;
  --f-d: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-b: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-m: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--v950); color: var(--ink); font: 15px/1.55 var(--f-b); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--rose); }
code { font: 13px var(--f-m); background: rgba(255, 61, 110, .12); padding: 1px 6px; border-radius: 6px; color: var(--rose); }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
svg { flex: none; }

/* fondo */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 700px at 80% -10%, #3b0d1f 0%, transparent 60%), radial-gradient(900px 600px at -10% 110%, #2a0915 0%, transparent 60%), var(--v950); }
.bg .grid { position: absolute; inset: -50%; background-image: linear-gradient(rgba(255, 90, 140, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 90, 140, .07) 1px, transparent 1px); background-size: 46px 46px; transform: perspective(900px) rotateX(58deg) translateY(-8%); transform-origin: center top; mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%); }
.bg .glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; }
.bg .g1 { width: 520px; height: 520px; background: #a3244a; top: -160px; right: -120px; }
.bg .g2 { width: 420px; height: 420px; background: #5c1228; bottom: -160px; left: -100px; }
@media (prefers-reduced-motion: no-preference) { .bg .g1 { animation: drift 18s ease-in-out infinite alternate; } .bg .g2 { animation: drift 22s ease-in-out infinite alternate-reverse; } }
@keyframes drift { to { transform: translate(-60px, 50px) scale(1.12); } }

.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 20px 50px -30px rgba(0, 0, 0, .9); }

/* marca */
.brand { display: flex; align-items: center; gap: 10px; font: 600 17px/1 var(--f-d); letter-spacing: .02em; white-space: nowrap; }
.brand b { color: var(--neon); font-weight: 800; margin-left: 4px; }
.brand .mk { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--v400), var(--v600)); box-shadow: 0 0 20px rgba(255, 61, 110, .45); }
.brand .mk svg { width: 18px; height: 18px; fill: none; stroke: var(--rose); stroke-width: 2; stroke-linejoin: round; }
.brand.big { font-size: 26px; justify-content: center; }
.brand.big .mk { width: 46px; height: 46px; border-radius: 13px; }
.brand.big .mk svg { width: 26px; height: 26px; }

/* botones */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, transform .1s; white-space: nowrap; }
.btn:hover { border-color: var(--neon2); background: rgba(255, 61, 110, .08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.neon { background: linear-gradient(135deg, var(--neon), var(--v400)); border-color: transparent; color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 8px 26px -8px rgba(255, 61, 110, .7); }
.btn.neon:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 10px 30px -6px rgba(255, 61, 110, .9); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.btn.danger { border-color: rgba(255, 107, 127, .45); color: #ffc2cb; }
.btn.danger:hover { background: rgba(255, 107, 127, .14); border-color: var(--err); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px; font-size: 13px; }
.link:hover { color: var(--rose); }

/* carga */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); font: 13px var(--f-m); letter-spacing: .1em; text-transform: uppercase; }
.ring { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255, 61, 110, .2); border-top-color: var(--neon); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
.login { min-height: 100vh; display: grid; place-content: center; padding: 24px 16px; gap: 14px; }
.login-card { width: min(420px, calc(100vw - 32px)); padding: 34px 30px 26px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, var(--neon), transparent); }
.tag { text-align: center; color: var(--muted); margin: 6px 0 18px; font-size: 13px; letter-spacing: .04em; }
form { display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font: 600 11px var(--f-m); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.fld input, .search input, select { width: 100%; background: rgba(13, 3, 6, .6); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.fld input:focus, .search input:focus, select:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(255, 61, 110, .18); }
.pw { position: relative; }
.pw input { padding-right: 46px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; opacity: .7; padding: 6px; }
.msg { min-height: 1.3em; font-size: 13px; color: var(--err); text-align: center; }
.msg.ok { color: var(--ok); }
.foot { text-align: center; color: var(--faint); font-size: 12px; margin: 0; }

/* barra superior */
.top { position: sticky; top: 10px; z-index: 20; margin: 10px max(16px, env(safe-area-inset-left)) 0; padding: 10px 14px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-radius: 16px; }
.crumbs { flex: 1; min-width: 0; color: var(--muted); font: 12px var(--f-m); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--rose); font-weight: 600; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.who span:not(.dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); flex: none; }

.wrap { padding: 26px max(16px, env(safe-area-inset-left)) 60px; max-width: 1380px; margin: 0 auto; }

/* biblioteca */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
h1 { font: 800 clamp(26px, 4vw, 40px)/1.05 var(--f-d); margin: 0 0 8px; letter-spacing: -.01em; background: linear-gradient(100deg, #fff 10%, var(--rose) 55%, var(--neon) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font: 600 15px/1.2 var(--f-d); margin: 0; letter-spacing: .02em; }
.sub { margin: 0; color: var(--muted); max-width: 60ch; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi { padding: 10px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(37, 10, 21, .6); min-width: 104px; }
.kpi .v { font: 800 24px/1.1 var(--f-d); color: var(--rose); font-variant-numeric: tabular-nums; }
.kpi .l { font: 11px var(--f-m); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px; margin-bottom: 20px; }
.search { flex: 1 1 260px; position: relative; display: block; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { padding-left: 40px; }
select { width: auto; padding: 10px 12px; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 12px; padding: 3px; background: rgba(13, 3, 6, .5); }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--v500); color: #fff; box-shadow: 0 0 14px rgba(255, 61, 110, .35); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.card { position: relative; padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s; text-align: left; border-radius: var(--r); }
.card:hover { transform: translateY(-3px); border-color: rgba(255, 61, 110, .55); box-shadow: 0 0 0 1px rgba(255, 61, 110, .25), 0 24px 50px -24px rgba(255, 61, 110, .45); }
.thumb { height: 190px; position: relative; background: radial-gradient(circle at 50% 40%, var(--v700), var(--v900)); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 86%; height: 86%; }
.thumb::after { content: ""; position: absolute; inset: auto 0 0; height: 60%; background: linear-gradient(transparent, rgba(20, 5, 10, .95)); pointer-events: none; }
.badge { position: absolute; top: 12px; left: 12px; z-index: 2; font: 600 10.5px var(--f-m); letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: rgba(13, 3, 6, .7); border: 1px solid var(--line2); color: var(--rose); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; margin-top: -40px; position: relative; z-index: 2; }
.card h3 { margin: 0; font: 600 16px/1.25 var(--f-d); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 12px var(--f-m); padding: 3px 8px; border-radius: 8px; background: rgba(255, 179, 198, .08); border: 1px solid var(--line); color: var(--muted); }
.chip.sz { color: var(--ink); display: inline-flex; align-items: center; gap: 5px; }
.chip.sz i { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.card .date { font: 11.5px var(--f-m); color: var(--faint); }

.empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { color: var(--muted); max-width: 52ch; margin: 0 0 8px; }
.big-ic { font-size: 40px; color: var(--neon); text-shadow: 0 0 24px var(--neon); }

/* detalle */
.d-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.d-status { min-height: 1.4em; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.d-status.ok { color: var(--ok); } .d-status.err { color: var(--err); }
.d-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .d-grid { grid-template-columns: minmax(0, 1fr); } }
.d-info { padding: 16px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 88px; }
@media (max-width: 960px) { .d-info { position: static; } }
.d-info h1 { font-size: 24px; margin: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.photos figure { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--v900); position: relative; }
.photos img { width: 100%; display: block; aspect-ratio: 3/4; object-fit: cover; }
.photos figcaption { position: absolute; left: 6px; bottom: 6px; font: 10px var(--f-m); letter-spacing: .1em; text-transform: uppercase; background: rgba(13, 3, 6, .75); padding: 2px 7px; border-radius: 6px; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13.5px; }
dl.facts dt { color: var(--muted); font: 11px var(--f-m); text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
dl.facts dd { margin: 0; }
.txt { font-size: 13px; color: var(--muted); white-space: pre-wrap; border-left: 2px solid var(--v400); padding-left: 10px; }
.d-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { padding: 16px; min-width: 0; }
.p-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font: 600 12px var(--f-m); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.mesa { background: #1a0a10; border: 1px solid var(--line); border-radius: 14px; overflow: auto; }
.mesa svg { display: block; width: 100%; height: auto; min-width: 560px; }
.pieces-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.pl { display: flex; gap: 10px; align-items: baseline; padding: 9px 11px; border-radius: 12px; background: rgba(13, 3, 6, .45); border: 1px solid var(--line); }
.pl .L { font: 800 20px/1 var(--f-d); color: var(--neon); }
.pl .t { font-weight: 700; font-size: 13px; }
.pl .s { font: 11.5px var(--f-m); color: var(--muted); }
.charts { display: grid; gap: 12px; }
.charts .svgbox { border-radius: 12px; overflow: hidden; background: #fff; }
.charts .svgbox svg { display: block; width: 100%; height: auto; }
.meds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.tw { overflow-x: auto; }
table.mt { width: 100%; border-collapse: collapse; font-size: 13px; }
.mt caption { text-align: left; font: 600 13px var(--f-d); padding-bottom: 8px; color: var(--rose); }
.mt th { font: 600 11px var(--f-m); color: var(--muted); text-align: right; padding: 6px; border-bottom: 1px solid var(--line2); letter-spacing: .05em; }
.mt td { padding: 6px; border-bottom: 1px solid var(--line); text-align: right; font: 13px var(--f-m); font-variant-numeric: tabular-nums; }
.mt th:first-child, .mt td:first-child { text-align: left; font-family: var(--f-b); }
.mt td small { color: var(--faint); }
.notes { display: grid; gap: 12px; font-size: 13.5px; }
.notes ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.notes b { color: var(--rose); }

/* modales */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8, 2, 4, .7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.sheet { width: min(640px, 100%); max-height: 90vh; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.sheet.small { width: min(420px, 100%); }
.sheet p { margin: 0; color: var(--muted); }
.m-head { display: flex; justify-content: space-between; align-items: center; }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; }
.x { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; padding: 6px; }
.drop { border: 1.5px dashed var(--line2); border-radius: 16px; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:hover, .drop.over { border-color: var(--neon); background: rgba(255, 61, 110, .07); }
.drop span { color: var(--muted); font-size: 13px; }
.drop-ic { font-size: 28px; color: var(--neon); text-shadow: 0 0 18px var(--neon); }
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.queue li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(13, 3, 6, .5); border: 1px solid var(--line); font-size: 13px; }
.queue li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .ok { color: var(--ok); } .queue .err { color: var(--err); } .queue .run { color: var(--warn); }

.skel { height: 300px; border-radius: var(--r); background: linear-gradient(100deg, rgba(92, 18, 40, .25) 30%, rgba(163, 36, 74, .35) 50%, rgba(92, 18, 40, .25) 70%); background-size: 300% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -150% 0; } }

@media (max-width: 640px) {
  .top { gap: 10px; }
  .crumbs { order: 3; flex-basis: 100%; }
  .who span:not(.dot) { max-width: 140px; }
  .bar select { flex: 1; }
  .d-actions .btn { flex: 1 1 auto; justify-content: center; }
}
