/* StartBox Labs — Dashboard client multi-tenant */

.dashboard-body {
    overflow: hidden;
    height: 100vh;
    box-sizing: border-box;
}

.app {
    display: block;
    height: 100%;
    background: var(--bg-0);
}

/* ---------- Barre de vues compacte (remplace l'ancienne colonne verticale) ---------- */
.nav.nav--slim {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    padding: 12px 32px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-soft);
}
.nav.nav--slim .nav__item {
    width: auto;
    padding: 8px 14px;
    font-size: 0.85rem;
}
.nav.nav--slim .nav__item--admin[hidden] { display: none; }

/* ---------- Sidebar (styles conserves pour compatibilite, non utilises sur dashboard.php) ---------- */

.app .sidebar {
    position: static;
    height: 100vh;
    padding: 18px 14px;
    gap: 16px;
    overflow-y: auto;
}

.tenant-selector {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
}
.tenant-selector label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}
.tenant-selector__select {
    background: transparent;
    color: var(--text);
    border: none;
    padding: 4px 0;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.tenant-selector__select option {
    background: var(--bg-1);
    color: var(--text);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
.nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    position: relative;
}
.nav__item:hover {
    background: var(--bg-2);
    color: var(--text);
}
.nav__item--active {
    background: linear-gradient(135deg, rgba(228, 200, 142, 0.15), rgba(176, 138, 62, 0.10));
    color: var(--text);
    border-color: rgba(228, 200, 142, 0.35);
}
.nav__icon {
    display: inline-flex;
    width: 22px;
    justify-content: center;
    font-size: 1rem;
    color: var(--accent);
}
.nav__label { flex: 1; }
.nav__badge {
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--warning);
    color: #1a120a;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.sidebar__link {
    display: inline-block;
    padding: 8px 4px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.15s ease;
}
.sidebar__link:hover { color: var(--accent); }

/* ---------- Main ---------- */

.main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 0;
    background:
        radial-gradient(900px 500px at 100% -10%, rgba(176, 138, 62, 0.06), transparent 60%),
        radial-gradient(700px 400px at -10% 100%, rgba(228, 200, 142, 0.06), transparent 60%);
}

/* ---------- Topbar ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 5px 32px;
    background: rgba(11, 15, 23, 0.4);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}
.topbar__left h2 {
    font-size: 1.4rem;
    margin: 0;
}
.topbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border-soft);
    background: var(--bg-2);
    border-radius: 999px;
    font-size: 0.82rem;
    white-space: nowrap;
}
.status-pill__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    box-shadow: 0 0 6px currentColor;
}
.status-pill[data-state="ok"]       .status-pill__dot { background: var(--success); }
.status-pill[data-state="ok"]       .status-pill__label { color: var(--success); }
.status-pill[data-state="degraded"] .status-pill__dot { background: var(--warning); }
.status-pill[data-state="degraded"] .status-pill__label { color: var(--warning); }
.status-pill[data-state="down"]     .status-pill__dot { background: var(--danger); }
.status-pill[data-state="down"]     .status-pill__label { color: var(--danger); }

.credits {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 6px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    position: relative;
}
.credits__label {
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.credits__value {
    color: var(--text);
    font-weight: 700;
    font-family: var(--font-mono);
}
.credits__topup {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--accent);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background 0.15s ease;
}
.credits__topup:hover {
    transform: scale(1.1);
    background: var(--accent-strong, var(--accent));
}

/* ---------- Views ---------- */

