/* ── Agents row — sous la chatbox ───────────────────────────────────────── */

.nd-agents-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 100%;
    margin-top: -0.5rem;
}

/* ── Card compact ────────────────────────────────────────────────────────── */
.nd-agent-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 0.5rem;
    overflow: visible;
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.52) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45) inset, 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.15s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.nd-agent-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(0, 0, 0, 0.48) 100%);
    transform: translateY(-1px);
}

.nd-agent-card:active { transform: translateY(0); }

.nd-agent-card__svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.15s ease;
}
.nd-agent-card:hover .nd-agent-card__svg { color: rgba(255, 255, 255, 0.65); }

.nd-agent-card__name {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.15s ease;
    white-space: nowrap;
}
.nd-agent-card:hover .nd-agent-card__name { color: rgba(255, 255, 255, 0.72); }

/* ── "More" — dashed border ──────────────────────────────────────────────── */
.nd-agent-card--more { border-style: dashed; }
.nd-agent-card--more:hover { border-style: solid; }

/* ── Hidden when chat active ─────────────────────────────────────────────── */
.nd-chat-active .nd-agents-row { display: none; }


/* ── Agent panel overlay ──────────────────────────────────────────────────── */
.nd-agent-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: nd-overlay-in 0.18s ease;
}
.nd-agent-panel-overlay[hidden] { display: none; }

@keyframes nd-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.nd-agent-panel {
    width: min(520px, calc(100vw - 2rem));
    background: rgba(18, 18, 22, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.1rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    padding: 1.25rem;
    animation: nd-panel-in 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes nd-panel-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.nd-agent-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.nd-agent-panel__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.nd-agent-panel__title {
    font-size: 0.95rem;
    font-weight: 600;
}

.nd-agent-panel__close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.35);
    padding: 0.25rem;
    border-radius: 0.4rem;
    display: flex;
    transition: color 0.15s, background 0.15s;
}
.nd-agent-panel__close:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.07);
}

.nd-agent-panel__desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    margin: 0 0 1rem;
}

/* ── Panel slides — plus large pour la grille de templates ───────────────── */
.nd-agent-panel--slides {
    width: min(600px, calc(100vw - 2rem));
}

/* ── Grille de templates dans l'overlay slides ───────────────────────────── */
.nd-slides-overlay-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* ── Sub-agent grid (FeatureGrid style) ───────────────────────────────────── */
.nd-agent-panel__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}


.nd-agent-sub {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.85rem;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
    transition: background 0.2s, border-color 0.2s, transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.nd-agent-sub:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.13);
    transform: translateY(-1px);
}
.nd-agent-sub:active { transform: translateY(0); }

/* Icon — small, white, no colour box */
.nd-agent-sub__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.38);
    transition: color 0.15s;
}
.nd-agent-sub:hover .nd-agent-sub__icon { color: rgba(255, 255, 255, 0.7); }

/* Text block */
.nd-agent-sub__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.nd-agent-sub__name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.3;
    transition: color 0.15s;
}
.nd-agent-sub:hover .nd-agent-sub__name { color: rgba(255, 255, 255, 0.95); }

.nd-agent-sub__desc {
    font-size: 0.67rem;
    color: rgba(255, 255, 255, 0.32);
    line-height: 1.4;
    transition: color 0.15s;
}
.nd-agent-sub:hover .nd-agent-sub__desc { color: rgba(255, 255, 255, 0.5); }

/* Arrow */
.nd-agent-sub__arrow {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.15);
    transition: color 0.2s, transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.nd-agent-sub:hover .nd-agent-sub__arrow {
    color: rgba(255, 255, 255, 0.5);
    transform: translateX(3px);
}

/* ── Tous les agents — full-screen overlay ───────────────────────────────── */
.nd-all-agents-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--sidebar-width-icon);
    z-index: 200;
    display: flex;
    align-items: stretch;
    background: rgba(8, 8, 14, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: nd-overlay-in 0.18s ease;
}

/* Quand le sidebar est épinglé (pleine largeur) */
html.aionos-sidebar-pinned .nd-all-agents-overlay,
html.aionos-sidebar-pinned-preload .nd-all-agents-overlay {
    left: var(--sidebar-width);
}

.nd-all-agents-overlay[hidden] { display: none; }

.nd-all-agents-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: nd-aa-panel-in 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}


@keyframes nd-aa-panel-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nd-all-agents-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.nd-all-agents-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}

