:root {
    --agents-background: #f4f7fb;
    --agents-surface: #ffffff;
    --agents-surface-soft: #f8fafc;
    --agents-border: #e3e9f2;
    --agents-text: #172033;
    --agents-muted: #68758a;
    --agents-primary: #335cff;
    --agents-primary-dark: #2145d7;
    --agents-secondary: #7557ff;
    --agents-success: #12936f;
    --agents-warning: #c97a15;
    --agents-danger: #d84d60;
    --agents-shadow: 0 18px 50px rgba(31, 45, 79, 0.08);
    --agents-radius: 22px;
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--agents-background);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--agents-text);
    background:
        radial-gradient(
            circle at 85% 3%,
            rgba(117, 87, 255, 0.09),
            transparent 30%
        ),
        radial-gradient(
            circle at 20% 0%,
            rgba(51, 92, 255, 0.08),
            transparent 30%
        ),
        var(--agents-background);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.agents-app {
    min-height: 100vh;
}

#sidebar-container .dashboard-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: var(--sidebar-width);
}

.agents-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.agents-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 86px;
    padding: 16px 34px;
    border-bottom: 1px solid rgba(227, 233, 242, 0.9);
    background: rgba(248, 250, 253, 0.9);
    backdrop-filter: blur(18px);
}

.agents-topbar-left,
.agents-topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.agents-topbar h1 {
    margin: 2px 0 0;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    letter-spacing: -0.04em;
}

.page-eyebrow,
.section-kicker {
    display: block;
    margin: 0;
    color: var(--agents-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mobile-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--agents-border);
    border-radius: 13px;
    color: var(--agents-text);
    background: var(--agents-surface);
}

.primary-button,
.secondary-button {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 13px;
    font-weight: 750;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.primary-button {
    border: 1px solid transparent;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--agents-primary),
            var(--agents-secondary)
        );
    box-shadow: 0 11px 25px rgba(51, 92, 255, 0.22);
}

.secondary-button {
    border: 1px solid var(--agents-border);
    color: var(--agents-text);
    background: var(--agents-surface);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
}

.agents-content {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 30px 34px 60px;
}

.hero-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.5fr);
    min-height: 290px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 30px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #182b6d 0%,
            #345dff 55%,
            #7755ff 100%
        );
    box-shadow: 0 28px 70px rgba(30, 57, 145, 0.22);
}

.hero-panel::before {
    position: absolute;
    inset: auto auto -160px -120px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    content: "";
}

.hero-copy {
    position: relative;
    z-index: 2;
    align-self: center;
    max-width: 790px;
    padding: 46px 52px;
}

.hero-badge {
    display: inline-flex;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-copy h2 {
    max-width: 710px;
    margin: 19px 0 14px;
    font-size: clamp(2rem, 4vw, 3.45rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.hero-copy p {
    max-width: 690px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.02rem;
    line-height: 1.75;
}

.hero-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 290px;
}

.brain-core {
    position: relative;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 108px;
    height: 108px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 32px;
    color: #294ec9;
    background: #ffffff;
    box-shadow:
        0 24px 50px rgba(18, 35, 99, 0.35),
        inset 0 0 0 7px rgba(51, 92, 255, 0.06);
    font-size: 2.4rem;
    font-weight: 900;
}

.brain-orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.27);
    border-radius: 50%;
}

.orbit-one {
    width: 210px;
    height: 210px;
}

.orbit-two {
    width: 285px;
    height: 285px;
}

.orbit-agent {
    position: absolute;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    font-weight: 850;
}

.orbit-agent-one {
    top: 48px;
}

.orbit-agent-two {
    right: 54px;
}

.orbit-agent-three {
    bottom: 44px;
}

.orbit-agent-four {
    left: 52px;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.statistic-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 98px;
    padding: 18px;
    border: 1px solid var(--agents-border);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.87);
    box-shadow: 0 10px 35px rgba(31, 45, 79, 0.04);
}

.statistic-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    color: var(--agents-primary);
    background: rgba(51, 92, 255, 0.09);
    font-size: 1.2rem;
    font-weight: 900;
}