.view {
    padding: 24px 32px 32px;
    overflow-y: auto;
    flex: 1;
    animation: fade-in 0.2s ease-out;
}
section.view[data-view="dashboard"] {
    margin-top: -24px;
    padding-top: 15px;
}
.view[hidden] { display: none; }
@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- KPI cards ---------- */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 10px;
}
.kpi-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.00)) var(--bg-1);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: border-color 0.15s ease;
}
.kpi-card:hover { border-color: var(--accent); }
.kpi-card--success { border-left-color: var(--success); }
.kpi-card--warning { border-left-color: var(--warning); }
.kpi-card--info    { border-left-color: var(--info); }
.kpi-card__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.kpi-card__value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 6px 0 4px;
    letter-spacing: -0.02em;
    color: var(--text);
}
.kpi-card__hint {
    font-size: 0.78rem;
    color: var(--text-dim);
}
.kpi-card__progress {
    margin-top: 10px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.kpi-card__progress-bar {
    height: 100%;
    background: var(--info);
    border-radius: inherit;
    transition: width 0.4s ease, background-color 0.2s ease;
}
.kpi-card__progress-bar[data-state="warn"]     { background: var(--warning); }
.kpi-card__progress-bar[data-state="critical"] { background: var(--danger, #e5484d); }

.usage-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0;
}
.usage-breakdown__empty {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
    padding: 18px 0;
}
.usage-row__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    margin-bottom: 4px;
}
.usage-row__label {
    text-transform: capitalize;
    color: var(--text);
    font-weight: 500;
}
.usage-row__value {
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}
.usage-row__value em {
    font-style: normal;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 4px;
}
.usage-row__bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
}
.usage-row__fill {
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    transition: width 0.4s ease;
}

/* ---------- Two-col layout ---------- */

.two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 10px;
}
@media (max-width: 1100px) {
    .two-col { grid-template-columns: 1fr; }
}

/* ---------- Panel ---------- */

