.top-acc { display: flex; align-items: center; gap: 14px; }
.link-tienda { color: #d1d5db; font-size: .85rem; text-decoration: none; }
.btn-salir { background: transparent; color: #fff; border: 1px solid #4b5563; border-radius: 8px; padding: 6px 12px; cursor: pointer; }

.login { display: grid; place-items: center; padding: 60px 16px; }
.login-caja { background: #fff; border: 1px solid var(--borde); border-radius: 16px; padding: 28px; width: min(380px, 100%); }
.login-caja h1 { margin: 0 0 4px; font-size: 1.4rem; }
.login-caja .btn { width: 100%; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding: 20px 0 8px; }
.kpi { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 14px 16px; }
.kpi .num { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.kpi .lbl { color: var(--gris); font-size: .82rem; margin-top: 2px; }
.kpi.destacado { background: #fef9c3; border-color: var(--amarillo-osc); }
.kpi.alerta .num { color: var(--rojo); }

.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--borde); margin: 18px 0 14px; }
.tab { background: none; border: 0; padding: 10px 16px; font-size: 1rem; font-weight: 700; color: var(--gris); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.activo { color: var(--negro); border-bottom-color: var(--amarillo-osc); }
.badge-tab { background: var(--negro); color: #fff; border-radius: 999px; font-size: .75rem; padding: 2px 8px; margin-left: 4px; }
.badge-tab.alerta { background: var(--rojo); }

.chips { padding-top: 0; }
.pedidos { display: grid; gap: 12px; padding: 8px 0 60px; }
.pedido { background: #fff; border: 1px solid var(--borde); border-left: 5px solid var(--borde); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.pedido.nuevo { border-left-color: var(--amarillo-osc); background: #fffdf0; }
.pedido.preparando { border-left-color: #3b82f6; }
.pedido.listo { border-left-color: var(--verde); }
.pedido.entregado { border-left-color: #9ca3af; opacity: .85; }
.pedido.cancelado { border-left-color: var(--rojo); opacity: .7; }
.ped-cab { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.ped-cab h3 { margin: 0; font-size: 1.05rem; }
.ped-meta { color: var(--gris); font-size: .85rem; }
.ped-meta a { color: inherit; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 700; }
.pill.nuevo { background: #fef08a; color: #854d0e; }
.pill.preparando { background: #dbeafe; color: #1e40af; }
.pill.listo { background: #dcfce7; color: #166534; }
.pill.entregado { background: #e5e7eb; color: #374151; }
.pill.cancelado { background: #fee2e2; color: #991b1b; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.bajo { background: #ffedd5; color: #9a3412; }
.pill.sin { background: #fee2e2; color: #991b1b; }
.origen { background: #ede9fe; color: #5b21b6; }
.ped-items { margin: 0; padding: 0; list-style: none; font-size: .92rem; display: grid; gap: 3px; }
.ped-items li { display: flex; justify-content: space-between; gap: 10px; }
.ped-nota { background: #f3f4f6; border-radius: 8px; padding: 8px 10px; font-size: .88rem; }
.ped-pie { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ped-total { font-size: 1.15rem; font-weight: 800; }
.ped-acc { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.chico { padding: 8px 12px; font-size: .88rem; }
.btn.peligro { color: var(--rojo); border-color: #fecaca; }
.btn.wa { background: #25d366; border-color: #1fb457; color: #fff; text-decoration: none; display: inline-block; }

.barra-inv { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.barra-inv input[type=search] { flex: 1 1 240px; max-width: 360px; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.check input { width: auto; margin: 0; }
.tabla-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--borde); border-radius: 14px; margin-bottom: 60px; }
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th { text-align: left; background: #f9fafb; color: var(--gris); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; }
.tabla td { padding: 8px 12px; border-top: 1px solid var(--borde); vertical-align: middle; }
.tabla tr.fila-sin { background: #fff7f7; }
.tabla tr.fila-bajo { background: #fffbeb; }
.tabla .prod small { display: block; color: var(--gris); }
.tabla input { width: 90px; margin: 0; padding: 7px 8px; text-align: right; }
.tabla input.guardado { outline: 2px solid var(--verde); }
.tabla input.fallo { outline: 2px solid var(--rojo); }
.sin-datos { text-align: center; color: var(--gris); padding: 40px 0; }

/* Conversaciones con el asistente */
.barra-conv { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.barra-conv .sub { margin: 0; color: var(--gris); font-size: .9rem; }
.convs { display: grid; gap: 10px; padding-bottom: 60px; }
.conv { background: #fff; border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; }
.conv summary { list-style: none; cursor: pointer; padding: 12px 16px; display: grid; gap: 4px; }
.conv summary::-webkit-details-marker { display: none; }
.conv[open] summary { border-bottom: 1px solid var(--borde); background: #fafafa; }
.conv-tit { font-weight: 700; }
.conv-meta { color: var(--gris); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.conv-chat { padding: 12px 16px 14px; display: grid; gap: 8px; background: #f9fafb; }
.cm { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.4; }
.cm.cli { background: var(--amarillo); color: var(--negro); justify-self: end; border-bottom-right-radius: 4px; }
.cm.bot { background: #fff; border: 1px solid var(--borde); justify-self: start; border-bottom-left-radius: 4px; }
.conv-herr { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.pill.herr { background: #eef2ff; color: #3730a3; }

.resaltado { outline: 3px solid var(--amarillo-osc); outline-offset: 2px; transition: outline-color .3s; }
.pill.enlace { border: 0; cursor: pointer; font: inherit; font-size: .75rem; font-weight: 700; }
.cm-lista { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--borde); font-size: .82rem; color: var(--gris); }

.stats { display: grid; gap: 14px; padding-bottom: 60px; }
.stats-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.grafico { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 16px; }
.grafico h3 { margin: 0 0 14px; font-size: 1rem; }
.grafico h3 small { color: var(--gris); font-weight: 500; margin-left: 6px; }
.dos-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.barras { display: flex; align-items: stretch; gap: 6px; height: 210px; padding-top: 18px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; cursor: default; }
.col .barra { width: 100%; max-width: 38px; background: #ca8a04; border-radius: 4px 4px 0 0; min-height: 0; transition: filter .15s; }
.col:hover .barra { filter: brightness(1.12); }
.col .val { font-size: .68rem; color: var(--negro); font-weight: 700; margin-bottom: 3px; white-space: nowrap; }
.col .eje { font-size: .66rem; color: var(--gris); margin-top: 6px; white-space: nowrap; }
.fila-top { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: .88rem; }
.fila-top .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-top .pista { background: #f3f4f6; border-radius: 4px; height: 12px; overflow: hidden; }
.fila-top .pista i { display: block; height: 100%; background: #ca8a04; border-radius: 4px; }
.fila-top b { min-width: 2.2em; text-align: right; }
.sub-fila { color: var(--gris); font-size: .8rem; margin: -2px 0 8px; }
@media (max-width: 600px) { .col .val { font-size: .58rem; } .col .eje:nth-child(odd) { visibility: hidden; } .tabs { overflow-x: auto; } .tab { white-space: nowrap; } }