.statistic-card strong,
.statistic-card span {
    display: block;
}

.statistic-card strong {
    font-size: 1.45rem;
    line-height: 1.1;
}

.statistic-card div span {
    margin-top: 4px;
    color: var(--agents-muted);
    font-size: 0.82rem;
}

.agents-toolbar {
    display: flex;
    gap: 14px;
    margin-top: 28px;
}

.search-wrapper {
    position: relative;
    flex: 1;
}

.search-wrapper input,
.agents-select {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--agents-border);
    outline: none;
    color: var(--agents-text);
    background: rgba(255, 255, 255, 0.92);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.search-wrapper input {
    padding: 0 48px;
    border-radius: 17px;
}

.agents-select {
    width: 235px;
    padding: 0 15px;
    border-radius: 17px;
}

.search-wrapper input:focus,
.agents-select:focus {
    border-color: rgba(51, 92, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(51, 92, 255, 0.09);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 18px;
    color: var(--agents-muted);
    transform: translateY(-50%);
}

.clear-search-button {
    position: absolute;
    top: 50%;
    right: 13px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 10px;
    color: var(--agents-muted);
    background: var(--agents-surface-soft);
    transform: translateY(-50%);
}

.category-tabs {
    display: flex;
    gap: 9px;
    margin: 18px 0 0;
    padding: 3px 0 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.category-tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--agents-border);
    border-radius: 999px;
    color: var(--agents-muted);
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 750;
}

.category-tab.active {
    border-color: var(--agents-primary);
    color: #ffffff;
    background: var(--agents-primary);
    box-shadow: 0 8px 20px rgba(51, 92, 255, 0.2);
}

