.agentes-app {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.agentes-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 24px;
    padding: 32px;
    border-radius: 22px;
    background: linear-gradient(135deg, #07101f, #0f2747 55%, #155d84);
    color: #ffffff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.agentes-hero h1 {
    margin: 12px 0 10px;
    font-size: 38px;
    color: #ffffff;
}

.agentes-hero p {
    max-width: 720px;
    font-size: 17px;
    line-height: 1.7;
}

.agentes-hero-meta {
    display: grid;
    gap: 12px;
    align-content: start;
}

.agentes-hero-chip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.agentes-hero-chip strong {
    color: #9edcff;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.agentes-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.agentes-sidebar {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 10px;
}

.agentes-nav-btn {
    border: 1px solid #d7dce2;
    background: #ffffff;
    color: #0b1b3b;
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s ease;
}

.agentes-nav-btn:hover,
.agentes-nav-btn.is-active {
    background: #0f2747;
    color: #ffffff;
    border-color: #0f2747;
}

.agentes-content {
    display: grid;
    gap: 20px;
}

.agentes-panel {
    display: none;
}

.agentes-panel.is-active {
    display: block;
}

.agentes-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.agentes-panel-header h2 {
    color: #0b1b3b;
    font-size: 28px;
    margin-bottom: 4px;
}

.agentes-panel-header p {
    color: #5d6878;
}

.agentes-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #dde3ea;
    padding: 22px;
    box-shadow: 0 8px 22px rgba(15, 39, 71, 0.08);
}

.agentes-grid {
    display: grid;
    gap: 18px;
}

.agentes-grid-summary {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.agentes-summary-card {
    padding: 24px;
    background: linear-gradient(180deg, #ffffff, #f4f7fb);
}

.agentes-summary-card h2 {
    font-size: 15px;
    color: #4b5970;
    margin-bottom: 8px;
}

.agentes-summary-card p {
    font-size: 34px;
    font-weight: bold;
    color: #0f2747;
}

.agentes-action-btn,
.agentes-secondary-btn,
.tabla-btn,
.agentes-boton {
    border: none;
    border-radius: 12px;
    min-height: 44px;
    padding: 10px 18px;
    font-weight: bold;
    cursor: pointer;
}

.agentes-action-btn,
.agentes-boton {
    background: #2ea7e6;
    color: #ffffff;
}

.agentes-action-btn:hover,
.agentes-boton:hover {
    background: #0b1b3b;
}

.agentes-secondary-btn,
.tabla-btn {
    background: #eef2f6;
    color: #12233f;
}

.tabla-btn.danger {
    background: #fde8e8;
    color: #992626;
}

.agentes-alert {
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: bold;
}

.agentes-alert.is-success {
    background: #e4f6ea;
    color: #17673a;
    border: 1px solid #b7e0c3;
}

.agentes-alert.is-error {
    background: #fde8e8;
    color: #962525;
    border: 1px solid #f0bbbb;
}

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

.agentes-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.agentes-table th,
.agentes-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e8edf3;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.agentes-table th {
    color: #46556d;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tabla-vacia {
    color: #687487;
    text-align: center;
    padding: 22px;
}

.acciones-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.logs-resultado {
    max-width: 420px;
    white-space: pre-wrap;
    word-break: break-word;
}

.agentes-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.agentes-field,
.agentes-checks,
.agentes-form-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agentes-field-small {
    max-width: 120px;
}

.agentes-field label,
.agentes-checks label {
    color: #12233f;
    font-weight: bold;
}

.agentes-field input,
.agentes-field select,
.agentes-field textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid #cfd7e1;
    border-radius: 12px;
    font-size: 15px;
    background: #ffffff;
}

.agentes-field textarea {
    min-height: 120px;
    resize: vertical;
}

.agentes-field input:focus,
.agentes-field select:focus,
.agentes-field textarea:focus {
    border-color: #2ea7e6;
    box-shadow: 0 0 0 3px rgba(46, 167, 230, 0.14);
    outline: none;
}

.agentes-checks {
    justify-content: center;
}

.agentes-checks label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.agentes-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
    align-items: end;
}

.agentes-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 31, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
}

.agentes-modal-dialog {
    width: min(980px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.agentes-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.agentes-modal-header h2 {
    color: #0b1b3b;
    font-size: 28px;
}

.agentes-modal-close {
    border: none;
    background: transparent;
    color: #0b1b3b;
    font-weight: bold;
    cursor: pointer;
}

.agentes-rel-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.agentes-rel-block {
    padding: 16px;
    border-radius: 16px;
    background: #f7f9fc;
    border: 1px solid #dde4ee;
    display: grid;
    gap: 12px;
}

.agentes-rel-block h3 {
    color: #0f2747;
}

.agentes-rel-item {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 600;
}

.agentes-rel-meta {
    color: #5d6878;
    font-size: 12px;
    font-weight: normal;
}

.agentes-rel-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 10px;
    align-items: center;
}

.agentes-login-wrap,
.agentes-bienvenida-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.agentes-login-card,
.agentes-bienvenida-card {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    padding: 32px;
}

.agentes-login-card h1,
.agentes-bienvenida-card h1 {
    color: #0b1b3b;
    margin-bottom: 14px;
    font-size: 34px;
}

.agentes-login-texto,
.agentes-bienvenida-card p {
    font-size: 16px;
    color: #444444;
    margin-bottom: 18px;
}

.agentes-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agentes-error {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #ffe3e3;
    color: #a11a1a;
    border: 1px solid #f1b7b7;
}

@media (max-width: 960px) {
    .agentes-hero,
    .agentes-layout,
    .agentes-rel-grid,
    .agentes-form-grid {
        grid-template-columns: 1fr;
    }

    .agentes-sidebar {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .agentes-panel-header {
        flex-direction: column;
        align-items: stretch;
    }
}
