* {
    box-sizing: border-box;
}


body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}


.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}
.status-success {
    color: #198754;
    font-weight: bold;
}

/* =========================
   CARD
   ========================= */

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.event-indicator.event-success {
    background-color: #198754;
}

.event-indicator.event-error {
    background-color: #f11c27;
}


/* =========================
   LOGIN
   ========================= */

.login-card {
    max-width: 400px;
    margin: 100px auto;
}


.login-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
}


/* =========================
   HEADER
   ========================= */

.header h1 {
    margin: 0 0 5px;
    font-size: 24px;
}


.header p {
    margin: 0;
    color: #6b7280;
}


/* =========================
   FORM
   ========================= */

.form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.form label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}


.form input {
    width: 100%;
}


.search-form {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    margin-top: 25px;
}


.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}


.field label {
    font-size: 14px;
    font-weight: 600;
}


input {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
}


.field input {
    width: 240px;
}


input:focus {
    border-color: #2563eb;
}


button {
    height: 42px;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    background: #2563eb;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}


button:hover {
    background: #1d4ed8;
}


/* =========================
   DASHBOARD
   ========================= */

.dashboard {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    min-height: 550px;
    margin-bottom: 20px;
}

.event-user {
    font-size: 12px;
    color: #7b8798;
}


.events-panel,
.detail-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}


.panel-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}


.panel-header h2 {
    margin: 0 0 5px;
    font-size: 18px;
}


.panel-header span {
    font-size: 13px;
    color: #6b7280;
}


/* =========================
   EVENT LIST
   ========================= */

.event-list {
    padding: 10px;
}

.event-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: gray;
    display: inline-block;
    margin-right: 8px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s;
}


.event-item:hover {
    background: #f3f4f6;
}


.event-item.selected {
    background: #eff6ff;
}


.event-dot {
    width: 14px;
    height: 14px;
    border: 2px solid #9ca3af;
    border-radius: 50%;
    flex-shrink: 0;
}


.event-item.selected .event-dot {
    border-color: #2563eb;
    background: #2563eb;
    box-shadow: inset 0 0 0 3px white;
}


.event-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}


.event-id {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.event-meta {
    margin-top: 5px;
    font-size: 12px;
    color: #6b7280;
}


/* =========================
   EVENT DETAIL
   ========================= */

.event-detail {
    padding: 20px;
}


.detail-title {
    margin-bottom: 20px;
}


.detail-title strong {
    font-size: 16px;
}


.detail-user {
    margin-top: 5px;
    color: #6b7280;
    font-size: 13px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.detail-header strong {
    font-size: 18px;
}

.detail-date {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.detail-user {
    margin-top: 8px;
}

/* =========================
   LOGS
   ========================= */

.log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.log-item {
    padding: 12px 15px;
    border-left: 3px solid #2563eb;
    background: #f8fafc;
    border-radius: 0 7px 7px 0;
    font-size: 14px;
    white-space: pre-wrap;
}


/* =========================
   RESULTADO EVENT_ID
   ========================= */

.result-container h2 {
    margin-top: 0;
}


#resultadoEvent {
    margin: 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    min-height: 100px;
    white-space: pre-wrap;
    overflow-x: auto;
}


/* =========================
   ESTADOS
   ========================= */

.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}


.general-result {
    margin-top: 15px;
    color: #dc2626;
    font-size: 14px;
}

.btn {
  display: flex;
  justify-content: flex-end; 
}


/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 900px) {

    .dashboard {
        grid-template-columns: 1fr;
    }


    .search-form {
        flex-direction: column;
        align-items: stretch;
    }


    .field input {
        width: 100%;
    }


    .search-form button {
        width: 100%;
    }

}

.event-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 85px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-paid-c {
    background-color: #DCFCE7;
    color: #166534;
}

.badge-cancel-c {
    background-color: #FEE2E2;
    color: #991B1B;
}

.badge-truncate-c {
    background-color: #c5c5c1;
    color: #111110;
}

.badge-unknown-c {
    background-color: #fce304;
    color: #374151;
}

.search-legend-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex: 1;
}

.legend-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    flex-shrink: 0;
}

.legend-card h3 {
    font-size: 14px;
    margin: 0 0 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 7px 0;
}

.legend-item small {
    color: #6b7280;
    font-size: 12px;
}

.badge {
    padding: 4px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid #000;
}

.badge-cancel {
    background: #fdfdfc;
    color: #050505;
}

.badge-disconnected {
    background: #fdfdfc;
    color: #050505;
}

.badge-paid {
    background: #fdfdfc;
    color: #050505;
}

/* En pantallas pequeñas, apilar los elementos */
@media (max-width: 700px) {
    .search-legend-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        flex-wrap: wrap;
    }

    .legend-card {
        width: fit-content;
        max-width: 100%;
    }
}