.panel {
    background: var(--bg-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.panel__header h3 {
    font-size: 0.95rem;
    color: var(--text);
    margin: 0;
}

/* ---------- Activity log ---------- */

.activity-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.activity-log__empty {
    padding: 20px;
    color: var(--text-dim);
    text-align: center;
    font-size: 0.85rem;
}
.activity-item {
    display: grid;
    grid-template-columns: 80px 130px 1fr;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
    align-items: baseline;
}
.activity-item__time   { color: var(--text-dim); font-size: 0.75rem; }
.activity-item__agent  { color: var(--accent-2); font-weight: 600; font-size: 0.78rem; }
.activity-item__msg    { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Agents summary ---------- */

.agents-summary {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.agents-summary li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.agents-summary li .role { color: var(--text); font-weight: 500; }
.agents-summary li .id { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.7rem; }

/* ---------- Kanban ---------- */

.kanban {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    height: 100%;
    min-height: 500px;
}
@media (max-width: 1200px) {
    .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .kanban { grid-template-columns: 1fr; }
}

.kanban__col {
    background: var(--bg-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}
.kanban__col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
}
.kanban__col-header h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0;
}
.kanban__col[data-col="preparing"]   .kanban__col-header h3 { color: var(--text-dim); }
.kanban__col[data-col="in_progress"] .kanban__col-header h3 { color: var(--info); }
.kanban__col[data-col="waiting"]     .kanban__col-header h3 { color: var(--warning); }
.kanban__col[data-col="done"]        .kanban__col-header h3 { color: var(--success); }

.kanban__count {
    background: var(--bg-3);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.kanban__list {
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban__hint {
    padding: 12px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.78rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.kanban-card {
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.kanban-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.kanban-card--waiting { border-left-color: var(--warning); }
.kanban-card--done    { border-left-color: var(--success); }
.kanban-card--in_progress { border-left-color: var(--info); }
.kanban-card--budget  { border-left-color: var(--danger, #e5484d); }
.kanban-card__badge {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.kanban-card__badge--budget {
    background: rgba(229, 72, 77, 0.15);
    color: var(--danger, #e5484d);
    border: 1px solid rgba(229, 72, 77, 0.35);
}

.human-approval--budget {
    border-color: rgba(229, 72, 77, 0.35);
}
.human-approval--budget .human-approval__icon {
    background: var(--danger, #e5484d);
    color: white;
}
.human-approval__meta {
    margin: 10px 0 4px;
    font-size: 0.85rem;
    color: var(--text-dim);
}
.human-approval__meta strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.kanban-card__title {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kanban-card__meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

/* ---------- Livrables ---------- */

.livrables-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.input {
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
#livrables-search { flex: 1; }

.livrables-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.livrables-list__empty {
    padding: 40px;
    color: var(--text-dim);
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.livrable {
    background: var(--bg-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.livrable__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.livrable__title {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
    flex: 1;
    line-height: 1.4;
}
.livrable__badge {
    padding: 3px 8px;
    background: rgba(228, 200, 142, 0.15);
    color: var(--accent);
    border: 1px solid rgba(228, 200, 142, 0.3);
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.livrable__meta {
    display: flex;
    gap: 12px;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    margin-bottom: 10px;
}
.livrable__content {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 160px;
    overflow-y: auto;
    white-space: pre-wrap;
}
.livrable__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* ---------- Settings ---------- */

.settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.settings__row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.9rem;
}
.settings__row:last-child { border-bottom: none; }
.settings__row label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}
.mono {
    font-family: var(--font-mono);
    color: var(--text);
    font-size: 0.85rem;
}

/* ---------- Modal ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-in 0.15s ease-out;
}
.modal[hidden] { display: none; }
@keyframes modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}
.modal__panel {
    position: relative;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    width: min(600px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modal-panel-in 0.2s ease-out;
}
.modal__panel--wide { width: min(900px, 92vw); }
@keyframes modal-panel-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
}
.modal__header h2 { font-size: 1.1rem; margin: 0; }
.modal__close {
    width: 32px; height: 32px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.modal__close:hover { background: var(--bg-2); color: var(--text); }

.modal__body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.modal__body label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.modal__body textarea {
    width: 100%;
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 140px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.modal__body textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal__hint {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(228, 200, 142, 0.08);
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
    font-size: 0.82rem;
    border-radius: 4px;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-soft);
}

/* Détail tâche : timeline */
.task-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.task-step {
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.task-step--fade-in {
    animation: step-in 0.3s ease-out;
}
@keyframes step-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Live pulse indicator */
.live-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--info);
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-ring 1.5s ease-in-out infinite;
    vertical-align: baseline;
}
@keyframes pulse-ring {
    0%   { transform: scale(0.8); opacity: 1; box-shadow: 0 0 0 0 var(--info); }
    70%  { transform: scale(1.1); opacity: 0.7; box-shadow: 0 0 0 8px transparent; }
    100% { transform: scale(0.8); opacity: 1; box-shadow: 0 0 0 0 transparent; }
}

.activity-item--warning .activity-item__agent { color: var(--warning); }
.activity-item--success .activity-item__agent { color: var(--success); }

/* ============ Brique E : table users + pills ============ */
.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.9rem;
}
.data-table th {
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    font-weight: 600;
}
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pill--ok    { background: rgba(46, 160, 67, 0.18); color: var(--success); border: 1px solid rgba(46, 160, 67, 0.35); }
.pill--muted { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); border: 1px solid var(--border-soft); }
.pill--role  { background: rgba(88, 168, 236, 0.15); color: var(--info); border: 1px solid rgba(88, 168, 236, 0.35); }
.pill--role.pill--admin  { background: rgba(229, 72, 77, 0.15); color: var(--danger, #e5484d); border-color: rgba(229, 72, 77, 0.35); }
.pill--role.pill--viewer { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); border-color: var(--border-soft); }

.nav__item--admin { position: relative; }
.nav__item--admin::before {
    content: "";
    position: absolute;
    top: 8px;
    right: 10px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--warning);
    opacity: 0.7;
}

/* ============ Brique F : analytics daily bars ============ */
.analytics-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
    padding: 12px 4px 0;
    overflow-x: auto;
}
.analytics-bar {
    flex: 0 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.analytics-bar__fill {
    width: 100%;
    background: linear-gradient(180deg, var(--accent), rgba(88, 168, 236, 0.5));
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: opacity 0.15s ease;
}
.analytics-bar:hover .analytics-bar__fill { opacity: 0.75; }
.analytics-bar__label {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 4px;
    font-family: var(--font-mono);
}
.activity-item--error   .activity-item__agent { color: var(--danger); }
.activity-item--error   { background: rgba(239, 68, 68, 0.08); }
.task-step__header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.8rem;
}
.task-step__agent {
    color: var(--accent-2);
    font-weight: 600;
}
.task-step__num {
    color: var(--text-dim);
    font-family: var(--font-mono);
}
.task-step__response {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.task-step__delegation {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ---------- User menu (topbar) ---------- */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
}
.user-menu__avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: grid; place-items: center;
}
.user-menu__info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.user-menu__name  { font-size: 0.82rem; color: var(--text); font-weight: 600; }
.user-menu__role  { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

.btn--logout {
    padding: 6px 10px;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.btn--logout:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Copy toast ---------- */

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: #0a2410;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toast-in 0.25s ease-out;
    z-index: 1000;
}
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
