:root {
    color-scheme: light;
    --ink: #0b0b10;
    --purple: #a000e8;
    --neon: #d500ff;
    --paper: #fff;
    --quiet: #f5f5f7;
    --line: #e8e5ec;
    --muted: #625c6a;
    font: 100%/1.5 system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
body:has(.viewer[open]) { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: #7900ad; text-underline-offset: .22em; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8700c4; outline-offset: 3px; }
h1, h2, p, figure { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -.055em; font-weight: 850; }
h2 { font-size: 1.2rem; letter-spacing: -.02em; }
.shell { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: var(--ink); border-bottom: 2px solid #7412a6; color: white; }
.wordmark { display: flex; align-items: center; gap: .75rem; min-height: 62px; color: inherit; text-decoration: none; font-weight: 900; letter-spacing: .085em; text-transform: uppercase; overflow-wrap: anywhere; }
.brand-mark { width: 28px; height: 24px; flex: 0 0 28px; background: linear-gradient(140deg, #7600cd, var(--neon)); clip-path: polygon(12% 0,100% 0,89% 29%,51% 71%,79% 71%,68% 100%,0 100%,10% 71%,50% 29%,0 29%); }
.catalog { flex: 1; padding-block: clamp(1.5rem, 4vw, 3rem) 4rem; }
.banner { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 12px 36px #17002914; }
#catalogo { scroll-margin-top: 1rem; }
.banner + #catalogo { margin-top: clamp(2rem, 5vw, 4rem); }
#catalog-title { margin-bottom: clamp(1.4rem, 4vw, 2.5rem); text-align: center; text-transform: uppercase; overflow-wrap: anywhere; }
#catalog-title::after { content: ''; display: block; width: 48px; height: 4px; border-radius: 4px; margin: 1rem auto 0; background: linear-gradient(90deg, var(--purple), var(--neon)); }
.art-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.55rem, 1.5vw, 1rem); }
.artwork { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--quiet); box-shadow: 0 3px 12px #1602200a; transition: box-shadow .2s, border-color .2s; }
.artwork img, .manage-card img { width: 100%; height: 100%; object-fit: contain; }
.artwork img { min-height: 0; transition: transform .22s ease; }
@media (hover: hover) {
    .artwork:hover { border-color: #ad29e2; box-shadow: 0 5px 20px #a000e821; }
    .artwork:hover img { transform: scale(1.025); }
}
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.85rem; }
.pagination a { display: grid; place-items: center; min-width: 42px; min-height: 42px; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 7px; color: inherit; text-decoration: none; font-weight: 720; }
.pagination a:hover { border-color: var(--purple); }
.pagination .page-step { background: var(--ink); border-color: var(--ink); color: white; }
.pagination [aria-current] { background: #8700c4; color: white; box-shadow: 0 4px 12px #a000e840; }
.empty { padding: 3rem 1rem; background: var(--quiet); border: 1px dashed #d8cfe0; border-radius: 12px; text-align: center; color: var(--muted); }
.whatsapp { display: grid; place-items: center; position: fixed; z-index: 2; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: #168642; box-shadow: 0 6px 20px #05251442; transition: background .2s; }
.whatsapp:hover { background: #107036; }

.viewer { width: min(1100px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #40364b; border-radius: 14px; background: #111017; color: white; }
.viewer::backdrop { background: #09060de8; }
.viewer-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: 3.25rem .65rem .85rem; }
.viewer-image { display: flex; justify-content: center; height: min(69dvh, 760px); overflow: auto; }
.viewer-image img { width: 100%; height: 100%; object-fit: contain; }
.viewer-image.zoomed { display: block; }
.viewer-image.zoomed img { max-width: none; width: 200%; height: 180%; object-position: left top; }
.viewer figcaption { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; overflow-wrap: anywhere; }
.viewer figcaption a { color: #edbcff; }
.viewer button { border: 1px solid #51465f; border-radius: 8px; color: white; background: #2a2232; min-width: 38px; min-height: 42px; }
.viewer button:hover { background: #4a2263; }
.viewer-close { position: absolute; top: .45rem; right: .65rem; }
.viewer-close, .viewer-prev, .viewer-next { font-size: 1.65rem; line-height: 1; }
.viewer-prev { grid-column: 1; }
.viewer figure { grid-column: 2; }
.viewer-next { grid-column: 3; }
.viewer .zoom { padding-inline: .6rem; }

.admin-body { background: var(--quiet); }
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.admin-layout { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 2rem; padding-block: 2rem; }
.admin-nav { align-self: start; display: grid; gap: .35rem; }
.admin-nav a { padding: .65rem .85rem; color: var(--ink); text-decoration: none; border-radius: 8px; font-weight: 600; }
.admin-nav a:hover, .admin-nav [aria-current] { background: #efddf9; color: #6f008a; }
.admin-main h1 { margin-bottom: 1.25rem; }
.panel { background: white; border: 1px solid var(--line); box-shadow: 0 4px 14px #20042c08; border-radius: 12px; padding: clamp(1rem, 3vw, 1.5rem); margin-bottom: 1rem; min-width: 0; }
.login { width: min(432px, calc(100% - 2rem)); margin: auto; padding: 2rem; }
.login .wordmark { min-height: 0; margin-bottom: 1.2rem; }
.login h1 { font-size: 2rem; margin-bottom: 1.25rem; }
.login form { margin-bottom: 1rem; }
.stack { display: grid; gap: 1rem; }
.fields, .metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.metric { display: grid; gap: .4rem; }
.metric strong { font-size: 2rem; line-height: 1; }
.metric span, .muted { color: var(--muted); font-size: .875rem; }
label { display: block; font-weight: 640; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 44px; padding: .5rem .65rem; border: 1px solid #cfc8d6; border-radius: 7px; color: var(--ink); background: white; }
label input:not([type=checkbox]), label select, label textarea { margin-top: .35rem; }
input[type=checkbox] { accent-color: #8700c4; width: 1rem; height: 1rem; vertical-align: middle; }
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .85rem; border: 1px solid transparent; border-radius: 8px; font-weight: 710; text-align: center; text-decoration: none; }
.primary { background: #8600c0; color: white; }
.primary:hover { background: #690098; }
.secondary { background: white; color: var(--ink); border-color: #cfc8d6; }
.secondary:hover { background: #f0e7f5; }
.danger { color: #992348; background: #fff2f5; border-color: #e9bccb; }
.danger:hover { background: #fbe2ea; }
.error, .notice { padding: .75rem; border-radius: 8px; margin-bottom: 1rem; }
.error { background: #ffe8ee; color: #861237; }
.notice { background: #e3f8ec; color: #15623a; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-bottom: 1rem; }
.toolbar [type=search] { flex: 1 1 220px; width: auto; }
.selection { justify-content: space-between; }
.manage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.manage-card { border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: white; }
.manage-card > a { display: block; aspect-ratio: 4 / 3; background: #f0edf3; }
.manage-info { display: grid; gap: .3rem; padding: .7rem; overflow-wrap: anywhere; }
.admin-art { max-height: 260px; width: auto; }
.drop-zone { padding: 1rem; border: 1px dashed #a77bb9; border-radius: 8px; background: #faf5fe; }
.drop-zone span { display: block; font-size: .875rem; font-weight: 400; color: var(--muted); }
.drop-zone.dragover { outline: 2px solid var(--purple); background: #efddf9; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .8rem; }
.previews:empty, .batch-summary:empty { display: none; }
.previews figure { overflow-wrap: anywhere; font-size: .875rem; }
.previews img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--quiet); border-radius: 8px; }
.previews span { display: block; color: #6c177e; font-weight: 600; }
.banner-preview { grid-template-columns: 1fr; }
.banner-preview img { aspect-ratio: auto; max-height: 400px; }

@media (max-width: 960px) {
    .art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-layout { grid-template-columns: 1fr; gap: 1rem; padding-top: 1rem; }
    .admin-nav { display: flex; flex-wrap: wrap; }
}
@media (max-width: 620px) {
    .shell { width: calc(100% - 24px); }
    .art-grid, .manage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fields { grid-template-columns: 1fr; }
    .catalog { padding-bottom: 5rem; }
}
@media (max-width: 320px) {
    .art-grid, .manage-grid, .metric-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
