/* Agent Console Modal */
.agent-console-modal,
.agent-console-modal * {
    font-family: 'Inter', sans-serif;
}

.agent-console-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.26s ease, visibility 0.26s ease;
}

.agent-console-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.agent-console-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 9, 12, 0.72);
    backdrop-filter: blur(12px);
}

.agent-console-frame {
    position: relative;
    width: min(1260px, 100%);
    height: min(760px, calc(100vh - 64px));
    overflow: hidden;
    background: #0b0d12;
    border: 1px solid #242832;
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.42);
    transform: translateY(12px) scale(0.985);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.agent-console-modal.is-open .agent-console-frame {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* App */
.agent-console-app {
    position: relative;
    height: 100%;
    color: #f4f4f5;
    background: #0b0d12;
}

/* Initial Loader */
.agent-console-loader {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    background: #0b0d12;
}

.agent-console-loader.is-active {
    display: flex;
}

.agent-console-loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.agent-console-loader-box p {
    margin: 0;
    color: #a0a8b6;
    font-size: 13px;
    font-weight: 500;
}

.agent-console-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #242832;
    border-top-color: #24e98a;
    border-radius: 999px;
    animation: agentSpin 0.8s linear infinite;
}

@keyframes agentSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Top Bar */
.agent-console-topbar {
    height: 66px;
    display: grid;
    grid-template-columns: 210px 1fr 44px;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    border-bottom: 1px solid #242832;
    background: #0d1016;
}

.agent-console-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.agent-console-search-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 780px;
}

.agent-console-search {
    height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 14px;
    border: 1px solid #252a34;
    background: #11141b;
}

.agent-console-search-svg {
    flex: 0 0 auto;
    color: #7e8796;
    display: block;
}

.agent-console-search-icon {
    color: #7e8796;
    font-size: 15px;
    line-height: 1;
    flex: 0 0 auto;
}

.agent-console-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #d8dde6;
    font-size: 13px;
    line-height: 40px;
    font-weight: 500;
}

.agent-console-close {
    width: 36px;
    height: 36px;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.agent-console-close:hover {
    background: #171b23;
}

/* Body */
.agent-console-body {
    height: calc(100% - 66px);
    display: grid;
    grid-template-columns: 230px 1fr;
}

/* Sidebar */
.agent-console-sidebar {
    padding: 22px;
    border-right: 1px solid #242832;
    background: #090b10;
}

.agent-sidebar-section {
    margin-bottom: 30px;
}

.agent-sidebar-section p {
    margin: 0 0 12px;
    color: #7d8695;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.agent-sidebar-link {
    width: 100%;
    height: 38px;
    padding: 0 14px;
    margin-bottom: 6px;
    border: 0;
    background: transparent;
    color: #8d96a6;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.agent-sidebar-link:hover,
.agent-sidebar-link.is-active {
    background: #131720;
    color: #ffffff;
}

.agent-mini-agent {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 32px;
    color: #aeb6c4;
    font-size: 13px;
    font-weight: 500;
}

.agent-mini-agent span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #24e98a;
}

.agent-sidebar-metric {
    padding: 13px 14px;
    margin-bottom: 8px;
    border: 1px solid #242832;
    background: #0f1218;
}

.agent-sidebar-metric span {
    display: block;
    margin-bottom: 7px;
    color: #818a99;
    font-size: 11px;
    font-weight: 500;
}

.agent-sidebar-metric strong {
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.04em;
}

/* Content */
.agent-console-content {
    position: relative;
    overflow-y: auto;
    padding: 28px 34px;
}

.agent-workspace-view {
    display: none;
}

.agent-workspace-view.is-active {
    display: block;
}

.agent-console-content-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.agent-console-kicker {
    margin: 0 0 9px;
    color: #a4adbd;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.agent-console-content-header h3 {
    margin: 0;
    max-width: 620px;
    color: #ffffff;
    font-size: clamp(34px, 3.3vw, 50px);
    line-height: 1.04;
    font-weight: 500;
    letter-spacing: -0.06em;
}

.agent-console-content-header p {
    max-width: 680px;
    margin: 14px 0 0;
    color: #939cab;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 500;
}

.agent-run-button {
    height: 42px;
    padding: 0 18px;
    border: 0;
    background: #ffffff;
    color: #080a0f;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.agent-run-button:hover {
    background: #24e98a;
}

/* Tabs */
.agent-console-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 22px;
    border-bottom: 1px solid #242832;
}

.agent-console-tabs button {
    height: 42px;
    padding: 0;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #818a99;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.agent-console-tabs button:hover {
    color: #ffffff;
}

.agent-console-tabs button.is-active {
    color: #ffffff;
    border-bottom-color: #24e98a;
}

.agent-tab-panel {
    display: none;
}

.agent-tab-panel.is-active {
    display: block;
}

/* Summary */
.agent-console-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid #242832;
    margin-bottom: 22px;
}

