:root { --acento: #6366f1; --borde: #eceef3; --fila: 36px; }
body { font-family: 'Plus Jakarta Sans', sans-serif; }

/* Menú lateral */
.nav-espacio { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; font-weight: 700; margin: 14px 12px 6px; }
.nav-tablero { display: flex; gap: 8px; align-items: center; padding: 7px 12px; margin: 1px 8px; border-radius: 8px; color: #475569; font-weight: 500; cursor: pointer; }
.nav-tablero:hover { background: #f1f5f9; }
.nav-tablero.activo { background: #eef2ff; color: #4338ca; font-weight: 700; }

/* Pestañas y barra */
.pestanas { display: flex; gap: 2px; border-bottom: 1px solid #e5e7eb; }
.pestana { padding: 8px 12px; color: #64748b; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.pestana.activa { color: #4338ca; border-bottom-color: var(--acento); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: #475569; font-weight: 600; background: #fff; border: 1px solid #e5e7eb; cursor: pointer; }
.chip.on { border-color: var(--acento); color: #4338ca; background: #eef2ff; }

/* Grupo y tabla */
.grupo { margin-bottom: 26px; }
.grupo-titulo { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; margin: 0 0 6px; cursor: pointer; }
.grupo-titulo .cuenta { color: #94a3b8; font-weight: 600; font-size: 12px; }
.tabla { border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(15,23,42,.05); table-layout: fixed; }
.tabla th { font-weight: 600; font-size: 11.5px; color: #64748b; height: 36px; padding: 0 6px; border-bottom: 1px solid var(--borde); border-right: 1px solid #f3f4f7; text-align: center; position: relative; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabla th.col-nombre { text-align: left; padding-left: 14px; position: sticky; left: 0; z-index: 2; }
.tabla td { height: var(--fila); border-bottom: 1px solid #f1f2f6; border-right: 1px solid #f3f4f7; text-align: center; padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tabla td.col-nombre { text-align: left; padding: 0 8px; font-weight: 500; position: sticky; left: 0; background: #fff; z-index: 1; }
.tabla tr:hover td { background: #fafbff; }
.tabla td.editable { cursor: pointer; }
.tabla td.editable:hover { outline: 1px solid #c7d2fe; outline-offset: -1px; }
.tabla td.editando { outline: 2px solid var(--acento); outline-offset: -2px; border-radius: 6px; }
.tabla tr.sub td { background: #fbfbfe; }
.tabla tr.sub td.col-nombre { padding-left: 38px; color: #475569; }
.tabla tr.agregar td { color: #94a3b8; }
.tabla tr.pie td { border-bottom: 0; height: 30px; }
.th-menu { position: absolute; right: 4px; top: 8px; opacity: 0; border-radius: 4px; padding: 0 4px; cursor: pointer; }
.tabla th:hover .th-menu { opacity: 1; background: #f1f5f9; }
.th-info { color: #cbd5e1; margin-left: 4px; cursor: help; }
.redim { position: absolute; right: 0; top: 0; bottom: 0; width: 5px; cursor: col-resize; }

/* Celdas */
.c-estado { display: flex; align-items: center; justify-content: center; height: 30px; margin: 0 -1px; border-radius: 7px; color: #fff; font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; transition: filter .15s; }
.c-estado:hover { filter: brightness(1.06); }
.c-estado.vacio { background: #e5e7eb; }
.avatar { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; align-items: center; justify-content: center; border: 2px solid #fff; background-size: cover; }
.avatares .avatar + .avatar { margin-left: -8px; }
.avatar.vacio { background: #e2e8f0; color: #94a3b8; }
.c-link { color: #4f46e5; }
.c-error { color: #dc2626; font-size: 11px; }
.cuenta-sub { background: #eef2ff; color: #4338ca; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-left: 6px; }
.flecha { display: inline-block; width: 16px; color: #94a3b8; cursor: pointer; transition: transform .15s; }
.flecha.abierta { transform: rotate(90deg); }
.barra-resumen { display: flex; height: 16px; border-radius: 8px; overflow: hidden; margin: 0 6px; }

/* Popovers, modales, panel */
.popover { position: fixed; z-index: 40; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.16); padding: 8px; min-width: 200px; max-height: 360px; overflow: auto; }
.popover .opcion { padding: 7px 8px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.popover .opcion:hover { background: #f1f5f9; }
.paleta { display: grid; grid-template-columns: repeat(2, 150px); gap: 6px; }
.paleta .c-estado { cursor: pointer; }
.modal-fondo { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 45; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: 460px; max-width: 94vw; max-height: 88vh; overflow: auto; }
#panel-item.abierto { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100vw; background: #fff; border-left: 1px solid #e5e7eb; box-shadow: -12px 0 32px rgba(15,23,42,.1); z-index: 30; overflow: auto; }
.aviso { background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(15,23,42,.25); animation: entra .2s ease-out; }
.aviso.error { background: #b91c1c; }
@keyframes entra { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.sortable-ghost { opacity: .35; }
.sortable-chosen td { background: #eef2ff !important; }
.asa { cursor: grab; color: #cbd5e1; opacity: 0; padding-right: 2px; }
.tabla tr:hover .asa { opacity: 1; }
