:root { --fondo:#f4f4f5; --tarjeta:#fff; --texto:#18181b; --gris:#71717a; --borde:#e4e4e7; --azul:#006fee; --verde:#17c964; --rojo:#f31260; --naranja:#f5a524; }
* { box-sizing: border-box; }
body { margin:0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--texto); background:var(--fondo); display:flex; min-height:100vh; }
a { color: var(--azul); text-decoration: none; }
.lateral { width: 200px; background: #fff; border-right: 1px solid var(--borde); padding: 16px 12px; display:flex; flex-direction:column; position: sticky; top:0; height:100vh; }
.marca { font-weight: 800; font-size: 20px; margin-bottom: 18px; }
.marca span { color: var(--azul); }
.lateral nav { display:flex; flex-direction:column; gap:2px; flex:1; }
.lateral .grupo { font-size: 11px; text-transform: uppercase; color: var(--gris); margin: 12px 8px 4px; letter-spacing:.04em; }
.lateral nav a { color: var(--texto); padding: 7px 10px; border-radius: 8px; }
.lateral nav a.activo, .lateral nav a:hover { background: #e6f1fe; color: var(--azul); }
.salir { color: var(--gris); font-size: 13px; padding: 6px 10px; }
main { flex:1; padding: 18px 24px; min-width: 0; }
.cabecera h1 { margin: 0; font-size: 20px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.miga { color: var(--gris); font-size: 12px; margin: 2px 0 14px; }
.tarjeta { background: var(--tarjeta); border-radius: 14px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tarjeta h2 { font-size: 16px; margin: 0 0 12px; }
.aviso { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; white-space: pre-line; }
.aviso.ok { background: #e8faf0; color: #0e793c; }
.aviso.mal { background: #fee7ef; color: #a10e45; }
.filtros { display:flex; gap: 8px; flex-wrap: wrap; }
.filtros .buscar { flex: 1; min-width: 240px; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--borde); border-radius: 10px; background:#fafafa; }
input:focus, select:focus { outline: 2px solid #99c7fb; background:#fff; }
.boton { display:inline-block; font: inherit; border: 1px solid var(--borde); background:#fff; color: var(--texto); padding: 8px 14px; border-radius: 10px; cursor:pointer; }
.boton:hover { background:#f4f4f5; }
.boton.primario { background: var(--azul); color:#fff; border-color: var(--azul); }
.boton.primario:hover { background:#005bc4; }
.boton.peligro { background:#fee7ef; color: var(--rojo); border-color:#fdd0df; }
.boton.ancho { display:block; text-align:center; margin-top: 10px; }
.tabla { width:100%; border-collapse: collapse; }
.tabla th { text-align:left; font-size:12px; color: var(--gris); font-weight:600; background:#f4f4f5; padding: 8px; }
.tabla th:first-child { border-radius: 8px 0 0 8px; } .tabla th:last-child { border-radius: 0 8px 8px 0; }
.tabla td { padding: 9px 8px; border-bottom: 1px solid #f4f4f5; vertical-align: top; }
.tabla tbody tr:hover { background:#fafafa; cursor:pointer; }
.tabla .num { text-align:right; }
.tabla .productos { max-width: 320px; }
.tabla tr.descuento td, .tabla tr.envio td { color: var(--gris); }
.detalle { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.vacio { color: var(--gris); text-align:center; padding: 30px; }
.paginacion { display:flex; gap: 8px; align-items:center; justify-content:flex-end; margin-top: 12px; color: var(--gris); }
.estado, .etiqueta { display:inline-block; font-size:12px; padding: 2px 9px; border-radius: 999px; background:#f4f4f5; color:#3f3f46; white-space: nowrap; font-weight: 500; }
.e-NEW { background:#f4f4f5; } .e-PENDING, .e-POSTPONED { background:#fdedd3; color:#936316; }
.e-STORE_REJECTED, .e-ERROR, .e-DELIVERY_RETURNED { background:#fee7ef; color:#a10e45; }
.e-STORE_ACCEPTED, .e-READY_TO_SHIP, .e-ON_TRANSIT { background:#e6f1fe; color:#005bc4; }
.e-DELIVERY_SUCCESS, .e-INCIDENT_RESOLVED { background:#e8faf0; color:#0e793c; }
.e-RECONSIGNED, .e-INCIDENT, .e-INCIDENT_PENDING { background:#fdedd3; color:#936316; }
.etiqueta.cod { background:#e6f1fe; color:#005bc4; } .etiqueta.mal { background:#fee7ef; color:#a10e45; }
.etiqueta.verde { background:#e8faf0; color:#0e793c; } .etiqueta.shopify { background:#e8faf0; color:#0e793c; }
.dos-columnas { display:grid; grid-template-columns: minmax(0,2fr) minmax(280px,1fr); gap: 14px; }
.datos { display:grid; grid-template-columns: 130px 1fr; gap: 6px 10px; margin:0; }
.datos dt { color: var(--gris); } .datos dd { margin:0; word-break: break-word; }
.total { text-align:right; margin: 10px 4px 0; }
.navegar { display:flex; justify-content: space-between; }
.config { display:grid; grid-template-columns: 300px minmax(0,1fr); gap: 14px; align-items:start; }
.lista-tiendas .tienda { display:block; color: var(--texto); padding: 10px; border-radius: 10px; margin-bottom: 6px; border:1px solid transparent; }
.lista-tiendas .tienda.sel, .lista-tiendas .tienda:hover { border-color: #cce3fd; background:#f5faff; }
.gris { color: var(--gris); } .verde { color: #0e793c; } .rojo { color: var(--rojo); } .azul { color: var(--azul); }
.conexion { display:flex; gap: 14px; align-items:center; margin-bottom: 16px; flex-wrap: wrap; }
.logo-shopify { width: 64px; height: 64px; border-radius: 50%; background: #95bf47; color:#fff; font-weight: 800; font-size: 30px; display:flex; align-items:center; justify-content:center; }
.conexion .acciones { margin-left:auto; display:flex; gap:8px; }
.formulario { display:flex; flex-direction:column; gap: 12px; max-width: 760px; }
.formulario label { display:flex; flex-direction:column; gap:4px; font-weight: 600; }
.formulario label.opcion, .formulario label.interruptor { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.formulario label.en-linea { display:inline-flex; margin-right: 14px; }
.formulario fieldset { border: 1px solid var(--borde); border-radius: 12px; padding: 10px 14px; display:flex; flex-direction:column; gap:8px; }
.formulario fieldset > div, .formulario fieldset .en-linea { display:inline-flex; }
.formulario legend { font-weight: 700; padding: 0 4px; }
code.bloque { display:block; background:#f4f4f5; padding: 8px 10px; border-radius: 8px; font-size: 12px; word-break: break-all; margin-bottom: 10px; }
.pie-config { display:flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
form.en-linea { display:flex; gap: 6px; }
.pantalla-login { align-items:center; justify-content:center; }
.login { width: 340px; display:flex; flex-direction:column; gap: 12px; }
.login label { display:flex; flex-direction:column; gap:4px; font-weight:600; }
@media (max-width: 900px) {
  body { flex-direction: column; } .lateral { width:auto; height:auto; position: static; flex-direction: row; align-items:center; gap: 10px; }
  .lateral nav { flex-direction: row; } .lateral .grupo { display:none; } .marca { margin:0; }
  .dos-columnas, .config { grid-template-columns: 1fr; } main { padding: 12px; }
  .tabla th:nth-child(4), .tabla td:nth-child(4), .tabla th:nth-child(7), .tabla td:nth-child(7) { display:none; }
}

.formulario .opciones { display:flex; flex-wrap: wrap; gap: 6px 22px; }
.formulario .guardar { align-self: flex-start; padding: 8px 28px; }
.formulario p.gris { margin: 0; }
