.agent-shell {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #f5f7fb;
}

.agent-side {
    width: 220px;
    flex: 0 0 220px;
    background: #1f2937;
    color: #fff;
}

.agent-brand {
    height: 56px;
    line-height: 56px;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.agent-user {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #16a34a;
    text-align: center;
    line-height: 40px;
    font-weight: 600;
}

.agent-name {
    font-size: 14px;
}

.agent-role {
    margin-top: 4px;
    color: #cbd5e1;
    font-size: 12px;
}

.agent-menu {
    padding: 12px 0;
}

.agent-menu li {
    height: 42px;
    line-height: 42px;
    padding: 0 22px;
    cursor: pointer;
    color: #d1d5db;
}

.agent-menu li:hover,
.agent-menu li.active {
    background: #111827;
    color: #fff;
}

.agent-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.agent-top {
    height: 56px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.agent-main iframe {
    flex: 1;
    border: 0;
    width: 100%;
    background: #f5f7fb;
}

.agent-page {
    padding: 16px;
}

.agent-search,
.agent-toolbar,
.agent-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 14px;
}

.agent-search .layui-inline {
    margin: 0 8px 8px 0;
}

.agent-search .layui-input,
.agent-search .layui-select-title input {
    width: 220px;
}

.agent-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.agent-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 18px;
}

.agent-stat span,
.agent-stat em {
    display: block;
    color: #64748b;
    font-style: normal;
}

.agent-stat strong {
    display: block;
    margin: 10px 0;
    font-size: 26px;
    color: #111827;
}

.agent-panel-title {
    margin-bottom: 10px;
    font-weight: 600;
}

.agent-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-workbench {
    color: #111827;
}

.agent-balance-line {
    margin: -4px 0 14px;
    font-size: 20px;
}

.agent-balance-line strong {
    margin: 0 4px;
    color: #e60012;
    font-size: 30px;
    font-weight: 700;
}

.agent-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px 20px;
    margin-bottom: 18px;
}

.agent-metric {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #dfe5ec;
    background: #fff;
    font-size: 22px;
}

.agent-metric span {
    color: #111827;
}

.agent-metric strong {
    color: #ef4444;
    font-size: 24px;
    font-weight: 500;
}

.agent-metric:nth-child(n+6) strong {
    color: #111827;
}

.agent-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr);
    gap: 18px;
    align-items: start;
}

.agent-chart-panel,
.agent-rank-panel {
    min-height: 420px;
}

.agent-workbench-chart {
    width: 100%;
    height: 360px;
}

.agent-rank-table th,
.agent-rank-table td {
    text-align: center;
}

.agent-stat-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 4px;
}

.agent-inline-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.agent-inline-fields .layui-input {
    width: 160px;
}

.agent-setting-table .layui-input {
    width: 140px;
}

.agent-field-label {
    display: block;
    margin-bottom: 6px;
    color: #475569;
}

.agent-form-actions {
    margin-top: 14px;
}

.agent-edit-form {
    padding: 18px 24px 6px;
}

.agent-form-page {
    max-width: 860px;
}

.agent-promote-url {
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f8fafc;
    word-break: break-all;
}

@media (max-width: 768px) {
    .agent-side {
        width: 168px;
        flex-basis: 168px;
    }

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

    .agent-metric-grid,
    .agent-dashboard-grid,
    .agent-stat-grid-compact {
        grid-template-columns: 1fr;
    }

    .agent-dashboard-grid {
        gap: 14px;
    }

    .agent-metric {
        justify-content: flex-start;
        padding: 0 16px;
        font-size: 18px;
    }

    .agent-search .layui-input,
    .agent-search .layui-select-title input {
        width: 100%;
    }
}
