:root {
    --kymba-purple: #7b42f6; 
    --kymba-purple-light: #9d70ff;
    --kymba-dark: #121212;
    --bg-color: #0a0a0a;
    --card-bg: #1e1e1e;
    --text-main: #f0f0f0;
    --text-muted: #a0a0a0;
    --border-color: #333333;
}

.hidden { display: none !important; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background-color: var(--bg-color); 
    padding: 30px; 
    color: var(--text-main);
    margin: 0;
}

/* LOGIN */
.login-wrapper { display: flex; justify-content: center; align-items: center; height: 100vh; background: radial-gradient(circle at center, #1a1a1a 0%, var(--bg-color) 100%); position: fixed; top: 0; left: 0; width: 100%; z-index: 2000; }
.login-box { background-color: rgba(30, 30, 30, 0.85); backdrop-filter: blur(10px); padding: 40px; border-radius: 24px; border: 1px solid rgba(123, 66, 246, 0.3); box-shadow: 0 0 40px rgba(123, 66, 246, 0.15); text-align: center; width: 100%; max-width: 380px; }
.login-logo-container { display: flex; justify-content: center; margin-bottom: 20px; }
.login-logo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid var(--kymba-purple); box-shadow: 0 0 20px var(--kymba-purple-light); }
.login-box h1 { font-size: 2.2em; margin-bottom: 5px; letter-spacing: 1px;}
.login-box h1 span { color: var(--kymba-purple-light); }
.login-box p { color: var(--text-muted); margin-bottom: 30px; font-weight: 500;}
.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-box input { width: 100%; padding: 16px; background-color: var(--bg-color); border: 1px solid var(--border-color); color: #fff; border-radius: 12px; font-size: 1.1em; text-align: center; box-sizing: border-box; }
.login-box input:focus { border-color: var(--kymba-purple); outline: none; }
.btn-login { width: 100%; padding: 16px; font-size: 1.1em; font-weight: 800; text-transform: uppercase; border-radius: 12px; margin-top: 5px; }
.error-msg { color: #ff5252 !important; margin-top: 20px; font-size: 0.95em; font-weight: bold; background: rgba(255, 82, 82, 0.1); padding: 10px; border-radius: 8px; border: 1px solid rgba(255, 82, 82, 0.3); }

/* HEADER Y CONTADOR */
.header { margin-bottom: 30px; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.logo-title { display: flex; align-items: center; gap: 15px; }
.header-logo { width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; object-fit: cover; border: 2px solid var(--kymba-purple); box-shadow: 0 0 12px rgba(157, 112, 255, 0.6); }
.logo-title h1 { display: flex; align-items: center; flex-wrap: wrap; margin: 0; }
.badge-total { background-color: var(--kymba-purple); color: white; font-size: 0.45em; padding: 4px 10px; border-radius: 12px; margin-left: 10px; font-weight: 700; letter-spacing: 0.5px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 15px; }
#tasa-cambio { white-space: nowrap; }
.rate-info { display: flex; align-items: center; gap: 10px; font-size: 1.1em; font-weight: bold; color: var(--kymba-purple-light); background: rgba(123, 66, 246, 0.15); padding: 8px 10px 8px 15px; border-radius: 20px; border: 1px solid rgba(123, 66, 246, 0.4); }
.rate-text { display: flex; flex-direction: column; gap: 2px; }
.rate-date { font-size: 0.7em; font-weight: 600; color: var(--text-muted); }
.rate-date-offline { color: #fbbf24; }
.btn-rate-refresh { background: transparent; border: 1px solid rgba(123, 66, 246, 0.4); border-radius: 50%; width: 32px; height: 32px; flex-shrink: 0; padding: 0; cursor: pointer; font-size: 0.85em; }
.btn-rate-refresh:hover { background: rgba(123, 66, 246, 0.3); }
.btn-rate-refresh:disabled { opacity: 0.4; cursor: wait; }

/* BARRA DE BÚSQUEDA Y ORDENADOR */
.search-bar-container { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 25px; }
#buscador { flex: 2; width: 100%; padding: 15px 20px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); color: #ffffff; font-size: 1.1em; outline: none; box-sizing: border-box; }
#buscador:focus { border-color: var(--kymba-purple); }
#ordenador { flex: 1; width: 100%; padding: 15px 20px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); color: #ffffff; font-size: 1em; outline: none; cursor: pointer; }
#ordenador:focus { border-color: var(--kymba-purple); }

.btn-sin-verificar { border-color: #fbbf24; color: #fbbf24; white-space: nowrap; }
.btn-sin-verificar.active { background: rgba(251, 191, 36, 0.15); }

/* BOTONES */
.btn-primary { background-color: var(--kymba-purple); color: white; border: none; padding: 10px 20px; border-radius: 8px; font-size: 1em; font-weight: 600; cursor: pointer; }
.btn-secondary { background-color: transparent; color: var(--kymba-purple-light); border: 1px solid var(--kymba-purple); padding: 10px 20px; border-radius: 8px; font-size: 1em; font-weight: 600; cursor: pointer; }

/* CATEGORÍAS */
.categories-container { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; }
.cat-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 15px 20px; min-width: 280px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.cat-card.active { border: 2px solid var(--kymba-purple); background: rgba(123, 66, 246, 0.05); }
.cat-info { display: flex; flex-direction: column; }
.cat-subtitle { font-size: 0.75em; font-weight: 700; margin-bottom: 4px; color: var(--kymba-purple-light); }
.cat-title { font-size: 1.2em; font-weight: 800; color: #ffffff; margin: 0 0 4px 0; }
.cat-desc { font-size: 0.85em; color: var(--text-muted); max-width: 180px; }
.cat-count-wrapper { display: flex; align-items: baseline; gap: 4px; }
.cat-count { font-size: 2.5em; font-weight: 900; color: #ffffff; }
.cat-count-label { font-size: 0.8em; color: var(--text-muted); font-weight: 600; }

/* PAGINACIÓN */
.paginacion { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 0 0 20px 0; scroll-margin-top: 15px; }
#paginacion-inferior { margin: 25px 0 0 0; }
.paginacion:empty { display: none; }
.pag-resumen { color: var(--text-muted); font-size: 0.9em; font-weight: 600; }
.pag-botones { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pag-btn { background: var(--card-bg); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 12px; min-width: 38px; font-size: 0.9em; font-weight: 600; cursor: pointer; }
.pag-btn:hover:not(:disabled) { border-color: var(--kymba-purple-light); }
.pag-btn.active { background: var(--kymba-purple); border-color: var(--kymba-purple); color: #ffffff; }
.pag-btn:disabled { opacity: 0.35; cursor: default; }
.pag-puntos { color: var(--text-muted); padding: 0 2px; }
.pag-selector { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.pag-selector select { width: auto; padding: 8px 10px; background: var(--card-bg); cursor: pointer; }
.catalogo-vacio { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 40px 0; }

/* CATALOGO Y TARJETAS */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--card-bg); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border-color); position: relative; text-decoration: none; color: inherit; }
.card:hover { transform: translateY(-5px); border-color: var(--kymba-purple-light); }
.card img { width: 100%; height: 160px; object-fit: cover; border-bottom: 1px solid var(--border-color); }
.card-img-fallback { height: 160px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 16px 20px; box-sizing: border-box; text-align: center; border-bottom: 1px solid var(--border-color); background: radial-gradient(circle at 20% 15%, rgba(157, 112, 255, 0.55) 0%, transparent 55%), linear-gradient(135deg, var(--kymba-purple) 0%, #2a1466 60%, var(--kymba-dark) 100%); }
.card-img-fallback span { color: #ffffff; font-size: 1.25em; font-weight: 900; line-height: 1.2; letter-spacing: 0.5px; text-transform: uppercase; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-content { padding: 16px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.1em; font-weight: 800; margin: 0 0 10px 0; color: #ffffff; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.card-badges .badge-idiomas { margin-bottom: 0; }
.badge-idiomas { align-self: flex-start; font-size: 0.75em; font-weight: 700; padding: 4px 8px; border-radius: 6px; margin-bottom: 12px; color: var(--text-muted); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-color); }
.badge-idiomas-aviso { color: #fbbf24; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.4); }
.badge-idiomas-alerta { color: #ff5252; background: rgba(255, 82, 82, 0.12); border-color: rgba(255, 82, 82, 0.5); }
.price-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.95em; border-bottom: 1px dashed var(--border-color); padding-bottom: 6px; }
.price-row:last-child { border-bottom: none; }
.price-label { color: var(--text-muted); font-weight: 500;}
.price-value { font-weight: 700; color: #ffffff; white-space: nowrap; }
.moneda { font-size: 0.75em; font-weight: 600; opacity: 0.7; }

/* ACCIONES DE ADMIN EN TARJETA */
.admin-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; z-index: 10; }
.btn-icon { background: rgba(18, 18, 18, 0.85); border: 1px solid var(--border-color); border-radius: 50%; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: white; }
.btn-icon:hover { background: var(--kymba-purple); }
.btn-delete:hover { background: #ff5252; }

/* FOOTER TARJETA */
.card-footer { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.badge-cat { background: rgba(123, 66, 246, 0.15); color: var(--kymba-purple-light); padding: 4px 8px; border-radius: 6px; font-size: 0.7em; font-weight: 700; text-transform: uppercase; }
.badge-date { white-space: nowrap; flex-shrink: 0; color: var(--text-muted); font-size: 0.75em; font-weight: 600; }

/* MODALES */
.modal { display: flex; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); justify-content: center; align-items: center; }
.modal-content { background-color: var(--card-bg); padding: 30px; border: 1px solid var(--kymba-purple); border-radius: 16px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto;}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.close-modal { background: none; border: none; color: var(--text-muted); font-size: 28px; font-weight: bold; cursor: pointer; }
.close-modal:hover { color: #fff; }
.form-group { margin-bottom: 20px; flex: 1; }
.form-row { display: flex; gap: 15px; }
.section-title { font-size: 1em; color: var(--kymba-purple-light); margin: 10px 0 15px 0; border-bottom: 1px dashed var(--border-color); padding-bottom: 5px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-muted); font-size: 0.9em; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--bg-color); color: #fff; font-size: 1em; box-sizing: border-box; }
textarea { font-family: inherit; line-height: 1.4; resize: vertical; }
.vista-previa { margin: 8px 0 0 0; font-size: 0.85em; color: var(--text-muted); }
.vista-previa span { color: var(--text-main); }
.imagen-campo { display: flex; gap: 12px; align-items: flex-start; }
.imagen-preview { width: 120px; height: 68px; flex-shrink: 0; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-color); }
.imagen-controles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.imagen-subir { display: flex; align-items: center; gap: 10px; }
.label-hint { font-weight: 400; font-size: 0.9em; opacity: 0.75; }
.idiomas-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-idioma { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 20px; background-color: var(--bg-color); color: var(--text-main); cursor: pointer; user-select: none; }
.chip-idioma input { width: auto; padding: 0; margin: 0; accent-color: var(--kymba-purple); cursor: pointer; }
.chip-idioma:has(input:checked) { border-color: var(--kymba-purple); background: rgba(123, 66, 246, 0.15); }
.btn-submit { width: 100%; background-color: var(--kymba-purple); color: white; border: none; padding: 15px; border-radius: 8px; font-size: 1.1em; font-weight: bold; cursor: pointer; margin-top: 10px; }

/* ESTILOS DE BANDEJA DE REVISIÓN */
.rev-card { background: #2a2a2a; border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; margin-bottom: 15px; }
.rev-header { display: flex; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px dashed var(--border-color); padding-bottom: 10px; }
.rev-type { font-weight: 900; }
.rev-actions { display: flex; gap: 10px; margin-top: 15px; }
.btn-approve { background: #4ade80; color: #121212; border: none; padding: 10px; border-radius: 6px; cursor: pointer; font-weight: bold; flex: 1;}
.btn-reject { background: #ff5252; color: #fff; border: none; padding: 10px; border-radius: 6px; cursor: pointer; font-weight: bold; flex: 1;}

/* MÓVILES */
@media (max-width: 768px) {
    body { padding: 15px; }
    .logo-title { justify-content: center; }
    .header-top { flex-direction: column; align-items: stretch; gap: 15px; text-align: center; }
    .header-actions { flex-wrap: wrap; justify-content: center; width: 100%; }
    .search-bar-container { flex-direction: column; }
    .badge-total { display: inline-block; margin-top: 5px; }
    .form-row { flex-direction: column; gap: 0; }
    .paginacion { justify-content: center; }
    .pag-resumen { width: 100%; text-align: center; }
    .modal-content { padding: 20px; width: 95%; }
}