/* ============================================================================
   COMPONENTE GLOBAL: KEBAB (⋮) DE ACCIONES  —  .inka-kebab
   ----------------------------------------------------------------------------
   Menú de acciones por fila/tarjeta. El comportamiento (abrir/cerrar/teclado/
   posición) lo maneja `InkaCodeUI.Kebab` (public/js/modules/ui/kebab.js) sobre
   `InkaCodeUI.FloatingLayer`. Estilo tomado del kebab de documentoelectrónico
   (dte-kebab), plano y compacto, con tokens globales `--ui-*` (dark automático).

   El menú (.inka-kebab__menu) recibe además la clase `.ui-floating-layer`
   (position:fixed + z-index) y el atributo `hidden` desde FloatingLayer; aquí
   solo definimos su caja. Ver README.md para el markup canónico.
   ============================================================================ */

.inka-kebab {
    position: relative;
    display: inline-block;
}

/* --- Disparador (⋮) -------------------------------------------------------- */
.inka-kebab__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ui-text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.inka-kebab__btn > i {
    font-size: 19px;
    font-weight: 700;
}

.inka-kebab__btn:hover {
    background: var(--ui-surface);
    border-color: var(--ui-border);
    color: var(--ui-text);
}

.inka-kebab__btn:focus {
    outline: none;
    box-shadow: var(--ui-focus-ring);
}

/* --- Menú ------------------------------------------------------------------ */
.inka-kebab__menu {
    position: fixed;            /* FloatingLayer calcula top/left; escapa overflow */
    z-index: 1090;
    min-width: min(164px, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    margin: 0;
    padding: 6px;
    list-style: none;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: var(--ui-shadow-card);
    text-align: left;          /* no heredar el text-align:center del <td> acciones */
}

.inka-kebab__menu > li {
    margin: 0;
    list-style: none;
}

/* --- Ítems ----------------------------------------------------------------- */
.inka-kebab__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-text);
    font-size: 13px;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.inka-kebab__item > i {
    flex: 0 0 auto;
    width: 16px;
    text-align: center;
    color: var(--ui-accent);
    font-size: 14px;
}
/* Iconos en imagen dentro de un ítem (logos/SVG): tamaño acotado y uniforme. */
.inka-kebab__item img {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Resaltado solo en hover (mouse) y en foco por teclado (:focus-visible).
   Al abrir con click enfocamos el primer ítem por programación, pero como la
   última interacción fue de mouse el navegador NO aplica :focus-visible, así que
   no se ve "pre-seleccionado". Con teclado (flechas) sí se resalta. */
.inka-kebab__item:focus {
    outline: none;
}

.inka-kebab__item:hover,
.inka-kebab__item:focus-visible {
    background: var(--ui-accent-soft);
    color: var(--ui-text);
    text-decoration: none;
    outline: none;
}

.inka-kebab__item--danger,
.inka-kebab__item--danger > i {
    color: var(--ui-danger);
}

.inka-kebab__item--danger:hover,
.inka-kebab__item--danger:focus-visible {
    background: var(--ui-danger-soft);
    color: var(--ui-danger);
}

.inka-kebab__item[disabled],
.inka-kebab__item[aria-disabled="true"] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Opcionales: agrupación (no se usan por defecto) ----------------------- */
.inka-kebab__section {
    padding: 10px 10px 5px;
    color: var(--ui-menu-section-text, var(--ui-text-secondary));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.inka-kebab__menu > .inka-kebab__section:first-child {
    padding-top: 4px;
}

.inka-kebab__divider {
    height: 0;
    margin: 5px 2px;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--ui-menu-divider, var(--ui-border));
}

/* --- Tema oscuro ----------------------------------------------------------- */
html.theme-dark .inka-kebab__btn:hover {
    background: #262626;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e6edf8;
}

html.theme-dark .inka-kebab__menu {
    background: #1f1f1f;
    border-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark .inka-kebab__item {
    color: #e6edf8;
}
