:root{
    --bg:#0b1220;
    --card:rgba(255,255,255,0.06);
    --card2:rgba(255,255,255,0.08);
    --border:rgba(255,255,255,0.12);
    --text:rgba(255,255,255,0.92);
    --muted:rgba(255,255,255,0.65);
    --accent:#6ea8fe;
    --danger:#f87171;
    --success:#4ade80;
    --warning:#fbbf24;
    --shadow:0 16px 40px rgba(0,0,0,0.35);
    --radius:18px;
    --radius-sm:12px;

    --header-h:80px;
}

/*tema claro (se activa con data-theme="light")*/
[data-theme="light"]{
    --bg:#f3f6ff;
    --card:rgba(0,0,0,0.05);
    --card2:rgba(0,0,0,0.07);
    --border:rgba(0,0,0,0.12);
    --text:rgba(0,0,0,0.88);
    --muted:rgba(0,0,0,0.58);
    --accent:#2563eb;
    --danger:#dc2626;
    --success:#16a34a;
    --warning:#d97706;
    --shadow:0 14px 34px rgba(0,0,0,0.14);
}

*{box-sizing:border-box}

body{
    margin:0;
    font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
    color:var(--text);
    background:
        radial-gradient(1200px 800px at 20% 10%, rgba(110,168,254,0.22), transparent 60%),
        radial-gradient(900px 600px at 80% 40%, rgba(134,239,172,0.16), transparent 55%),
        radial-gradient(700px 500px at 30% 90%, rgba(251,191,36,0.12), transparent 60%),
        var(--bg);
    min-height:100vh;
    padding:0;
    transition: background 0.2s ease;
}

.wrap{
    max-width:1180px;
    margin:0 auto;
    padding:0 22px;
}

.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

/* -----------------------------
   HEADER FIJO - MODERNO
----------------------------- */
.app-header{
    position:fixed;
    top:0;
    left:0;
    right:0;
    height:var(--header-h);
    z-index:50;
    background:linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.15));
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom:1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