.agent-summary-card {
    padding: 14px 16px;
    border-right: 1px solid #242832;
    background: #0f1218;
}

.agent-summary-card:last-child {
    border-right: 0;
}

.agent-summary-card span {
    display: block;
    margin-bottom: 8px;
    color: #818a99;
    font-size: 12px;
    font-weight: 500;
}

.agent-summary-card strong {
    display: block;
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.04em;
}

/* Table */
.agent-console-table-card {
    border: 1px solid #242832;
    background: #0f1218;
}

.agent-table-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 18px;
    border-bottom: 1px solid #242832;
}

.agent-table-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.agent-table-header span {
    color: #818a99;
    font-size: 12px;
    font-weight: 500;
}

.agent-table-wrap {
    overflow-x: auto;
}

.agent-results-console-table {
    width: 100%;
    min-width: 830px;
    border-collapse: collapse;
}

.agent-results-console-table th,
.agent-results-console-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #242832;
    text-align: left;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
}

.agent-results-console-table th {
    color: #798292;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #0b0d12;
}

.agent-results-console-table td {
    color: #d8dde6;
    font-weight: 500;
}

.agent-results-console-table tbody tr {
    cursor: pointer;
}

.agent-results-console-table tbody tr:hover {
    background: #151922;
}

.agent-results-console-table tbody tr:last-child td {
    border-bottom: 0;
}

.agent-status-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
}

.agent-status-high {
    background: rgba(36, 233, 138, 0.12);
    color: #24e98a;
}

.agent-status-warm {
    background: rgba(255, 183, 77, 0.13);
    color: #ffbd66;
}

.agent-status-review {
    background: rgba(164, 173, 189, 0.13);
    color: #b9c0cc;
}

/* Bottom Panels */
.agent-console-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 22px;
}

.agent-console-small-panel {
    border: 1px solid #242832;
    background: #0f1218;
}

.agent-small-panel-header {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 16px;
    border-bottom: 1px solid #242832;
}

.agent-small-panel-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.agent-small-panel-header span {
    min-width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    background: #24e98a;
    color: #06100b;
    font-size: 12px;
    font-weight: 800;
}

.agent-activity-list {
    padding: 14px 16px;
}

.agent-activity-item {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.agent-activity-item:last-child {
    margin-bottom: 0;
}

.agent-activity-item span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    background: #171b23;
    color: #24e98a;
    font-size: 11px;
    font-weight: 800;
}

.agent-activity-item p {
    margin: 3px 0 0;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.agent-recommendation-text {
    margin: 0;
    padding: 16px;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
}

/* Signals */
.agent-signal-grid {
    display: grid;
    gap: 0;
}

.agent-signal-card {
    display: grid;
    grid-template-columns: 40px 1fr 60px;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid #242832;
}

.agent-signal-card:last-child {
    border-bottom: 0;
}

.agent-signal-number {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: #171b23;
    color: #24e98a;
    font-size: 11px;
    font-weight: 800;
}

.agent-signal-card h4 {
    margin: 0 0 5px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.agent-signal-card p {
    margin: 0;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.agent-signal-card strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

/* Notes */
.agent-notes-list {
    display: grid;
    gap: 0;
}

.agent-note-card {
    padding: 18px;
    border-bottom: 1px solid #242832;
}

.agent-note-card:last-child {
    border-bottom: 0;
}

.agent-note-card h4 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.agent-note-card p {
    margin: 0;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
}

/* Agents View */
.agent-agent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.agent-agent-card {
    padding: 20px;
    border: 1px solid #242832;
    background: #0f1218;
}

.agent-agent-card span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    background: #171b23;
    color: #24e98a;
    font-size: 12px;
    font-weight: 800;
}

.agent-agent-card h4 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.agent-agent-card p {
    min-height: 62px;
    margin: 0 0 18px;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
}

.agent-agent-card strong {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    background: rgba(36, 233, 138, 0.12);
    color: #24e98a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Tasks */
.agent-task-list {
    display: grid;
    gap: 12px;
}

.agent-task-card {
    display: grid;
    grid-template-columns: 9px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 18px;
    border: 1px solid #242832;
    background: #0f1218;
}

.agent-task-card > span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #24e98a;
}

.agent-task-card h4 {
    margin: 0 0 5px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.agent-task-card p {
    margin: 0;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.agent-task-card strong {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
}

/* Skeletons */
.agent-view-skeleton,
.agent-tab-loader {
    display: none;
}

.agent-view-skeleton.is-active,
.agent-tab-loader.is-active {
    display: block;
}

.agent-view-skeleton.is-active + .agent-workspace-view {
    display: none;
}

.agent-skeleton-line,
.agent-skeleton-grid div,
.agent-skeleton-table div {
    position: relative;
    overflow: hidden;
    background: #151922;
}

.agent-skeleton-line::after,
.agent-skeleton-grid div::after,
.agent-skeleton-table div::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.06),
        transparent
    );
    animation: agentSkeleton 1.15s infinite;
}

@keyframes agentSkeleton {
    100% {
        transform: translateX(100%);
    }
}

.agent-skeleton-small {
    width: 160px;
    height: 14px;
    margin-bottom: 15px;
}

.agent-skeleton-title {
    width: min(520px, 90%);
    height: 52px;
    margin-bottom: 16px;
}

.agent-skeleton-copy {
    width: min(680px, 94%);
    height: 18px;
    margin-bottom: 28px;
}

.agent-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid #242832;
    margin-bottom: 22px;
}