.agents-section {
    margin-top: 34px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.section-heading h2,
.modal-heading h2 {
    margin: 4px 0 0;
    font-size: 1.45rem;
    letter-spacing: -0.035em;
}

.section-heading p {
    margin: 0;
    color: var(--agents-muted);
    font-size: 0.86rem;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 19px;
}

.agent-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 388px;
    overflow: hidden;
    border: 1px solid var(--agents-border);
    border-radius: var(--agents-radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 35px rgba(31, 45, 79, 0.04);
    transition:
        transform 190ms ease,
        box-shadow 190ms ease,
        border-color 190ms ease;
}

.agent-card:hover {
    border-color: rgba(51, 92, 255, 0.28);
    box-shadow: var(--agents-shadow);
    transform: translateY(-4px);
}

.agent-card-top-line {
    height: 5px;
    background:
        linear-gradient(
            90deg,
            var(--agent-accent, #335cff),
            var(--agent-accent-secondary, #7557ff)
        );
}

.agent-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px;
}

.agent-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.agent-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.agent-avatar {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 66px;
    height: 66px;
    overflow: hidden;
    border: 1px solid rgba(51, 92, 255, 0.12);
    border-radius: 20px;
    color: var(--agent-accent, #335cff);
    background:
        linear-gradient(
            145deg,
            rgba(51, 92, 255, 0.08),
            rgba(117, 87, 255, 0.12)
        );
    font-size: 1.6rem;
    font-weight: 900;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-title-wrapper {
    min-width: 0;
}

.agent-title-wrapper h3 {
    margin: 0;
    overflow: hidden;
    font-size: 1.12rem;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-category {
    display: block;
    margin-top: 5px;
    color: var(--agents-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.favorite-button {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--agents-border);
    border-radius: 13px;
    color: #9aa4b5;
    background: var(--agents-surface);
    font-size: 1.15rem;
}

.favorite-button.active {
    border-color: rgba(245, 174, 45, 0.4);
    color: #e39a19;
    background: rgba(255, 188, 51, 0.1);
}

.agent-description {
    min-height: 66px;
    margin: 18px 0 15px;
    color: var(--agents-muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.agent-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    margin-bottom: 15px;
}

.agent-status,
.agent-version {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 800;
}

.agent-status.available {
    color: var(--agents-success);
    background: rgba(18, 147, 111, 0.09);
}

.agent-status.coming-soon {
    color: var(--agents-warning);
    background: rgba(201, 122, 21, 0.1);
}

.agent-status.locked {
    color: var(--agents-danger);
    background: rgba(216, 77, 96, 0.1);
}

.agent-version {
    color: var(--agents-muted);
    background: var(--agents-surface-soft);
}

.capability-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 20px;
}

.capability-tag {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 10px;
    border: 1px solid var(--agents-border);
    border-radius: 9px;
    color: #4d5b71;
    background: var(--agents-surface-soft);
    font-size: 0.72rem;
    font-weight: 700;
}

.agent-card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
    margin-top: auto;
}

.open-agent-button,
.agent-info-button {
    min-height: 44px;
    border-radius: 13px;
    font-weight: 800;
}

.open-agent-button {
    border: 1px solid transparent;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--agent-accent, #335cff),
            var(--agent-accent-secondary, #7557ff)
        );
}

.open-agent-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.agent-info-button {
    width: 46px;
    border: 1px solid var(--agents-border);
    color: var(--agents-text);
    background: var(--agents-surface);
}

.empty-state {
    padding: 55px 20px;
    border: 1px dashed #ccd5e3;
    border-radius: var(--agents-radius);
    text-align: center;
    background: rgba(255, 255, 255, 0.65);
}

.empty-state-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 20px;
    color: var(--agents-primary);
    background: rgba(51, 92, 255, 0.09);
    font-size: 1.7rem;
}

.empty-state h3 {
    margin: 0;
}

.empty-state p {
    margin: 10px 0 20px;
    color: var(--agents-muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
}

.agent-modal-panel {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    background: var(--agents-surface);
    box-shadow: 0 35px 90px rgba(15, 23, 42, 0.28);
}

.tools-modal-panel {
    width: min(900px, 100%);
    padding: 30px;
}

.modal-close-button {
    position: sticky;
    z-index: 4;
    top: 16px;
    float: right;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 16px 16px 0 0;
    border: 1px solid var(--agents-border);
    border-radius: 14px;
    color: var(--agents-text);
    background: rgba(255, 255, 255, 0.92);
    font-size: 1.3rem;
}

.agent-modal-hero {
    padding: 38px 32px 28px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--agent-accent, #335cff),
            var(--agent-accent-secondary, #7557ff)
        );
}

.agent-modal-identity {
    display: flex;
    align-items: center;
    gap: 18px;
}

.agent-modal-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 27px;
    background: rgba(255, 255, 255, 0.17);
    font-size: 2rem;
    font-weight: 900;
}

.agent-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-modal-hero h2 {
    margin: 0;
    font-size: 1.8rem;
}

.agent-modal-hero p {
    margin: 7px 0 0;
    color: rgba(255, 255, 255, 0.8);
}

.agent-modal-body {
    padding: 28px 32px 34px;
}

.agent-modal-body h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.agent-modal-body > p {
    color: var(--agents-muted);
    line-height: 1.7;
}

.agent-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.agent-detail-item {
    padding: 15px;
    border: 1px solid var(--agents-border);
    border-radius: 15px;
    background: var(--agents-surface-soft);
}

.agent-detail-item span,
.agent-detail-item strong {
    display: block;
}

.agent-detail-item span {
    color: var(--agents-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.agent-detail-item strong {
    margin-top: 5px;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-actions button {
    flex: 1;
}

.modal-heading {
    padding-right: 55px;
}

.modal-heading p {
    color: var(--agents-muted);
    line-height: 1.65;
}

.capabilities-matrix {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin-top: 24px;
}

.capability-matrix-card {
    min-height: 135px;
    padding: 18px;
    border: 1px solid var(--agents-border);
    border-radius: 18px;
    background: var(--agents-surface-soft);
}

.capability-matrix-card strong {
    display: block;
    margin-bottom: 7px;
}

.capability-matrix-card p {
    margin: 0;
    color: var(--agents-muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.capability-state {
    display: inline-flex;
    margin-top: 13px;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--agents-success);
    background: rgba(18, 147, 111, 0.09);
    font-size: 0.68rem;
    font-weight: 850;
}

.toast {
    position: fixed;
    z-index: 300;
    right: 24px;
    bottom: 24px;
    max-width: min(390px, calc(100vw - 48px));
    padding: 14px 17px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    color: #ffffff;
    background: #172033;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 1180px) {
    .agents-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .statistics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .capabilities-matrix {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    #sidebar-container .dashboard-sidebar {
        transform: translateX(-105%);
        transition: transform 220ms ease;
    }

    body.sidebar-open #sidebar-container .dashboard-sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 70;
        display: block;
        visibility: hidden;
        background: rgba(15, 23, 42, 0.48);
        opacity: 0;
        transition:
            opacity 220ms ease,
            visibility 220ms ease;
    }

    body.sidebar-open .sidebar-overlay {
        visibility: visible;
        opacity: 1;
    }

    .agents-main {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: grid;
        place-items: center;
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        display: none;
    }

    .hero-copy {
        padding: 40px;
    }
}

@media (max-width: 680px) {
    .agents-topbar {
        min-height: 74px;
        padding: 13px 16px;
    }

    .page-eyebrow {
        display: none;
    }

    .agents-topbar-actions .secondary-button {
        display: none;
    }

    .agents-topbar-actions .primary-button {
        width: 44px;
        min-width: 44px;
        overflow: hidden;
        padding: 0;
        color: transparent;
        white-space: nowrap;
    }

    .agents-topbar-actions .primary-button::first-letter {
        color: #ffffff;
    }

    .agents-content {
        padding: 18px 15px 45px;
    }

    .hero-panel {
        min-height: auto;
        border-radius: 23px;
    }

    .hero-copy {
        padding: 30px 24px;
    }

    .hero-copy h2 {
        font-size: 2rem;
    }

    .statistics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .statistic-card {
        min-height: 86px;
        padding: 13px;
    }

    .statistic-icon {
        width: 42px;
        height: 42px;
    }

    .agents-toolbar {
        flex-direction: column;
    }

    .agents-select {
        width: 100%;
    }

    .agents-grid {
        grid-template-columns: 1fr;
    }

    .agent-card {
        min-height: 370px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .agent-modal-panel {
        border-radius: 22px;
    }

    .agent-modal-hero,
    .agent-modal-body {
        padding-right: 22px;
        padding-left: 22px;
    }

    .agent-detail-grid,
    .capabilities-matrix {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .tools-modal-panel {
        padding: 24px 20px;
    }
}

/* MARCUS_DASHBOARD_AGENT_THUMBNAILS_START */
#all-agents-grid.agents-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.dashboard-agent-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    width: 100%;
    min-width: 0;
    min-height: 150px;
    padding: 20px;
    overflow: hidden;
    text-align: left;
    border-radius: 20px;
}

.dashboard-agent-avatar {
    display: block;
    width: 104px;
    height: 104px;
    max-width: 104px;
    max-height: 104px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    border-radius: 18px;
}

.dashboard-agent-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.dashboard-agent-content strong {
    font-size: 1.05rem;
}

.dashboard-agent-content span {
    line-height: 1.45;
}

@media (max-width: 1250px) {
    #all-agents-grid.agents-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    #all-agents-grid.agents-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-agent-card {
        grid-template-columns: 84px minmax(0, 1fr);
        min-height: 120px;
        padding: 15px;
    }

    .dashboard-agent-avatar {
        width: 84px;
        height: 84px;
        max-width: 84px;
        max-height: 84px;
    }
}
/* MARCUS_DASHBOARD_AGENT_THUMBNAILS_END */


/* MARCUS_AGENTS_PREMIUM_V2_START */

#sidebar-container {
    position: relative;
    z-index: 80;
}

#sidebar-container .dashboard-sidebar {
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
    opacity: 1 !important;
    width: var(--sidebar-width);
    height: 100vh;
    border-right: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 12px 0 45px rgba(31, 45, 79, 0.06);
    backdrop-filter: blur(20px);
}

#sidebar-container .sidebar-navigation {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 25px;
}

#sidebar-container .sidebar-link {
    position: relative;
    margin: 3px 13px;
    border-radius: 13px;
    transition:
        color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

#sidebar-container .sidebar-link:hover {
    transform: translateX(3px);
    background: rgba(51, 92, 255, 0.07);
}

#sidebar-container .sidebar-link.active {
    color: #ffffff !important;
    background:
        linear-gradient(
            135deg,
            var(--agents-primary),
            var(--agents-secondary)
        ) !important;
    box-shadow:
        0 12px 25px rgba(51, 92, 255, 0.24);
}

#sidebar-container .sidebar-link.active svg,
#sidebar-container .sidebar-link.active i {
    color: #ffffff !important;
}

.sidebar-fallback {
    padding: 20px 12px;
}

.sidebar-fallback .sidebar-brand {
    padding: 8px 10px 24px;
}

.sidebar-fallback .brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--agents-text);
    font-weight: 900;
    text-decoration: none;
}

