/* Panel de administración */
:root {
    --fondo: #f4f5f9;
    --lateral: #16161f;
    --tarjeta: #ffffff;
    --texto: #1f2130;
    --suave: #6b7080;
    --borde: #e7e8ef;
    --marca: #ff4d2e;
    --marca2: #ff2d87;
    --verde: #12a150;
    --verde-claro: #dcfce7;
    --rojo: #dc2626;
    --rojo-claro: #fee2e2;
    --amarillo-claro: #fef3c7;
    --azul-claro: #e0f2fe;
}

body.admin {
    background: var(--fondo);
    color: var(--texto);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}
a { color: inherit; }

/* Menú lateral */
.admin-lateral {
    position: fixed; top: 0; bottom: 0; left: 0; width: 248px; z-index: 40;
    background: var(--lateral); color: #c9cad6; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.admin-marca { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; text-decoration: none; color: #fff; }
.admin-marca small { display: block; color: #8b8da0; font-size: 12px; }
.admin-logo {
    width: 38px; height: 38px; border-radius: 11px; flex: none; color: #fff; font-weight: 800; font-size: 18px;
    background: linear-gradient(135deg, var(--marca), var(--marca2)); display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(255, 77, 46, .35);
}
.admin-lateral .grupo { text-transform: uppercase; font-size: 11px; letter-spacing: .08em; color: #6f7186; padding: 14px 10px 6px; font-weight: 700; }
.admin-lateral a:not(.admin-marca), .admin-lateral .salir {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
    color: #c9cad6; text-decoration: none; font-weight: 600; font-size: 14px;
    background: none; border: 0; width: 100%; text-align: left; transition: background .15s, color .15s;
}
.admin-lateral i { font-style: normal; width: 22px; text-align: center; }
.admin-lateral a:not(.admin-marca):hover, .admin-lateral .salir:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-lateral a.activo { background: linear-gradient(90deg, rgba(255,77,46,.25), rgba(255,45,135,.12)); color: #fff; box-shadow: inset 3px 0 0 var(--marca); }

.admin-barra-movil { display: none; }
.admin-velo { display: none; }

.admin-contenido { margin-left: 248px; padding: 28px 32px 56px; max-width: 1400px; }
.admin-contenido.sin-menu { margin-left: 0; max-width: none; }

@media (max-width: 991px) {
    .admin-lateral { transform: translateX(-100%); transition: transform .25s; }
    body.menu-abierto .admin-lateral { transform: none; }
    body.menu-abierto .admin-velo { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
    .admin-barra-movil {
        display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
        background: var(--lateral); color: #fff; padding: 10px 14px;
    }
    .admin-barra-movil a { text-decoration: none; font-size: 20px; }
    .btn-menu { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; }
    .admin-contenido { margin-left: 0; padding: 16px; }
}

/* Encabezados */
.encabezado { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.encabezado h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.bienvenida {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
    background: linear-gradient(120deg, var(--marca), var(--marca2)); color: #fff; border-radius: 18px; padding: 24px 28px;
    box-shadow: 0 12px 30px rgba(255, 77, 46, .25);
}
.bienvenida h1 { font-size: 26px; font-weight: 800; margin: 0; }
.bienvenida p { margin: 4px 0 0; opacity: .9; }
.bienvenida .btn-primario { background: #fff; color: var(--texto); box-shadow: none; }
.bienvenida .btn-secundario { background: rgba(255,255,255,.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }

/* Tarjetas */
.tarjeta {
    background: var(--tarjeta); border-radius: 16px; padding: 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 0 0 1px var(--borde);
    margin-bottom: 16px;
}
.tarjeta h2 { font-size: 15px; font-weight: 750; margin-bottom: 14px; }
.tarjeta.sin-relleno { padding: 0; overflow: hidden; }
.tarjeta-cabeza { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 20px 6px; }
.tarjeta-cabeza h2 { margin: 0; }
.tarjeta-cabeza a { color: var(--marca); font-weight: 600; text-decoration: none; }

.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.indicador {
    display: flex; gap: 14px; align-items: center; background: var(--tarjeta); border-radius: 16px; padding: 18px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 0 0 1px var(--borde); text-decoration: none; transition: transform .15s;
}
a.indicador:hover { transform: translateY(-2px); }
.indicador .icono { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none; }
.indicador.naranja .icono { background: #ffedd5; }
.indicador.verde .icono { background: var(--verde-claro); }
.indicador.morado .icono { background: #ede9fe; }
.indicador.rosa .icono { background: #fce7f3; }
.indicador .etiqueta { color: var(--suave); font-size: 13px; }
.indicador .valor { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }

/* Gráfica de ventas */
.grafica { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.barra-dia { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.barra-dia .barra { width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--marca2), var(--marca)); min-height: 2px; transition: opacity .15s; }
.barra-dia:hover .barra { opacity: .75; }
.barra-dia span { font-size: 11px; color: var(--suave); }

.mas-vendido { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.mas-vendido:last-child { border-bottom: 0; }
.atajos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.atajos a { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--fondo); text-decoration: none; font-size: 20px; transition: background .15s; }
.atajos a span { font-size: 13px; font-weight: 600; }
.atajos a:hover { background: #ffedd5; }

/* Pestañas de filtros */
.pestanas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pestanas a { text-decoration: none; padding: 7px 14px; border-radius: 999px; background: #fff; font-weight: 600; box-shadow: 0 0 0 1px var(--borde); }
.pestanas a span { background: var(--fondo); border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.pestanas a.activo { background: var(--texto); color: #fff; box-shadow: none; }
.pestanas a.activo span { background: rgba(255,255,255,.2); }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { background: #fafbfc; color: var(--suave); font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--borde); text-align: left; white-space: nowrap; }
.tabla td { padding: 12px 14px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: #fff8f5; }
.tabla a { color: var(--texto); font-weight: 650; text-decoration: none; }
.tabla a:hover { color: var(--marca); }
.miniatura { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; border: 1px solid var(--borde); background: #fff; }
.miniatura.grande { width: 56px; height: 56px; }

.etiqueta-estado { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: #eef0f4; white-space: nowrap; }
.etiqueta-estado.ok { background: var(--verde-claro); color: #166534; }
.etiqueta-estado.error { background: var(--rojo-claro); color: #991b1b; }
.etiqueta-estado.pendiente { background: var(--amarillo-claro); color: #92400e; }
.etiqueta-estado.info { background: var(--azul-claro); color: #075985; }
.etiqueta-estado.naranja { background: #ffedd5; color: #c2410c; }

/* Botones y formularios */
.btn-primario { background: linear-gradient(135deg, var(--marca), #ff6a3d); color: #fff; border-radius: 10px; font-weight: 700; border: 0; padding: 8px 16px; box-shadow: 0 4px 12px rgba(255, 77, 46, .3); }
.btn-primario:hover { color: #fff; filter: brightness(1.05); }
.btn-secundario { background: #fff; color: var(--texto); border-radius: 10px; font-weight: 650; border: 0; padding: 7px 14px; box-shadow: inset 0 0 0 1px #d6d8e1; }
.btn-secundario:hover { background: #f7f7fa; }
.btn-peligro { background: #fff; color: var(--rojo); border-radius: 10px; font-weight: 650; border: 0; padding: 7px 14px; box-shadow: inset 0 0 0 1px #fecaca; }
.btn-peligro:hover { background: var(--rojo-claro); color: var(--rojo); }

.form-control, .form-select { border-radius: 10px; border-color: #d6d8e1; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--marca); box-shadow: 0 0 0 3px rgba(255, 77, 46, .15); }
.form-check-input:checked { background-color: var(--marca); border-color: var(--marca); }

.interruptor { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; font-weight: 600; }
.interruptor input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: #d6d8e1; position: relative; flex: none; transition: background .2s; cursor: pointer; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.interruptor input:checked { background: var(--verde); }
.interruptor input:checked::after { left: 21px; }

.desglose div { display: flex; justify-content: space-between; padding: 5px 0; color: var(--suave); }
.desglose .total { border-top: 1px solid var(--borde); margin-top: 6px; padding-top: 10px; color: var(--texto); font-weight: 800; font-size: 16px; }

/* Fotos del producto */
.galeria-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.foto-admin { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--borde); background: #fff; }
.foto-admin.principal { grid-column: span 2; grid-row: span 2; border: 2px solid var(--marca); }
.foto-admin img { width: 100%; height: 100%; object-fit: cover; }
.marca-principal { position: absolute; left: 8px; top: 8px; background: var(--marca); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.foto-admin .acciones { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.foto-admin:hover .acciones { opacity: 1; }
@media (hover: none) { .foto-admin .acciones { opacity: 1; } }
.foto-admin .acciones button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; }
.subir-foto { aspect-ratio: 1; border-radius: 12px; border: 2px dashed #d6d8e1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--suave); text-align: center; padding: 8px; font-size: 13px; transition: all .15s; }
.subir-foto strong { font-size: 28px; color: var(--marca); }
.subir-foto:hover { border-color: var(--marca); background: #fff8f5; }
.video-admin { max-width: 280px; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: #111; }
.video-admin video, .video-admin iframe { width: 100%; height: 100%; border: 0; object-fit: cover; }

/* Reseñas */
.resena-admin { padding: 16px 20px; border-bottom: 1px solid var(--borde); }
.resena-admin.pendiente { background: #fffbeb; }
.estrellas { color: #f59e0b; letter-spacing: 2px; }
.estrellas span { color: #e5e7eb; }

/* Avisos */
.aviso { border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-weight: 500; }
.aviso-ok { background: var(--verde-claro); color: #166534; }
.aviso-error { background: var(--rojo-claro); color: #991b1b; }
.aviso-alerta { background: var(--amarillo-claro); color: #92400e; }

.vacio { text-align: center; padding: 48px 16px; color: var(--suave); }
.vacio h2 { color: var(--texto); font-size: 16px; }

pre.codigo { background: #f7f8fa; border: 1px solid var(--borde); border-radius: 10px; padding: 12px; font-size: 12px; max-height: 420px; overflow: auto; }

.login-caja { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, #16161f, #2a1730); }
.login-caja .tarjeta { width: 100%; max-width: 400px; padding: 32px; }

/* Calcomanía (vista previa en el editor) */
.vista-sticker { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--borde); container-type: inline-size; max-width: 260px; margin: 0 auto; }
.vista-sticker img { width: 100%; height: 100%; object-fit: cover; }
.sticker { position: absolute; z-index: 2; display: grid; place-items: center; text-align: center; background: linear-gradient(135deg, var(--marca), var(--marca2)); color: #fff; font-weight: 800; line-height: 1.1; box-shadow: 0 4px 14px rgba(0,0,0,.25); border: 3px solid #fff; }
.sticker > span { padding: 4px; font-size: clamp(9px, 2.6cqw, 15px); }
.sticker-ti, .sticker-td, .sticker-bi, .sticker-bd { width: 40%; aspect-ratio: 1; border-radius: 50%; }
.sticker-ti { top: -3%; left: -3%; transform: rotate(-12deg); }
.sticker-td { top: -3%; right: -3%; transform: rotate(12deg); }
.sticker-bi { bottom: -3%; left: -3%; transform: rotate(-8deg); }
.sticker-bd { bottom: -3%; right: -3%; transform: rotate(8deg); }
.sticker-arriba, .sticker-abajo { left: 0; right: 0; height: 17%; border: 0; border-radius: 0; text-transform: uppercase; }
.sticker-arriba { top: 0; } .sticker-abajo { bottom: 0; }

.pasos-admin li { margin-bottom: 6px; }
.costos { background: #fff7ed; border-radius: 14px; padding: 18px; }
.costos p { margin: 6px 0; color: var(--suave); }

/* Acciones sobre productos seleccionados */
.barra-acciones { position: sticky; top: 8px; z-index: 20; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--lateral); color: #fff; border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.barra-acciones strong { margin-right: auto; }
.tabla tr.apagado td { opacity: .55; }
.tabla tr.apagado td:first-child, .tabla tr.apagado td:last-child { opacity: 1; }

/* Pedidos fáciles de leer: pasos, qué sigue y fotos de lo que se compró */
.pasos-pedido { list-style: none; display: flex; padding: 0; margin: 0; counter-reset: paso; }
.pasos-pedido li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.pasos-pedido li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: var(--borde); z-index: 0; }
.pasos-pedido li:first-child::before { display: none; }
.pasos-pedido li.hecho::before, .pasos-pedido li.actual::before { background: var(--verde); }
.pasos-pedido .punto {
    position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: #f1f2f6; color: var(--suave); font-size: 15px; font-weight: 800; border: 2px solid var(--borde);
}
.pasos-pedido li.hecho .punto { background: var(--verde); border-color: var(--verde); color: #fff; }
.pasos-pedido li.actual .punto { background: #fff; border-color: var(--marca); box-shadow: 0 0 0 4px rgba(255, 77, 46, .15); }
.pasos-pedido .texto { font-size: 11.5px; color: var(--suave); line-height: 1.2; }
.pasos-pedido li.hecho .texto { color: var(--texto); }
.pasos-pedido li.actual .texto { color: var(--marca); font-weight: 700; }
.pasos-pedido.cancelado { opacity: .45; filter: grayscale(1); }

.que-sigue { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 10px 14px; background: #f4f5f9; font-size: 14px; }
.que-sigue.te-toca { background: #fff4ef; color: #9a3412; font-weight: 650; box-shadow: inset 3px 0 0 var(--marca); }

.pedidos-tarjetas { display: grid; gap: 12px; padding: 14px; }
.pedido-tarjeta { display: grid; gap: 12px; border: 1px solid var(--borde); border-radius: 14px; padding: 14px; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.pedido-tarjeta:hover { border-color: #d6d8e1; box-shadow: 0 6px 18px rgba(20, 20, 40, .08); color: inherit; }
.pedido-tarjeta .arriba { display: flex; gap: 12px; align-items: flex-start; }
.fotos-pedido { display: flex; flex-shrink: 0; }
.fotos-pedido img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid #fff; background: #f1f2f6; }
.fotos-pedido img + img { margin-left: -22px; }
.pedido-tarjeta .lo-que-compro { font-weight: 700; line-height: 1.3; }
.pedido-tarjeta .quien { font-size: 13px; color: var(--suave); }
.pedido-tarjeta .total { font-weight: 800; font-size: 17px; white-space: nowrap; margin-left: auto; text-align: right; }

.articulo-pedido { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.articulo-pedido img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: #f1f2f6; flex-shrink: 0; }
@media (max-width: 575px) {
    .pasos-pedido .texto { font-size: 10px; }
    .pasos-pedido .punto { width: 28px; height: 28px; font-size: 13px; }
    .pasos-pedido li::before { top: 13px; }
    .fotos-pedido img { width: 52px; height: 52px; }
}
.direccion-fija { background: #f4f5f9; border-radius: 12px; padding: 12px 14px; line-height: 1.6; }