.nd-all-agents-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.3);
    padding: 5px;
    border-radius: 6px;
    display: flex;
    transition: color 0.15s, background 0.15s;
}
.nd-all-agents-close:hover {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.07);
}

.nd-all-agents-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 36px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

.nd-aa-section {}

.nd-aa-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
    margin-bottom: 10px;
}

.nd-aa-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.nd-aa-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
    position: relative;
    overflow: visible;
    transition: background 0.18s, border-color 0.18s, transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.nd-aa-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.13);
    transform: translateY(-1px);
}
.nd-aa-card:active { transform: translateY(0); }

.nd-aa-card--soon {
    opacity: 0.45;
    cursor: default;
}
.nd-aa-card--soon:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.07);
    transform: none;
}

.nd-aa-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.15s, background 0.15s;
}
.nd-aa-card:not(.nd-aa-card--soon):hover .nd-aa-card-icon {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
}

.nd-aa-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nd-aa-card-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nd-aa-card:not(.nd-aa-card--soon):hover .nd-aa-card-name { color: rgba(255, 255, 255, 0.95); }

.nd-aa-card-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1.4;
}

.nd-aa-soon-badge {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1px 5px;
    text-transform: uppercase;
}

/* ── File card (icône fichier en overflow sur la carte agent) ──────────────── */
.nd-fc {
    pointer-events: none;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
/* Mode inline : remplace l'icône, s'intègre dans le flux */
.nd-fc--inline {
    display: block;
}
.nd-aa-card:not(.nd-aa-card--soon):hover .nd-fc {
    transform: translateY(-2px) rotate(2deg);
}

.nd-fc-body {
    width: 46px;
    height: 58px;
    background: #181820;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 6px 5px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255,255,255,0.06) inset;
    overflow: hidden;
    position: relative;
}

.nd-fc-banner {
    position: absolute;
    bottom: 3px;
    right: -5px;
    z-index: 2;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 6px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.nd-fc-banner--code   { background: #334155; }   /* slate  — Cybersec */
.nd-fc-banner--swift  { background: #c2410c; }   /* red    — Swift/iOS */
.nd-fc-banner--html   { background: #4f46e5; }   /* indigo — tsx/Web */
.nd-fc-banner--json   { background: #92400e; }   /* amber  — JSON/Workflow */
.nd-fc-banner--pptx   { background: #9a3412; }   /* dark-red — PPTX */
.nd-fc-banner--xlsx   { background: #065f46; }   /* green  — XLSX */
.nd-fc-banner--doc    { background: #1e3a8a; }   /* navy   — DOC */
.nd-fc-banner--search { background: #0e7490; }   /* cyan   — Recherche */
.nd-fc-banner--trad   { background: #6d28d9; }   /* violet — Traduction */
.nd-fc-banner--synth  { background: #0f766e; }   /* teal   — Synthèse */

/* Shared bar */
.nd-fc-b {
    height: 2px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
}
.nd-fc-b--dim { background: rgba(255, 255, 255, 0.1); }

/* Mono text for code/json brackets */
.nd-fc-m {
    font-family: monospace;
    font-size: 5px;
    color: rgba(255, 255, 255, 0.28);
    line-height: 1;
    flex-shrink: 0;
}

/* Code placeholder */
.nd-fc-code { display: flex; flex-direction: column; gap: 3px; }
.nd-fc-cr { display: flex; align-items: center; gap: 1px; }
.nd-fc-ind { padding-left: 4px; }

/* JSON placeholder */
.nd-fc-json { display: flex; flex-direction: column; gap: 2px; }
.nd-fc-jr { display: flex; align-items: center; gap: 3px; padding-left: 4px; }

/* PPTX placeholder */
.nd-fc-slide {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 2px;
    padding: 3px 3px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.nd-fc-slide-icon {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: rgba(249, 115, 22, 0.4);
}

/* XLSX placeholder */
.nd-fc-xlsx { display: flex; flex-direction: column; gap: 1px; }
.nd-fc-xh { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; }
.nd-fc-xh > div { height: 7px; background: rgba(255,255,255,0.18); border-radius: 1px; }
.nd-fc-xr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; }
.nd-fc-xr > div { height: 6px; background: rgba(255,255,255,0.09); border-radius: 1px; }
.nd-fc-xr--dim > div { background: rgba(255,255,255,0.05); }

/* DOC placeholder */
.nd-fc-doc { display: flex; flex-direction: column; gap: 2.5px; }