.fallback-logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--agents-primary),
            var(--agents-secondary)
        );
}

.sidebar-fallback .sidebar-link {
    display: block;
    padding: 12px 15px;
    color: var(--agents-text);
    text-decoration: none;
}

.agents-main {
    transition: margin-left 220ms ease;
}

.agents-section {
    margin-top: 34px;
}

.section-heading {
    margin-bottom: 18px;
}

#all-agents-grid.agents-grid,
#favorites-grid.agents-grid,
#recent-grid.agents-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.premium-agent-card {
    --card-delay: 0ms;

    position: relative;
    display: grid;
    grid-template-columns:
        112px minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
    min-height: 196px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(222, 229, 240, 0.95);
    border-radius: 23px;
    outline: none;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.99),
            rgba(248, 250, 255, 0.96)
        );
    box-shadow:
        0 12px 35px rgba(31, 45, 79, 0.06);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    animation:
        premiumAgentCardIn
        420ms ease
        var(--card-delay)
        forwards;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.premium-agent-card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 115px;
    height: 115px;
    border-radius: 0 0 0 100%;
    background:
        radial-gradient(
            circle at top right,
            rgba(117, 87, 255, 0.11),
            transparent 70%
        );
    pointer-events: none;
    content: "";
}

.premium-agent-card:hover,
.premium-agent-card:focus-visible {
    border-color:
        rgba(51, 92, 255, 0.28);
    box-shadow:
        0 22px 48px rgba(38, 57, 111, 0.13);
    transform: translateY(-5px);
}