[data-theme="light"] .app-header{
    background:linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.header-inner{
    height:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}

.brand{
    display:flex;
    align-items:center;
    gap:16px;
    min-width:0;
}

.brand-logo{
    width:56px;
    height:56px;
    object-fit:contain;
    border-radius:16px;
    background:rgba(255,255,255,0.1);
    padding:6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
}

.brand-logo:hover{
    transform: scale(1.05);
}

[data-theme="light"] .brand-logo{
    background:rgba(255,255,255,0.5);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.brand-text{
    display:flex;
    flex-direction:column;
    gap:2px;
    min-width:0;
}

.brand-title{
    font-weight:800;
    font-size:16px;
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    letter-spacing: -0.02em;
}

.brand-sub{
    font-size:12px;
    color:var(--muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.brand-author{
    font-size:12px;
    color:var(--muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-style: italic;
}

.header-right{
    display:flex;
    align-items:center;
    gap:12px;
    flex-shrink:0;
}

.header-status{
    color:var(--text);
    font-size:12px;
    max-width:260px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    padding:8px 14px;
    border:1px solid var(--border);
    border-radius:40px;
    background:rgba(0,0,0,0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-weight:500;
}

[data-theme="light"] .header-status{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.5);
}

.header-power{
    display:flex;
    flex-direction:column;
    gap:2px;
    padding:6px 14px;
    border-radius:40px;
    border:1px solid rgba(110,168,254,0.4);
    background:linear-gradient(135deg, rgba(110,168,254,0.2), rgba(110,168,254,0.05));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(110,168,254,0.1);
}

.hp-label{
    font-size:10px;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:.06em;
    font-weight:600;
}

.hp-value{
    font-weight:900;
    font-size:16px;
    color:var(--accent);
}

.icon-btn{
    border:1px solid var(--border);
    background:rgba(0,0,0,0.25);
    color:var(--text);
    width:44px;
    height:44px;
    border-radius:40px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

[data-theme="light"] .icon-btn{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.5);
    color:rgba(0,0,0,0.88);
}

.icon-btn:hover{
    border-color:var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110,168,254,0.3);
}

/* -----------------------------
   CONTENIDO (baja por header)
----------------------------- */
.app-content{
    padding-top: calc(var(--header-h) + 22px);
    padding-bottom: 22px;
}

/* -----------------------------
   LAYOUT / TARJETAS
----------------------------- */
.grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}

.card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    overflow:hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover{
    transform: translateY(-2px);
    box-shadow: 0 20px 48px rgba(0,0,0,0.4);
}

.head{
    padding:16px 18px;
    background:linear-gradient(180deg,var(--card2),transparent);
    border-bottom:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.title{
    font-weight:700;
    font-size:15px;
    text-transform:uppercase;
    color:rgba(255,255,255,0.9);
    letter-spacing: 0.03em;
}

[data-theme="light"] .title{color:rgba(0,0,0,0.8)}

.body{padding:18px}

.fields{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px 16px;
}

.field label,
.fake-label{
    display:block;
    font-size:12px;
    color:var(--muted);
    margin-bottom:6px;
    font-weight:500;
    letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea{
    width:100%;
    padding:12px 14px;
    border-radius:var(--radius-sm);
    border:1px solid var(--border);
    background:rgba(0,0,0,0.3);
    color:var(--text);
    outline:none;
    font-size:14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

[data-theme="light"] .field input,
[data-theme="light"] .field select,
[data-theme="light"] .field textarea{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.5);
    color:rgba(0,0,0,0.88);
}

.field input:focus,
.field select:focus,
.field textarea:focus{
    border-color:var(--accent);
    box-shadow: 0 0 0 3px rgba(110,168,254,0.2);
}

.field textarea{min-height:44px;resize:vertical}

.input-with-toggle{
    display: flex;
    gap: 8px;
}

.input-with-toggle input{
    flex: 1;
}

.sign-toggle{
    width: 44px;
    border:1px solid var(--border);
    background:rgba(0,0,0,0.3);
    color:var(--text);
    border-radius:var(--radius-sm);
    cursor:pointer;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

[data-theme="light"] .sign-toggle{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.5);
}

.sign-toggle:hover{
    border-color:var(--accent);
    background:var(--accent);
    color: white;
}

.row{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:14px;
    padding:12px 14px;
    border-radius:var(--radius-sm);
    border:1px solid var(--border);
    background:rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

[data-theme="light"] .row{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.4);
}

.row input[type="checkbox"]{
    width:18px;
    height:18px;
    accent-color:var(--accent);
    cursor:pointer;
}

.row span{
    color:rgba(255,255,255,0.9);
    font-size:13px;
    font-weight:500;
}

[data-theme="light"] .row span{color:rgba(0,0,0,0.8)}

.results{grid-column:1/-1}

.kpi{
    display:grid;
    grid-template-columns:1.2fr 0.8fr;
    gap:16px;
    align-items:start;
}

.big{
    padding:18px;
    border-radius:var(--radius-sm);
    border:1px solid rgba(110,168,254,0.3);
    background:linear-gradient(135deg, rgba(110,168,254,0.15), rgba(110,168,254,0.05));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.big .val{
    font-size:32px;
    font-weight:800;
    color:var(--accent);
    line-height:1.2;
}

.big .sub{
    color:var(--muted);
    font-size:12px;
    margin-top:6px;
    font-weight:500;
}

.list{
    border-radius:var(--radius-sm);
    border:1px solid var(--border);
    background:rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding:14px;
    max-height: 200px;
    overflow-y: auto;
}

[data-theme="light"] .list{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.4);
}

.line{
    display:flex;
    justify-content:space-between;
    gap:10px;
    padding:8px 0;
    border-bottom:1px dashed var(--border);
    font-size:13px;
}

.line:last-child{border-bottom:0}

.k{color:var(--muted); font-weight:500}
.v{font-weight:600}

[data-theme="light"] .k{color:rgba(0,0,0,0.6)}

.toolbar{
    display:grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.box{
    border:1px solid var(--border);
    background:rgba(0,0,0,0.15);
    border-radius:var(--radius-sm);
    padding:14px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: transform 0.2s ease;
}

.box:hover{
    transform: translateY(-2px);
    border-color: rgba(110,168,254,0.3);
}

[data-theme="light"] .box{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.3);
}

.box-title{
    font-weight:700;
    font-size:12px;
    text-transform:uppercase;
    color:rgba(255,255,255,0.8);
    margin-bottom:12px;
    letter-spacing: 0.04em;
}

[data-theme="light"] .box-title{color:rgba(0,0,0,0.7)}

.actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:end;
    margin-top:14px;
}

.btn{
    border:1px solid var(--border);
    background:rgba(0,0,0,0.25);
    color:var(--text);
    padding:10px 16px;
    border-radius:40px;
    cursor:pointer;
    font-size:13px;
    font-weight:500;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

[data-theme="light"] .btn{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.4);
    color:rgba(0,0,0,0.88);
}

.btn:hover{
    border-color:var(--accent);
    background:rgba(110,168,254,0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110,168,254,0.2);
}

.btn.danger{
    border-color:rgba(248,113,113,0.3);
    color:var(--danger);
}

.btn.danger:hover{
    border-color:var(--danger);
    background:rgba(248,113,113,0.2);
    box-shadow: 0 4px 12px rgba(248,113,113,0.2);
}

.btn-small{
    padding:6px 12px;
    font-size:12px;
}

.small{font-size:11px;color:var(--muted);margin-top:10px}

/* -----------------------------
   LOGO PREVIEW - CORREGIDO
----------------------------- */
.logo-preview-container {
    position: relative;
    min-height: 100px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.logo-preview {
    max-width: 100%;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: none;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.2);
    padding: 8px;
}

.logo-preview[src]:not([src=""]):not([src="images/"]) {
    display: block !important;
}

.logo-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    padding: 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    width: 100%;
    min-height: 100px;
    background: rgba(0,0,0,0.1);
}

.logo-preview-placeholder svg {
    opacity: 0.5;
    width: 40px;
    height: 40px;
}

[data-theme="light"] .logo-preview-placeholder {
    background: rgba(255,255,255,0.3);
}

[data-theme="light"] .logo-preview {
    background: rgba(255,255,255,0.4);
}

/* -----------------------------
   GALERÍA DE LOGOS - MODIFICADA
   Tamaño reducido al 50% y altura fija para dos filas
----------------------------- */
.gallery-upload {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.gallery-upload input[type="file"] {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 40px;
    color: var(--text);
    font-size: 12px;
}

.gallery-upload input[type="file"]::file-selector-button {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 4px 10px;
    margin-right: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
}

.gallery-upload input[type="file"]::file-selector-button:hover {
    border-color: var(--accent);
    background: rgba(110,168,254,0.2);
}

/* Grid de galería - tamaño reducido al 50% */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); /* Antes 120px, ahora 60px (50%) */
    gap: 6px; /* Antes 12px, ahora 6px */
    margin-top: 8px;
    padding: 6px;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.1);
    min-height: 140px; /* Altura mínima para asegurar dos filas */
    max-height: 160px; /* Altura máxima para mostrar solo dos filas */
    overflow-y: auto; /* Scroll si hay más de dos filas */
}

[data-theme="light"] .gallery-grid {
    background: rgba(255,255,255,0.2);
}

.gallery-loading,
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-style: italic;
    font-size: 12px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px; /* Antes 12px, ahora 6px */
    overflow: hidden;
    border: 1px solid transparent; /* Antes 2px, ahora 1px */
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.gallery-item.selected {
    border-color: var(--accent);
    border-width: 2px;
    transform: scale(1.02);
    box-shadow: 0 0 0 2px rgba(110,168,254,0.3);
}

.gallery-item.current-logo {
    border-color: var(--success);
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}

.gallery-item.current-logo::after {
    content: "✓";
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(74, 222, 128, 0.9);
    color: white;
    font-size: 8px;
    font-weight: bold;
    width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 4px 3px 2px;
    font-size: 7px; /* Antes 11px, ahora 7px */
    text-align: center;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px; /* Antes 28px, ahora 16px */
    height: 16px; /* Antes 28px, ahora 16px */
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px; /* Antes 16px, ahora 10px */
    font-weight: bold;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.gallery-item:hover .gallery-item-delete {
    opacity: 1;
    transform: scale(1);
}

.gallery-item-delete:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.gallery-item-check {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 7px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.gallery-item.selected .gallery-item-check {
    opacity: 1;
    transform: scale(1);
}

.gallery-item-check::after {
    content: "✓";
}

.gallery-item-size {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 6px; /* Antes 10px, ahora 6px */
    padding: 1px 3px;
    border-radius: 6px;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-item-size {
    opacity: 1;
}

/* Indicador de imagen seleccionada */
.gallery-item.selected::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(110, 168, 254, 0.1);
    border: 2px solid var(--accent);
    z-index: 5;
    pointer-events: none;
}

/* Animación para nuevas imágenes */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(110, 168, 254, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(110, 168, 254, 0); }
    100% { box-shadow: 0 0 0 0 rgba(110, 168, 254, 0); }
}

.gallery-item.new-image {
    animation: pulse 1.5s ease-out;
}

/* -----------------------------
   DRAWER CONFIG
----------------------------- */
.drawer-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.6);
    z-index:70;
    opacity:0;
    transition:opacity .2s ease;
    pointer-events: none;
}