.agent-skeleton-grid div {
    height: 72px;
    border-right: 1px solid #242832;
}

.agent-skeleton-grid div:last-child {
    border-right: 0;
}

.agent-skeleton-table {
    display: grid;
    border: 1px solid #242832;
}

.agent-skeleton-table div {
    height: 58px;
    border-bottom: 1px solid #242832;
}

.agent-skeleton-table div:last-child {
    border-bottom: 0;
}

/* Detail Panel */
.agent-detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 460px;
    height: 100%;
    background: #0b0d12;
    border-left: 1px solid #242832;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 5;
    overflow-y: auto;
}

.agent-detail-panel.is-open {
    transform: translateX(0);
}

.agent-detail-header {
    height: 66px;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid #242832;
    background: #0d1016;
}

.agent-detail-close {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.agent-detail-close:hover {
    background: #171b23;
}

.agent-detail-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 19px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.045em;
}

.agent-detail-action {
    height: 36px;
    padding: 0 15px;
    border: 0;
    background: #ffffff;
    color: #080a0f;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.agent-detail-action:hover {
    background: #24e98a;
}

.agent-detail-content {
    padding: 24px;
}

.agent-detail-title-row {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 13px;
    align-items: center;
    margin-bottom: 22px;
}

.agent-detail-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    background: #171b23;
    color: #24e98a;
    font-size: 15px;
    font-weight: 800;
}

.agent-detail-title-row h4 {
    margin: 0 0 4px;
    color: #ffffff;
    font-size: 22px;
    line-height: 1.05;
    font-weight: 500;
    letter-spacing: -0.055em;
}

.agent-detail-title-row p {
    margin: 0;
    color: #8b94a3;
    font-size: 13px;
    font-weight: 500;
}

.agent-detail-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #242832;
    margin-bottom: 24px;
}

.agent-detail-meta-grid div {
    min-height: 68px;
    padding: 13px;
    border-right: 1px solid #242832;
    border-bottom: 1px solid #242832;
}

.agent-detail-meta-grid div:nth-child(2),
.agent-detail-meta-grid div:nth-child(4) {
    border-right: 0;
}

.agent-detail-meta-grid div:nth-child(3),
.agent-detail-meta-grid div:nth-child(4) {
    border-bottom: 0;
}

.agent-detail-meta-grid span {
    display: block;
    margin-bottom: 8px;
    color: #818a99;
    font-size: 11px;
    font-weight: 500;
}

.agent-detail-meta-grid strong {
    display: block;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
}

.agent-detail-section {
    margin-bottom: 22px;
}

.agent-detail-section-header {
    margin-bottom: 10px;
}

.agent-detail-section-header h5 {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.agent-detail-note {
    padding: 14px;
    border: 1px solid #242832;
    background: #0f1218;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
}

.agent-next-step-list {
    display: grid;
    gap: 8px;
}

.agent-next-step-list div {
    padding: 12px 14px;
    border: 1px solid #242832;
    background: #0f1218;
    color: #d8dde6;
    font-size: 13px;
    font-weight: 500;
}

/* Mobile */
@media (max-width: 980px) {
    .agent-console-modal {
        padding: 14px;
    }

    .agent-console-frame {
        height: calc(100vh - 28px);
    }

    .agent-console-body {
        grid-template-columns: 1fr;
    }

    .agent-console-sidebar {
        display: none;
    }

    .agent-console-topbar {
        grid-template-columns: auto 1fr 42px;
        gap: 12px;
        padding: 0 14px;
    }

    .agent-console-brand span {
        display: none;
    }

    .agent-console-search-wrap {
        max-width: none;
    }

    .agent-console-content {
        padding: 20px;
    }

    .agent-console-content-header {
        display: block;
    }

    .agent-run-button {
        margin-top: 16px;
    }

    .agent-console-summary-row,
    .agent-console-bottom-grid,
    .agent-agent-grid,
    .agent-skeleton-grid {
        grid-template-columns: 1fr;
    }

    .agent-summary-card {
        border-right: 0;
        border-bottom: 1px solid #242832;
    }

    .agent-summary-card:last-child {
        border-bottom: 0;
    }

    .agent-detail-panel {
        width: 100%;
    }
}