.premium-agent-card:focus-visible {
    box-shadow:
        0 0 0 4px rgba(51, 92, 255, 0.11),
        0 22px 48px rgba(38, 57, 111, 0.13);
}

.premium-agent-avatar-wrapper {
    position: relative;
    align-self: start;
    width: 112px;
    height: 112px;
    overflow: visible;
    border-radius: 20px;
    background:
        linear-gradient(
            145deg,
            rgba(51, 92, 255, 0.12),
            rgba(117, 87, 255, 0.08)
        );
    box-shadow:
        0 13px 28px rgba(31, 45, 79, 0.12);
}

.premium-agent-avatar {
    display: block;
    width: 112px;
    height: 112px;
    max-width: 112px;
    max-height: 112px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    object-fit: cover;
    object-position: center;
    background: #eef2ff;
}

.premium-agent-avatar-fallback {
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    border-radius: 20px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--agents-primary),
            var(--agents-secondary)
        );
    font-size: 2rem;
    font-weight: 900;
}

.premium-agent-avatar-fallback[hidden] {
    display: none;
}

.premium-status-dot {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 19px;
    height: 19px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    box-shadow:
        0 4px 12px rgba(31, 45, 79, 0.2);
}

.premium-status-dot.status-available {
    background: #18a875;
}

.premium-status-dot.status-coming-soon {
    background: #e59a32;
}

.premium-status-dot.status-locked {
    background: #9aa6b8;
}