.drawer-overlay.show{
    opacity:1;
    pointer-events: auto;
}

.drawer{
    position:fixed;
    top:0;
    right:0;
    height:100vh;
    width:min(440px, 92vw);
    z-index:80;
    background: var(--bg);
    border-left:1px solid var(--border);
    box-shadow: var(--shadow);
    transform:translateX(105%);
    transition:transform .25s cubic-bezier(0.4, 0, 0.2, 1);
    display:flex;
    flex-direction:column;
}

.drawer.open{
    transform:translateX(0);
}

.drawer-head{
    height:var(--header-h);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 20px;
    border-bottom:1px solid var(--border);
    background: var(--card);
}

.drawer-title{
    font-weight:800;
    letter-spacing:.02em;
    font-size:16px;
}

.drawer-body{
    padding:20px;
    overflow:auto;
    background: var(--bg);
}

.drawer-box{
    box-shadow:none;
    background: var(--card2);
}

/* -----------------------------
   CHART
----------------------------- */
.chart-container{
    background: rgba(0,0,0,0.15);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 16px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

[data-theme="light"] .chart-container{
    background: rgba(255,255,255,0.3);
}

/* -----------------------------
   RESPONSIVE
----------------------------- */
@media (max-width: 980px){
    .grid{grid-template-columns:1fr}
    .fields{grid-template-columns:1fr}
    .kpi{grid-template-columns:1fr}
    .toolbar{grid-template-columns:1fr}
    .wrap{padding:0 14px}
    
    .brand-logo{
        width:48px;
        height:48px;
    }
    
    .brand-title{
        font-size:14px;
    }
    
    .brand-sub{
        font-size:11px;
    }
    
    .header-status{
        display:none;
    }
    
    .header-power{
        padding:4px 10px;
    }
    
    .hp-value{
        font-size:14px;
    }
    
    .icon-btn{
        width:40px;
        height:40px;
    }
    
    .logo-preview-container {
        min-height: 80px;
    }
    
    .logo-preview {
        max-height: 80px;
    }
    
    .logo-preview-placeholder {
        min-height: 80px;
        padding: 15px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        min-height: 120px;
        max-height: 140px;
    }

    .gallery-upload {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-upload input[type="file"] {
        width: 100%;
    }
}

@media (max-width: 580px){
    .brand-text .brand-sub{
        display:none;
    }
    
    .brand-author{
        font-size:11px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 4px;
        min-height: 100px;
        max-height: 120px;
    }

    .gallery-item-delete {
        opacity: 1;
        transform: scale(1);
        width: 14px;
        height: 14px;
        font-size: 8px;
    }

    .gallery-item-overlay {
        opacity: 1;
        transform: translateY(0);
        font-size: 6px;
        padding: 2px 1px;
    }

    .gallery-item-check {
        width: 12px;
        height: 12px;
        font-size: 6px;
    }

    .gallery-item-size {
        font-size: 5px;
        padding: 1px 2px;
    }
}

/* -----------------------------
   BOTÓN PDF
----------------------------- */
.btn-pdf{
    padding:10px 16px;
    height:44px;
    border-radius:40px;
    border:1px solid var(--border);
    background:rgba(0,0,0,0.25);
    color:var(--text);
    cursor:pointer;
    font-weight:600;
    font-size:13px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

[data-theme="light"] .btn-pdf{
    border:1px solid rgba(0,0,0,0.1);
    background:rgba(255,255,255,0.4);
    color:rgba(0,0,0,0.88);
}

.btn-pdf:hover{
    border-color:var(--accent);
    background:rgba(110,168,254,0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110,168,254,0.2);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--card);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
    opacity: 0.5;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}