/**
 * session-stats.css — Widget de Movimientos de Sesión / Contador de ingresos
 * Usado en auditoria-acciones.html
 */

/* ── Widget: Contador de ingresos por día / rango ─────────────────────────── */
.um-login-stats-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    overflow: hidden;
}

.um-login-stats-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px 20px;
    flex-wrap: wrap;
    row-gap: 10px;
}

.um-login-stats-card {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-right: 20px;
}

.um-login-stats-divider {
    width: 1px;
    height: 40px;
    background: #e5e7eb;
    margin-right: 20px;
    flex-shrink: 0;
}

.um-login-stats-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.um-login-stats-icon--users  { background: #eff6ff; color: #2563eb; }
.um-login-stats-icon--logins { background: #f0fdf4; color: #16a34a; }

.um-login-stats-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.um-login-stats-label {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.um-login-stats-count {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 32px;
}

.um-login-stats-number {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
    letter-spacing: -1px;
}

.um-login-stats-unit {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.um-login-stats-spinner {
    font-size: 18px;
    color: #9ca3af;
}

/* Botón "Detalle" */
.um-login-stats-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.um-login-stats-detail-btn:hover {
    border-color: #6b7280;
    background: #f3f4f6;
}

.um-login-stats-detail-btn .ss-chevron {
    transition: transform .2s ease;
    font-size: 11px;
}

/* Filtros a la derecha */
.um-login-stats-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.um-login-stats-today-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}

.um-login-stats-today-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.um-login-stats-today-btn.um-login-stats-today-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.um-login-stats-range {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.um-login-stats-range-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}

.um-login-stats-date-input {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    color: #1a1a1a;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s;
    outline: none;
    height: 32px;
}

.um-login-stats-date-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* Panel de desglose */
.um-login-stats-detail {
    border-top: 1px solid #e5e7eb;
    overflow-x: auto;
}

.um-login-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.um-login-stats-table thead tr {
    background: #f9fafb;
}

.um-login-stats-table th {
    padding: 8px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.um-login-stats-th-count,
.um-login-stats-td-count { text-align: center; }

.um-login-stats-th-bar { width: 180px; }

.um-login-stats-table tbody tr {
    transition: background .1s;
}

.um-login-stats-table tbody tr:hover { background: #f9fafb; }

.um-login-stats-table td {
    padding: 8px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #1a1a1a;
    vertical-align: middle;
}

.um-login-stats-table tbody tr:last-child td { border-bottom: none; }

.um-login-stats-td-rank {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
    width: 32px;
    text-align: center;
}

.um-login-stats-td-user {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.um-login-stats-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.um-login-stats-username {
    font-weight: 500;
    color: #1a1a1a;
}

.um-login-stats-td-name { color: #6b7280; }

.um-login-stats-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 13px;
}

.um-login-stats-td-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
}

.um-login-stats-bar-track {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.um-login-stats-bar-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 3px;
    transition: width .4s ease;
}

.um-login-stats-bar-pct {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    min-width: 30px;
    text-align: right;
}

.um-login-stats-empty {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
    font-size: 13px;
}

/* ── Tabs de Auditoría ────────────────────────────────────────────────────── */
.aa-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.aa-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    margin-bottom: -1px;
}

.aa-tab:hover { color: #1a1a1a; }

.aa-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.aa-tab-panel { display: none; }
.aa-tab-panel.active { display: block; }

@media (max-width: 680px) {
    .um-login-stats-bar {
        flex-direction: column;
        align-items: flex-start;
        row-gap: 12px;
    }
    .um-login-stats-divider { display: none; }
    .um-login-stats-filters { margin-left: 0; width: 100%; }
    .um-login-stats-th-bar, .um-login-stats-td-bar { display: none; }
}