.premium-agent-content {
    position: relative;
    z-index: 2;
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.premium-agent-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.premium-agent-title-group {
    min-width: 0;
}

.premium-agent-title {
    margin: 0;
    overflow: hidden;
    color: var(--agents-text);
    font-size: 1.08rem;
    line-height: 1.25;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premium-agent-subtitle {
    display: block;
    margin-top: 5px;
    color: var(--agents-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

.premium-agent-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 33px;
    height: 33px;
    border: 1px solid var(--agents-border);
    border-radius: 11px;
    color: var(--agents-muted);
    background: rgba(255, 255, 255, 0.85);
    transition:
        color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.premium-agent-card:hover
.premium-agent-arrow {
    color: #ffffff;
    background: var(--agents-primary);
    transform: translate(2px, -2px);
}

.premium-agent-description {
    display: -webkit-box;
    min-height: 42px;
    margin: 12px 0 15px;
    overflow: hidden;
    color: var(--agents-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.premium-agent-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.premium-agent-badges {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.premium-agent-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.category-badge {
    max-width: 125px;
    overflow: hidden;
    color: #526075;
    background: #eef2f7;
    text-overflow: ellipsis;
}

.status-badge.status-available {
    color: #087552;
    background: rgba(18, 147, 111, 0.11);
}

.status-badge.status-coming-soon {
    color: #9c5e0d;
    background: rgba(201, 122, 21, 0.12);
}

.status-badge.status-locked {
    color: #68758a;
    background: rgba(104, 117, 138, 0.11);
}

.premium-agent-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--agents-primary),
            var(--agents-secondary)
        );
    box-shadow:
        0 8px 18px rgba(51, 92, 255, 0.19);
    font-size: 0.75rem;
    font-weight: 800;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.premium-agent-launch:hover {
    transform: translateY(-1px);
    box-shadow:
        0 11px 23px rgba(51, 92, 255, 0.25);
}

.premium-agent-launch:disabled {
    color: #7c8798;
    background: #e8edf4;
    box-shadow: none;
    cursor: not-allowed;
}

.category-tabs {
    display: flex;
    gap: 9px;
    margin-top: 20px;
    padding: 4px 1px 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.premium-category-tab {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--agents-border);
    border-radius: 999px;
    color: var(--agents-muted);
    background: rgba(255, 255, 255, 0.84);
    font-size: 0.78rem;
    font-weight: 750;
    transition:
        color 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.premium-category-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(51, 92, 255, 0.25);
}

.premium-category-tab small {
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    color: #68758a;
    background: #edf1f7;
    font-size: 0.66rem;
}

.premium-category-tab.is-active {
    border-color: transparent;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--agents-primary),
            var(--agents-secondary)
        );
    box-shadow:
        0 9px 22px rgba(51, 92, 255, 0.19);
}

.premium-category-tab.is-active small {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.19);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    visibility: hidden;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}

.sidebar-overlay.is-visible {
    visibility: visible;
    opacity: 1;
}

.toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 150;
    max-width: min(390px, calc(100vw - 32px));
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 15px;
    color: #ffffff;
    background: #172033;
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.27);
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes premiumAgentCardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1350px) {
    #all-agents-grid.agents-grid,
    #favorites-grid.agents-grid,
    #recent-grid.agents-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    :root {
        --sidebar-width: 270px;
    }

    .hero-panel {
        grid-template-columns:
            minmax(0, 1fr) 235px;
    }

    .hero-copy {
        padding: 38px;
    }
}

@media (max-width: 900px) {
    body.sidebar-mobile-open {
        overflow: hidden;
    }

    #sidebar-container .dashboard-sidebar {
        width: min(286px, 86vw);
        transform: translateX(-105%);
        transition:
            transform 220ms ease;
    }

    #sidebar-container
    .dashboard-sidebar.is-open {
        transform: translateX(0);
    }

    .agents-main {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: grid;
        place-items: center;
    }

    .statistics-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        display: none;
    }

    .hero-copy {
        max-width: 100%;
    }
}

@media (max-width: 680px) {
    .agents-topbar {
        align-items: flex-start;
        padding: 13px 16px;
    }

    .agents-topbar-actions {
        gap: 8px;
    }

    .agents-topbar-actions
    .secondary-button {
        display: none;
    }

    .agents-topbar-actions
    .primary-button {
        min-height: 41px;
        padding: 0 12px;
        font-size: 0.76rem;
    }

    .agents-content {
        padding:
            18px 15px 45px;
    }

    .hero-panel {
        min-height: auto;
        border-radius: 23px;
    }

    .hero-copy {
        padding: 30px 24px;
    }

    .hero-copy h2 {
        font-size: 2rem;
    }

    .statistics-grid {
        gap: 10px;
    }

    .statistic-card {
        min-height: 85px;
        padding: 13px;
    }

    .statistic-icon {
        width: 41px;
        height: 41px;
    }

    .agents-toolbar {
        flex-direction: column;
    }

    .agents-select {
        width: 100%;
    }

    #all-agents-grid.agents-grid,
    #favorites-grid.agents-grid,
    #recent-grid.agents-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .premium-agent-card {
        grid-template-columns:
            88px minmax(0, 1fr);
        gap: 14px;
        min-height: 165px;
        padding: 14px;
        border-radius: 19px;
    }

    .premium-agent-avatar-wrapper,
    .premium-agent-avatar,
    .premium-agent-avatar-fallback {
        width: 88px;
        height: 88px;
        max-width: 88px;
        max-height: 88px;
        border-radius: 17px;
    }

    .premium-agent-description {
        margin-top: 9px;
        margin-bottom: 11px;
    }

    .premium-agent-footer {
        align-items: flex-end;
    }

    .category-badge {
        display: none;
    }

    .premium-agent-launch {
        padding: 0 10px;
    }
}

@media (max-width: 430px) {
    .statistics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .statistic-card {
        gap: 9px;
    }

    .statistic-card div span {
        font-size: 0.72rem;
    }

    .premium-agent-card {
        grid-template-columns:
            76px minmax(0, 1fr);
    }

    .premium-agent-avatar-wrapper,
    .premium-agent-avatar,
    .premium-agent-avatar-fallback {
        width: 76px;
        height: 76px;
        max-width: 76px;
        max-height: 76px;
    }

    .premium-agent-title {
        font-size: 0.98rem;
    }

    .premium-agent-description {
        -webkit-line-clamp: 2;
        font-size: 0.76rem;
    }

    .premium-agent-launch span:first-child {
        display: none;
    }

    .premium-agent-launch {
        width: 34px;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .premium-agent-card {
        opacity: 1;
        transform: none;
        animation: none;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* MARCUS_AGENTS_PREMIUM_V2_END */


/* Sidebar officielle : aucune surcharge locale */

/* MARCUS_AGENTS_BRAND_FIX_START */

/*
 * Correction du logo de la sidebar Agents :
 * - le texte Marcus était blanc sur fond blanc ;
 * - l'image du logo était étirée horizontalement.
 */

#sidebar-container .sidebar-brand .brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: #0f1a2d !important;
    font-size: 19px !important;
    font-weight: 850 !important;
    letter-spacing: -0.5px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

#sidebar-container .sidebar-brand .brand span {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #0f1a2d !important;
    white-space: nowrap !important;
}

#sidebar-container .sidebar-brand .brand strong {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #1878ff !important;
}

#sidebar-container .sidebar-brand .brand img {
    flex: 0 0 45px !important;
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    height: 45px !important;
    object-fit: cover !important;
    object-position: center 28% !important;
    border-radius: 13px !important;
}

/* MARCUS_AGENTS_BRAND_FIX_END */

/* Sidebar identique au Dashboard */

#sidebar-container .dashboard-sidebar,
#sidebar-container .sidebar-navigation,
#sidebar-container .sidebar-bottom {
    background: #0f1a2d !important;
}

#sidebar-container .sidebar-brand {
    background: transparent !important;
}


/* Logo Marcus identique au Dashboard */

#sidebar-container .sidebar-brand .brand {
    color: #ffffff !important;
}

#sidebar-container .sidebar-brand .brand span {
    color: #ffffff !important;
}

#sidebar-container .sidebar-brand .brand strong {
    color: #1878ff !important;
}

